stella.calibration
Class CalibrationMaster

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.calibration.CalibrationMaster
All Implemented Interfaces:
Cloneable, Remote, EventListener, Caster, ErrorSending, ErrorCaster, Alive, CalibrationControlling, ListenerControlling, RmiAcknowledgeCaster, RmiCommandListener, RmiDoneCaster, RmiErrorCaster, RmiParameterClustering, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying, RmiCaster, RmiEventListener, RmiListener, RmiPropertyBearing, TriggerableReload, StepInitializable

public class CalibrationMaster
extends GenericMaster
implements CalibrationControlling, Reloadable

This class is an intermediate step to a adapter that is capable only of steering the calibrational units. Guiding is only possible with the daughter class AdapterMaster. This class handles the following commands:

A remark to proper construction: For the parameter set to register the lamp-switch driver (i.e. the 1-wire driver), it must be present in the GenericMaster.KEY_DRIVERS list, though for switching of the lamps we relie on OneWireSwitchs and not interfere with the switch driver itself.


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.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static long DEFALIGHTQUARTZ
          The default time the quartz may be turned on.
private static long DEFALIGHTTHAR
          The default time the ThAr may be turned on.
private static String DEFCALIBRATION
          The name of the calibration unit driver for postioning lamps.
private static long DEFCALIBRATIONOFFTIME
          The default time to turn off calibration.
private static long DEFCALIBRATIONONTIME
          The default time to turn on calibration.
private static String DEFFILTERCLEAR
          The default name of the filter wheel position for star into fiber.
private static String DEFFILTERQUARTZ
          The default name of the filter wheel position for Quartz into fiber.
private static String DEFFILTERTHAR
          The default name of the filter wheel position for ThAr into fiber.
private static String DEFFILTERWHEEL
          The name of the filter wheel driver.
private static long DEFFLATFIELDOFFTIME
          The default time to turn off flat-fielding.
private static long DEFFLATFIELDONTIME
          The default time to turn on flat-fielding.
private static long DEFMOVETIME
          The default time to change the filter.
private static String DEFPOSITIONHOME
          The position name in the calibration unit for home position.
private static String DEFPOSITIONQUARTZ
          The position name in the calibration unit for choosing ThAr.
private static String DEFPOSITIONTHAR
          The position name in the calibration unit for choosing ThAr.
private static boolean DEFRETRACEUNIT
          If true, calibration unit is placed to POSITIONHOME after lamp off.
private static long DEFSELECTFILTERTIME
          The default time to change the filter.
private static String DEFSET
          The default properties file for the adapter master parameters.
private static String DEFSWITCHQUARTZ
          The name of the halogen lamp switch in the parameter set.
private static String DEFSWITCHTHAR
          The name of the thorium lamp switch in the parameter set.
private static String DEFWHEELPOSITIONS
          The default names to position lookup table for the wheel.
static String KEY_ALIGHTQUARTZ
          The time the quartz is allowed to be on at maximum, ms.
static String KEY_ALIGHTTHAR
          The time the ThAr is allowed to be on at maximum, ms.
static String KEY_CALIBRATION
          The name of the calibration unit driver for postioning lamps.
static String KEY_CALIBRATIONOFFTIME
          Time for turning off calibration light.
static String KEY_CALIBRATIONONTIME
          Time for turning on calibration light.
static String KEY_FILTERCLEAR
          The filter wheel position for calibration light.
static String KEY_FILTERQUARTZ
          The filter wheel position for calibration light.
static String KEY_FILTERTHAR
          The filter wheel position for calibration light.
static String KEY_FILTERWHEEL
          The name of the filter wheel drivers.
static String KEY_FLATFIELDOFFTIME
          Time for turning off flat-fielding light.
static String KEY_FLATFIELDONTIME
          Time for turning on flat-fielding light.
static String KEY_MOVETIME
          Time for moving the calibration unit.
static String KEY_POSITIONHOME
          The position name in the calibration unit for home position
static String KEY_POSITIONQUARTZ
          The position name in the calibration unit for choosing Halogen.
static String KEY_POSITIONTHAR
          The position name in the calibration unit for choosing ThAr.
static String KEY_RETRACEUNIT
          The position name in the calibration unit for choosing ThAr.
static String KEY_SELECTFILTERTIME
          Time for selecting the filter.
static String KEY_SWITCHQUARTZ
          The name of the halogen lamp switch in the parameter set.
static String KEY_SWITCHTHAR
          The name of the thorium lamp switch in the parameter set.
static String KEY_WHEELPOSITIONS
          The filter wheel position for telescope light.
private  List<String> wheeldriver
          A list of filter-wheel driver names.
private  Map<String,List<Integer>> wheelposition
          A lookup-table for filter names to integer position in filter wheels.
 
Fields inherited from class stella.rmi.GenericMaster
DEFUNIQUE, KEY_ABORTTIME, KEY_AUTOMATIC, KEY_COMMTIME, KEY_COMMUNICATOR, 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
CalibrationMaster(Map<String,String> prop)
          Constructs a new adapter master.
 
Method Summary
 boolean accepts(CommandEvent ce)
          Checks if the command received is accepted by the adapter master.
private  boolean calibrationLight()
          Returns the trigger state of the calibration light switch.
 boolean calibrationMove()
          Changes the calibration unit for input of thar.
 boolean calibrationOff()
          Switches calibration light off.
 boolean calibrationOn()
          Switches calibration light on.
 boolean changeCalibrationPosition(String newpos)
          To allow the a cahnge of the positioning of the calibration unit during operation.
 boolean changeCalibrationSwitch(String newswitch)
          To allow the change of the calibration-light switch without change in the properties this method takes the name of the new calibration-light switch.
 boolean changeFlatFieldPosition(String newpos)
          To allow the a change of the positioning of the flat-field unit during operation.
 boolean changeFlatFieldSwitch(String newswitch)
          To allow the change of the flat-field light switch without change in the properties this method takes the name of the new flat-field light switch.
 void exit()
          Turn lamps off on exit.
 boolean filterOffset(String name, int off)
          Steps the filter wheel on the given index back or forth for the given number of steps.
private  boolean filterWheelZero()
          Does a zero-positioning on all filter wheels found.
private  boolean flatFieldLight()
          Returns the trigger state of the calibration light switch.
 boolean flatFieldMove()
          Changes the calibration unit for input of quartz.
 boolean flatFieldOff()
          Switches flat-fielding light off.
 boolean flatFieldOn()
          Switches flat-fielding light.
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.
 String getFilterPosition()
          Gets the current fiber input source as the filter wheel position.
 boolean homeMove()
          Changes the calibration unit to home position
private  void init2()
          Additionally initializes the filter-to-position lookup tables.
protected  boolean initializeMaster()
          Initializes the calibration master.
 void initStep(int curstep)
          Additionally initializes the filter-to-position lookup tables.
 boolean isCalibration()
          Returns true if calibration light, i.e.
 boolean isFlatField()
          Returns true if flatfield light is switched on.
static void main(String[] arg)
          Constructs a new adapter master.
private  boolean offFlat()
          Turns the flat-fielding light off and does whatever adjustments necessary to feed telescope light into the spectrograph again.
private  boolean offThAr()
          Turns the calibration light off and does whatever adjustments necessary to feed telescope light into the spectrograph.
private  boolean onFlat()
          Turns the flat-fielding light on and does whatever adjustments necessary to feed it into the spectrograph.
private  boolean onThAr()
          Turns on the calibration light.
protected  boolean parkMaster()
          Parks the adapter.
private  String parseFilter()
          Parses the state of all filter wheels to get the current active filter.
 boolean prepareCalibration()
          Prepares a calibration exposure.
 boolean prepareFlatField()
          Prepares a flat field exposure.
 boolean prepareScience()
          Prepares a science operation.
protected  boolean processCommand(CommandEvent cmd, int acknr)
          Process the command.
 void quit()
          Gracefully quite the adapter master.
 double rescanned(String key, String old, String newval)
          On reload, we can rebuild the filter lookup table.
 boolean reset()
          Zero positions all filter wheels and sets the calibration sledge to home.
protected  boolean resetMaster()
          Resets the adapter.
private  boolean selectFilter(String filter)
          Selects a new filter or filter wheel position within the adapter.
 boolean setFilterPosition(String pos)
          Selects fiber input / ccd onput by changing the filter wheel position
private  Map<String,List<Integer>> setupFilterTable(List<String> wheels, String pos)
          Sets up the filter wheel table by parsing the individual filter wheel entries into integer positions.
private  boolean shiftCalibrationUnit(String position)
          Shift the calibration unit to the position specified, if we have it.
private  boolean sledgeHome()
          Does a homing on the calibration unit sledge.
protected  Object statusMaster()
          Returns a short description of the status of the adapter.
 
Methods inherited from class stella.rmi.GenericMaster
abortMaster, addErrorListener, addRmiErrorListener, automatic, 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, manual, park, quitMaster, reload, 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
automatic, external, getStatus, initialize, manual, park, setPassive
 
Methods inherited from interface util.Reloadable
reload
 
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

KEY_FILTERWHEEL

public static final String KEY_FILTERWHEEL
The name of the filter wheel drivers.

See Also:
Constant Field Values

KEY_CALIBRATION

public static final String KEY_CALIBRATION
The name of the calibration unit driver for postioning lamps.

See Also:
Constant Field Values

KEY_POSITIONHOME

public static final String KEY_POSITIONHOME
The position name in the calibration unit for home position

See Also:
Constant Field Values

KEY_POSITIONTHAR

public static final String KEY_POSITIONTHAR
The position name in the calibration unit for choosing ThAr.

See Also:
Constant Field Values

KEY_POSITIONQUARTZ

public static final String KEY_POSITIONQUARTZ
The position name in the calibration unit for choosing Halogen.

See Also:
Constant Field Values

KEY_RETRACEUNIT

public static final String KEY_RETRACEUNIT
The position name in the calibration unit for choosing ThAr.

See Also:
Constant Field Values

KEY_SWITCHTHAR

public static final String KEY_SWITCHTHAR
The name of the thorium lamp switch in the parameter set.

See Also:
Constant Field Values

KEY_SWITCHQUARTZ

public static final String KEY_SWITCHQUARTZ
The name of the halogen lamp switch in the parameter set.

See Also:
Constant Field Values

KEY_ALIGHTTHAR

public static final String KEY_ALIGHTTHAR
The time the ThAr is allowed to be on at maximum, ms.

See Also:
Constant Field Values

KEY_ALIGHTQUARTZ

public static final String KEY_ALIGHTQUARTZ
The time the quartz is allowed to be on at maximum, ms.

See Also:
Constant Field Values

KEY_WHEELPOSITIONS

public static final String KEY_WHEELPOSITIONS
The filter wheel position for telescope light.

See Also:
Constant Field Values

KEY_FILTERTHAR

public static final String KEY_FILTERTHAR
The filter wheel position for calibration light.

See Also:
Constant Field Values

KEY_FILTERQUARTZ

public static final String KEY_FILTERQUARTZ
The filter wheel position for calibration light.

See Also:
Constant Field Values

KEY_FILTERCLEAR

public static final String KEY_FILTERCLEAR
The filter wheel position for calibration light.

See Also:
Constant Field Values

KEY_CALIBRATIONONTIME

public static final String KEY_CALIBRATIONONTIME
Time for turning on calibration light.

See Also:
Constant Field Values

KEY_CALIBRATIONOFFTIME

public static final String KEY_CALIBRATIONOFFTIME
Time for turning off calibration light.

See Also:
Constant Field Values

KEY_FLATFIELDONTIME

public static final String KEY_FLATFIELDONTIME
Time for turning on flat-fielding light.

See Also:
Constant Field Values

KEY_FLATFIELDOFFTIME

public static final String KEY_FLATFIELDOFFTIME
Time for turning off flat-fielding light.

See Also:
Constant Field Values

KEY_SELECTFILTERTIME

public static final String KEY_SELECTFILTERTIME
Time for selecting the filter.

See Also:
Constant Field Values

KEY_MOVETIME

public static final String KEY_MOVETIME
Time for moving the calibration unit.

See Also:
Constant Field Values

DEFSET

private static final String DEFSET
The default properties file for the adapter master parameters.

See Also:
Constant Field Values

DEFFILTERWHEEL

private static final String DEFFILTERWHEEL
The name of the filter wheel driver.

See Also:
Constant Field Values

DEFCALIBRATION

private static final String DEFCALIBRATION
The name of the calibration unit driver for postioning lamps.

See Also:
Constant Field Values

DEFPOSITIONHOME

private static final String DEFPOSITIONHOME
The position name in the calibration unit for home position.

See Also:
Constant Field Values

DEFPOSITIONTHAR

private static final String DEFPOSITIONTHAR
The position name in the calibration unit for choosing ThAr.

See Also:
Constant Field Values

DEFPOSITIONQUARTZ

private static final String DEFPOSITIONQUARTZ
The position name in the calibration unit for choosing ThAr.

See Also:
Constant Field Values

DEFRETRACEUNIT

private static final boolean DEFRETRACEUNIT
If true, calibration unit is placed to POSITIONHOME after lamp off.

See Also:
Constant Field Values

DEFSWITCHTHAR

private static final String DEFSWITCHTHAR
The name of the thorium lamp switch in the parameter set.

See Also:
Constant Field Values

DEFSWITCHQUARTZ

private static final String DEFSWITCHQUARTZ
The name of the halogen lamp switch in the parameter set.

See Also:
Constant Field Values

DEFALIGHTQUARTZ

private static final long DEFALIGHTQUARTZ
The default time the quartz may be turned on.

See Also:
Constant Field Values

DEFALIGHTTHAR

private static final long DEFALIGHTTHAR
The default time the ThAr may be turned on.

See Also:
Constant Field Values

DEFWHEELPOSITIONS

private static final String DEFWHEELPOSITIONS
The default names to position lookup table for the wheel.

See Also:
Constant Field Values

DEFFILTERTHAR

private static final String DEFFILTERTHAR
The default name of the filter wheel position for ThAr into fiber.

See Also:
Constant Field Values

DEFFILTERQUARTZ

private static final String DEFFILTERQUARTZ
The default name of the filter wheel position for Quartz into fiber.

See Also:
Constant Field Values

DEFFILTERCLEAR

private static final String DEFFILTERCLEAR
The default name of the filter wheel position for star into fiber.

See Also:
Constant Field Values

DEFCALIBRATIONONTIME

private static final long DEFCALIBRATIONONTIME
The default time to turn on calibration.

See Also:
Constant Field Values

DEFCALIBRATIONOFFTIME

private static final long DEFCALIBRATIONOFFTIME
The default time to turn off calibration.

See Also:
Constant Field Values

DEFFLATFIELDONTIME

private static final long DEFFLATFIELDONTIME
The default time to turn on flat-fielding.

See Also:
Constant Field Values

DEFFLATFIELDOFFTIME

private static final long DEFFLATFIELDOFFTIME
The default time to turn off flat-fielding.

See Also:
Constant Field Values

DEFSELECTFILTERTIME

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

See Also:
Constant Field Values

DEFMOVETIME

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

See Also:
Constant Field Values

wheelposition

private Map<String,List<Integer>> wheelposition
A lookup-table for filter names to integer position in filter wheels.


wheeldriver

private List<String> wheeldriver
A list of filter-wheel driver names.

Constructor Detail

CalibrationMaster

public CalibrationMaster(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 filter-to-position lookup tables.


setupFilterTable

private Map<String,List<Integer>> setupFilterTable(List<String> wheels,
                                                   String pos)
Sets up the filter wheel table by parsing the individual filter wheel entries into integer positions.


exit

public void exit()
Turn lamps off on exit.

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

rescanned

public double rescanned(String key,
                        String old,
                        String newval)
On reload, we can rebuild the filter lookup table.

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

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

calibrationOn

public boolean calibrationOn()
                      throws RemoteException
Switches calibration light on. Does not change fiber input or move the calibration unit.

Specified by:
calibrationOn in interface CalibrationControlling
Returns:
True if ThAr was switched on.
Throws:
RemoteException

reset

public boolean reset()
              throws RemoteException
Zero positions all filter wheels and sets the calibration sledge to home.

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

calibrationOff

public boolean calibrationOff()
                       throws RemoteException
Switches calibration light off. Does not change fiber input or move the calibration unit.

Specified by:
calibrationOff in interface CalibrationControlling
Returns:
True if ThAr was switched off.
Throws:
RemoteException

calibrationMove

public boolean calibrationMove()
                        throws RemoteException
Changes the calibration unit for input of thar.

Specified by:
calibrationMove in interface CalibrationControlling
Returns:
True if ThAr was switched off.
Throws:
RemoteException

flatFieldOn

public boolean flatFieldOn()
                    throws RemoteException
Switches flat-fielding light. Does not change fiber input.

Specified by:
flatFieldOn in interface CalibrationControlling
Returns:
True if halogen lamp was switched on.
Throws:
RemoteException

flatFieldOff

public boolean flatFieldOff()
                     throws RemoteException
Switches flat-fielding light off. Does not change fiber input.

Specified by:
flatFieldOff in interface CalibrationControlling
Returns:
True if halogen lamp was switched off.
Throws:
RemoteException

flatFieldMove

public boolean flatFieldMove()
                      throws RemoteException
Changes the calibration unit for input of quartz.

Specified by:
flatFieldMove in interface CalibrationControlling
Returns:
True if ThAr was switched off.
Throws:
RemoteException

homeMove

public boolean homeMove()
                 throws RemoteException
Changes the calibration unit to home position

Throws:
RemoteException

prepareCalibration

public boolean prepareCalibration()
                           throws RemoteException
Prepares a calibration exposure. If the ThAr is not switch on, we do so, then we move the calibration unit and the filter wheel.

Specified by:
prepareCalibration in interface CalibrationControlling
Throws:
RemoteException

prepareFlatField

public boolean prepareFlatField()
                         throws RemoteException
Prepares a flat field exposure. If the Quartz is not switched on, we do so, then we move the calibration unit and the filter wheel.

Specified by:
prepareFlatField in interface CalibrationControlling
Throws:
RemoteException

prepareScience

public boolean prepareScience()
                       throws RemoteException
Prepares a science operation. Turn off calibration lamps, retraces the unit, if desired and selects the clear filter position.

Specified by:
prepareScience in interface CalibrationControlling
Throws:
RemoteException

setFilterPosition

public boolean setFilterPosition(String pos)
                          throws RemoteException
Selects fiber input / ccd onput by changing the filter wheel position

Specified by:
setFilterPosition in interface CalibrationControlling
Returns:
True if filter wheel position was selected.
Throws:
RemoteException

filterOffset

public boolean filterOffset(String name,
                            int off)
                     throws RemoteException
Steps the filter wheel on the given index back or forth for the given number of steps. Mainly an error-tracing method, so use with care.

Specified by:
filterOffset in interface CalibrationControlling
Throws:
RemoteException

getFilterPosition

public String getFilterPosition()
                         throws RemoteException
Gets the current fiber input source as the filter wheel position. Returns null if no filter wheel is present.

Specified by:
getFilterPosition in interface CalibrationControlling
Throws:
RemoteException

isCalibration

public boolean isCalibration()
                      throws RemoteException
Returns true if calibration light, i.e. ThAr, is switched on. False may also be returned on adapters that do not support calibration light.

Specified by:
isCalibration in interface CalibrationControlling
Throws:
RemoteException

isFlatField

public boolean isFlatField()
                    throws RemoteException
Returns true if flatfield light is switched on.

Specified by:
isFlatField in interface CalibrationControlling
Throws:
RemoteException

changeCalibrationSwitch

public boolean changeCalibrationSwitch(String newswitch)
                                throws RemoteException
To allow the change of the calibration-light switch without change in the properties this method takes the name of the new calibration-light switch. Note that the switch must be present in the adapter master's parameter-list, it is not constructed here, only the name of the switch is changed here. Thus, if we start the adapter with two calibration units intalled, we should provide power switches for both in the adapter set: e.g. ThAr1Switch and ThAr2Switch. In this case, we can switch during operation to a new light power switch with a call to this method and 'ThAr2Switch' as an argument. Normally this requires a change in the calibration unit positioning, too, see changeCalibrationPosition(java.lang.String).

Specified by:
changeCalibrationSwitch in interface CalibrationControlling
Returns:
True, if the new switch was found and can be switched.
Throws:
RemoteException

changeFlatFieldSwitch

public boolean changeFlatFieldSwitch(String newswitch)
                              throws RemoteException
To allow the change of the flat-field light switch without change in the properties this method takes the name of the new flat-field light switch. Note that the switch must be present in the adapter master's parameter-list, it is not constructed here, only the name of the switch is changed here. Thus, if we start the adapter with two calibration units intalled, we should provide power switches for both in the adapter set: e.g. Quartz1Switch and Quartz2Switch. In this case, we can switch during operation to a new light power switch with a call to this method and 'Quartz2Switch' as an argument. Normally this requires a change in the calibration unit positioning, too, see changeCalibrationPosition(java.lang.String).

Specified by:
changeFlatFieldSwitch in interface CalibrationControlling
Returns:
True, if the new switch was found and can be switched.
Throws:
RemoteException

changeCalibrationPosition

public boolean changeCalibrationPosition(String newpos)
                                  throws RemoteException
To allow the a cahnge of the positioning of the calibration unit during operation. In case of two different calibrational units present in the adapter, a call to this method allows the use of the spare calibration unit without restarting of the adapter. Note that you might also want to change the calibration power switch, changeCalibrationSwitch(java.lang.String).

Specified by:
changeCalibrationPosition in interface CalibrationControlling
Returns:
True if the new position was accepted.
Throws:
RemoteException

changeFlatFieldPosition

public boolean changeFlatFieldPosition(String newpos)
                                throws RemoteException
To allow the a change of the positioning of the flat-field unit during operation. In case of two different flat-field units present in the adapter, a call to this method allows the use of the spare flat-field unit without restarting of the adapter. Note that you might also want to change the flat field power switch, changeFlatFieldSwitch(java.lang.String).

Specified by:
changeFlatFieldPosition in interface CalibrationControlling
Returns:
True if the new position was accepted.
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

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

statusMaster

protected Object statusMaster()
Returns a short description of the status of the adapter.

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

initializeMaster

protected boolean initializeMaster()
Initializes the calibration master. Sets zero position on the filter wheels, the shutter and the calibration sledge.

Specified by:
initializeMaster in class GenericMaster

resetMaster

protected boolean resetMaster()
Resets the adapter.

Specified by:
resetMaster in class GenericMaster

parkMaster

protected boolean parkMaster()
Parks the adapter. Switches the lights on.

Specified by:
parkMaster in class GenericMaster

parseFilter

private String parseFilter()
Parses the state of all filter wheels to get the current active filter.


filterWheelZero

private boolean filterWheelZero()
Does a zero-positioning on all filter wheels found. Returns true on success of all.


sledgeHome

private boolean sledgeHome()
Does a homing on the calibration unit sledge. If no sledge was found or the home positioning was successful, true is returned.


calibrationLight

private boolean calibrationLight()
Returns the trigger state of the calibration light switch. If no switch is found, false is returned.


flatFieldLight

private boolean flatFieldLight()
Returns the trigger state of the calibration light switch. If no switch is found, false is returned.


onThAr

private boolean onThAr()
Turns on the calibration light. This method returns as soon as everything is ready from the adapter side.


offThAr

private boolean offThAr()
Turns the calibration light off and does whatever adjustments necessary to feed telescope light into the spectrograph. This method returns as soon as everything is ready from the adapter side.


onFlat

private boolean onFlat()
Turns the flat-fielding light on and does whatever adjustments necessary to feed it into the spectrograph. This method returns as soon as everything is ready from the adapter side.


offFlat

private boolean offFlat()
Turns the flat-fielding light off and does whatever adjustments necessary to feed telescope light into the spectrograph again. This method returns as soon as everything is ready from the adapter side.


selectFilter

private boolean selectFilter(String filter)
Selects a new filter or filter wheel position within the adapter. This method returns as soon as everything is ready from the adapter side.


shiftCalibrationUnit

private boolean shiftCalibrationUnit(String position)
Shift the calibration unit to the position specified, if we have it.


main

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

Throws:
RemoteException