public class FocusMeasure extends AbstractFitsMomentsValue implements ErrorDependingParameter
CentralFocus, ExtraFocal and IntraFocal,
we get the central normalized moment of order KEY_FOCUSORDER
plus the current focus and fit a parabola into these three values,
the true focus being the maximum of the fitting parabola.PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private static int |
DEFFOCUSORDER
Default order is kurtosis.
|
private static String |
DEFFOCUSPOSITION
Default property value.
|
private static double |
DEFRISE
Default we should rise at least for 1000.
|
private VectorG |
extrafocal
The focus position to the fits moments, extrafocale.
|
private Value |
focus
The parameter that delivers current sky brightness.
|
private VectorG |
infocus
The focus position to the fits moments, at estimated focus.
|
private VectorG |
intrafocal
The focus position to the fits moments, intrafocale.
|
static String |
KEY_FOCUSORDER
This key links to the moment we use for focus measure.
|
static String |
KEY_FOCUSPOSITION
The name of the parameter that delivers the current focus position.
|
static String |
KEY_RISE
The default minimum rise of the parabola against extra/intrafocal.
|
KEY_FITSMOMENTSKEY_INDEXKEY_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_MAPSEPARATORNAMING_EXTENSIONCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
FocusMeasure(Map<String,String> prop)
Construction of the flat exposure time calculator.
|
| Modifier and Type | Method and Description |
|---|---|
private VectorG |
extractMoments(Value f,
int order)
We calculate an exposure time from the light sensor.
|
private static Double |
getFocus(VectorG in,
VectorG out,
VectorG here,
double up)
Using the flat-field filter name and the fits moments, we estimate the
best exposure time by using the average of the current fits compared to
the target average in
#KEY_TARGETLEVEL. |
Number |
getForError(ErrorEvent td)
If queried with an error, recording probably just starts.
|
Number |
getForTarget(TargetDefinition td)
If queried with a target, we cannot return anything, thus null is
returned here.
|
Number |
getValue()
We get the estimated flat exposure time.
|
void |
registerError(ErrorEvent ee)
If we receive an error
AccumulationStart, we set the new moment
window, start our gather thread and clear any old list. |
void |
registerParameter(Parameter p)
We register a parameter that delivers sky brightness.
|
void |
registerTarget(TargetDefinition td)
We register the target.
|
getDateObs, getExposureTime, getFits, getRegistered, init, registerMonitor, setValueget, setgetAsStar, getConstant, getFormattedFor, getSetupcreateParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, overrideDefaultName, register, rescanned, 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, stringPropertiesinitgetFormattedForpublic static final String KEY_FOCUSORDER
public static final String KEY_FOCUSPOSITION
public static final String KEY_RISE
private static final int DEFFOCUSORDER
private static final String DEFFOCUSPOSITION
private static final double DEFRISE
private Value focus
private VectorG extrafocal
private VectorG intrafocal
private VectorG infocus
public void registerParameter(Parameter p)
registerParameter in interface ParameterDependingregisterParameter in class AbstractFitsMomentsValuepublic void registerTarget(TargetDefinition td)
registerTarget in interface TargetDependingpublic void registerError(ErrorEvent ee)
AccumulationStart, we set the new moment
window, start our gather thread and clear any old list.registerError in interface ErrorDependingParameterpublic Number getValue()
public Number getForTarget(TargetDefinition td)
getForTarget in interface TargetDependingParametergetForTarget in interface TargetDependingValuepublic Number getForError(ErrorEvent td)
getForError in interface ErrorDependingParameterprivate static Double getFocus(VectorG in, VectorG out, VectorG here, double up)
#KEY_TARGETLEVEL. If there is no prior
fits average, we try to estimate the exposure time from the current
light level.