stella.adapter
Class AdapterMaster

java.lang.Object
  extended by util.PropertyContainer
      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.AdapterMaster
All Implemented Interfaces:
Cloneable, Remote, EventListener, Caster, ErrorSending, ErrorCaster, AdapterControlling, Alive, FocusControlling, GuiderControlling, ListenerControlling, RmiAcknowledgeCaster, RmiCommandListener, RmiDoneCaster, RmiErrorCaster, RmiParameterClustering, ExitCleaning, Initializable, PropertyBearing, Reloadable, RmiCaster, RmiEventListener, RmiListener, RmiPropertyBearing, TriggerableReload, StepInitializable

public class AdapterMaster
extends GenericMaster
implements AdapterControlling, Reloadable

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
 
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.PropertyContainer
PropertyContainer.URLResource
 
Field Summary
private  boolean abate
          True, if we wait for the transient oscillations to abate.
private  AcquiringUnit acquiretask
          The acquire unit doing the acquire task.
private  TimerTask active
          The guider task.
private  OffsetCaster comoff
          The adapter-to-telescope communication.
private  int currentdither
          A counter for dithering offsets.
private static long DEFACQUIRETIME
          The default acquire time.
static String DEFALTITUDE
          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 reset.
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.
private static int DEFDITHERING
          The number of dithering points around the pinhole.
private static double DEFDITHERRADIUS
          The radius of dithering points around the pinhole.
static String DEFDITHERTARGET
          The default name of the target should-be-dithered parameter.
private static long DEFFAINTFOCUSTIME
          The default focus time.
private static long DEFFINDTIME
          The default recognize-find time.
private static long DEFFIXEDROTATORTIME
          The default time to change the filter.
private static long DEFFOCUSTIME
          The default focus time.
private static String DEFFOCUSVALUE
          Default focus temperature parameter name.
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 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.
private static long DEFLOOPFACTOR
          If true, no telescope move is done during manual acquire.
static String DEFMAGTARGET
          The default name of the target magnitude parameter.
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.
private static long DEFREDUCETIME
          The default reduce time during a guider period.
private static long DEFSTARTGUIDINGTIME
          The default time till guiding starts.
private static String DEFSTELLAGUIDER
          The default properties file for the stella guider.
private static long DEFSTOPGUIDINGTIME
          The default time till guiding stops.
private static boolean DEFSUPPRESSCENTER
          If true, no telescope move is done during manual acquire.
static String DEFTARGETNAME
          The default name of the target name parameter.
private  Point2D dithershift
          The dither shift, or null if no dither required.
private  int expid
          The internal counter for the command id.
private  FocussingUnit faintfocustask
          The focus unit doing the focus on faint stars, if any.
private  FocussingUnit focustask
          The focus unit doing the focus.
private  AbstractStarGuider guider
          The encapsulating class for the STELLA guider methods.
private  GuidingUnit guidingtask
          The guider unit doing the guiding task plus the loop.
static String KEY_ACQUIRETIME
          Time for the acquire command.
static String KEY_ACQUIREUNIT
          The properties of the AcquiringUnit.
static String KEY_ALTITUDE
          The height 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_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_DITHERING
          The number of dithering offsets.
static String KEY_DITHERRADIUS
          The radius in pixel of the diterhing mechanism.
static String KEY_DITHERTARGET
          The internal magnitude of the target set on acquire,
static String KEY_EXPOSUREFRAME
          The window on the guider ccd used on exposures, unbinned.
static String KEY_FAINTFOCUSTIME
          Time for the auto faint focus command.
static String KEY_FAINTFOCUSUNIT
          The properties of the FocussingUnit for faint stars.
static String KEY_FINDTIME
          Time for the find command.
static String KEY_FOCUSTIME
          Time for the auto focus command.
static String KEY_FOCUSUNIT
          The properties of the FocussingUnit.
static String KEY_FOCUSVALUE
          The name of the parameter that holds the focus.
static String KEY_GUIDERCCD
          The name of the CCD driver class used for guiding.
static String KEY_GUIDERDELAY
          For transient response of guiding loop.
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_LOOPFACTOR
          If the adapter exposure time is not ms, this is the division to ms.
static String KEY_MAGTARGET
          The internal magnitude of the target set on acquire,
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_REDUCETIME
          Reduction time of a single guider loop execution.
static String KEY_STARTGUIDINGTIME
          Time for starting the guiding.
static String KEY_STELLAGUIDER
          The properties of the Guiding class.
static String KEY_STOPGUIDINGTIME
          Time for stopping the guiding.
static String KEY_SUPPRESSCENTER
          If the adapter has a small FOV, the telescope is not moved in manual.
static String KEY_TARGETNAME
          The rmi-target name for errors on acquire,
private  String lastunique
          The last unique format.
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.
private  Point2D pinhole
          If dither, we have to query the guider once for its primary pinhole.
private static Timer timer
          The timer to scheduler the guider task.
private  int virgin
          An int that get zero on finds, tracks guider mode changes.
 
Fields inherited from class stella.rmi.GenericMaster
DEFUNIQUE, KEY_ABORTTIME, KEY_AUTOMATIC, KEY_COMMTIME, KEY_COMMUNICATOR, KEY_DRIVERS, KEY_HISTORYDB, KEY_INITTIME, 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.PropertyContainer
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES
 
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.PropertyBearing
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
AdapterMaster(Map 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.
protected  boolean acquireAdapter(CommandEvent cmd)
          Brings the acquire star at the cross-hair of the guider.
 boolean autoFocus()
          We do a focus on the star by simply passing to doFocus().
 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.
private  AdapterUnit createAdapterUnit(String unit)
          Sets all required knowledge available to an adapter unit.
private  ErrorEvent doAcquire(String mode)
          Acquires a star.
private  ErrorEvent doFaintFocus()
          Does a focusing on a faint star.
private  ErrorEvent doFocus()
          Does a telescope focus using the focus pyramid.
protected  boolean doSetFocus(double mm)
          Directly moves the focus.
protected  boolean doSetFocusOffset(double mm)
          Directly offsets the focus.
private  ErrorEvent doStartGuiding(String mode)
          Starts guiding.
private  boolean doStopGuiding()
          Stops the guiding.
protected  boolean faintFocusAdapter()
          Focuses a lately acquired star.
protected  boolean findAdapter(CommandEvent com)
          Registers a list of stars that are expected in the following acquire field.
 boolean focus(double pos)
          Does a direct set on the focus, which either moves the telescope focus or some other unit visiblie for the adapter.
protected  boolean focusAdapter()
          Focuses a lately acquired star.
 boolean focusOffset(double pos)
          Does a direct set on the focus, which either moves the telescope focus or some other unit visiblie for the adapter.
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  int getNextExp()
          Returns the next available exposure id.
private static List 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  void init2()
          Additionally initializes the adapter-to-telescope communication and defaults values for fixed rotator, guiding and acquisition time.
 boolean initGuider()
          init guier
protected  boolean initializeMaster()
          Initializes the adapter.
 void initStep(int curstep)
          Additionally initializes the filter-to-position lookup tables.
protected  boolean isAbate()
          Returns the status of the abate flag which is set during an initial phase if transient oscilations of the guider might hamper the results.
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.
protected  boolean processCommand(CommandEvent cmd, int acknr)
          Process the command.
 void quit()
          Gracefully quite the adapter master.
protected  void quitMaster()
          Quits the adapter.
 double reload()
          On reload, we have to reload the individual units as well.
 double rescanned(String key, String old, String newval)
          On rescan, we have to assign various variables to underlying instances.
protected  void resetExp()
          Resets the exposure id manually.
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.
protected  boolean startGuiding(CommandEvent com)
          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, exit, 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, 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.PropertyContainer
augment, augment, augment, clone, createFrom, createFrom, createFrom, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getLocalClassLoader, getLocalized, getLocalized, getLocalizedString, getLocalizedString, getProperties, getPropertiesToKey, getPropertiesToKey, getProperty, getResource, getResourceAsStream, getResourceFromKey, getResources, has, init, isNew, keyCreate, keyCreate, parseObject, reload, 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
 

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_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_STELLAGUIDER

public static final String KEY_STELLAGUIDER
The properties of the Guiding 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_FAINTFOCUSUNIT

public static final String KEY_FAINTFOCUSUNIT
The properties of the FocussingUnit for faint stars.

See Also:
Constant Field Values

KEY_ACQUIREUNIT

public static final String KEY_ACQUIREUNIT
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_DITHERTARGET

public static final String KEY_DITHERTARGET
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_FOCUSVALUE

public static final String KEY_FOCUSVALUE
The name of the parameter that holds the focus.

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_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 auto focus command.

See Also:
Constant Field Values

KEY_FAINTFOCUSTIME

public static final String KEY_FAINTFOCUSTIME
Time for the auto faint 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_GUIDERDELAY

public static final String KEY_GUIDERDELAY
For transient response of guiding loop.

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_REDUCETIME

public static final String KEY_REDUCETIME
Reduction time of a single guider loop execution.

See Also:
Constant Field Values

KEY_DITHERING

public static final String KEY_DITHERING
The number of dithering offsets. Zero means guide on pinhole.

See Also:
Constant Field Values

KEY_DITHERRADIUS

public static final String KEY_DITHERRADIUS
The radius in pixel of the diterhing mechanism.

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_EXPOSUREFRAME

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

See Also:
Constant Field Values

KEY_SUPPRESSCENTER

public static final String KEY_SUPPRESSCENTER
If the adapter has a small FOV, the telescope is not moved in manual.

See Also:
Constant Field Values

KEY_LOOPFACTOR

public static final String KEY_LOOPFACTOR
If the adapter exposure time is not ms, this is the division to ms.

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 reset.

See Also:
Constant Field Values

DEFSTELLAGUIDER

private static final String DEFSTELLAGUIDER
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

DEFALTITUDE

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

See Also:
Constant Field Values

DEFFOCUSVALUE

private static final String DEFFOCUSVALUE
Default focus temperature parameter name.

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

DEFFAINTFOCUSTIME

private static final long DEFFAINTFOCUSTIME
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

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

DEFREDUCETIME

private static final long DEFREDUCETIME
The default reduce time during a guider period.

See Also:
Constant Field Values

DEFDITHERING

private static final int DEFDITHERING
The number of dithering points around the pinhole.

See Also:
Constant Field Values

DEFDITHERRADIUS

private static final double DEFDITHERRADIUS
The radius of dithering points around the pinhole.

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

DEFSUPPRESSCENTER

private static final boolean DEFSUPPRESSCENTER
If true, no telescope move is done during manual acquire.

See Also:
Constant Field Values

DEFLOOPFACTOR

private static final long DEFLOOPFACTOR
If true, no telescope move is done during manual acquire.

See Also:
Constant Field Values

focustask

private FocussingUnit focustask
The focus unit doing the focus.


faintfocustask

private FocussingUnit faintfocustask
The focus unit doing the focus on faint stars, if any.


acquiretask

private AcquiringUnit acquiretask
The acquire unit doing the acquire task.


guidingtask

private GuidingUnit guidingtask
The guider unit doing the guiding task plus the loop.


comoff

private OffsetCaster comoff
The adapter-to-telescope communication.


guider

private AbstractStarGuider guider
The encapsulating class for the STELLA guider methods.


virgin

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


active

private TimerTask active
The guider task. Restarted on each #doGuide call.


timer

private static Timer timer
The timer to scheduler the guider task.


currentdither

private int currentdither
A counter for dithering offsets.


dithershift

private Point2D dithershift
The dither shift, or null if no dither required.


pinhole

private Point2D pinhole
If dither, we have to query the guider once for its primary pinhole.


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.


expid

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


lastunique

private String lastunique
The last unique format.


abate

private boolean abate
True, if we wait for the transient oscillations to abate.

Constructor Detail

AdapterMaster

public AdapterMaster(Map prop)
              throws RemoteException
Constructs a new adapter master. The parameter set served is constructed in the PropertyContainer.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.


createAdapterUnit

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


reload

public double reload()
On reload, we have to reload the individual units as well. The telescope communication has to be checked. The guider instance has to be reloaded.

Specified by:
reload in interface Reloadable
Overrides:
reload in class GenericMaster

rescanned

public double rescanned(String key,
                        String old,
                        String newval)
On rescan, we have to assign various variables to underlying instances.

Specified by:
rescanned in interface Reloadable
Overrides:
rescanned in class GenericMaster

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

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

autoFocus

public boolean autoFocus()
                  throws RemoteException
We do a focus on the star by simply passing to doFocus(). The star must be manually acquired before.

Specified by:
autoFocus in interface AdapterControlling
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

focus

public boolean focus(double pos)
              throws RemoteException
Does a direct set on the focus, which either moves the telescope focus or some other unit visiblie for the adapter. Also allowed in automatic mode.

Specified by:
focus in interface FocusControlling
Throws:
RemoteException

focusOffset

public boolean focusOffset(double pos)
                    throws RemoteException
Does a direct set on the focus, which either moves the telescope focus or some other unit visiblie for the adapter. Also allowed in automatic mode.

Specified by:
focusOffset in interface FocusControlling
Throws:
RemoteException

initGuider

public boolean initGuider()
                   throws RemoteException
init guier

Specified by:
initGuider in interface GuiderControlling
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 AdapterCommands.

Specified by:
accepts in interface RmiCommandListener
Throws:
RemoteException

isAbate

protected boolean isAbate()
Returns the status of the abate flag which is set during an initial phase if transient oscilations of the guider might hamper the results.


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

statusMaster

protected Object statusMaster()
Returns a status message.

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

abortMaster

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

Overrides:
abortMaster in class GenericMaster

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

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.


findAdapter

protected boolean findAdapter(CommandEvent com)
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:


startGuiding

protected boolean startGuiding(CommandEvent com)
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.


acquireAdapter

protected boolean acquireAdapter(CommandEvent cmd)
Brings the acquire star at the cross-hair of the guider.


focusAdapter

protected boolean focusAdapter()
Focuses a lately acquired star. Method uses exposure increase from last acquire.


faintFocusAdapter

protected boolean faintFocusAdapter()
Focuses a lately acquired star. Method uses exposure increase from last acquire. Method asumes faintfocustask is valid.


doSetFocus

protected boolean doSetFocus(double mm)
Directly moves the focus.


doSetFocusOffset

protected boolean doSetFocusOffset(double mm)
Directly offsets the focus.


doFocus

private ErrorEvent doFocus()
Does a telescope focus using the focus pyramid. The following things must be done, before this method may be commenced: Then, the procedure is as follows: Note that after the focus adjustment, the focus pyramid must be removed from the beam by an other master. It is not clear in the moment, if a re-acquire is needed after the focus sequence, but I think it's not.


doFaintFocus

private ErrorEvent doFaintFocus()
Does a focusing on a faint star. This is done by moments.


doAcquire

private ErrorEvent doAcquire(String mode)
Acquires a star. Delegates to the acquire unit.


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.


takeExposure

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


getNextExp

protected int getNextExp()
Returns the next available exposure id.


resetExp

protected void resetExp()
Resets the exposure id manually. Automatically done for each new unique target encountered.


getStarDescriptions

private static List 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