stella.adapter
Class AuxiliaryUnit

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.adapter.AuxiliaryUnit
All Implemented Interfaces:
Cloneable, Guiding.RawFrame, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying
Direct Known Subclasses:
AuxiliaryCaptureUnit, AuxiliaryPinholeUnit

public abstract class AuxiliaryUnit
extends PropertyBundles
implements Guiding.RawFrame

The base class for auxiliary master sub-units that use the guider-ccd and maybe some other ccd in some way. Methods exist for checking consitancy. This class replaces the AdapterUnit on telescopes with an auxiliary guiding telescope. Currently, a AuxiliaryPinholeUnit, an AuxiliaryAcquireUnit and a AuxiliaryGuiderUnit exits.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
static String COARSETYPE
          Acquire frames start with this header, followed by date and count.
static String FINETYPE
          Acquire frames start with this header, followed by date and count.
private  AuxiliaryGuider guider
          The image-processing unit.
static String GUIDERTYPE
          Guiding frames start with this header, followed by date and count.
static String KEY_FALLBACK
          The fallback unit window read-out size.
static String KEY_GUIDERTILE
          The tile number to use on the guider ccd.
private  boolean manual
          If true, we are in manual mode and do not generate status events.
private  AuxiliaryMaster master
          The master controling the auxiliary unit, used for unique & errors.
static String PINHOLETYPE
          Pinhole frames start with this header, followed by date and count.
private  OffsetCaster telescope
          The communicator to send offset commands.
 
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 AuxiliaryUnit(Map<String,String> prop)
          No default settings.
 
Method Summary
protected abstract  ErrorEvent doAuxiliaryTask(String mode)
          Commits the task of this unit.
private  Guiding.RawFrame fromTiler(Point2D around)
          This method returns the Guiding#RawFrame this auxiliar unit is currently focusing on.
protected abstract  String getAuxiliaryType()
          Returns the type of this unit.
 File getBiasFrame()
          Returns the file holding the bias image.
 long getBiasTime()
          Returns the exposure time of the bias frame.
 Dimension getBinning()
          Returns the auxiliary binning that should be used.
 File getDarkFrame()
          Returns the file holding the dark image.
 long getDarkTime()
          Returns the exposure time of the dark frame.
protected abstract  Point2D getFocusPoint()
          This method returns a pixel-point on the guider-ccd that is or that is close to the focus of interest.
protected  AuxiliaryGuider getGuider()
          Get the adapter helper that can be used for calculating image-realted quantities.
protected  AuxiliaryMaster getMaster()
          Get the adapter helper that can be used for calculating image-realted quantities.
 Rectangle getReadoutFrame()
          This method returns the Rectangle this auxiliar unit is currently focusing on.
protected  OffsetCaster getTelescope()
          Get the telescope communication.
protected  boolean isManual()
          Returns the manual status, normally inherited from the adapter master.
protected  boolean isValid()
          Checks if all the required quantities are set and non-null.
protected  void setGuider(AuxiliaryGuider calculus)
          Sets the adapter helper who knows everything image related.
protected  void setManual(boolean nostatus)
          Sets manual mode, in which case we should not send status event, but rather use syslog.
protected  void setMaster(AuxiliaryMaster chef)
          Sets the adapter helper who knows everything image related.
protected  void setTelescope(OffsetCaster sendto)
          Set the telescope communication.
 
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

COARSETYPE

public static final String COARSETYPE
Acquire frames start with this header, followed by date and count.

See Also:
Constant Field Values

FINETYPE

public static final String FINETYPE
Acquire frames start with this header, followed by date and count.

See Also:
Constant Field Values

GUIDERTYPE

public static final String GUIDERTYPE
Guiding frames start with this header, followed by date and count.

See Also:
Constant Field Values

PINHOLETYPE

public static final String PINHOLETYPE
Pinhole frames start with this header, followed by date and count.

See Also:
Constant Field Values

KEY_GUIDERTILE

public static final String KEY_GUIDERTILE
The tile number to use on the guider ccd.

See Also:
Constant Field Values

KEY_FALLBACK

public static final String KEY_FALLBACK
The fallback unit window read-out size.

See Also:
Constant Field Values

manual

private boolean manual
If true, we are in manual mode and do not generate status events.


telescope

private OffsetCaster telescope
The communicator to send offset commands.


guider

private AuxiliaryGuider guider
The image-processing unit.


master

private AuxiliaryMaster master
The master controling the auxiliary unit, used for unique & errors.

Constructor Detail

AuxiliaryUnit

protected AuxiliaryUnit(Map<String,String> prop)
No default settings.

Method Detail

setManual

protected void setManual(boolean nostatus)
Sets manual mode, in which case we should not send status event, but rather use syslog.


isManual

protected boolean isManual()
Returns the manual status, normally inherited from the adapter master.


setTelescope

protected void setTelescope(OffsetCaster sendto)
Set the telescope communication.


getTelescope

protected OffsetCaster getTelescope()
Get the telescope communication. If isValid() returns true, this will never return null.


setGuider

protected void setGuider(AuxiliaryGuider calculus)
Sets the adapter helper who knows everything image related.


getGuider

protected AuxiliaryGuider getGuider()
Get the adapter helper that can be used for calculating image-realted quantities. If isValid() returns true, this will never return null.


setMaster

protected void setMaster(AuxiliaryMaster chef)
Sets the adapter helper who knows everything image related.


getMaster

protected AuxiliaryMaster getMaster()
Get the adapter helper that can be used for calculating image-realted quantities. If isValid() returns true, this will never return null.


isValid

protected boolean isValid()
Checks if all the required quantities are set and non-null.


getReadoutFrame

public Rectangle getReadoutFrame()
This method returns the Rectangle this auxiliar unit is currently focusing on. If the Guider#RawFrame is defined, we use it, otherwise we default to a frame of size KEY_FALLBACK centered around the rotational center.

Specified by:
getReadoutFrame in interface Guiding.RawFrame

getBinning

public Dimension getBinning()
Returns the auxiliary binning that should be used.

Specified by:
getBinning in interface Guiding.RawFrame

getBiasFrame

public File getBiasFrame()
Returns the file holding the bias image. If no dark tiler exists, we return null here.

Specified by:
getBiasFrame in interface Guiding.RawFrame

getBiasTime

public long getBiasTime()
Returns the exposure time of the bias frame. Non-zero only on shutter-less systems.

Specified by:
getBiasTime in interface Guiding.RawFrame

getDarkTime

public long getDarkTime()
Returns the exposure time of the dark frame.

Specified by:
getDarkTime in interface Guiding.RawFrame

getDarkFrame

public File getDarkFrame()
Returns the file holding the dark image.

Specified by:
getDarkFrame in interface Guiding.RawFrame

fromTiler

private Guiding.RawFrame fromTiler(Point2D around)
This method returns the Guiding#RawFrame this auxiliar unit is currently focusing on. It uses the value of the KEY_GUIDERTILE plus the master's DarkTiler to return the correct frame and binning. If the point on the ccd is null, at least the binning should be applicable.


getFocusPoint

protected abstract Point2D getFocusPoint()
This method returns a pixel-point on the guider-ccd that is or that is close to the focus of interest. This might be the center of rotation or the position of an acquire star etc.


doAuxiliaryTask

protected abstract ErrorEvent doAuxiliaryTask(String mode)
Commits the task of this unit. All relevant information must be available to this object before commencing this call. This method may not return a status event, those generated should be sent immediately.

Parameters:
mode - An integer specifying the action to be taken.
Returns:
null on okay, or an ErrorEvent desribing the failure.

getAuxiliaryType

protected abstract String getAuxiliaryType()
Returns the type of this unit.