stella.telescope
Class TelescopeMaster

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

public class TelescopeMaster
extends GenericMaster
implements PointingModelControlling, Reloadable

Class that resides on the telescope side and directly talks to a Pilar3 server via a TCP/IP socket connection.


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 DEFALLOWCLEAR
          Time it takes for clearing the errors.
private static String DEFALTITUDENAME
          The name of the azimuthal pilar value.
private static String DEFALTITUDEOFFSETNAME
          The name of the azimuthal pilar value.
private static String DEFAZIMUTHNAME
          The name of the azimuthal pilar value.
private static String DEFAZIMUTHOFFSETNAME
          The name of the azimuthal pilar value.
private static long DEFCOVERTIME
          Time for closing the covers, maximum.
private static boolean DEFDBPOINTING
          If this points to true, we add the PM offset also to the done table.
private static long DEFDEROTATORTIME
          Time for derotating the telescope.
private static long DEFERRORRESETTIME
          Time it takes for clearing the errors.
private static long DEFFOCUSTIME
          Time for focusing the telescope.
private static long DEFINITTIME
          Time for initializing the telescope .
private static long DEFMOVETIME
          Time for moving the telescope, maximum.
private static long DEFOFFSETTIME
          Time for offsetting the telescop, maximum.
private static long DEFPARKTIME
          Time for parking the telescope.
private static String DEFPILAR
          The name of the filter wheel driver.
private static long DEFPOINTINGADDTIME
          Time it takes for selecting pointing model.
private static long DEFPOINTINGMODELTIME
          Time it takes for selecting pointing model.
private static long DEFPOINTINGPOSITIONTIME
          Time it takes for retrieving true position.
private static long DEFPOINTINGREQUESTTIME
          Time it takes for selecting pointing model.
private static long DEFPOINTINGSAVETIME
          Time it takes for selecting pointing model.
private static String DEFSET
          The default properties file for the adapter master parameters.
private static long DEFSTARTTRACKINGTIME
          Time it takes for starting tracking.
private static String DEFSTATENAME
          The name of the azimuthal pilar value.
private static long DEFSTOPTRACKINGTIME
          Time it takes for stopping tracking.
private static long DEFVERTICALTIMEOUT
          Time it takes for selecting pointing model.
static String KEY_ALLOWCLEAR
          Minimum time difference to allow clearing of errors.
static String KEY_ALTITUDENAME
          The name of the azimuthal pilar value.
static String KEY_ALTITUDEOFFSETNAME
          The name of the azimuthal pilar value.
static String KEY_AZIMUTHNAME
          The name of the azimuthal pilar value.
static String KEY_AZIMUTHOFFSETNAME
          The name of the azimuthal pilar value.
static String KEY_COVERTIME
          Time for closing the mirror covers, maximum.
static String KEY_COVERVERTICAL
          Points to the vertical position on cover closure if needed
static String KEY_DBPOINTING
          If this points to true, we add the PM offset also to the done table.
static String KEY_DEROTATORTIME
          Time for derotator action the telescope.
static String KEY_ERRORRESETTIME
          Time it takes for stopping tracking.
static String KEY_FOCUSTIME
          Time for focusing the telescope.
static String KEY_MOVETIME
          Time for moving the telescope, maximum.
static String KEY_OFFSETTIME
          Time for offsetting the telescop, maximum.
static String KEY_PILAR
          The name of the telescope driver, a PilarDriver.
static String KEY_POINTINGADDTIME
          Time it takes for adding a measurement to a pointing model.
static String KEY_POINTINGMODELTIME
          Time it takes for stopping tracking.
static String KEY_POINTINGPOSITIONTIME
          Time it takes for stopping tracking.
static String KEY_POINTINGREQUESTTIME
          Time it takes for requesting a pointing model.
static String KEY_POINTINGSAVETIME
          Time it takes for adding a measurement to a pointing model.
static String KEY_STARTTRACKINGTIME
          Time it takes for starting tracking.
static String KEY_STATENAME
          The name of the telescope-is-ready trigger.
static String KEY_STOPTRACKINGTIME
          Time it takes for stopping tracking.
static String KEY_VERTICALTIMEOUT
          Timeout for sliding vertical.
private  long lastclear
          Last time the ETEL errors have been cleared.
private  TelescopeDriver pi4
          For convenience, the pilar driver for the telescope.
private  Map<String,TelescopePosition> pointinglist
          The list of telescope positions.
private  PointingFunction pointingmodel
          If we have queried the actual pointing model.
 
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
TelescopeMaster(Map<String,String> prop)
          Constructs a new telescope master.
 
Method Summary
protected  boolean abortMaster()
          Method called to abort the telescope.
 boolean accepts(CommandEvent ce)
          Checks if the command received is accepted by the adapter master.
 boolean addOffset(double deg1, double deg2)
          Offsets the telescope.
private  boolean addPilarPointingMeasure(PilarDriver pd4, String unique)
           
 boolean addPointingAs(String unique)
          Adds a pointing to the Pilar list, specifying the measurement name.
private  boolean addPointingMeasure(String unique)
          Adds the current pointing to the Pilar pointing model measures via the POINTING.MODEL.ADD set method.
private  boolean applyAddOffset(double daz, double dalt)
          Apply an offset to the telescope and return immediately.
private  boolean applyAddOffset(double daz, double dalt, double h)
          Apply an offset to the telescope and return immediately.
private  boolean applyDerotator(double deg)
          Applies a new derotator position in degrees.
private  boolean applyDerotatorOffset(double deg)
          Applies a new derotator position in degrees.
private  boolean applyFocus(double mm)
          Applies a new focus position in millimeters.
private  boolean applyFocusOffset(double mm)
          Applies a new focus offset in millimeters.
private  boolean applyOffset(double daz, double dalt)
          Apply an offset to the telescope and return immediately.
private  boolean applyOffset(double daz, double dalt, double h)
          Apply an offset to the telescope and return immediately.
 boolean changePointingModel(String model)
          Switches to the specified pointing model.
 boolean changePort(int portid)
          Switches to the specified port.
 boolean clear()
          Clear the telescope errors.
private  boolean clearErrors()
          Clears any errors that are present on the telescope.
private  boolean clearPointingMeasures()
          Clear all pointing measures from the Pilar list.
 boolean clearPointings()
          Clears current pointing measures.
 boolean closeCover()
          Protects the telescope by closing the covers.
 boolean derotator(double deg)
          Sets the derotator in the telescope.
 boolean derotatorOffset(double deg)
          Sets the derotator offset in the telescope.
 String errors()
          Returns a list of errors present on the system.
 boolean focus(double mm)
          Sets the focus in the telescope.
 boolean focusOffset(double mm)
          Sets the focus in the telescope.
protected  int getAcknowledgeNumber(CommandEvent cmd)
          Returns the number of acknowledge event to be sent back as a function of the command type.
private  PointingFunction getActivePointingModel()
          Queries the Pilar driver for the currently active pointing model and tries to construct a VectorFunction out of it to.
protected  long getCompletionTime(CommandEvent cmd, int acknr)
          Returns the individual completion times.
private  TelescopeOffsets getPointingOffsets(String unique)
          If a pointing model is available, we can get the uncorrected pointing from POSITION.HORIZONTAL and the true pointing plus offset from POSITION.INSTRUMENTAL.REALPOS.
private  TelescopePosition getPointingPosition()
          If a pointing model is available, we can get the uncorrected pointing from POSITION.HORIZONTAL and the true pointing plus offset from POSITION.INSTRUMENTAL.REALPOS.
 Object getTcsParameter(String parameter)
          Gets the specified parameter to the value.
private  boolean guiding(boolean on)
          Changes the current tracking state and waits until the telescope is in the new state.
private  void init2()
          Grabs the instance of the pilar driver.
 boolean initialize()
          Initializes the telescope.
protected  boolean initializeMaster()
          Initializes the calibration master.
 void initStep(int curstep)
          Additionally initializes the filter-to-position lookup tables.
 boolean loadPointings(File load)
          Loads measures from a file to pilar.
static void main(String[] arg)
          Constructs a new telescope master.
 boolean moveAzAlt(double az, double alt)
          Moves the azimuth and altitude axis of the telescope, start tracking.
 boolean moveRaDec(double ra, double dec, double off, boolean follow)
          Moves the telescope to the given ra and dec, start tracking.
 boolean offset(double deg1, double deg2)
          Offsets the telescope.
 boolean openCover()
          Protects the telescope by closing the covers.
 boolean park()
          Parks the telescope.
protected  boolean parkMaster()
          Parks the telescope.
private static Map<String,VectorG> parsePointingList(String list)
          We take a list of the Pilar pointing measure format and parse that into a lookup table linking pointing names (unique) to a four-dimensional vector, with az, azoff, z, zoff as its components.
 String pointingAt()
          Returns the pointing plus pointing-model offset.
private  boolean port(int id)
          Changes to the specified port.
private  boolean position(double az, double alt)
          Positions the telescope at a certain az/alt.
protected  boolean processCommand(CommandEvent cmd, int acknr)
          Process the command.
private  boolean protect(boolean yes)
          Closes the mirror cover.
 void quit()
          Quits the master.
 boolean requestPointingModel()
          Loads the currently active pointing model.
 double rescanned(String key, String old, String newval)
          On reload, we can change the telescope driver to another, but already loaded, driver.
protected  boolean resetMaster()
          Resets the telescope.
private  boolean savePilarPointingMeasures(File meas)
          Saves the current active list to the given file.
private  boolean savePointingMeasures(File meas)
          Saves the current active list to the given file.
 boolean savePointings(File save)
          Saves the pointing to a file.
private  boolean selectPointingModel(String model)
          Selects a pointing model.
 boolean setTcsParameter(String parameter, Object value)
          Sets the specified parameter to the value.
private  boolean slide(double ra, double de, double off, boolean follow)
          Positions the telescope to a certain ra, dec and start tracking.
 boolean startTracking()
          Starts the tracking from the current position of the telescope.
protected  Object statusMaster()
          Returns a short description of the status of the telescope.
 boolean stopTracking()
          Stops the tracking of the telescope.
private  boolean tracking(boolean on)
          Changes the current tracking state.
 boolean wipe()
          Escape for clearing errors.
 
Methods inherited from class stella.rmi.GenericMaster
addErrorListener, addRmiErrorListener, automatic, createCommunicator, exit, external, formatWithGlobals, getAllDrivers, getDriver, getHistorySql, getLastError, getObserveSql, getParameterByKey, getParameterByName, getParameterCluster, getParameterValueByKey, getParameterValueByName, getPermissionSql, getProposalSql, getStatus, getTargetSql, getTaskSql, getUnique, getUserSql, isAlive, isAuto, isManual, isPassive, manual, quitMaster, reload, 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
automatic, external, getStatus, manual, reset, 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_PILAR

public static final String KEY_PILAR
The name of the telescope driver, a PilarDriver.

See Also:
Constant Field Values

KEY_STATENAME

public static final String KEY_STATENAME
The name of the telescope-is-ready trigger.

See Also:
Constant Field Values

KEY_AZIMUTHNAME

public static final String KEY_AZIMUTHNAME
The name of the azimuthal pilar value.

See Also:
Constant Field Values

KEY_AZIMUTHOFFSETNAME

public static final String KEY_AZIMUTHOFFSETNAME
The name of the azimuthal pilar value.

See Also:
Constant Field Values

KEY_ALTITUDENAME

public static final String KEY_ALTITUDENAME
The name of the azimuthal pilar value.

See Also:
Constant Field Values

KEY_ALTITUDEOFFSETNAME

public static final String KEY_ALTITUDEOFFSETNAME
The name of the azimuthal pilar value.

See Also:
Constant Field Values

KEY_COVERTIME

public static final String KEY_COVERTIME
Time for closing the mirror covers, maximum.

See Also:
Constant Field Values

KEY_MOVETIME

public static final String KEY_MOVETIME
Time for moving the telescope, maximum.

See Also:
Constant Field Values

KEY_OFFSETTIME

public static final String KEY_OFFSETTIME
Time for offsetting the telescop, maximum.

See Also:
Constant Field Values

KEY_DEROTATORTIME

public static final String KEY_DEROTATORTIME
Time for derotator action the telescope.

See Also:
Constant Field Values

KEY_FOCUSTIME

public static final String KEY_FOCUSTIME
Time for focusing the telescope.

See Also:
Constant Field Values

KEY_STARTTRACKINGTIME

public static final String KEY_STARTTRACKINGTIME
Time it takes for starting tracking.

See Also:
Constant Field Values

KEY_STOPTRACKINGTIME

public static final String KEY_STOPTRACKINGTIME
Time it takes for stopping tracking.

See Also:
Constant Field Values

KEY_ERRORRESETTIME

public static final String KEY_ERRORRESETTIME
Time it takes for stopping tracking.

See Also:
Constant Field Values

KEY_POINTINGMODELTIME

public static final String KEY_POINTINGMODELTIME
Time it takes for stopping tracking.

See Also:
Constant Field Values

KEY_POINTINGPOSITIONTIME

public static final String KEY_POINTINGPOSITIONTIME
Time it takes for stopping tracking.

See Also:
Constant Field Values

KEY_POINTINGREQUESTTIME

public static final String KEY_POINTINGREQUESTTIME
Time it takes for requesting a pointing model.

See Also:
Constant Field Values

KEY_POINTINGADDTIME

public static final String KEY_POINTINGADDTIME
Time it takes for adding a measurement to a pointing model.

See Also:
Constant Field Values

KEY_POINTINGSAVETIME

public static final String KEY_POINTINGSAVETIME
Time it takes for adding a measurement to a pointing model.

See Also:
Constant Field Values

KEY_ALLOWCLEAR

public static final String KEY_ALLOWCLEAR
Minimum time difference to allow clearing of errors.

See Also:
Constant Field Values

KEY_COVERVERTICAL

public static final String KEY_COVERVERTICAL
Points to the vertical position on cover closure if needed

See Also:
Constant Field Values

KEY_VERTICALTIMEOUT

public static final String KEY_VERTICALTIMEOUT
Timeout for sliding vertical.

See Also:
Constant Field Values

KEY_DBPOINTING

public static final String KEY_DBPOINTING
If this points to true, we add the PM offset also to the done table.

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

DEFPILAR

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

See Also:
Constant Field Values

DEFSTATENAME

private static final String DEFSTATENAME
The name of the azimuthal pilar value.

See Also:
Constant Field Values

DEFAZIMUTHNAME

private static final String DEFAZIMUTHNAME
The name of the azimuthal pilar value.

See Also:
Constant Field Values

DEFAZIMUTHOFFSETNAME

private static final String DEFAZIMUTHOFFSETNAME
The name of the azimuthal pilar value.

See Also:
Constant Field Values

DEFALTITUDENAME

private static final String DEFALTITUDENAME
The name of the azimuthal pilar value.

See Also:
Constant Field Values

DEFALTITUDEOFFSETNAME

private static final String DEFALTITUDEOFFSETNAME
The name of the azimuthal pilar value.

See Also:
Constant Field Values

DEFINITTIME

private static final long DEFINITTIME
Time for initializing the telescope .

See Also:
Constant Field Values

DEFPARKTIME

private static final long DEFPARKTIME
Time for parking the telescope.

See Also:
Constant Field Values

DEFCOVERTIME

private static final long DEFCOVERTIME
Time for closing the covers, maximum.

See Also:
Constant Field Values

DEFMOVETIME

private static final long DEFMOVETIME
Time for moving the telescope, maximum.

See Also:
Constant Field Values

DEFOFFSETTIME

private static final long DEFOFFSETTIME
Time for offsetting the telescop, maximum.

See Also:
Constant Field Values

DEFDEROTATORTIME

private static final long DEFDEROTATORTIME
Time for derotating the telescope.

See Also:
Constant Field Values

DEFFOCUSTIME

private static final long DEFFOCUSTIME
Time for focusing the telescope.

See Also:
Constant Field Values

DEFSTARTTRACKINGTIME

private static final long DEFSTARTTRACKINGTIME
Time it takes for starting tracking.

See Also:
Constant Field Values

DEFSTOPTRACKINGTIME

private static final long DEFSTOPTRACKINGTIME
Time it takes for stopping tracking.

See Also:
Constant Field Values

DEFERRORRESETTIME

private static final long DEFERRORRESETTIME
Time it takes for clearing the errors.

See Also:
Constant Field Values

DEFPOINTINGMODELTIME

private static final long DEFPOINTINGMODELTIME
Time it takes for selecting pointing model.

See Also:
Constant Field Values

DEFPOINTINGREQUESTTIME

private static final long DEFPOINTINGREQUESTTIME
Time it takes for selecting pointing model.

See Also:
Constant Field Values

DEFPOINTINGADDTIME

private static final long DEFPOINTINGADDTIME
Time it takes for selecting pointing model.

See Also:
Constant Field Values

DEFPOINTINGSAVETIME

private static final long DEFPOINTINGSAVETIME
Time it takes for selecting pointing model.

See Also:
Constant Field Values

DEFALLOWCLEAR

private static final long DEFALLOWCLEAR
Time it takes for clearing the errors.

See Also:
Constant Field Values

DEFPOINTINGPOSITIONTIME

private static final long DEFPOINTINGPOSITIONTIME
Time it takes for retrieving true position.

See Also:
Constant Field Values

DEFVERTICALTIMEOUT

private static final long DEFVERTICALTIMEOUT
Time it takes for selecting pointing model.

See Also:
Constant Field Values

DEFDBPOINTING

private static final boolean DEFDBPOINTING
If this points to true, we add the PM offset also to the done table.

See Also:
Constant Field Values

pi4

private TelescopeDriver pi4
For convenience, the pilar driver for the telescope.


pointingmodel

private PointingFunction pointingmodel
If we have queried the actual pointing model.


pointinglist

private Map<String,TelescopePosition> pointinglist
The list of telescope positions.


lastclear

private long lastclear
Last time the ETEL errors have been cleared.

Constructor Detail

TelescopeMaster

public TelescopeMaster(Map<String,String> prop)
                throws RemoteException
Constructs a new telescope 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()
Grabs the instance of the pilar driver. At this stage, this driver already exists, if it was defined in the properties. We exit here, if the telescope driver is not found.


rescanned

public double rescanned(String key,
                        String old,
                        String newval)
On reload, we can change the telescope driver to another, but already loaded, driver.

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

moveAzAlt

public boolean moveAzAlt(double az,
                         double alt)
                  throws RemoteException
Moves the azimuth and altitude axis of the telescope, start tracking. Only allowed in manual mode.

Specified by:
moveAzAlt in interface TelescopeControlling
Throws:
RemoteException

moveRaDec

public boolean moveRaDec(double ra,
                         double dec,
                         double off,
                         boolean follow)
                  throws RemoteException
Moves the telescope to the given ra and dec, start tracking. If a derotator is present at the current port, and if the pilar driver is set up to using it, the offset will be applied, and derotator following will be enabled. Only allowed in manual mode.

Specified by:
moveRaDec in interface TelescopeControlling
Throws:
RemoteException

offset

public boolean offset(double deg1,
                      double deg2)
               throws RemoteException
Offsets the telescope. Both values are in degrees. This offset works on the main axes of the telescope, thus it is an az/alt offset for az/alt telescopes and a ra/de offset for paralactically mounted telescopes. Independent of the mount, it is a spatial offset, not an angle difference. For the case of an az/alt telescope, this means that the difference in the azimuth encoder reading that will result from this offset is higher by 1/cos(alt). Only allowed in manual mode.

Specified by:
offset in interface TelescopeControlling
Throws:
RemoteException

addOffset

public boolean addOffset(double deg1,
                         double deg2)
                  throws RemoteException
Offsets the telescope. Both values are in degrees. This offset works on the main axes of the telescope, thus it is an az/alt offset for az/alt telescopes and a ra/de offset for paralactically mounted telescopes. Independent of the mount, it is a spatial offset, not an angle difference. For the case of an az/alt telescope, this means that the difference in the azimuth encoder reading that will result from this offset is higher by 1/cos(alt). Only allowed in manual mode.

Specified by:
addOffset in interface TelescopeControlling
Throws:
RemoteException

derotator

public boolean derotator(double deg)
                  throws RemoteException
Sets the derotator in the telescope.

Specified by:
derotator in interface TelescopeControlling
Throws:
RemoteException

derotatorOffset

public boolean derotatorOffset(double deg)
                        throws RemoteException
Sets the derotator offset in the telescope.

Specified by:
derotatorOffset in interface TelescopeControlling
Throws:
RemoteException

focus

public boolean focus(double mm)
              throws RemoteException
Sets the focus in the telescope. STELLA-I does that by moving M2.

Specified by:
focus in interface FocusControlling
Throws:
RemoteException

focusOffset

public boolean focusOffset(double mm)
                    throws RemoteException
Sets the focus in the telescope. STELLA-I does that by moving M2.

Specified by:
focusOffset in interface FocusControlling
Throws:
RemoteException

startTracking

public boolean startTracking()
                      throws RemoteException
Starts the tracking from the current position of the telescope. Only allowed in manual mode.

Specified by:
startTracking in interface TelescopeControlling
Throws:
RemoteException

stopTracking

public boolean stopTracking()
                     throws RemoteException
Stops the tracking of the telescope. The telescope remains at its current position. Only allowed in manual mode.

Specified by:
stopTracking in interface TelescopeControlling
Throws:
RemoteException

changePort

public boolean changePort(int portid)
                   throws RemoteException
Switches to the specified port. The port is identified with an integer that is telescope dependend. May throw an unsupported operation exception, if the telescope does not have different ports available. Only allowed in manual mode.

Specified by:
changePort in interface TelescopeControlling
Throws:
RemoteException

changePointingModel

public boolean changePointingModel(String model)
                            throws RemoteException
Switches to the specified pointing model.

Specified by:
changePointingModel in interface PointingModelControlling
Throws:
RemoteException

requestPointingModel

public boolean requestPointingModel()
                             throws RemoteException
Loads the currently active pointing model. Also works in automatic mode.

Specified by:
requestPointingModel in interface PointingModelControlling
Throws:
RemoteException

loadPointings

public boolean loadPointings(File load)
                      throws RemoteException
Loads measures from a file to pilar. Available in any mode. This method has no equivalent as a command, i.e. it can only be triggered remotely. If any list is active, the list is always replaced.

Specified by:
loadPointings in interface PointingModelControlling
Throws:
RemoteException

savePointings

public boolean savePointings(File save)
                      throws RemoteException
Saves the pointing to a file. Available in any mode. Different to the command-triggered save, this method does not clear the internal Pilar list, this must be done by issuing a clearPointings().

Specified by:
savePointings in interface PointingModelControlling
Throws:
RemoteException

clearPointings

public boolean clearPointings()
                       throws RemoteException
Clears current pointing measures. Available in any mode.

Specified by:
clearPointings in interface PointingModelControlling
Throws:
RemoteException

addPointingAs

public boolean addPointingAs(String unique)
                      throws RemoteException
Adds a pointing to the Pilar list, specifying the measurement name. If name is null, the empty string is used, which is further processed in Pilar. This method is only available in manual mode.

Specified by:
addPointingAs in interface PointingModelControlling
Parameters:
unique - An identifier for this measure or null.
Throws:
RemoteException

setTcsParameter

public boolean setTcsParameter(String parameter,
                               Object value)
                        throws RemoteException
Sets the specified parameter to the value.

Specified by:
setTcsParameter in interface TelescopeControlling
Throws:
RemoteException

getTcsParameter

public Object getTcsParameter(String parameter)
                       throws RemoteException
Gets the specified parameter to the value.

Specified by:
getTcsParameter in interface TelescopeControlling
Throws:
RemoteException

initialize

public boolean initialize()
                   throws RemoteException
Initializes the telescope. Only allowed in manual mode.

Specified by:
initialize in interface ListenerControlling
Specified by:
initialize in interface TelescopeControlling
Overrides:
initialize in class GenericMaster
Throws:
RemoteException

park

public boolean park()
             throws RemoteException
Parks the telescope. Only allowed in manual mode.

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

errors

public String errors()
              throws RemoteException
Returns a list of errors present on the system.

Specified by:
errors in interface TelescopeControlling
Throws:
RemoteException

wipe

public boolean wipe()
             throws RemoteException
Escape for clearing errors.

Specified by:
wipe in interface TelescopeControlling
Throws:
RemoteException

pointingAt

public String pointingAt()
                  throws RemoteException
Returns the pointing plus pointing-model offset.

Specified by:
pointingAt in interface TelescopeControlling
Throws:
RemoteException

clear

public boolean clear()
              throws RemoteException
Clear the telescope errors. Only allowed in manual mode.

Specified by:
clear in interface TelescopeControlling
Throws:
RemoteException

closeCover

public boolean closeCover()
                   throws RemoteException
Protects the telescope by closing the covers. For immediate protection, similar to park, but without moving the telescope. Only allowed in manual mode.

Specified by:
closeCover in interface TelescopeControlling
Throws:
RemoteException

openCover

public boolean openCover()
                  throws RemoteException
Protects the telescope by closing the covers. For immediate protection, similar to park, but without moving the telescope. Only allowed in manual mode.

Specified by:
openCover in interface TelescopeControlling
Throws:
RemoteException

quit

public void quit()
          throws RemoteException
Quits the master. Only allowed in manual mode.

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

getAcknowledgeNumber

protected int getAcknowledgeNumber(CommandEvent cmd)
Returns the number of acknowledge event to be sent back as a function of the command type. Different to the Pilar2 implementation, init telescope and park telescope now only support a single acknowledge event.

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

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

abortMaster

protected boolean abortMaster()
Method called to abort the telescope. Stops any movement.

Overrides:
abortMaster in class GenericMaster

resetMaster

protected boolean resetMaster()
Resets the telescope. Calls park and, if this is successful, init.

Specified by:
resetMaster in class GenericMaster

parkMaster

protected boolean parkMaster()
Parks the telescope. Also called on exit.

Specified by:
parkMaster in class GenericMaster

selectPointingModel

private boolean selectPointingModel(String model)
Selects a pointing model. If the model is not known, we produce a configuration error.

Returns:
True on success, false otherwise.

position

private boolean position(double az,
                         double alt)
Positions the telescope at a certain az/alt. As in the contract of PilarDriver#moveAzAlt, tracking of the telescope is not started. In automatic mode, the last error is set on failures.

Returns:
True on success, false otherwise.

slide

private boolean slide(double ra,
                      double de,
                      double off,
                      boolean follow)
Positions the telescope to a certain ra, dec and start tracking. If the current port has a derotator and the underlying driver allows its use, the derotator offset and its following behaviour is set. In automatic mode, the last error is set on failures.

Returns:
True on success, false otherwise.

applyOffset

private boolean applyOffset(double daz,
                            double dalt)
Apply an offset to the telescope and return immediately. This method does not block until an offset is reached, but rather applies it and then return immediately. There is no way to block until an offset is reached.


applyOffset

private boolean applyOffset(double daz,
                            double dalt,
                            double h)
Apply an offset to the telescope and return immediately. This method does not block until an offset is reached, but rather applies it and then return immediately. There is no way to block until an offset is reached.


applyAddOffset

private boolean applyAddOffset(double daz,
                               double dalt,
                               double h)
Apply an offset to the telescope and return immediately. This method does not block until an offset is reached, but rather applies it and then return immediately. There is no way to block until an offset is reached.


applyAddOffset

private boolean applyAddOffset(double daz,
                               double dalt)
Apply an offset to the telescope and return immediately. This method does not block until an offset is reached, but rather applies it and then return immediately. There is no way to block until an offset is reached.


applyDerotator

private boolean applyDerotator(double deg)
Applies a new derotator position in degrees. The command blocks until the new focus is reached.


applyDerotatorOffset

private boolean applyDerotatorOffset(double deg)
Applies a new derotator position in degrees. The command blocks until the new focus is reached.


applyFocus

private boolean applyFocus(double mm)
Applies a new focus position in millimeters. The command blocks until the new focus is reached.


applyFocusOffset

private boolean applyFocusOffset(double mm)
Applies a new focus offset in millimeters. The command returns immediately.


tracking

private boolean tracking(boolean on)
Changes the current tracking state. This does not wait until the telescope is truly tracking, it merely initiates the tracking.

See Also:
guiding

guiding

private boolean guiding(boolean on)
Changes the current tracking state and waits until the telescope is in the new state.

See Also:
tracking

clearErrors

private boolean clearErrors()
Clears any errors that are present on the telescope. Use with care! 4pi has screwed up things here, you can clear errors and destroy the telescope!


protect

private boolean protect(boolean yes)
Closes the mirror cover. It turened out that it may be necessarry to slide to vertical position before doing that. The KEY_COVERVERTICAL property points to the vertical value in that case.

Returns:
True, If covers were closed.

port

private boolean port(int id)
Changes to the specified port. The argument is an identifier that is driver-specific. This method is never called in automatic mode.


getPointingPosition

private TelescopePosition getPointingPosition()
If a pointing model is available, we can get the uncorrected pointing from POSITION.HORIZONTAL and the true pointing plus offset from POSITION.INSTRUMENTAL.REALPOS. Don't think it's the other way round! This definition was introduced as the wish for pointing model generation somewhat late in the process.


getPointingOffsets

private TelescopeOffsets getPointingOffsets(String unique)
If a pointing model is available, we can get the uncorrected pointing from POSITION.HORIZONTAL and the true pointing plus offset from POSITION.INSTRUMENTAL.REALPOS. Don't think it's the other way round! This definition was introduced as the wish for pointing model generation somewhat late in the process.


getActivePointingModel

private PointingFunction getActivePointingModel()
Queries the Pilar driver for the currently active pointing model and tries to construct a VectorFunction out of it to. This is done by querying for the POINTING.MODEL.TYPE, fuelling the integer value into PointingFunction.createFromType(int, int) and subsequentially querying all relevant paramters in this pointing model via the PointingFunction.getParameterNames() and PointingFunction.setParameter(java.lang.String, double) functions. Returns the pointing model function on success or null, if unsuccessful at any step.


addPointingMeasure

private boolean addPointingMeasure(String unique)
Adds the current pointing to the Pilar pointing model measures via the POINTING.MODEL.ADD set method. The name supplied is the unique name of this measurement. This method is available in all modes.

Parameters:
unique - The identifier in the pointing measurement file for this.

addPilarPointingMeasure

private boolean addPilarPointingMeasure(PilarDriver pd4,
                                        String unique)

parsePointingList

private static Map<String,VectorG> parsePointingList(String list)
We take a list of the Pilar pointing measure format and parse that into a lookup table linking pointing names (unique) to a four-dimensional vector, with az, azoff, z, zoff as its components.


savePointingMeasures

private boolean savePointingMeasures(File meas)
Saves the current active list to the given file. If file exits, it is overwrittn without warning.


savePilarPointingMeasures

private boolean savePilarPointingMeasures(File meas)
Saves the current active list to the given file. If file exits, it is overwrittn without warning.


clearPointingMeasures

private boolean clearPointingMeasures()
Clear all pointing measures from the Pilar list. This command requires an integer parameter, according to the documentation, which I have now clue on what it is, so I suplly zero.


main

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

Throws:
RemoteException