stella.adapter
Class ScienceAcquire

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.adapter.AdapterUnit
                  extended by stella.adapter.AcquiringUnit
                      extended by stella.adapter.ScienceAcquire
All Implemented Interfaces:
Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class ScienceAcquire
extends AcquiringUnit

The adapter sub-unit that does acquiring on a target star with the helper camera installed at the prime focus on STELLA-2. This helper camera is identically to the camera in the auxiliary telescope and only present during testing.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  Value azimuth
          If we want to make our own pointing model.
private static Dimension DEFACQUIREBINNING
          The default binning on acquire.
static String DEFAZIMUTHNAME
          Default name of the azimuth parameter.
private static File DEFBIASCOARSEFITS
          The default fits file holding guider bias image data.
private static long DEFBIASCOARSETIME
          The default exposure time in milli seconds of the bias frame.
private static File DEFBIASFINEFITS
          The default fits file holding guider bias image data.
private static double DEFBIASFINETIME
          The default exposure time in milli seconds of the bias frame.
private static double DEFBINARYMAG
          A companion may be fainter by this mag to still trigger proximity.
private static double DEFBINARYSEPARATE
          A companion must be closer (degs) to trigger proximity.
private static double DEFBINARYTIME
          Time factorial increase in proximity.
private static Rectangle DEFCOARSEFRAME
          The default acquire frame.
private static double DEFCOARSEOFFSET
          An estimate of the allowed matching failures.
private static File DEFDARKCOARSEFITS
          The default fits file holding guider bias image data.
private static long DEFDARKCOARSETIME
          The default exposure time in milli seconds of the bias frame.
private static File DEFDARKFINEFITS
          The default fits file holding guider bias image data.
private static double DEFDARKFINETIME
          The default exposure time in milli seconds of the bias frame.
private static int DEFDATAMAXACQUIRE
          The default data max for 'good' filtered pixels.
private static int DEFDATAMINACQUIRE
          The default data min for 'good' filtered pixels.
private static Dimension DEFENLARGECOARSE
          The default pixel enlargement during coarse acquire.
private static Dimension DEFENLARGEFINE
          The default pixel enlargement during acquire.
private static double DEFEXPOSEACQUIRE
          The default S/N on acquire.
private static Rectangle DEFFINEFRAME
          The default acquire frame.
private static boolean DEFKEEPACQUIREFITS
          If true, all acquire fits are kept on disc.
private static boolean DEFKEEPACQUIREINFO
          If true, all acquire fits are kept on disc.
private static int DEFKEEPACQUIREWHAT
          An integer specifying which acquire fits to keep.
private static double DEFMAGERROR
          An estimate of the mgnitude error.
private static double DEFMAXSHIFTACQUIRE
          The default maximum shift for a successful acquire, pixel.
private static long DEFMINTIMEACQUIRE
          Minimum exposure time on acquire in ms.
private static double DEFPOSITIONERROR
          An estimate of the catalog errors in pixels on ccd.
private static int DEFRETRYCOARSE
          The default number of retries on acquire.
private static int DEFRETRYFINE
          The default number of retries on acquire.
private static long DEFROWTIMING
          Read out time for a single row, acquire frame.
private static int DEFSEARCHBOXACQUIRE
          The default search box, unbiased.
private static double DEFTIMEINCREASE
          The default time increase if no stars have been found.
private  double increase
          If the acquire exposure time was increased, this is the final factor.
static String KEY_ACQUIREBINNING
          The binning used during acquire.
static String KEY_AZIMUTHNAME
          The height of the target for calculating CCD rotation.
static String KEY_BIASCOARSEFITS
          Headerless name of the bias fits file, if we have any.
static String KEY_BIASCOARSETIME
          Integration time on the bias fits.
static String KEY_BIASFINEFITS
          Headerless name of the bias fits file, if we have any.
static String KEY_BIASFINETIME
          Integration time on the bias fits.
static String KEY_BINARYMAG
          A companion may be fainter by this mag to still trigger proximity.
static String KEY_BINARYSEPARATE
          A companion must be closer (degs) to trigger proximity.
static String KEY_BINARYTIME
          Time factorial increase in proximity.
static String KEY_CATALOGFINE
          The window on the guider ccd used on acquire, unbinned.
static String KEY_CATALOGFRAME
          The window on the guider ccd used on acquire, unbinned.
static String KEY_COARSEFRAME
          The window on the guider ccd used on acquire, unbinned.
static String KEY_COARSEOFFSET
          The expected maximum distance of target to pinhole after coarse.
static String KEY_DARKCOARSEFITS
          Headerless name of the dark fits file, if we have any.
static String KEY_DARKCOARSETIME
          Time of the dark fits file, if we have any.
static String KEY_DARKFINEFITS
          Headerless name of the dark fits file, if we have any.
static String KEY_DARKFINETIME
          Time of the dark fits file, if we have any.
static String KEY_DATAMAXACQUIRE
          A default data maximum value for star detection.
static String KEY_DATAMINACQUIRE
          A default data minimum value for star detection.
static String KEY_ENLARGECOARSE
          A gray-zone around the acquire field for catalog star inclusion.
static String KEY_ENLARGEFINE
          A gray-zone around the acquire field for catalog star inclusion.
static String KEY_EXPOSEACQUIRE
          Signal to noise wanted on acquire.
static String KEY_FINEFRAME
          The window on the guider ccd used on acquire, unbinned.
static String KEY_KEEPACQUIREFITS
          If true, all acquire fits are kept on disc.
static String KEY_KEEPACQUIREINFO
          If true, all acquire fits are kept on disc.
static String KEY_KEEPACQUIREWHAT
          An integer specifying which acquire fits to keep.
static String KEY_MAGERROR
          An estimate of the magnitude errors.
static String KEY_MAXSHIFTACQUIRE
          Maximum allowed shift during acquire.
static String KEY_MINTIMEACQUIRE
          Minimum exposure time on acquire in ms.
static String KEY_POSITIONERROR
          An estimate of the catalog errors in pixels on ccd.
static String KEY_RETRYCOARSE
          Maximum retries on coarse acquire.
static String KEY_RETRYFINE
          Maximum retries on fine acquire.
static String KEY_ROWTIMING
          Row read-out time for bright strip detection.
static String KEY_SEARCHBOXACQUIRE
          A search box for star detection, unbinned.
static String KEY_TIMEINCREASE
          Increase the exposure time on coarse acquire fails.
static String PFCOARSETYPE
          Id for prime focus coarse.
static String PFFINETYPE
          Id for prime focus coarse.
private  Guiding.RawFrame raw
          Helper application.
 
Fields inherited from class stella.adapter.AcquiringUnit
COARSE, COARSEFINE, FINE, NONE
 
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
ScienceAcquire(Map<String,String> prop)
          Constructs a new acquire unit.
 
Method Summary
private  ErrorEvent coarseAcquire(long acquireraw, Dimension bin, int datamin, int datamax, int search, double poserr, double magerr)
          Do a coarse acquire with the specified calculated exposure time.
private  void databaseOffset(Object objid, Vector2D degoff)
          This is a secondary acquiring unit in test phase.
protected  ErrorEvent doUnitTask(String mode)
          Brings the acquire star at the cross-hair of the guider.
private  ErrorEvent fineAcquire(long acquireraw, Dimension bin, int datamin, int datamax, int search, double poserr, double magerr)
          Do a fine acquire with the specified calculated exposure time.
protected  double getIncrease()
          If acquire failed because of no-star detected, retrrieve this last increase factor.
protected  String getUnitType()
          The type of this unit is AdapterUnit.ACQUIRETYPE.
protected  void setMaster(AdapterMaster chef)
          Sets the adapter master.
 
Methods inherited from class stella.adapter.AdapterUnit
getGuider, getMaster, getTelescope, isManual, isValid, 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

PFCOARSETYPE

public static final String PFCOARSETYPE
Id for prime focus coarse.

See Also:
Constant Field Values

PFFINETYPE

public static final String PFFINETYPE
Id for prime focus coarse.

See Also:
Constant Field Values

KEY_KEEPACQUIREFITS

public static final String KEY_KEEPACQUIREFITS
If true, all acquire fits are kept on disc.

See Also:
Constant Field Values

KEY_KEEPACQUIREINFO

public static final String KEY_KEEPACQUIREINFO
If true, all acquire fits are kept on disc.

See Also:
Constant Field Values

KEY_KEEPACQUIREWHAT

public static final String KEY_KEEPACQUIREWHAT
An integer specifying which acquire fits to keep.

See Also:
Constant Field Values

KEY_ACQUIREBINNING

public static final String KEY_ACQUIREBINNING
The binning used during acquire.

See Also:
Constant Field Values

KEY_EXPOSEACQUIRE

public static final String KEY_EXPOSEACQUIRE
Signal to noise wanted on acquire.

See Also:
Constant Field Values

KEY_ROWTIMING

public static final String KEY_ROWTIMING
Row read-out time for bright strip detection.

See Also:
Constant Field Values

KEY_MINTIMEACQUIRE

public static final String KEY_MINTIMEACQUIRE
Minimum exposure time on acquire in ms.

See Also:
Constant Field Values

KEY_DATAMINACQUIRE

public static final String KEY_DATAMINACQUIRE
A default data minimum value for star detection.

See Also:
Constant Field Values

KEY_DATAMAXACQUIRE

public static final String KEY_DATAMAXACQUIRE
A default data maximum value for star detection.

See Also:
Constant Field Values

KEY_SEARCHBOXACQUIRE

public static final String KEY_SEARCHBOXACQUIRE
A search box for star detection, unbinned.

See Also:
Constant Field Values

KEY_POSITIONERROR

public static final String KEY_POSITIONERROR
An estimate of the catalog errors in pixels on ccd.

See Also:
Constant Field Values

KEY_MAGERROR

public static final String KEY_MAGERROR
An estimate of the magnitude errors.

See Also:
Constant Field Values

KEY_TIMEINCREASE

public static final String KEY_TIMEINCREASE
Increase the exposure time on coarse acquire fails.

See Also:
Constant Field Values

KEY_COARSEOFFSET

public static final String KEY_COARSEOFFSET
The expected maximum distance of target to pinhole after coarse.

See Also:
Constant Field Values

KEY_RETRYCOARSE

public static final String KEY_RETRYCOARSE
Maximum retries on coarse acquire.

See Also:
Constant Field Values

KEY_COARSEFRAME

public static final String KEY_COARSEFRAME
The window on the guider ccd used on acquire, unbinned.

See Also:
Constant Field Values

KEY_CATALOGFRAME

public static final String KEY_CATALOGFRAME
The window on the guider ccd used on acquire, unbinned.

See Also:
Constant Field Values

KEY_CATALOGFINE

public static final String KEY_CATALOGFINE
The window on the guider ccd used on acquire, unbinned.

See Also:
Constant Field Values

KEY_ENLARGECOARSE

public static final String KEY_ENLARGECOARSE
A gray-zone around the acquire field for catalog star inclusion.

See Also:
Constant Field Values

KEY_BIASCOARSEFITS

public static final String KEY_BIASCOARSEFITS
Headerless name of the bias fits file, if we have any.

See Also:
Constant Field Values

KEY_BIASCOARSETIME

public static final String KEY_BIASCOARSETIME
Integration time on the bias fits.

See Also:
Constant Field Values

KEY_DARKCOARSEFITS

public static final String KEY_DARKCOARSEFITS
Headerless name of the dark fits file, if we have any.

See Also:
Constant Field Values

KEY_DARKCOARSETIME

public static final String KEY_DARKCOARSETIME
Time of the dark fits file, if we have any.

See Also:
Constant Field Values

KEY_RETRYFINE

public static final String KEY_RETRYFINE
Maximum retries on fine acquire.

See Also:
Constant Field Values

KEY_FINEFRAME

public static final String KEY_FINEFRAME
The window on the guider ccd used on acquire, unbinned.

See Also:
Constant Field Values

KEY_ENLARGEFINE

public static final String KEY_ENLARGEFINE
A gray-zone around the acquire field for catalog star inclusion.

See Also:
Constant Field Values

KEY_BIASFINEFITS

public static final String KEY_BIASFINEFITS
Headerless name of the bias fits file, if we have any.

See Also:
Constant Field Values

KEY_BIASFINETIME

public static final String KEY_BIASFINETIME
Integration time on the bias fits.

See Also:
Constant Field Values

KEY_DARKFINEFITS

public static final String KEY_DARKFINEFITS
Headerless name of the dark fits file, if we have any.

See Also:
Constant Field Values

KEY_DARKFINETIME

public static final String KEY_DARKFINETIME
Time of the dark fits file, if we have any.

See Also:
Constant Field Values

KEY_MAXSHIFTACQUIRE

public static final String KEY_MAXSHIFTACQUIRE
Maximum allowed shift during acquire. Pixel distance.

See Also:
Constant Field Values

KEY_BINARYMAG

public static final String KEY_BINARYMAG
A companion may be fainter by this mag to still trigger proximity.

See Also:
Constant Field Values

KEY_BINARYSEPARATE

public static final String KEY_BINARYSEPARATE
A companion must be closer (degs) to trigger proximity.

See Also:
Constant Field Values

KEY_BINARYTIME

public static final String KEY_BINARYTIME
Time factorial increase in proximity.

See Also:
Constant Field Values

KEY_AZIMUTHNAME

public static final String KEY_AZIMUTHNAME
The height of the target for calculating CCD rotation.

See Also:
Constant Field Values

DEFKEEPACQUIREINFO

private static final boolean DEFKEEPACQUIREINFO
If true, all acquire fits are kept on disc.

See Also:
Constant Field Values

DEFKEEPACQUIREFITS

private static final boolean DEFKEEPACQUIREFITS
If true, all acquire fits are kept on disc.

See Also:
Constant Field Values

DEFKEEPACQUIREWHAT

private static final int DEFKEEPACQUIREWHAT
An integer specifying which acquire fits to keep.

See Also:
Constant Field Values

DEFACQUIREBINNING

private static final Dimension DEFACQUIREBINNING
The default binning on acquire.


DEFROWTIMING

private static final long DEFROWTIMING
Read out time for a single row, acquire frame.

See Also:
Constant Field Values

DEFEXPOSEACQUIRE

private static final double DEFEXPOSEACQUIRE
The default S/N on acquire.

See Also:
Constant Field Values

DEFMINTIMEACQUIRE

private static final long DEFMINTIMEACQUIRE
Minimum exposure time on acquire in ms.

See Also:
Constant Field Values

DEFDATAMINACQUIRE

private static final int DEFDATAMINACQUIRE
The default data min for 'good' filtered pixels.

See Also:
Constant Field Values

DEFDATAMAXACQUIRE

private static final int DEFDATAMAXACQUIRE
The default data max for 'good' filtered pixels.

See Also:
Constant Field Values

DEFSEARCHBOXACQUIRE

private static final int DEFSEARCHBOXACQUIRE
The default search box, unbiased.

See Also:
Constant Field Values

DEFPOSITIONERROR

private static final double DEFPOSITIONERROR
An estimate of the catalog errors in pixels on ccd.

See Also:
Constant Field Values

DEFMAGERROR

private static final double DEFMAGERROR
An estimate of the mgnitude error.

See Also:
Constant Field Values

DEFTIMEINCREASE

private static final double DEFTIMEINCREASE
The default time increase if no stars have been found.

See Also:
Constant Field Values

DEFRETRYCOARSE

private static final int DEFRETRYCOARSE
The default number of retries on acquire.

See Also:
Constant Field Values

DEFCOARSEFRAME

private static final Rectangle DEFCOARSEFRAME
The default acquire frame.


DEFENLARGECOARSE

private static final Dimension DEFENLARGECOARSE
The default pixel enlargement during coarse acquire.


DEFBIASCOARSEFITS

private static final File DEFBIASCOARSEFITS
The default fits file holding guider bias image data.


DEFBIASCOARSETIME

private static final long DEFBIASCOARSETIME
The default exposure time in milli seconds of the bias frame.

See Also:
Constant Field Values

DEFDARKCOARSEFITS

private static final File DEFDARKCOARSEFITS
The default fits file holding guider bias image data.


DEFDARKCOARSETIME

private static final long DEFDARKCOARSETIME
The default exposure time in milli seconds of the bias frame.

See Also:
Constant Field Values

DEFCOARSEOFFSET

private static final double DEFCOARSEOFFSET
An estimate of the allowed matching failures.

See Also:
Constant Field Values

DEFRETRYFINE

private static final int DEFRETRYFINE
The default number of retries on acquire.

See Also:
Constant Field Values

DEFFINEFRAME

private static final Rectangle DEFFINEFRAME
The default acquire frame.


DEFENLARGEFINE

private static final Dimension DEFENLARGEFINE
The default pixel enlargement during acquire.


DEFBIASFINEFITS

private static final File DEFBIASFINEFITS
The default fits file holding guider bias image data.


DEFBIASFINETIME

private static final double DEFBIASFINETIME
The default exposure time in milli seconds of the bias frame.

See Also:
Constant Field Values

DEFDARKFINEFITS

private static final File DEFDARKFINEFITS
The default fits file holding guider bias image data.


DEFDARKFINETIME

private static final double DEFDARKFINETIME
The default exposure time in milli seconds of the bias frame.

See Also:
Constant Field Values

DEFMAXSHIFTACQUIRE

private static final double DEFMAXSHIFTACQUIRE
The default maximum shift for a successful acquire, pixel.

See Also:
Constant Field Values

DEFBINARYMAG

private static final double DEFBINARYMAG
A companion may be fainter by this mag to still trigger proximity.

See Also:
Constant Field Values

DEFBINARYSEPARATE

private static final double DEFBINARYSEPARATE
A companion must be closer (degs) to trigger proximity.

See Also:
Constant Field Values

DEFBINARYTIME

private static final double DEFBINARYTIME
Time factorial increase in proximity.

See Also:
Constant Field Values

DEFAZIMUTHNAME

public static final String DEFAZIMUTHNAME
Default name of the azimuth parameter.

See Also:
Constant Field Values

increase

private double increase
If the acquire exposure time was increased, this is the final factor.


raw

private Guiding.RawFrame raw
Helper application.


azimuth

private Value azimuth
If we want to make our own pointing model. Altitude is always set.

Constructor Detail

ScienceAcquire

public ScienceAcquire(Map<String,String> prop)
Constructs a new acquire unit.

Method Detail

setMaster

protected void setMaster(AdapterMaster chef)
Sets the adapter master.

Overrides:
setMaster in class AdapterUnit

getUnitType

protected String getUnitType()
The type of this unit is AdapterUnit.ACQUIRETYPE.

Specified by:
getUnitType in class AdapterUnit

doUnitTask

protected ErrorEvent doUnitTask(String mode)
Brings the acquire star at the cross-hair of the guider. Needs the image rotation and the target altitude. If acquiring was not successful an error event describing the error is returned. In case of success, null is returned.

Specified by:
doUnitTask in class AdapterUnit
Parameters:
mode - If the unit supports more than a single mode, otherwise null
Returns:
null on okay, or an ErrorEvent desribing the failure.

coarseAcquire

private ErrorEvent coarseAcquire(long acquireraw,
                                 Dimension bin,
                                 int datamin,
                                 int datamax,
                                 int search,
                                 double poserr,
                                 double magerr)
Do a coarse acquire with the specified calculated exposure time.


fineAcquire

private ErrorEvent fineAcquire(long acquireraw,
                               Dimension bin,
                               int datamin,
                               int datamax,
                               int search,
                               double poserr,
                               double magerr)
Do a fine acquire with the specified calculated exposure time.


getIncrease

protected double getIncrease()
If acquire failed because of no-star detected, retrrieve this last increase factor.

Specified by:
getIncrease in class AcquiringUnit

databaseOffset

private void databaseOffset(Object objid,
                            Vector2D degoff)
This is a secondary acquiring unit in test phase. Instead of writing to the db, we print the current az, azoff, altitude and altoff together with unique into the log file.