stella.parameter
Class FocusMeasure

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.AbstractTargetParameter
                      extended by stella.parameter.AbstractTargetValue
                          extended by stella.parameter.AbstractFitsMomentsValue
                              extended by stella.parameter.FocusMeasure
All Implemented Interfaces:
Cloneable, ErrorDependingParameter, Parameter, TargetDependingValue, ParameterDepending, TargetDepending, TargetDependingParameter, Value, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class FocusMeasure
extends AbstractFitsMomentsValue
implements ErrorDependingParameter

We measure the focus by maximizing a central moment of the image fits. This is done in the following way:


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
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.
 
Fields inherited from class stella.parameter.AbstractFitsMomentsValue
KEY_FITSMOMENTS
 
Fields inherited from class stella.parameter.AbstractTargetParameter
KEY_INDEX
 
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 stella.ErrorDependingParameter
NAMING_EXTENSION
 
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
FocusMeasure(Map<String,String> prop)
          Construction of the flat exposure time calculator.
 
Method Summary
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.
 
Methods inherited from class stella.parameter.AbstractFitsMomentsValue
getDateObs, getExposureTime, getFits, getRegistered, init, registerMonitor, setValue
 
Methods inherited from class stella.parameter.AbstractTargetValue
get, set
 
Methods inherited from class stella.parameter.AbstractTargetParameter
getAsStar, getConstant, getFormattedFor, getSetup
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, rescanned, 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.Parameter
get, getFormatted, getName, getString, set
 
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.Initializable
init
 
Methods inherited from interface stella.TargetDependingParameter
getFormattedFor
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_FOCUSORDER

public static final String KEY_FOCUSORDER
This key links to the moment we use for focus measure.

See Also:
Constant Field Values

KEY_FOCUSPOSITION

public static final String KEY_FOCUSPOSITION
The name of the parameter that delivers the current focus position.

See Also:
Constant Field Values

KEY_RISE

public static final String KEY_RISE
The default minimum rise of the parabola against extra/intrafocal.

See Also:
Constant Field Values

DEFFOCUSORDER

private static final int DEFFOCUSORDER
Default order is kurtosis.

See Also:
Constant Field Values

DEFFOCUSPOSITION

private static final String DEFFOCUSPOSITION
Default property value.

See Also:
Constant Field Values

DEFRISE

private static final double DEFRISE
Default we should rise at least for 1000.

See Also:
Constant Field Values

focus

private Value focus
The parameter that delivers current sky brightness.


extrafocal

private VectorG extrafocal
The focus position to the fits moments, extrafocale.


intrafocal

private VectorG intrafocal
The focus position to the fits moments, intrafocale.


infocus

private VectorG infocus
The focus position to the fits moments, at estimated focus.

Constructor Detail

FocusMeasure

public FocusMeasure(Map<String,String> prop)
Construction of the flat exposure time calculator.

Method Detail

registerParameter

public void registerParameter(Parameter p)
We register a parameter that delivers sky brightness. Preferrably it links directly to a brightness sensor, if none is present, a solz-dependancy can be used.

Specified by:
registerParameter in interface ParameterDepending
Overrides:
registerParameter in class AbstractFitsMomentsValue

registerTarget

public void registerTarget(TargetDefinition td)
We register the target. Grabs the the target filter and grabs the current time-stamp to allow proper identification of the fits moments.

Specified by:
registerTarget in interface TargetDepending

registerError

public 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.

Specified by:
registerError in interface ErrorDependingParameter

getValue

public Number getValue()
We get the estimated flat exposure time.

Specified by:
getValue in interface Value

getForTarget

public Number getForTarget(TargetDefinition td)
If queried with a target, we cannot return anything, thus null is returned here.

Specified by:
getForTarget in interface TargetDependingValue
Specified by:
getForTarget in interface TargetDependingParameter

getForError

public Number getForError(ErrorEvent td)
If queried with an error, recording probably just starts.

Specified by:
getForError in interface ErrorDependingParameter

getFocus

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. If there is no prior fits average, we try to estimate the exposure time from the current light level.


extractMoments

private VectorG extractMoments(Value f,
                               int order)
We calculate an exposure time from the light sensor. This is done, if no prior flats in the desired filter has been exposed.