stella.adapter
Class AuxiliaryMaster

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by util.rmi.RmiPropertyContainer
                  extended by util.rmi.AbstractRmiListener
                      extended by stella.rmi.AbstractRmiCasterAndListener
                          extended by stella.rmi.ReceiverTorso
                              extended by stella.rmi.GenericMaster
                                  extended by stella.adapter.AuxiliaryMaster
All Implemented Interfaces:
Cloneable, Remote, EventListener, Caster, ErrorSending, ErrorCaster, Alive, DitherControlling, GuiderControlling, ListenerControlling, RmiAcknowledgeCaster, RmiCommandListener, RmiDoneCaster, RmiErrorCaster, RmiParameterClustering, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster, RmiEventListener, RmiListener, RmiPropertyBearing, TriggerableReload, StepInitializable

public class AuxiliaryMaster
extends GenericMaster
implements DitherControlling

This class handles the adapter communication to the SCS. It extends the CalibrationMaster and additionally understands the following commands:

During execution of the various commands, different errors can be thrown, refer to the appropriate methods.


Nested Class Summary
private  class AuxiliaryMaster.ContinuousExposure
          A thread that continousely exposes the auxiliary camera until stopped.
 
Nested classes/interfaces inherited from class stella.rmi.GenericMaster
GenericMaster.Standalone
 
Nested classes/interfaces inherited from class stella.rmi.ReceiverTorso
ReceiverTorso.CommandHandler
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  int acquirevirgin
          An int that get zero on finds, tracks reacquires.
private  AuxiliaryGuider auxiliary
          The encapsulating class for the STELLA guider methods.
private  AuxiliaryCoarseUnit coarsetask
          The acquire unit doing the coarse acquire task.
private  OffsetCaster com
          The adapter-to-telescope communication.
private  AuxiliaryMaster.ContinuousExposure continuous
          If continuous exposures are underway, this is the thread.
private  DarkOverlapTiler darkgather
          For dark-frames gathering during twilight.
private static long DEFACQUIRETIME
          The default acquire time.
static String DEFALTITUDE
          The default name of the altitude parameter.
private static String DEFAUXILIARYGUIDER
          The default properties file for the stella guider.
static String DEFAZIMUTH
          The default name of the altitude parameter.
private static Rectangle DEFCLEARFRAME
          The frame that should be cleared on a reset.
private static long DEFCLEARTIME
          The time required for a clear ccd.
private static String DEFCOMMUNICATOR
          The default properties file for the stella guider.
static String DEFDECTARGET
          The default name of the target declination parameter.
static String DEFDEROTATOROFF
          The default name of the telescope derotator parameter.
static String DEFDITHERTARGET
          The default name of the target should-be-dithered parameter.
static String DEFEXPOSURETIMELEFT
          The default name of the paramter holding the exposure time left .
private static long DEFFINDTIME
          The default recognize-find time.
private static long DEFFIXEDROTATORTIME
          The default time to change the filter.
static String DEFFOCUS
          The default name of the focus parameter.
private static long DEFFOCUSTIME
          The default focus time.
static String DEFFRACTIONALEXPOSE
          The default name of the paramter holding the fractional exposure time.
private static String DEFGUIDERCCD
          The name of the CCD driver class used for guiding.
private static long DEFGUIDERDELAY
          The default guider delay prior to first guiding step.
static float DEFGUIDERMAG
          Guide stars must be brighter than this.
static String DEFIMAGEROTATION
          The default name of the plain image rotation.
private static boolean DEFKEEPOFFSETS
          If true, all guiding offsets are kept.
private static boolean DEFKEEPPIDS
          If true, all guiding pids are kept.
static String DEFLOSTCOUNT
          The default name of the paramter counting guidng losses
static String DEFMAGTARGET
          The default name of the target magnitude parameter.
private static long DEFMOVETIME
          The maximum time we wait for move telescope.
static String DEFOFFSETAVERAGE
          The default name of the paramter counting arcsec offsets.
private static long DEFOFFSETDELAY
          The default delay on stop guiding if offset are active.
private static int DEFOFFSETWAIT
          The default delay on stop guiding if offset are active.
static String DEFRATARGET
          The default name of the target right ascension parameter.
static String DEFSEEING
          The default name of the paramter accumulating guiding seeing.
static String DEFSPURIOUSCOUNT
          The default name of the paramter counting guidng losses
private static long DEFSTARTGUIDINGTIME
          The default time till guiding starts.
private static long DEFSTARTTILINGTIME
          The default time till guiding starts.
private static long DEFSTOPGUIDINGTIME
          The default time till guiding stops.
private static long DEFSTOPTILINGTIME
          The default time till guiding stops.
static String DEFTARGETNAME
          The default name of the target name parameter.
static String DEFWINDMAX
          The default name of the paramter holding windspeed max.
private  int expid
          The internal counter for the command id.
private  AuxiliaryFineUnit finetask
          The acquire unit doing the fine acquire task.
private  int guidervirgin
          An int that get zero on finds, tracks guider mode changes.
private  AuxiliaryGuidingUnit guidetask
          The guider unit doing the guiding task plus the loop.
static String KEY_ACQUIRETIME
          Time for the acquire command.
static String KEY_ALTITUDE
          The height of the target for calculating CCD rotation.
static String KEY_AUXILIARYGUIDER
          The properties of the Guiding class.
static String KEY_AZIMUTH
          The azimuth of the target for calculating CCD rotation.
static String KEY_CLEARFRAME
          The entire size of the CCD.
static String KEY_CLEARTIME
          The clearing exposure time.
static String KEY_COARSEUNIT
          The properties of the AcquiringUnit.
static String KEY_COMMUNICATOR
          The properties of the AdapterTelescopeCaster class.
static String KEY_DARKTILER
          The properties of the dark tiler for dawn action.
static String KEY_DECTARGET
          The internal declination of the target set on acquire,
static String KEY_DEROTATOROFF
          The name of the Value holding the derotator offset.
static String KEY_EXPOSUREFRAME
          The window on the guider ccd used on exposures, unbinned.
static String KEY_EXPOSURETIMELEFT
          The parameter holding the exposure time left.
static String KEY_FINDTIME
          Time for the find command.
static String KEY_FINEUNIT
          The properties of the AcquiringUnit.
static String KEY_FOCUS
          The focus of the telescope.
static String KEY_FOCUSTIME
          Time for the focus command.
static String KEY_FOCUSUNIT
          The properties of the FocussingUnit.
static String KEY_FRACTIONALEXPOSE
          The parameter holding the fractional exposure time.
static String KEY_GUIDERCCD
          The name of the CCD driver class used for guiding.
static String KEY_GUIDERDELAY
          Delay until guiding stars.
static String KEY_GUIDERMAG
          The key for the faintest star to guide on.
static String KEY_GUIDESTARMERIT
          This expression, with $0=mag and $1=distance merits the guide star
static String KEY_GUIDINGUNIT
          The properties of the GuidingUnit.
static String KEY_IMAGEROTATION
          The name of the Value holding the plain image rotation.
static String KEY_KEEPOFFSETS
          If true, we record the az/alt offset in a data output stream.
static String KEY_KEEPPIDS
          If true, we record the pid offset in a data output stream.
static String KEY_LOSTCOUNT
          Issued to the local parameter cluster as number of target losts.
static String KEY_MAGTARGET
          The internal magnitude of the target set on acquire,
static String KEY_MOVETIME
          The time-out for move-telescopes.
static String KEY_OFFSETAVERAGE
          Issued to the local parameter cluster as average offset.
static String KEY_OFFSETDELAY
          Delay on guiding stop, if offsets are active.
static String KEY_OFFSETWAIT
          Maximum offset delays waited on stop guiding.
static String KEY_RATARGET
          The internal right ascension of the target set on acquire,
static String KEY_SEEING
          Issued to the local parameter cluster as the seeing estimate.
static String KEY_SPURIOUSCOUNT
          Issued to the local parameter cluster as number of guiding losts.
static String KEY_STARTGUIDINGTIME
          Time for starting the guiding.
static String KEY_STARTTILINGTIME
          Time for starting the guiding.
static String KEY_STOPGUIDINGTIME
          Time for stopping the guiding.
static String KEY_STOPTILINGTIME
          Time for stopping the guiding.
static String KEY_TARGETNAME
          The rmi-target name for errors on acquire,
static String KEY_WINDMAX
          The wind-speed maxometer parameter.
private  String lastunique
          Last recorded unique.
private  DataOutputStream offrecord
          An object output stream were we serialize our alt/az offs in.
private static String OFFSETEXTENSION
          The extension for the recorded offsets.
private  DataOutputStream pidrecord
          An object output stream were we serialize our pids offs in.
private static String PIDSEXTENSION
          The extension for the recorded pids.
 
Fields inherited from class stella.rmi.GenericMaster
DEFUNIQUE, KEY_ABORTTIME, KEY_AUTOMATIC, KEY_COMMTIME, KEY_DRIVERS, KEY_HISTORYDB, KEY_INITTIME, KEY_NODB, KEY_OBSERVEDB, KEY_OVERRULEAUTO, KEY_PARKTIME, KEY_PERMISSIONDB, KEY_PROPOSALDB, KEY_QUITTIME, KEY_REAUTO, KEY_RESETTIME, KEY_SET, KEY_SHUTDOWNDELAY, KEY_STATUSTIME, KEY_TARGETDB, KEY_TASKDB, KEY_UNIQUE, KEY_USERDB, lastabort, lastinit, lastpark, lastreset, telescope
 
Fields inherited from class stella.rmi.ReceiverTorso
KEY_BIND, KEY_BINDNAME, KEY_COMMANDCASTER, KEY_ERRORCOOL
 
Fields inherited from class util.rmi.AbstractRmiListener
KEY_ALIVE, KEY_EXPORTPORT, KEY_INIT, KEY_LISTENERNAME, KEY_RETRY, KEY_RETRYSLEEP
 
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.rmi.RmiAcknowledgeCaster
NAMING_EXTENSION
 
Fields inherited from interface stella.rmi.RmiDoneCaster
NAMING_EXTENSION
 
Fields inherited from interface util.StepInitializable
KEY_INITDEPTH
 
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
AuxiliaryMaster(Map<String,String> prop)
          Constructs a new adapter master.
 
Method Summary
protected  boolean abortMaster()
          Method called to abort the device.
 boolean accepts(CommandEvent ce)
          Checks if the command received is accepted by the adapter master.
private  boolean acquire(AcquireAuxiliary com)
          Brings the acquire star at the cross-hair of the guider.
 boolean automatic()
          Enables automatic operation.
 boolean center(double[] ra, double[] de, float[] m, float[] bv)
          We center at a star by finding and acquiring it.
protected  String coarseType()
          Delivers a unique id for the currently active target in guiding mode.
private  AuxiliaryUnit createAuxiliaryUnit(String unit)
          Sets all required knowledge available to an adapter unit.
static StarDescription defaultGuidingStar(List<StarDescription> def, double racenter, double decenter, float minmag)
          Default guiding star, above defined threshold.
private  boolean defineCenter(double ra, double de)
          We set the center of the science field.
 boolean ditherOffset(double ra, double de)
          Sets a dither offset which is allowed only in manual mode.
private  ErrorEvent doAcquire(String mode)
          Acquires a star.
private  boolean doSetDither(double dra, double dde)
          Applies a dithering to the auxiliarz guider.
private  boolean doStartExposing(double tsec)
          Starts the continuous getting of exposures with the stated exposure time.
private  ErrorEvent doStartGuiding(String mode)
          Starts guiding.
private  boolean doStartTiling()
          Stars a tiling process if a tiler is assigned.
private  boolean doStopExposing()
          We stop continuous exposures and join on the camera for exit.
private  boolean doStopGuiding()
          Stops the guiding.
private  boolean doStopTiling()
          Stops the tiling process if a tiler is assigned.
 void exit()
          If we have a dark tiler, we exit it, too.
private  boolean find(FindAuxiliary cmd)
          Registers a list of stars that are expected in the following acquire field.
protected  String fineType()
          Delivers a unique id for the currently active target in guiding mode.
private  boolean geometry(int xoff, int yoff, int xsize, int ysize, int xbin, int ybin)
          Sets the geometry of the next image on the ccd.
protected  int getAcknowledgeNumber(CommandEvent cmd)
          Returns the number of acknowledge events produced for each command.
protected  long getCompletionTime(CommandEvent cmd, int acknr)
          Returns the individual completion times.
protected  DarkOverlapTiler getDarkTiler()
          Some auxiliar units need access to the dark tiler.
private  int getNextExp()
          Returns the next available command id.
private static List<StarDescription> getStarDescriptions(double[] ra, double[] de, float[] mag, float[] bv)
          Converts an array of ra, dec, Vmag, and B-V into a list of star descriptions.
private  boolean guideStar(StarDescription s)
          We set the guiding star.
protected  String guidingHead()
          Delivers a unique id for the currently active target in guiding mode.
private  void init2()
          Additionally initializes the adapter-to-telescope communication and defaults values for fixed rotator, guiding and acquisition time.
 boolean initGuider()
          Initializes the guider and prepares it for a new guider loop.
protected  boolean initializeMaster()
          Initializes the adapter.
 void initStep(int curstep)
          Additionally initializes the filter-to-position lookup tables.
static void main(String[] arg)
          Constructs a new adapter master.
 boolean manual()
          Disables automatic operation.
private  boolean moveTelescope(double ra, double de)
          For manual access we also allow moving the telescope.
 boolean offsetAzAlt(double daz, double dalt)
          Offsets the telescope for a given amount in azimuth and altitude, degrees.
private  boolean offsetTelescope(double daz, double dalt)
          For manual access to telescope offsets.
 boolean offsetXY(int dx, int dy)
          Offsets the telescope for a given pixel distance on the guider ccd.
protected  boolean parkMaster()
          Parks the adapter.
private  void prepare()
          Prepares the master for a new target.
protected  boolean processCommand(CommandEvent cmd, int acknr)
          Process the command.
 void quit()
          Gracefully quite the adapter master.
protected  void quitMaster()
          Quits the adapter.
protected  boolean resetMaster()
          Resets the adapter.
 boolean singleShot(double t)
          If in manual mode, we take a single guider camera shot.
 boolean startGuiding()
          Guides on a previously acquired star.
private  boolean startGuiding(StartGuidingAuxiliary sga)
          Starts the guiding in the required mode.
protected  Object statusMaster()
          Returns a status message.
 boolean stopGuiding()
          Stops guiding if active.
private  boolean takeExposure(double tsec)
          Take an exposure with the guiding camera.
 
Methods inherited from class stella.rmi.GenericMaster
addErrorListener, addRmiErrorListener, createCommunicator, external, formatWithGlobals, getAllDrivers, getDriver, getHistorySql, getLastError, getObserveSql, getParameterByKey, getParameterByName, getParameterCluster, getParameterValueByKey, getParameterValueByName, getPermissionSql, getProposalSql, getStatus, getTargetSql, getTaskSql, getUnique, getUserSql, initialize, isAlive, isAuto, isManual, isPassive, park, reload, rescanned, reset, restartAllDrivers, restartNamedDriver, revert, rmiAddParameter, rmiCommand, rmiGet, rmiGetAllParameterNames, rmiRemoveParameter, rmiSet, setLastError, setParameterValueByKey, setParameterValueByName, setPassive, shutdown, zeroAllOmc
 
Methods inherited from class stella.rmi.ReceiverTorso
addRmiAcknowledgeListener, addRmiDoneListener, bindDefault, containsRemoteProperty, deregisterAtCaster, equals, getRemoteProperties, getRemoteProperty, hashCode, notifyAcknowledgeListener, notifyDoneListener, registerAtCaster, removeRmiAcknowledgeListener, removeRmiDoneListener, sendAllPrematureDone, sendPrematureDone, setRemoteProperty, toString, unbindDefault
 
Methods inherited from class stella.rmi.AbstractRmiCasterAndListener
bindToRegistry, getBindName, isValid, notifyErrorListener, removeErrorListener, removeRmiErrorListener, sendError, sendError, sendError, sendStatus, sendStatus, sendStatus, unbindFromRegistry
 
Methods inherited from class util.rmi.AbstractRmiListener
allBound, blockBinding, blockBinding, disconnect, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, startBinding, startBinding
 
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, removeProperty, setObject, setProperties, setProperty, stringProperties
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.rmi.ListenerControlling
external, getStatus, initialize, park, reset, setPassive
 
Methods inherited from interface util.rmi.RmiCaster
bindToRegistry, isValid, unbindFromRegistry
 
Methods inherited from interface stella.ErrorCaster
removeErrorListener
 
Methods inherited from interface util.rmi.RmiEventListener
getListenerName
 
Methods inherited from interface util.rmi.RmiListener
disconnect, isConnected
 
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

OFFSETEXTENSION

private static final String OFFSETEXTENSION
The extension for the recorded offsets.

See Also:
Constant Field Values

PIDSEXTENSION

private static final String PIDSEXTENSION
The extension for the recorded pids.

See Also:
Constant Field Values

KEY_GUIDERCCD

public static final String KEY_GUIDERCCD
The name of the CCD driver class used for guiding.

See Also:
Constant Field Values

KEY_DARKTILER

public static final String KEY_DARKTILER
The properties of the dark tiler for dawn action.

See Also:
Constant Field Values

KEY_CLEARFRAME

public static final String KEY_CLEARFRAME
The entire size of the CCD.

See Also:
Constant Field Values

KEY_CLEARTIME

public static final String KEY_CLEARTIME
The clearing exposure time.

See Also:
Constant Field Values

KEY_AUXILIARYGUIDER

public static final String KEY_AUXILIARYGUIDER
The properties of the Guiding class.

See Also:
Constant Field Values

KEY_COMMUNICATOR

public static final String KEY_COMMUNICATOR
The properties of the AdapterTelescopeCaster class.

See Also:
Constant Field Values

KEY_FOCUSUNIT

public static final String KEY_FOCUSUNIT
The properties of the FocussingUnit.

See Also:
Constant Field Values

KEY_COARSEUNIT

public static final String KEY_COARSEUNIT
The properties of the AcquiringUnit.

See Also:
Constant Field Values

KEY_FINEUNIT

public static final String KEY_FINEUNIT
The properties of the AcquiringUnit.

See Also:
Constant Field Values

KEY_GUIDINGUNIT

public static final String KEY_GUIDINGUNIT
The properties of the GuidingUnit.

See Also:
Constant Field Values

KEY_TARGETNAME

public static final String KEY_TARGETNAME
The rmi-target name for errors on acquire,

See Also:
Constant Field Values

KEY_RATARGET

public static final String KEY_RATARGET
The internal right ascension of the target set on acquire,

See Also:
Constant Field Values

KEY_DECTARGET

public static final String KEY_DECTARGET
The internal declination of the target set on acquire,

See Also:
Constant Field Values

KEY_MAGTARGET

public static final String KEY_MAGTARGET
The internal magnitude of the target set on acquire,

See Also:
Constant Field Values

KEY_DEROTATOROFF

public static final String KEY_DEROTATOROFF
The name of the Value holding the derotator offset.

See Also:
Constant Field Values

KEY_IMAGEROTATION

public static final String KEY_IMAGEROTATION
The name of the Value holding the plain image rotation.

See Also:
Constant Field Values

KEY_ALTITUDE

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

See Also:
Constant Field Values

KEY_AZIMUTH

public static final String KEY_AZIMUTH
The azimuth of the target for calculating CCD rotation.

See Also:
Constant Field Values

KEY_FOCUS

public static final String KEY_FOCUS
The focus of the telescope.

See Also:
Constant Field Values

KEY_LOSTCOUNT

public static final String KEY_LOSTCOUNT
Issued to the local parameter cluster as number of target losts.

See Also:
Constant Field Values

KEY_SPURIOUSCOUNT

public static final String KEY_SPURIOUSCOUNT
Issued to the local parameter cluster as number of guiding losts.

See Also:
Constant Field Values

KEY_OFFSETAVERAGE

public static final String KEY_OFFSETAVERAGE
Issued to the local parameter cluster as average offset.

See Also:
Constant Field Values

KEY_SEEING

public static final String KEY_SEEING
Issued to the local parameter cluster as the seeing estimate.

See Also:
Constant Field Values

KEY_WINDMAX

public static final String KEY_WINDMAX
The wind-speed maxometer parameter.

See Also:
Constant Field Values

KEY_EXPOSURETIMELEFT

public static final String KEY_EXPOSURETIMELEFT
The parameter holding the exposure time left.

See Also:
Constant Field Values

KEY_FRACTIONALEXPOSE

public static final String KEY_FRACTIONALEXPOSE
The parameter holding the fractional exposure time.

See Also:
Constant Field Values

KEY_FINDTIME

public static final String KEY_FINDTIME
Time for the find command.

See Also:
Constant Field Values

KEY_ACQUIRETIME

public static final String KEY_ACQUIRETIME
Time for the acquire command.

See Also:
Constant Field Values

KEY_FOCUSTIME

public static final String KEY_FOCUSTIME
Time for the focus command.

See Also:
Constant Field Values

KEY_STARTGUIDINGTIME

public static final String KEY_STARTGUIDINGTIME
Time for starting the guiding.

See Also:
Constant Field Values

KEY_STOPGUIDINGTIME

public static final String KEY_STOPGUIDINGTIME
Time for stopping the guiding.

See Also:
Constant Field Values

KEY_STARTTILINGTIME

public static final String KEY_STARTTILINGTIME
Time for starting the guiding.

See Also:
Constant Field Values

KEY_STOPTILINGTIME

public static final String KEY_STOPTILINGTIME
Time for stopping the guiding.

See Also:
Constant Field Values

KEY_GUIDERDELAY

public static final String KEY_GUIDERDELAY
Delay until guiding stars.

See Also:
Constant Field Values

KEY_OFFSETDELAY

public static final String KEY_OFFSETDELAY
Delay on guiding stop, if offsets are active.

See Also:
Constant Field Values

KEY_OFFSETWAIT

public static final String KEY_OFFSETWAIT
Maximum offset delays waited on stop guiding.

See Also:
Constant Field Values

KEY_KEEPOFFSETS

public static final String KEY_KEEPOFFSETS
If true, we record the az/alt offset in a data output stream.

See Also:
Constant Field Values

KEY_KEEPPIDS

public static final String KEY_KEEPPIDS
If true, we record the pid offset in a data output stream.

See Also:
Constant Field Values

KEY_MOVETIME

public static final String KEY_MOVETIME
The time-out for move-telescopes.

See Also:
Constant Field Values

KEY_EXPOSUREFRAME

public static final String KEY_EXPOSUREFRAME
The window on the guider ccd used on exposures, unbinned.

See Also:
Constant Field Values

KEY_GUIDERMAG

public static final String KEY_GUIDERMAG
The key for the faintest star to guide on.

See Also:
Constant Field Values

KEY_GUIDESTARMERIT

public static final String KEY_GUIDESTARMERIT
This expression, with $0=mag and $1=distance merits the guide star

See Also:
Constant Field Values

DEFGUIDERCCD

private static final String DEFGUIDERCCD
The name of the CCD driver class used for guiding.

See Also:
Constant Field Values

DEFCLEARFRAME

private static final Rectangle DEFCLEARFRAME
The frame that should be cleared on a reset.


DEFCLEARTIME

private static final long DEFCLEARTIME
The time required for a clear ccd.

See Also:
Constant Field Values

DEFAUXILIARYGUIDER

private static final String DEFAUXILIARYGUIDER
The default properties file for the stella guider.

See Also:
Constant Field Values

DEFCOMMUNICATOR

private static final String DEFCOMMUNICATOR
The default properties file for the stella guider.

See Also:
Constant Field Values

DEFTARGETNAME

public static final String DEFTARGETNAME
The default name of the target name parameter.

See Also:
Constant Field Values

DEFRATARGET

public static final String DEFRATARGET
The default name of the target right ascension parameter.

See Also:
Constant Field Values

DEFDECTARGET

public static final String DEFDECTARGET
The default name of the target declination parameter.

See Also:
Constant Field Values

DEFMAGTARGET

public static final String DEFMAGTARGET
The default name of the target magnitude parameter.

See Also:
Constant Field Values

DEFDITHERTARGET

public static final String DEFDITHERTARGET
The default name of the target should-be-dithered parameter.

See Also:
Constant Field Values

DEFDEROTATOROFF

public static final String DEFDEROTATOROFF
The default name of the telescope derotator parameter.

See Also:
Constant Field Values

DEFIMAGEROTATION

public static final String DEFIMAGEROTATION
The default name of the plain image rotation.

See Also:
Constant Field Values

DEFAZIMUTH

public static final String DEFAZIMUTH
The default name of the altitude parameter.

See Also:
Constant Field Values

DEFALTITUDE

public static final String DEFALTITUDE
The default name of the altitude parameter.

See Also:
Constant Field Values

DEFFOCUS

public static final String DEFFOCUS
The default name of the focus parameter.

See Also:
Constant Field Values

DEFLOSTCOUNT

public static final String DEFLOSTCOUNT
The default name of the paramter counting guidng losses

See Also:
Constant Field Values

DEFSPURIOUSCOUNT

public static final String DEFSPURIOUSCOUNT
The default name of the paramter counting guidng losses

See Also:
Constant Field Values

DEFOFFSETAVERAGE

public static final String DEFOFFSETAVERAGE
The default name of the paramter counting arcsec offsets.

See Also:
Constant Field Values

DEFSEEING

public static final String DEFSEEING
The default name of the paramter accumulating guiding seeing.

See Also:
Constant Field Values

DEFWINDMAX

public static final String DEFWINDMAX
The default name of the paramter holding windspeed max.

See Also:
Constant Field Values

DEFEXPOSURETIMELEFT

public static final String DEFEXPOSURETIMELEFT
The default name of the paramter holding the exposure time left .

See Also:
Constant Field Values

DEFFRACTIONALEXPOSE

public static final String DEFFRACTIONALEXPOSE
The default name of the paramter holding the fractional exposure time.

See Also:
Constant Field Values

DEFFINDTIME

private static final long DEFFINDTIME
The default recognize-find time.

See Also:
Constant Field Values

DEFACQUIRETIME

private static final long DEFACQUIRETIME
The default acquire time.

See Also:
Constant Field Values

DEFFOCUSTIME

private static final long DEFFOCUSTIME
The default focus time.

See Also:
Constant Field Values

DEFSTARTGUIDINGTIME

private static final long DEFSTARTGUIDINGTIME
The default time till guiding starts.

See Also:
Constant Field Values

DEFSTOPGUIDINGTIME

private static final long DEFSTOPGUIDINGTIME
The default time till guiding stops.

See Also:
Constant Field Values

DEFSTARTTILINGTIME

private static final long DEFSTARTTILINGTIME
The default time till guiding starts.

See Also:
Constant Field Values

DEFSTOPTILINGTIME

private static final long DEFSTOPTILINGTIME
The default time till guiding stops.

See Also:
Constant Field Values

DEFFIXEDROTATORTIME

private static final long DEFFIXEDROTATORTIME
The default time to change the filter.

See Also:
Constant Field Values

DEFGUIDERDELAY

private static final long DEFGUIDERDELAY
The default guider delay prior to first guiding step.

See Also:
Constant Field Values

DEFOFFSETDELAY

private static final long DEFOFFSETDELAY
The default delay on stop guiding if offset are active.

See Also:
Constant Field Values

DEFOFFSETWAIT

private static final int DEFOFFSETWAIT
The default delay on stop guiding if offset are active.

See Also:
Constant Field Values

DEFKEEPOFFSETS

private static final boolean DEFKEEPOFFSETS
If true, all guiding offsets are kept.

See Also:
Constant Field Values

DEFKEEPPIDS

private static final boolean DEFKEEPPIDS
If true, all guiding pids are kept.

See Also:
Constant Field Values

DEFMOVETIME

private static final long DEFMOVETIME
The maximum time we wait for move telescope.

See Also:
Constant Field Values

DEFGUIDERMAG

public static final float DEFGUIDERMAG
Guide stars must be brighter than this.

See Also:
Constant Field Values

coarsetask

private AuxiliaryCoarseUnit coarsetask
The acquire unit doing the coarse acquire task.


finetask

private AuxiliaryFineUnit finetask
The acquire unit doing the fine acquire task.


guidetask

private AuxiliaryGuidingUnit guidetask
The guider unit doing the guiding task plus the loop.


com

private OffsetCaster com
The adapter-to-telescope communication.


auxiliary

private AuxiliaryGuider auxiliary
The encapsulating class for the STELLA guider methods.


darkgather

private DarkOverlapTiler darkgather
For dark-frames gathering during twilight.


guidervirgin

private int guidervirgin
An int that get zero on finds, tracks guider mode changes.


acquirevirgin

private int acquirevirgin
An int that get zero on finds, tracks reacquires.


offrecord

private DataOutputStream offrecord
An object output stream were we serialize our alt/az offs in.


pidrecord

private DataOutputStream pidrecord
An object output stream were we serialize our pids offs in.


lastunique

private String lastunique
Last recorded unique.


expid

private int expid
The internal counter for the command id. Start at 1


continuous

private AuxiliaryMaster.ContinuousExposure continuous
If continuous exposures are underway, this is the thread.

Constructor Detail

AuxiliaryMaster

public AuxiliaryMaster(Map<String,String> prop)
                throws RemoteException
Constructs a new adapter master. The parameter set served is constructed in the PropertyResources.init() section of the parent class.

Throws:
RemoteException
Method Detail

initStep

public void initStep(int curstep)
Additionally initializes the filter-to-position lookup tables.

Specified by:
initStep in interface StepInitializable
Overrides:
initStep in class GenericMaster
Parameters:
curstep - The current initialization depth.

init2

private void init2()
Additionally initializes the adapter-to-telescope communication and defaults values for fixed rotator, guiding and acquisition time.


exit

public void exit()
If we have a dark tiler, we exit it, too.

Specified by:
exit in interface ExitCleaning
Overrides:
exit in class GenericMaster

createAuxiliaryUnit

private AuxiliaryUnit createAuxiliaryUnit(String unit)
Sets all required knowledge available to an adapter unit. This is the adapter guider, the telescope communication, and the adapter master itself.


automatic

public boolean automatic()
                  throws RemoteException
Enables automatic operation. If we are currently guiding, the guiding is stopped.

Specified by:
automatic in interface ListenerControlling
Overrides:
automatic in class GenericMaster
Returns:
True if automatic mode was attained.
Throws:
RemoteException

manual

public boolean manual()
               throws RemoteException
Disables automatic operation. This method calls the doStopGuiding() method to kill any ongoing guiding.

Specified by:
manual in interface ListenerControlling
Overrides:
manual in class GenericMaster
Returns:
True if manual mode was attained.
Throws:
RemoteException

center

public boolean center(double[] ra,
                      double[] de,
                      float[] m,
                      float[] bv)
               throws RemoteException
We center at a star by finding and acquiring it.

Specified by:
center in interface GuiderControlling
Throws:
RemoteException

ditherOffset

public boolean ditherOffset(double ra,
                            double de)
                     throws RemoteException
Sets a dither offset which is allowed only in manual mode.

Specified by:
ditherOffset in interface DitherControlling
Throws:
RemoteException

initGuider

public boolean initGuider()
                   throws RemoteException
Description copied from interface: GuiderControlling
Initializes the guider and prepares it for a new guider loop.

Specified by:
initGuider in interface GuiderControlling
Throws:
RemoteException

singleShot

public boolean singleShot(double t)
                   throws RemoteException
If in manual mode, we take a single guider camera shot.

Specified by:
singleShot in interface GuiderControlling
Throws:
RemoteException

offsetAzAlt

public boolean offsetAzAlt(double daz,
                           double dalt)
                    throws RemoteException
Offsets the telescope for a given amount in azimuth and altitude, degrees.

Specified by:
offsetAzAlt in interface GuiderControlling
Throws:
RemoteException

offsetXY

public boolean offsetXY(int dx,
                        int dy)
                 throws RemoteException
Offsets the telescope for a given pixel distance on the guider ccd. Does not change the acquire/guiding center.

Specified by:
offsetXY in interface GuiderControlling
Parameters:
dx - Difference in pixel
dy - Difference in pixel
Throws:
RemoteException

startGuiding

public boolean startGuiding()
                     throws RemoteException
Guides on a previously acquired star.

Specified by:
startGuiding in interface GuiderControlling
Throws:
RemoteException

stopGuiding

public boolean stopGuiding()
                    throws RemoteException
Stops guiding if active.

Specified by:
stopGuiding in interface GuiderControlling
Throws:
RemoteException

quit

public void quit()
          throws RemoteException
Gracefully quite the adapter master. The exit of the Java VM is delayed for five seconds.

Specified by:
quit in interface ListenerControlling
Overrides:
quit in class GenericMaster
Throws:
RemoteException

accepts

public boolean accepts(CommandEvent ce)
                throws RemoteException
Checks if the command received is accepted by the adapter master. An adapter master accepts all AuxiliaryCommands.

Specified by:
accepts in interface RmiCommandListener
Throws:
RemoteException

getDarkTiler

protected DarkOverlapTiler getDarkTiler()
Some auxiliar units need access to the dark tiler.


getAcknowledgeNumber

protected int getAcknowledgeNumber(CommandEvent cmd)
Returns the number of acknowledge events produced for each command. If the command is unknown an IllegalArgumentException is thrown.

Overrides:
getAcknowledgeNumber in class GenericMaster

getCompletionTime

protected long getCompletionTime(CommandEvent cmd,
                                 int acknr)
Returns the individual completion times. For exposure commands, the first acknowledge time is the sum of the exposure time plus the read-out time from the controller to the local buffer. The second acknowledge time is the time it takes to write the fits file out of the local data buffer.
If the command is unknown an IllegalArgumentException is thrown.

Overrides:
getCompletionTime in class GenericMaster
Parameters:
cmd - The command to process.
acknr - The number of the acknowledge that will be sent back.

processCommand

protected boolean processCommand(CommandEvent cmd,
                                 int acknr)
Process the command. The exposure commands are split into three processes, the first one consisting of taking the exposure, the second transfering the CCD-data to the local buffer. The third part is writing the locally buffered data to the fits file. This allows the sequencer to continue operation once the data has been transfered from the CCD to the local buffer. In principle, the next exposure can start as soon as the data transfer to the local buffer is completed.

Overrides:
processCommand in class GenericMaster

initializeMaster

protected boolean initializeMaster()
Initializes the adapter. Additionally, does a clearing of the guider ccd by a call to resetMaster().

Specified by:
initializeMaster in class GenericMaster

abortMaster

protected boolean abortMaster()
Method called to abort the device. Empty implementation.

Overrides:
abortMaster in class GenericMaster

statusMaster

protected Object statusMaster()
Returns a status message.

Specified by:
statusMaster in class GenericMaster
Returns:
A string or an ErrorEvent.

resetMaster

protected boolean resetMaster()
Resets the adapter. This method should be called at least after lamp-light has been shining into the adapter and the guider-ccd may be contaminated.

Specified by:
resetMaster in class GenericMaster

parkMaster

protected boolean parkMaster()
Parks the adapter.

Specified by:
parkMaster in class GenericMaster

quitMaster

protected void quitMaster()
Quits the adapter. Similar to parkMaster(), but also deregisters from the telescope and the registry.

Overrides:
quitMaster in class GenericMaster

guidingHead

protected String guidingHead()
Delivers a unique id for the currently active target in guiding mode. If a unique parameter is present, this is used, otherwise, we depend on the current date and targetcount.


coarseType

protected String coarseType()
Delivers a unique id for the currently active target in guiding mode. If a unique parameter is present, this is used, otherwise, we depend on the current date and targetcount.


fineType

protected String fineType()
Delivers a unique id for the currently active target in guiding mode. If a unique parameter is present, this is used, otherwise, we depend on the current date and targetcount.


moveTelescope

private boolean moveTelescope(double ra,
                              double de)
For manual access we also allow moving the telescope.


offsetTelescope

private boolean offsetTelescope(double daz,
                                double dalt)
For manual access to telescope offsets.


doSetDither

private boolean doSetDither(double dra,
                            double dde)
Applies a dithering to the auxiliarz guider. Only possible if not guiding on central source.


find

private boolean find(FindAuxiliary cmd)
Registers a list of stars that are expected in the following acquire field. From this list we construct two lists of Guiding.RawStar objects that can be passed into the Guiding.match(java.util.List, java.util.List, double, double) method. We proceed as follows:


prepare

private void prepare()
Prepares the master for a new target. The virgin state for guider and acquire is set here. The current date is cecked, if different from the last date and the target count is increased.


startGuiding

private boolean startGuiding(StartGuidingAuxiliary sga)
Starts the guiding in the required mode. This method returns as soon as the guiding starts. Uses an exposure increas signaled by the acquire unit.


takeExposure

private boolean takeExposure(double tsec)
Take an exposure with the guiding camera.


defineCenter

private boolean defineCenter(double ra,
                             double de)
We set the center of the science field. No additional action commences unless we do an acquire or a start guiding. The only purpose of this method is to allow the guider CCD to determine at which pixel the derotator axis will be imaged onto the guider.


guideStar

private boolean guideStar(StarDescription s)
We set the guiding star.


defaultGuidingStar

public static StarDescription defaultGuidingStar(List<StarDescription> def,
                                                 double racenter,
                                                 double decenter,
                                                 float minmag)
Default guiding star, above defined threshold.


acquire

private boolean acquire(AcquireAuxiliary com)
Brings the acquire star at the cross-hair of the guider.


getNextExp

private int getNextExp()
Returns the next available command id. If 65535 is passed, restart.


doAcquire

private ErrorEvent doAcquire(String mode)
Acquires a star. Delegates to the acquire units. The following modes are supported:


doStartGuiding

private ErrorEvent doStartGuiding(String mode)
Starts guiding. We construct a new guiding timer task and put it onto the master's timer until stopGuiding() is called.


doStopGuiding

private boolean doStopGuiding()
Stops the guiding. The guider task is canceled. Method returns only after no more offsets are active.


doStartTiling

private boolean doStartTiling()
Stars a tiling process if a tiler is assigned. Always returns true, as this is a non-critical error.


doStopTiling

private boolean doStopTiling()
Stops the tiling process if a tiler is assigned. Always returns true, as this is a non-critical error.


doStartExposing

private boolean doStartExposing(double tsec)
Starts the continuous getting of exposures with the stated exposure time. Expsoing stops only after a call to doStopExposing() or if a new acquire sequence is started.


doStopExposing

private boolean doStopExposing()
We stop continuous exposures and join on the camera for exit.


geometry

private boolean geometry(int xoff,
                         int yoff,
                         int xsize,
                         int ysize,
                         int xbin,
                         int ybin)
Sets the geometry of the next image on the ccd. Calls the six methods in MainCamera related to the size/origin/binning of the image.


getStarDescriptions

private static List<StarDescription> getStarDescriptions(double[] ra,
                                                         double[] de,
                                                         float[] mag,
                                                         float[] bv)
Converts an array of ra, dec, Vmag, and B-V into a list of star descriptions.


main

public static void main(String[] arg)
                 throws RemoteException
Constructs a new adapter master. The single argument supplied are the adapter properties.

Throws:
RemoteException