public class FitsMoments extends AbstractFitsParameter implements ParameterDepending, RemoteParameter, ExitCleaning
This parameter is best situated in the VM that also does the fits retireval. To allow outside masters access to it, the moments can be queried as a remote parameter.
| Modifier and Type | Class and Description |
|---|---|
private class |
FitsMoments.Calculate
The thread that calculates the moments.
|
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private Rectangle |
box
The read-out window for moment calculation if no frame registered.
|
private FitsMoments.Calculate |
calcthread
The thread that does the calculation.
|
private static boolean |
DEFBIND
The default auto-binding as a
RemoteParameter. |
static String |
DEFBINDNAME
Default binding name.
|
private static String |
DEFFRAMENAME
Default frame.
|
private static int |
DEFMOMENTORDER
Default order of the central moments.
|
static String |
DEFNAME
My default name.
|
private static boolean |
DEFUSECACHED
The default auto-binding as a
RemoteParameter. |
private Parameter |
frameprovider
The frame provider used to get the moments window.
|
static String |
KEY_BIND
The key in the Map for auto-binding of the trigger.
|
static String |
KEY_FRAMENAME
This is the name of the frame providing parameter we use
|
static String |
KEY_MOMENTORDER
We calculate up to this moment order.
|
static String |
KEY_MOMENTWINDOW
The window we take pixels from
|
static String |
KEY_ORDERNAME
This is the name of the order providing parameter we use
|
static String |
KEY_TARGETNAME
This is the name of the order providing parameter we use
|
static String |
KEY_USECACHED
If false we wait for the new moments to be calculated.
|
private Object |
oldname
The name of the target when the last fits was registered.
|
private int |
order
The order to which moments are calculated.
|
private Value |
orderprovider
The order provider used to get the moments order to which we calc.
|
private List<CentralMoments> |
quadrants
The pixel extracted from the fits file as a list of Doubles.
|
private List<RmiListener> |
stubs
A list of registered rmi listners.
|
private Parameter |
targetname
The target name.
|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
FitsMoments(Map<String,String> prop)
Constructs a new fits-order moments parameter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRmiListener(RmiListener ear)
Adds a listener for notification on exit.
|
boolean |
bindToRegistry()
Binds to registry.
|
List<CentralMoments> |
blockGet()
Always wait for the calc thread to exit.
|
void |
exit()
Unbinds from registry, if bound.
|
Object |
get()
Returns all moments accumulated.
|
Rectangle |
getBox()
We return the current moment frame or null if none is set.
|
int |
getOrder()
We return the current active moment oreder.
|
List<CentralMoments> |
getQuadrants()
Returns all moments accumulated.
|
void |
init()
We scan our default properties for a possible read-out window and use the
default order.
|
boolean |
isValid()
Returns true.
|
protected boolean |
processMFits(MFits fits,
Rectangle readout,
Dimension bin,
Date when,
long registered,
double expt)
The fits file should be registered just when the fits file resides in
memory.
|
void |
registerParameter(Parameter p)
We register a frame parameter of the name
KEY_FRAMENAME |
Object |
remoteGet()
The remote edge of this trigger.
|
void |
removeRmiListener(RmiListener ear)
Removes a listener.
|
void |
setBox(Rectangle b)
We set the current moment frame or null if none is ddesired.
|
void |
setOrder(int o)
We set the current active moment oreder.
|
boolean |
unbindFromRegistry()
Unbinds from registry.
|
getDateObs, getExposureTime, getRegistered, registerMFits, registerMonitor, rmiDateObs, rmiExposureTime, rmiRegistered, set, setDateObs, setExposureTime, setRegisteredrescannedcreateParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, overrideDefaultName, register, setName, toStringclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdefaultBoolean, 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, stringPropertiespublic static final String KEY_MOMENTWINDOW
public static final String KEY_MOMENTORDER
public static final String KEY_FRAMENAME
public static final String KEY_ORDERNAME
public static final String KEY_TARGETNAME
public static final String KEY_BIND
public static final String KEY_USECACHED
public static final String DEFNAME
public static final String DEFBINDNAME
private static final int DEFMOMENTORDER
private static final String DEFFRAMENAME
private static final boolean DEFBIND
RemoteParameter.private static final boolean DEFUSECACHED
RemoteParameter.private List<CentralMoments> quadrants
private List<RmiListener> stubs
private int order
private Rectangle box
private Parameter frameprovider
private Parameter targetname
private Object oldname
private Value orderprovider
private FitsMoments.Calculate calcthread
public FitsMoments(Map<String,String> prop) throws RemoteException
RemoteExceptionpublic void init()
throws InitException
init in interface Initializableinit in class AbstractRemoteParameterInitExceptionpublic void exit()
exit in interface ExitCleaningexit in class AbstractRemoteParameterpublic void registerParameter(Parameter p)
KEY_FRAMENAMEregisterParameter in interface ParameterDependingpublic int getOrder()
public void setOrder(int o)
public Rectangle getBox()
public void setBox(Rectangle b)
protected boolean processMFits(MFits fits, Rectangle readout, Dimension bin, Date when, long registered, double expt)
processMFits in class AbstractFitsParameterfits - The fits object holding the datareadout - The readout framebin - The applied binningwhen - The time of the exposure or the register time, if dateobs
unknown.registered - The time this fits was registered.expt - Exposure time in seconds.public List<CentralMoments> blockGet()
public List<CentralMoments> getQuadrants()
public boolean bindToRegistry()
throws RemoteException
bindToRegistry in interface RmiCasterbindToRegistry in class AbstractRemoteParameterRemoteExceptionpublic boolean unbindFromRegistry()
throws RemoteException
unbindFromRegistry in interface RmiCasterunbindFromRegistry in class AbstractRemoteParameterRemoteExceptionpublic Object remoteGet() throws RemoteException
remoteGet in interface RemoteParameterremoteGet in class AbstractRemoteParameterRemoteExceptionpublic void addRmiListener(RmiListener ear) throws RemoteException
addRmiListener in interface RemoteParameteraddRmiListener in class AbstractFitsParameterRemoteExceptionpublic void removeRmiListener(RmiListener ear) throws RemoteException
removeRmiListener in interface RemoteParameterremoveRmiListener in class AbstractFitsParameterRemoteExceptionpublic boolean isValid()
throws RemoteException
isValid in interface RmiCasterisValid in class AbstractRemoteParameterRemoteException