stella.parameter
Class AbstractFitsParameter

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.AbstractRemoteParameter
                      extended by stella.parameter.AbstractFitsParameter
All Implemented Interfaces:
Cloneable, Remote, EventListener, EventTrigger, Parameter, RemoteFitsParameter, RemoteParameter, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster
Direct Known Subclasses:
AbstractFitsValue, FitsMoments

public abstract class AbstractFitsParameter
extends AbstractRemoteParameter
implements RemoteFitsParameter, EventTrigger

A class of values that deal with read-in fits files, where a (small) window is extracted to get some statistics. For asynchronous access, we notify a sleeping object on ADU arrival.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  Date dateobs
          And the obs-date.
private  double exptime
          The exposure time in seconds.
private  long registered
          The time the fits was registered.
private  Object sleeper
          The object to notify of adus changes, local only.
private  List<RmiUpdateListener> update
          On registering, we copy the update listeners for rmi notification.
 
Fields inherited from class stella.parameter.AbstractRemoteParameter
DEFBIND, KEY_BIND
 
Fields inherited from class stella.parameter.AbstractParameter
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
protected AbstractFitsParameter(Map<String,String> prop)
          Constructs a new fits measuring tool.
 
Method Summary
 void addRmiListener(RmiListener ear)
          Adds a listener for notification on exit.
 Date getDateObs()
          Returns the observation time, if specified in the fits header or the time of fits registering.
 double getExposureTime()
          Returns the exposure time in seconds or zero if undefined.
 long getRegistered()
          Returns the time-stamp when the fits was registered.
protected abstract  boolean processFits(nom.tam.fits.Fits file, Rectangle readout, Dimension bin, Date when, long reg, double t)
          Processes the fits to avoid storing of all data.
 void registerFits(nom.tam.fits.Fits file, double t, Rectangle readout, Dimension bin)
          The fits file and the exposure time should be registered just when the fits file resides in memory.
 Object registerMonitor(Object waiter)
          Registers an object.
 void removeRmiListener(RmiListener ear)
          Removes a listener.
 Date rmiDateObs()
          Remote access to getDateObs().
 double rmiExposureTime()
          Remote access to getExposureTime().
 long rmiRegistered()
          Remote access to getRegistered().
 Object set(Object o)
          Setting is not allowed.
protected  void setDateObs(Date t)
          Sets the exposure time for subclasses.
protected  void setExposureTime(double t)
          Sets the exposure time for subclasses.
protected  void setRegistered(long r)
          Returns the time-stamp when the fits was registered.
 
Methods inherited from class stella.parameter.AbstractRemoteParameter
bindToRegistry, exit, init, isValid, remoteGet, rescanned, unbindFromRegistry
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, setObject, setProperties, setProperty, stringProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.rmi.RemoteParameter
remoteGet
 
Methods inherited from interface util.rmi.RmiCaster
bindToRegistry, isValid, unbindFromRegistry
 
Methods inherited from interface stella.Parameter
get
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

exptime

private double exptime
The exposure time in seconds.


registered

private long registered
The time the fits was registered.


dateobs

private Date dateobs
And the obs-date.


update

private List<RmiUpdateListener> update
On registering, we copy the update listeners for rmi notification.


sleeper

private Object sleeper
The object to notify of adus changes, local only.

Constructor Detail

AbstractFitsParameter

protected AbstractFitsParameter(Map<String,String> prop)
Constructs a new fits measuring tool. After construct, call registerFits before retrieve the value.

Method Detail

addRmiListener

public void addRmiListener(RmiListener ear)
                    throws RemoteException
Adds a listener for notification on exit.

Specified by:
addRmiListener in interface RemoteParameter
Overrides:
addRmiListener in class AbstractRemoteParameter
Throws:
RemoteException

removeRmiListener

public void removeRmiListener(RmiListener ear)
                       throws RemoteException
Removes a listener.

Specified by:
removeRmiListener in interface RemoteParameter
Overrides:
removeRmiListener in class AbstractRemoteParameter
Throws:
RemoteException

registerFits

public void registerFits(nom.tam.fits.Fits file,
                         double t,
                         Rectangle readout,
                         Dimension bin)
The fits file and the exposure time should be registered just when the fits file resides in memory. Then, a #getValue will retrieve the daughter class value. The fits values extracted are zero and scale corrected and promoted to doubles.

Parameters:
t - Exposure time in seconds.

registerMonitor

public Object registerMonitor(Object waiter)
Registers an object. Event triggers are expected to change their value without prediction. Registering a sequencer guarantees that changes in the trigger value result in a notification of the sequencer.

Specified by:
registerMonitor in interface EventTrigger

set

public Object set(Object o)
Setting is not allowed.

Specified by:
set in interface Parameter
Returns:
The previous value of this parameter.

setExposureTime

protected void setExposureTime(double t)
Sets the exposure time for subclasses.


getExposureTime

public double getExposureTime()
Returns the exposure time in seconds or zero if undefined.


rmiExposureTime

public double rmiExposureTime()
                       throws RemoteException
Remote access to getExposureTime().

Specified by:
rmiExposureTime in interface RemoteFitsParameter
Throws:
RemoteException

setDateObs

protected void setDateObs(Date t)
Sets the exposure time for subclasses.


getDateObs

public Date getDateObs()
Returns the observation time, if specified in the fits header or the time of fits registering.


rmiDateObs

public Date rmiDateObs()
                throws RemoteException
Remote access to getDateObs().

Specified by:
rmiDateObs in interface RemoteFitsParameter
Throws:
RemoteException

getRegistered

public long getRegistered()
Returns the time-stamp when the fits was registered.


setRegistered

protected void setRegistered(long r)
Returns the time-stamp when the fits was registered.


rmiRegistered

public long rmiRegistered()
                   throws RemoteException
Remote access to getRegistered().

Specified by:
rmiRegistered in interface RemoteFitsParameter
Throws:
RemoteException

processFits

protected abstract boolean processFits(nom.tam.fits.Fits file,
                                       Rectangle readout,
                                       Dimension bin,
                                       Date when,
                                       long reg,
                                       double t)
Processes the fits to avoid storing of all data. If true is returned, we continue with notifying our monitors.

Parameters:
file - The fits object holding the data
readout - The readout frame
bin - The applied binning
when - The time of the exposure or the register time, if dateobs unknown.
reg - The time this fits was registered.
t - Exposure time in seconds.