|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.adapter.AdapterUnit
stella.adapter.FocussingUnit
stella.adapter.FocussingMoments
public abstract class FocussingMoments
This class uses maximization of ADU moments to obtain a best focus. Its
mechanism of offsetting the focus are unspecified, but a CCD must be
present in order to obtain images from which ADU statistics can be drawn.
Additionally, a method must be present that allows a crude estimate of the
focus position. This can be done with a temperature model, but any other
mechanism is allowed, as long as it adheres to crudeFocus().
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private boolean |
abort
Abort ongoing focus sequence. |
private static double |
DEFA4ERROR
Default A4 error (2011-10-14). |
private static double |
DEFA4SLOPE
Default A4 slope (2011-10-14). |
private static Dimension |
DEFADUSIZE
The default size around the bright spot. |
private static Dimension |
DEFBLOBSIZE
The default blob size. |
private static boolean |
DEFDOSAVE
If true we save the indivdual images during focus. |
private static boolean |
DEFDOSEARCH
If temperature model is accurate enough, we can skip the search. |
private static double |
DEFERRORZERNIKE
Default always do sequence. |
private static double |
DEFEXPOSEFOCUS
The default S/N on acquire. |
private static Dimension |
DEFFOCUSBINNING
The default binning on acquire. |
private static int |
DEFFOCUSORDER
The moment during fine focus. |
private static double |
DEFHIGHSKYSIGMA
Per default we do not do ADU rejection, thus this is zero. |
private static double |
DEFLOWSKYSIGMA
Per default we do not do ADU rejection, thus this is zero. |
private static boolean |
DEFMEDIANSKY
Default we use median for sky-level determination. |
private static String |
DEFMOMENTS
Default focus temperature parameter name. |
private static int |
DEFSEARCHORDER
The moment during coarse focus. |
private static int |
DEFSEARCHSTEPS
Default half-number of search steps. |
private static int |
DEFSKYFRAME
The defautl sky frame size. |
private static double |
DEFZERNIKESTEP
Default no extra Zernike images. |
private static double |
DEFZEXPOSE
Default no extra increase in exposure time on Zernikes. |
private long |
expt
The exposure time in ms calculated once per focus sequence. |
static String |
EXTRAFOCAL
Extension for extrafocal image in Zernike coefficient determination. |
static String |
INTRAFOCAL
Extension for intrafocal image in Zernike coefficient determination. |
static String |
KEY_A4ERROR
This is the error estimate for A4 slope. |
static String |
KEY_A4SLOPE
This is the slope of A4 versus steps. |
static String |
KEY_ADUSIZE
The box to scan for A4. |
static String |
KEY_BLOBSIZE
The default blob size. |
static String |
KEY_DOSAVE
Save the focus sequence images. |
static String |
KEY_DOSEARCH
Once the temperature model is accurate enough, we do not search. |
static String |
KEY_ERRORZERNIKE
If the zernike error is below this, we spare the sequence. |
static String |
KEY_EXPOSEFOCUS
The S/N for focus. |
static String |
KEY_FOCUSBINNING
The binnning for focus images. |
static String |
KEY_FOCUSFRAME
The frame for focus images. |
static String |
KEY_FOCUSOFFSET
The offset from the optimal focus for image 1&2. |
static String |
KEY_FOCUSORDER
The moment during fine focus. |
static String |
KEY_HIGHSKYSIGMA
If greather than zero, the high bound sigma for background rejection. |
static String |
KEY_LOWSKYSIGMA
If greather than zero, the low-bound sigma for background rejection. |
static String |
KEY_MAXFOCUSEXPOSE
If the exposure time required for moments exceed this, do T only. |
static String |
KEY_MEDIANSKY
If true, use median in background frame. |
static String |
KEY_MOMENTS
The name of the fits moments to use. |
static String |
KEY_MOMENTSFRAME
The frame for focus moments, smaller than image frame. |
static String |
KEY_SEARCHOFFSET
The step width, if focus model is bad. |
static String |
KEY_SEARCHORDER
The moment during coarse focus. |
static String |
KEY_SEARCHSTEPS
The number of search steps in either direction. |
static String |
KEY_SKYFRAME
The default sky frame size. |
static String |
KEY_ZERNIKESTEP
If this multiplier to searchsteps is greater 0, we do Zernikes. |
static String |
KEY_ZEXPOSE
Multiplier to nominal exposure time for extra/intra focal Zernike. |
private FitsMoments |
moments
The fits-moments parameter. |
static String |
SEARCH
If the mode quals search, we always do an extensive search. |
| Fields inherited from class stella.adapter.FocussingUnit |
|---|
increase |
| Fields inherited from class stella.adapter.AdapterUnit |
|---|
ACQUIRETYPE, GUIDERTYPE, PYRAMIDTYPE |
| 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.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
protected |
FocussingMoments(Map<String,String> prop)
Constructor chaining. |
| Method Summary | |
|---|---|
private double |
coarseFocus()
In the coarse focus, we do a temperature model, even if very inaccurate, then procced to in and out with #KEY_SEARCH step, doing a
image on the small frame along the offsets. |
protected abstract double |
crudeFocus()
This method makes a first crude focus and returns the current focus position in arbitrary units, which my be millimeters or steps or even non-linear units. |
protected ErrorEvent |
doFocusTask(String mode)
Task of this unit is to auto focus after a successful acquire. |
private double |
doZernikes(double zernike,
double pos0)
Does Zernike focussing using A4. |
private double |
getA4Focus(nom.tam.fits.Fits extra,
double fext,
nom.tam.fits.Fits intra,
double fint)
From an extra and an intra focal image, done at considerable offset from the estimated focus, we calculate the second image moment and derive the focus with the pre-measured slope of A4 vs. |
private double |
getA4Focus(nom.tam.fits.Fits extra,
double fext,
nom.tam.fits.Fits intra,
double fint,
int use)
From an extra and an intra focal image, done at considerable offset from the estimated focus, we calculate the second image moment and derive the focus with the pre-measured slope of A4 vs. |
abstract double |
getMaximumFocus()
Returns the maximum focus position to avoid focus underruns. |
abstract double |
getMinimumFocus()
Returns the minimum focus position to avoid focus underruns. |
private Double |
getMomentAt(double step,
int order,
String fext)
We position the linear stage at the indicated step, take an image with the CCD camera on the #KEY_FOCSUFRAME and calculate the moments
of this image. |
protected boolean |
isValid()
We are valid only if we have the linear drive and the moments. |
private double |
scanA4(nom.tam.fits.Fits ff,
int use)
We calculate the A4 parameter from second image moments following Equation 5 in PASP118, 1165, but without pixel scaling. |
void |
setAbort(boolean to)
Allows the sub-device to abort as soone as possible. |
protected void |
setMaster(AdapterMaster chef)
From the master, we query the driver for the linear stage and grab the temperature and the fits moments parameter. |
private nom.tam.fits.Fits |
takeSingleImage(CcdDriver ccd,
long ms,
Dimension bin,
String uu)
Takes a single image, stores it, resets the driver. |
| Methods inherited from class stella.adapter.FocussingUnit |
|---|
setFocus, setFocusOffset, setIncrease |
| Methods inherited from class stella.adapter.AdapterUnit |
|---|
doUnitTask, getGuider, getMaster, getTelescope, getUnitType, isManual, resetUnit, setGuider, setManual, setTelescope |
| 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, init, 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, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| 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 |
| Field Detail |
|---|
public static final String EXTRAFOCAL
public static final String INTRAFOCAL
public static final String SEARCH
public static final String KEY_MOMENTS
public static final String KEY_FOCUSOFFSET
public static final String KEY_FOCUSORDER
public static final String KEY_SEARCHSTEPS
public static final String KEY_SEARCHOFFSET
public static final String KEY_SEARCHORDER
public static final String KEY_DOSEARCH
public static final String KEY_DOSAVE
public static final String KEY_FOCUSFRAME
public static final String KEY_MOMENTSFRAME
public static final String KEY_FOCUSBINNING
public static final String KEY_EXPOSEFOCUS
public static final String KEY_MAXFOCUSEXPOSE
public static final String KEY_ZERNIKESTEP
public static final String KEY_ZEXPOSE
public static final String KEY_A4SLOPE
public static final String KEY_A4ERROR
public static final String KEY_BLOBSIZE
public static final String KEY_ADUSIZE
public static final String KEY_SKYFRAME
public static final String KEY_MEDIANSKY
public static final String KEY_LOWSKYSIGMA
public static final String KEY_HIGHSKYSIGMA
public static final String KEY_ERRORZERNIKE
private static final String DEFMOMENTS
private static final int DEFSEARCHSTEPS
private static final boolean DEFDOSEARCH
private static final boolean DEFDOSAVE
private static final double DEFEXPOSEFOCUS
private static final int DEFSEARCHORDER
private static final int DEFFOCUSORDER
private static final Dimension DEFFOCUSBINNING
private static final double DEFZERNIKESTEP
private static final double DEFZEXPOSE
private static final double DEFA4SLOPE
private static final double DEFA4ERROR
private static final Dimension DEFBLOBSIZE
private static final Dimension DEFADUSIZE
private static final int DEFSKYFRAME
private static final boolean DEFMEDIANSKY
private static final double DEFLOWSKYSIGMA
private static final double DEFHIGHSKYSIGMA
private static final double DEFERRORZERNIKE
private FitsMoments moments
private long expt
private boolean abort
| Constructor Detail |
|---|
protected FocussingMoments(Map<String,String> prop)
| Method Detail |
|---|
public abstract double getMinimumFocus()
public abstract double getMaximumFocus()
protected abstract double crudeFocus()
protected void setMaster(AdapterMaster chef)
setMaster in class AdapterUnitprotected boolean isValid()
isValid in class AdapterUnitpublic void setAbort(boolean to)
Abortable
setAbort in interface Abortableprotected ErrorEvent doFocusTask(String mode)
private double coarseFocus()
#KEY_SEARCH step, doing a
image on the small frame along the offsets. For each image, the value
of the KEY_SEARCHORDER moment is recorded, in this list the
maximum is found. From this maximum and from its neighbouring values,
a parabola is fit through this three points, the maximum is the new
focus, which we also set. If the maximum value in the original sequence
is at the edge, we return a value slightly inside, depending on
the two inner points to the maximum.
private double doZernikes(double zernike,
double pos0)
private double getA4Focus(nom.tam.fits.Fits extra,
double fext,
nom.tam.fits.Fits intra,
double fint)
private double getA4Focus(nom.tam.fits.Fits extra,
double fext,
nom.tam.fits.Fits intra,
double fint,
int use)
use - The extension to use.
private double scanA4(nom.tam.fits.Fits ff,
int use)
throws nom.tam.fits.FitsException,
IOException
A4 = sqrt(Mx+My), with
Mx,y = Σ(x,y_ij-x,y_c)^2*ADU_ij/ΣADU_ij
Centered on the brightest pixel blob in the image, we use a rectangle
of size KEY_ADUSIZE and around that a #SKYFRAME thick
frame for background determination. The background is either the
median or the mean of the ADUs in the sky frame, the RMS estimate
is either the quartile-sigma or the standard deviation. The two
values KEY_LOWSKYSIGMA and KEY_HIGHSKYSIGMA define
which range of ADUs should be considered background. This background
count is removed from the image prior to calculating the moments.
nom.tam.fits.FitsException
IOException
private Double getMomentAt(double step,
int order,
String fext)
#KEY_FOCSUFRAME and calculate the moments
of this image. The value returned is the indicated central normalized
moment, except for 1 that returns the average and 2 returns the square
root of the variance. If the positioning fails (or if the requested
position is out of range) null is returned.
private nom.tam.fits.Fits takeSingleImage(CcdDriver ccd,
long ms,
Dimension bin,
String uu)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||