public abstract class MomentsFocussing extends AbstractFocussingUnit implements Abortable
AbstractFocussingUnit.MethodPropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private static String |
A4MOM |
private static String |
A4MOMREM |
private boolean |
abort
Abort ongoing focus sequence.
|
private static boolean |
DEFDOSAVE
If true we save the indivdual images during focus.
|
private static char |
DEFFINEFOCUSCHAR
Fine-focus ID char in fits file name.
|
private static String |
DEFFWHMMEASURE
Default fwhm measure parameter name.
|
private static String |
DEFMOMENTS
Default focus temperature parameter name.
|
static String |
EXTRAFOCAL
Extension for extrafocal image in Zernike coefficient determination.
|
private static String |
FOCMOM |
private static String |
FOCMOMREM |
private Double |
fwhm
The current best estimate of the seeing FWHM.
|
private static String |
FWHMGAUSS |
private static String |
FWHMGAUSSREM |
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_BLOBFRAME
The frame for searching blobs, smaller than image frame.
|
static String |
KEY_DOSAVE
Save the focus sequence images.
|
static String |
KEY_ERRORCRUDE
Estimated focussing error on crude focus.
|
static String |
KEY_EXPOSEFOCUS
The S/N for focus.
|
static String |
KEY_FINEFOCUSCHAR
The file-name char for identifying fine-focus sequence.
|
static String |
KEY_FOCUSBINNING
The CCD binnning for focus images.
|
static String |
KEY_FOCUSFRAME
The CCD 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_FWHMBLOB
The default blob size.
|
static String |
KEY_FWHMMEASURE |
static String |
KEY_FWHMSIZE
The box to scan for fwhm.
|
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_ZERNIKEBINNING
The CCD binnning for Zernike focus images.
|
static String |
KEY_ZERNIKEBLOB
The default blob size.
|
static String |
KEY_ZERNIKEFRAME
The CCD frame for zernike focus images.
|
static String |
KEY_ZERNIKESIZE
The box to scan for A4.
|
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 FwhmMeasure |
measfwhm
We also measure the FWHM in the final focus image.
|
private FitsMoments |
moments
The fits-moments parameter.
|
private static String |
SETFOCUS |
private static String |
SETFOCUSREM |
KEY_FITSDIR, KEY_XTENSIONKEY_UNITTYPEKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOMECONFIG, KEY_CLASS| Modifier | Constructor and Description |
|---|---|
protected |
MomentsFocussing(Map<String,String> prop) |
| Modifier and Type | Method and Description |
|---|---|
private double |
a4Moment(MImageHDU hdu,
Rectangle a4box,
Vector2D skyrms) |
Vector2D |
coarseFocus(double crude,
CcdDriver aux,
Star focus,
ExposureTimeProviding etc,
TransparencyMeasuring haze)
Returns the coarse focus estimate.
|
private Double |
estimateFwhm(MImageHDU f0) |
Vector2D |
fineFocus(double coarse,
CcdDriver aux,
Star focus,
ExposureTimeProviding etc,
TransparencyMeasuring haze)
Returns the fine focus.
|
double |
getFwhm(CcdDriver aux,
Star focus,
ExposureTimeProviding etc,
TransparencyMeasuring haze)
The estimate of the FWHM in pixel at the current focus position.
|
protected abstract double |
getMaximumFocus()
Returns the maximum focus position to avoid focus underruns.
|
protected abstract double |
getMinimumFocus()
Returns the minimum focus position to avoid focus underruns.
|
private double |
getMoment(MFits mf,
int order,
double expt,
Rectangle window,
Dimension bin) |
protected boolean |
isValid()
We are valid only if we have the linear drive and the moments.
|
private Rectangle |
regionOfInterest(MImageHDU hdu,
Rectangle blobbox,
Dimension blobsize,
Dimension active)
We extract the rectangle around the detected zernike image.
|
void |
registerGlobals(GlobalGrouping set)
From the master, we query the driver for the linear stage and grab the
temperature and the fits moments parameter.
|
private double |
scanA4(MImageHDU hdu)
We calculate the A4 parameter from second image moments following
Equation 5 in PASP118, 1165, but without pixel scaling.
|
Vector2D |
scanFocus(CcdDriver aux,
Star focus,
ExposureTimeProviding etc,
TransparencyMeasuring haze)
This method scans for a focus.
|
void |
setAbort(boolean to)
Allows the sub-device to abort as soone as possible.
|
private Vector2D |
skyFrameAroundBox(MImageHDU hdu,
Rectangle a4box) |
finished, preparebinningAndWindow, configureUnit, getAcquisitionExtension, getFitsDirectory, getOneExposure, isManual, reducedFloat, save, save, setManualdefaultGuidingStar, getMaster, getUnitType, init, isValid, setMasterclone, 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, rescanned, setObject, setProperties, setProperty, stringProperties, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcrudeFocus, setFocus, setFocusOffsetdefaultBoolean, 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 EXTRAFOCAL
public static final String INTRAFOCAL
public static final String KEY_FWHMMEASURE
public static final String KEY_MOMENTS
public static final String KEY_FINEFOCUSCHAR
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_DOSAVE
public static final String KEY_FOCUSFRAME
public static final String KEY_ZERNIKEFRAME
public static final String KEY_MOMENTSFRAME
public static final String KEY_BLOBFRAME
public static final String KEY_FOCUSBINNING
public static final String KEY_ZERNIKEBINNING
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_ZERNIKEBLOB
public static final String KEY_FWHMBLOB
public static final String KEY_ZERNIKESIZE
public static final String KEY_FWHMSIZE
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_ERRORCRUDE
private static final String DEFMOMENTS
private static final String DEFFWHMMEASURE
private static final boolean DEFDOSAVE
private static final char DEFFINEFOCUSCHAR
private static final String A4MOMREM
private static final String A4MOM
private static final String FWHMGAUSSREM
private static final String FWHMGAUSS
private static final String FOCMOMREM
private static final String FOCMOM
private static final String SETFOCUSREM
private static final String SETFOCUS
private FitsMoments moments
private FwhmMeasure measfwhm
private boolean abort
private Double fwhm
protected abstract double getMinimumFocus()
protected abstract double getMaximumFocus()
public void registerGlobals(GlobalGrouping set)
registerGlobals in interface GlobalDependingregisterGlobals in class GenericUnitprotected boolean isValid()
isValid in class GenericUnitpublic void setAbort(boolean to)
Abortablepublic Vector2D coarseFocus(double crude, CcdDriver aux, Star focus, ExposureTimeProviding etc, TransparencyMeasuring haze) throws FocussingException
coarseFocus in interface Focussingcrude - The best focus estimate from the crude model.aux - The ancillary camera to use for the focus sequence.focus - The focus star, already in the field of the camera.etc - The exposure time calculator.haze - Possible raw-time exposure increase due to clouds.FocussingExceptionpublic Vector2D fineFocus(double coarse, CcdDriver aux, Star focus, ExposureTimeProviding etc, TransparencyMeasuring haze) throws FocussingException
FocussingfineFocus in interface Focussingaux - The ancillary camera to use for the focus sequence.focus - The focus star, already in the field of the camera.etc - The exposure time calculator.haze - Possible raw-time exposure increase due to clouds.FocussingExceptionpublic Vector2D scanFocus(CcdDriver aux, Star focus, ExposureTimeProviding etc, TransparencyMeasuring haze) throws FocussingException
scanFocus in interface Focussingaux - The ancillary camera to use for the focus sequence.focus - The focus star, already in the field of the camera.etc - The exposure time calculator.haze - Possible raw-time exposure increase due to clouds.FocussingExceptionpublic double getFwhm(CcdDriver aux, Star focus, ExposureTimeProviding etc, TransparencyMeasuring haze)
private double getMoment(MFits mf, int order, double expt, Rectangle window, Dimension bin) throws FocussingException
FocussingExceptionprivate double scanA4(MImageHDU hdu) throws BasicFitsException
A4 = sqrt(Mx+My), withCentered on the brightest pixel blob in the image, we use a rectangle of size
Mx,y = Σ(x,y_ij-x,y_c)^2*ADU_ij/ΣADU_ij
#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.BasicFitsExceptionprivate double a4Moment(MImageHDU hdu, Rectangle a4box, Vector2D skyrms) throws BasicFitsException
hdu - a4box - skyrms - BasicFitsExceptionprivate Vector2D skyFrameAroundBox(MImageHDU hdu, Rectangle a4box) throws BasicFitsException
hdu - a4box - BasicFitsExceptionprivate Rectangle regionOfInterest(MImageHDU hdu, Rectangle blobbox, Dimension blobsize, Dimension active) throws BasicFitsException
#KEY_BLOBSIZE). We center our frame of interest around this group
and return an appropriate rectangle. This rectangle may exceed the image
area.hdu - BasicFitsException