stella.ccd
Class WifsipMaster

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.ccd.WifsipMaster
All Implemented Interfaces:
Cloneable, Remote, EventListener, Caster, ErrorSending, ErrorCaster, Alive, AutoClearControlling, AutoFocusControlling, CcdControlling, FocusControlling, ListenerControlling, ReadoutModeControlling, RmiAcknowledgeCaster, RmiCommandListener, RmiDoneCaster, RmiErrorCaster, RmiParameterClustering, WifsipControlling, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying, RmiCaster, RmiEventListener, RmiListener, RmiPropertyBearing, TriggerableReload, StepInitializable

public class WifsipMaster
extends GenericMaster
implements WifsipControlling, AutoClearControlling, AutoFocusControlling, ReadoutModeControlling, Reloadable

This master controlls the WiFSIP instrument. It provides methods for accessing the filter wheel as well as the CCD.


Nested Class Summary
private  class WifsipMaster.CcdWatch
          This class reads from the CCD the current values of temperature and pressure and compares them to set values.
static class WifsipMaster.WifsipGeometry
          Default conversion of focus star position to readout frame on CCD.
 
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  Map<String,String> addfits
          The fits header data added during operation, see FitsCcd.
private static long BIASEXPOSURE
          The exposure time on bias frames if driver does not support bias.
private static String BIASTYPE
          The imagetype value for manual bias.
private  CcdDriver camera
          The driver object for the camera.
private  Map<String,String> ccdfits
          CCD info fits.
private  Map<String,Function> colortable
          Additional correction to focus star and the color of focus star.
private static String COMMENTSEPARATOR
          In fits-keys map the separator between values and comments.
private static String DARKTYPE
          The imagetype value for manual bias.
static String DATENUMBERSEPARATOR
          Separatesd the date from the running number.
private static long DEFABORTEXPOSURETIME
          The default abort exposure time, first part, without readout time.
private static String DEFABORTFITS
          The default fits-file name head for aborted exposures.
private static File DEFARCHIVEPATH
          The default path where the archive host stores fits files.
private  Map<String,String> defaultfits
          The fits header data given as defaults.
private static String DEFBIASFITS
          The default fits-file name head for bias exposures.
private static long DEFBIASTIME
          The default bias time, first part, without readout time.
private static String DEFBINDNAME
          The default binding name for this master.
private static String DEFCAMERA
          The default name for the camera driver.
private static boolean DEFCAMERABIAS
          Default ccd driver does support bias.
private static boolean DEFCAMERADARK
          Default ccd driver does support dark.
private static String DEFDARKFITS
          The default fits-file name head for bias exposures.
private static long DEFENABLEWATCH
          If set to any time other than zero, this is the watch intervall.
private static double DEFEXPOSEBUFFER
          The default multiplier for exposure time.
private static String DEFEXPOSURETRIGGER
          The default exposure-trigger name
private static String DEFFILTERSELECTED
          The parameter name that holds the current filter.
private static String DEFFILTERWHEEL
          The name of the filter wheel driver.
private static String DEFFITSKEYS
          Default fits keys and their parameter and remark mapping.
private static long DEFFITSTIME
          The default fits time.
private static String DEFFIXFITSKEYS
          Default fixed fits keys.
private static String DEFFOCUSEXPOSURE
          The default focus exposure table, per filter, mag to msec.
private static long DEFFOCUSTIME
          The default focus exposure time in manual mode.
private static long DEFGEOMETRYTIME
          The default geometry time.
private static long DEFMAXEXPOSURE
          The default maximal exposure time
private static long DEFMINEXPOSURE
          The default minimal exposure time
private static double DEFPIXELSCALE
          The default pixel scale in pixel per radian.
private static long DEFREADOUTTIME
          The default multiplier for read-out time.
private static long DEFSAFETYTIME
          The default safety time.
static String DEFSCIENCEFITS
          The default fits-file name head for bias exposures.
private static long DEFSELECTFILTERTIME
          The default time to change the filter.
private static String DEFTRANSFERTRIGGER
          The default exposure-trigger name
private static String DEFWHEELPOSITIONS
          The default names to position lookup table for the wheel.
private static long DEFWRITETIME
          The default write time.
private static DateFormat df
          The date formatter to get from no to a guider/acquire fits name.
private  Map<String,Function> exposuretable
          The exposure time from the focus star and filter.
private static DateFormat FITSDATE
          The formatter for fits dates.
private static String FITSEND
          The FITS key denoting the end of the header section.
private static String FITSEXTENSION
          The FITS key denoting the end of the header section.
private  Map<String,String> fixfits
          The fits header data with unchangable fits entries, keys to val/rem.
private  Focusable focusser
          IF I hava a telescope with focussing capabilities.
private  MomentsFocusser focusunit
          Then I can focus using wifsip and fits moments.
private static String IMAGETYPE
          The special imagetype key that is set during manual bias/science.
static String KEY_ABORTEXPOSURETIME
          Time for the abort exposure command, first part, without readout time.
static String KEY_ABORTFITS
          The key to the header for science fits on the ccd host.
static String KEY_ARCHIVEPATH
          The fits path on the archive host.
static String KEY_BIASFITS
          The key to the header for bias fits on the ccd host.
static String KEY_BIASTIME
          Time for the bias command, first part, without readout time.
static String KEY_CAMERA
          The key matching the name of ccd driver.
static String KEY_CAMERABIAS
          If true, driver supports bias frames directly.
static String KEY_CAMERADARK
          If true, driver supports dark frames.
static String KEY_CCDFITSKEYS
          A map of CCD-keywords to keep and additional comments.
static String KEY_CCDWATCHMAXIMUM
          If this is set, we observe these CCD-info key for not being lower.
static String KEY_CCDWATCHMINIMUM
          If this is set, we observe these CCD-info key for not being higher.
static String KEY_DARKFITS
          The key to the header for dark fits on the ccd host.
static String KEY_DATEFORMAT
          The formatter for the date.
static String KEY_ENABLEWATCH
          If set to any time other than zero, this is the watch intervall.
static String KEY_EXPOSEBUFFER
          The multiplier for the exposure time.
static String KEY_EXPOSURETRIGGER
          The key matching the name of the expose-trigger.
static String KEY_FILTERSELECTED
          The parameter name that holds the current filter.
static String KEY_FILTERWHEEL
          The name of the filter wheel drivers.
static String KEY_FITSKEYS
          The key pointig to default Fits-header information, keys section.
static String KEY_FITSTIME
          Time for the fits command.
static String KEY_FIXFITSKEYS
          A map of fixed fits keywords.
static String KEY_FOCUSCLASS
          The key matching the properties of the focusser.
static String KEY_FOCUSCOLOR
          How to get from color of star to creected magnitude.
static String KEY_FOCUSEXPOSURE
          How to get from corrected magnitudes to exposure times in ms.
static String KEY_FOCUSGEOMETRY
          The key matching the properties of the focus gemotery.
static String KEY_FOCUSTIME
          Default exposure time for auto focus.
static String KEY_GEOMETRYTIME
          Time for the geometry command.
static String KEY_MAXEXPOSURE
          The maximum exposure time allowed for science frames.
static String KEY_MINEXPOSURE
          The minimum exposure time allowed for science frames.
static String KEY_PIXELSCALE
          How to get from color of star to creected magnitude.
static String KEY_READOUTTIME
          The multiplier for the expected read-out time.
static String KEY_SAFETYTIME
          If non-null, added to the exposure time for ack(2) on exposures.
static String KEY_SCIENCEFITS
          The key to the header for science fits on the ccd host.
static String KEY_SELECTFILTERTIME
          Time for selecting the filter.
static String KEY_TRANSFERTRIGGER
          The key matching the name of the transfer-trigger.
static String KEY_WATCHMAXVALUES
          The vaules below which we may not fall during watch.
static String KEY_WATCHMINVALUES
          The vaules above which we may not fall during watch.
static String KEY_WHEELPOSITIONS
          The filter wheel position for telescope light.
static String KEY_WRITETIME
          The time for the expected fits write-time.
private static NumberFormat nf
          The number format for running counts.
private static String OBJECTTYPE
          The imagetype value for manual bias.
static double REFMAG
          A reference magnitude for focus.
private static String TYPEREM
          The imagetpye comment for manual operation.
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.
private  MomentsGeometric wifsipfocus
          How I convert the focus star x/y to a readout window and extension.
 
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
WifsipMaster(Map<String,String> prop)
          Constructs a new CCD master.
 
Method Summary
 boolean abortExposure(String writeto)
          Supported only with with JanosDriver.
protected  boolean abortMaster()
          Aborts the CCD if possible.
private  boolean abortTake()
          Aborts the exposure.
 boolean accepts(CommandEvent ce)
          Checks if the command received is accepted by the ccd master.
static void addCCDHeaderInfo(nom.tam.fits.Header head, Map<String,String> keep, Map<String,?> ccd)
          Adds information received from the ccd driver.
static void addFitsHeaderInfo(nom.tam.fits.Header head, Map<String,String> give, ParameterClustering set)
          Writes fits header information.
 boolean addFitsKey(String key, String parametername, String comment)
          Adds a key to the fits header section.
static void addFixedHeaderInfo(nom.tam.fits.Header head, Map<String,String> fix)
          Adds data from a fixed key/value/remark mapping.
private static void addHeaderKeys(nom.tam.fits.Header head, Map<String,List<Object>> javakeys)
          Adds fits keys before the #END header keyword.
 boolean autoFocus()
          In manual mode, this is allowed.
private  boolean doAutoClear(boolean mode)
          If the camera supports auto clearing enabling and disabling, we try to switch it on or off.
private  ErrorEvent doAutoFocus(long expt, boolean extsearch)
          Tries to auto focus.
private  boolean doMode(String mode)
          If the camera supports mode switching, we try to switch the camera to the stated mode.
 void exit()
          Stops the timer in this VM.
 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 fitsKey(String key, String parameter, String comment)
          Adds/removes a fits header key from the customizable table.
 boolean focus(double mm)
          In manual mode, this is allowed.
 boolean focusOffset(double mm)
          In manual mode, this is allowed.
private  String formatFitsName(String fitsname)
          Convenience method to make this a one-liner.
private  boolean geometry(int xoff, int yoff, int xsize, int ysize, int xbin, int ybin)
          Sets the geometry of the next image on the ccd.
protected  int getAcknowledgeNumber(CommandEvent cmd)
          Returns the number of acknowledge events produced for each command.
 boolean getBiasExposure(String fits)
          Takes a bias image.
protected  long getCompletionTime(CommandEvent cmd, int acknr)
          Returns the individual completion times.
 boolean getDarkExposure(String fits, double time)
          Takes a dark exposure.
 String getFilterPosition()
          Gets the current fiber input source as the filter wheel position.
 boolean getScienceExposure(String fits, double time)
          Takes a scientific exposure.
private  void init2()
          The main initialization section.
protected  boolean initializeMaster()
          Initializes the CCD.
 void initStep(int curstep)
          Delay the init method of the receiver torso until we finished the initialization of the ccd master.
static void main(String[] arg)
          Starts the ccd master with the given properties or directly accesses a running CCD master.
protected  boolean parkMaster()
          Parks the CCD.
private  String parseFilter()
          Parses the state of all filter wheels to get the current active filter.
private  long prepareAutoFocus(AutoFocusCcd afc)
          Uses the information provided in the auto-focus command to calculate a correct exposure time and readout frame.
private static Class<?> probeForType(Object val)
          If no type argument is given, we try to deduce it from the value type, using the following, sequential, rules: If the value is parsable as a Long, its type is long If the value is parsable as a Double, its type is double It type is String.
protected  boolean processCommand(CommandEvent cmd, int acknr)
          Process the command.
 void quit()
          Gracefully quite the ccd master.
protected  void quitMaster()
          Quits the master.
 boolean removeAllFitsKeys()
          Removes all except the default fits header keys.
 boolean removeFitsKey(String key)
          Removes a fits header key.
 double rescanned(String key, String old, String newval)
          On reload, we can rebuild the fits tables.
 boolean reset()
          Zero positions all filter wheels and sets the calibration sledge to home.
protected  boolean resetMaster()
          Resets the CCD.
private  boolean selectFilter(String filter)
          Selects a new filter or filter wheel position within the adapter.
 boolean selectReadoutMode(String mode)
          In manual mode we allow this.
 boolean setAutoClear(boolean to)
          In manual mode we allow this.
 boolean setFilterPosition(String pos)
          Selects fiber input / ccd onput by changing the filter wheel position
 boolean setFullFrame()
          Resets the CCD-windowing.
 boolean setImageGeometry(int xoff, int yoff, int xsize, int ysize, int xbin, int ybin)
          Sets the image geometry.
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.
protected  Object statusMaster()
          Returns a status information of the camera as a string.
private  boolean takeBias()
          Takes a bias exposure.
private  boolean takeDark(double time)
          Takes a dark exposure.
private  boolean takeExposure(double time)
          Takes a normal exposure.
private  boolean writeFits(File fits, boolean science, boolean surestore)
          Writes the data allocated in the CcdDriver object to a fits file provided as an argument.
 
Methods inherited from class stella.rmi.GenericMaster
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, 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

REFMAG

public static final double REFMAG
A reference magnitude for focus. A star with this mag in V need 1sec.

See Also:
Constant Field Values

DATENUMBERSEPARATOR

public static final String DATENUMBERSEPARATOR
Separatesd the date from the running number.

See Also:
Constant Field Values

KEY_FOCUSCLASS

public static final String KEY_FOCUSCLASS
The key matching the properties of the focusser.

See Also:
Constant Field Values

KEY_FOCUSGEOMETRY

public static final String KEY_FOCUSGEOMETRY
The key matching the properties of the focus gemotery.

See Also:
Constant Field Values

KEY_CAMERA

public static final String KEY_CAMERA
The key matching the name of ccd driver.

See Also:
Constant Field Values

KEY_MINEXPOSURE

public static final String KEY_MINEXPOSURE
The minimum exposure time allowed for science frames.

See Also:
Constant Field Values

KEY_MAXEXPOSURE

public static final String KEY_MAXEXPOSURE
The maximum exposure time allowed for science frames.

See Also:
Constant Field Values

KEY_EXPOSURETRIGGER

public static final String KEY_EXPOSURETRIGGER
The key matching the name of the expose-trigger.

See Also:
Constant Field Values

KEY_TRANSFERTRIGGER

public static final String KEY_TRANSFERTRIGGER
The key matching the name of the transfer-trigger.

See Also:
Constant Field Values

KEY_FITSKEYS

public static final String KEY_FITSKEYS
The key pointig to default Fits-header information, keys section.

See Also:
Constant Field Values

KEY_CCDFITSKEYS

public static final String KEY_CCDFITSKEYS
A map of CCD-keywords to keep and additional comments.

See Also:
Constant Field Values

KEY_FIXFITSKEYS

public static final String KEY_FIXFITSKEYS
A map of fixed fits keywords.

See Also:
Constant Field Values

KEY_SELECTFILTERTIME

public static final String KEY_SELECTFILTERTIME
Time for selecting the filter.

See Also:
Constant Field Values

KEY_GEOMETRYTIME

public static final String KEY_GEOMETRYTIME
Time for the geometry command.

See Also:
Constant Field Values

KEY_FITSTIME

public static final String KEY_FITSTIME
Time for the fits command.

See Also:
Constant Field Values

KEY_BIASTIME

public static final String KEY_BIASTIME
Time for the bias command, first part, without readout time.

See Also:
Constant Field Values

KEY_ABORTEXPOSURETIME

public static final String KEY_ABORTEXPOSURETIME
Time for the abort exposure command, first part, without readout time.

See Also:
Constant Field Values

KEY_READOUTTIME

public static final String KEY_READOUTTIME
The multiplier for the expected read-out time.

See Also:
Constant Field Values

KEY_EXPOSEBUFFER

public static final String KEY_EXPOSEBUFFER
The multiplier for the exposure time.

See Also:
Constant Field Values

KEY_WRITETIME

public static final String KEY_WRITETIME
The time for the expected fits write-time.

See Also:
Constant Field Values

KEY_SAFETYTIME

public static final String KEY_SAFETYTIME
If non-null, added to the exposure time for ack(2) on exposures.

See Also:
Constant Field Values

KEY_CAMERABIAS

public static final String KEY_CAMERABIAS
If true, driver supports bias frames directly.

See Also:
Constant Field Values

KEY_CAMERADARK

public static final String KEY_CAMERADARK
If true, driver supports dark frames.

See Also:
Constant Field Values

KEY_ARCHIVEPATH

public static final String KEY_ARCHIVEPATH
The fits path on the archive host.

See Also:
Constant Field Values

KEY_DATEFORMAT

public static final String KEY_DATEFORMAT
The formatter for the date.

See Also:
Constant Field Values

KEY_BIASFITS

public static final String KEY_BIASFITS
The key to the header for bias fits on the ccd host.

See Also:
Constant Field Values

KEY_DARKFITS

public static final String KEY_DARKFITS
The key to the header for dark fits on the ccd host.

See Also:
Constant Field Values

KEY_SCIENCEFITS

public static final String KEY_SCIENCEFITS
The key to the header for science fits on the ccd host.

See Also:
Constant Field Values

KEY_ABORTFITS

public static final String KEY_ABORTFITS
The key to the header for science fits on the ccd host.

See Also:
Constant Field Values

KEY_FILTERSELECTED

public static final String KEY_FILTERSELECTED
The parameter name that holds the current filter.

See Also:
Constant Field Values

KEY_FILTERWHEEL

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

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_CCDWATCHMINIMUM

public static final String KEY_CCDWATCHMINIMUM
If this is set, we observe these CCD-info key for not being higher.

See Also:
Constant Field Values

KEY_WATCHMINVALUES

public static final String KEY_WATCHMINVALUES
The vaules above which we may not fall during watch.

See Also:
Constant Field Values

KEY_CCDWATCHMAXIMUM

public static final String KEY_CCDWATCHMAXIMUM
If this is set, we observe these CCD-info key for not being lower.

See Also:
Constant Field Values

KEY_WATCHMAXVALUES

public static final String KEY_WATCHMAXVALUES
The vaules below which we may not fall during watch.

See Also:
Constant Field Values

KEY_ENABLEWATCH

public static final String KEY_ENABLEWATCH
If set to any time other than zero, this is the watch intervall.

See Also:
Constant Field Values

KEY_FOCUSTIME

public static final String KEY_FOCUSTIME
Default exposure time for auto focus. Only for manual mode.

See Also:
Constant Field Values

KEY_FOCUSEXPOSURE

public static final String KEY_FOCUSEXPOSURE
How to get from corrected magnitudes to exposure times in ms.

See Also:
Constant Field Values

KEY_FOCUSCOLOR

public static final String KEY_FOCUSCOLOR
How to get from color of star to creected magnitude.

See Also:
Constant Field Values

KEY_PIXELSCALE

public static final String KEY_PIXELSCALE
How to get from color of star to creected magnitude.

See Also:
Constant Field Values

DEFCAMERA

private static final String DEFCAMERA
The default name for the camera driver.

See Also:
Constant Field Values

DEFFILTERWHEEL

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

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

DEFMINEXPOSURE

private static final long DEFMINEXPOSURE
The default minimal exposure time

See Also:
Constant Field Values

DEFMAXEXPOSURE

private static final long DEFMAXEXPOSURE
The default maximal exposure time

See Also:
Constant Field Values

DEFFILTERSELECTED

private static final String DEFFILTERSELECTED
The parameter name that holds the current filter.

See Also:
Constant Field Values

DEFEXPOSURETRIGGER

private static final String DEFEXPOSURETRIGGER
The default exposure-trigger name

See Also:
Constant Field Values

DEFTRANSFERTRIGGER

private static final String DEFTRANSFERTRIGGER
The default exposure-trigger name

See Also:
Constant Field Values

DEFFITSKEYS

private static final String DEFFITSKEYS
Default fits keys and their parameter and remark mapping.

See Also:
Constant Field Values

DEFFIXFITSKEYS

private static final String DEFFIXFITSKEYS
Default fixed fits keys.

See Also:
Constant Field Values

DEFFOCUSEXPOSURE

private static final String DEFFOCUSEXPOSURE
The default focus exposure table, per filter, mag to msec.

See Also:
Constant Field Values

DEFPIXELSCALE

private static final double DEFPIXELSCALE
The default pixel scale in pixel per radian.

See Also:
Constant Field Values

DEFGEOMETRYTIME

private static final long DEFGEOMETRYTIME
The default geometry time.

See Also:
Constant Field Values

DEFFITSTIME

private static final long DEFFITSTIME
The default fits time.

See Also:
Constant Field Values

DEFBIASTIME

private static final long DEFBIASTIME
The default bias time, first part, without readout time.

See Also:
Constant Field Values

DEFABORTEXPOSURETIME

private static final long DEFABORTEXPOSURETIME
The default abort exposure time, first part, without readout time.

See Also:
Constant Field Values

DEFSELECTFILTERTIME

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

See Also:
Constant Field Values

DEFWRITETIME

private static final long DEFWRITETIME
The default write time.

See Also:
Constant Field Values

DEFREADOUTTIME

private static final long DEFREADOUTTIME
The default multiplier for read-out time.

See Also:
Constant Field Values

DEFEXPOSEBUFFER

private static final double DEFEXPOSEBUFFER
The default multiplier for exposure time.

See Also:
Constant Field Values

DEFSAFETYTIME

private static final long DEFSAFETYTIME
The default safety time.

See Also:
Constant Field Values

DEFFOCUSTIME

private static final long DEFFOCUSTIME
The default focus exposure time in manual mode.

See Also:
Constant Field Values

DEFCAMERABIAS

private static final boolean DEFCAMERABIAS
Default ccd driver does support bias.

See Also:
Constant Field Values

DEFCAMERADARK

private static final boolean DEFCAMERADARK
Default ccd driver does support dark.

See Also:
Constant Field Values

DEFARCHIVEPATH

private static final File DEFARCHIVEPATH
The default path where the archive host stores fits files.


DEFBIASFITS

private static final String DEFBIASFITS
The default fits-file name head for bias exposures.

See Also:
Constant Field Values

DEFDARKFITS

private static final String DEFDARKFITS
The default fits-file name head for bias exposures.

See Also:
Constant Field Values

DEFSCIENCEFITS

public static final String DEFSCIENCEFITS
The default fits-file name head for bias exposures.

See Also:
Constant Field Values

DEFABORTFITS

private static final String DEFABORTFITS
The default fits-file name head for aborted exposures.

See Also:
Constant Field Values

DEFBINDNAME

private static final String DEFBINDNAME
The default binding name for this master.

See Also:
Constant Field Values

DEFENABLEWATCH

private static final long DEFENABLEWATCH
If set to any time other than zero, this is the watch intervall.

See Also:
Constant Field Values

df

private static final DateFormat df
The date formatter to get from no to a guider/acquire fits name.


nf

private static final NumberFormat nf
The number format for running counts.


BIASEXPOSURE

private static final long BIASEXPOSURE
The exposure time on bias frames if driver does not support bias.

See Also:
Constant Field Values

IMAGETYPE

private static final String IMAGETYPE
The special imagetype key that is set during manual bias/science.

See Also:
Constant Field Values

BIASTYPE

private static final String BIASTYPE
The imagetype value for manual bias.

See Also:
Constant Field Values

DARKTYPE

private static final String DARKTYPE
The imagetype value for manual bias.

See Also:
Constant Field Values

OBJECTTYPE

private static final String OBJECTTYPE
The imagetype value for manual bias.

See Also:
Constant Field Values

TYPEREM

private static final String TYPEREM
The imagetpye comment for manual operation.

See Also:
Constant Field Values

FITSEXTENSION

private static final String FITSEXTENSION
The FITS key denoting the end of the header section. Note blanks!

See Also:
Constant Field Values

FITSEND

private static final String FITSEND
The FITS key denoting the end of the header section. Note blanks!

See Also:
Constant Field Values

FITSDATE

private static final DateFormat FITSDATE
The formatter for fits dates.


COMMENTSEPARATOR

private static final String COMMENTSEPARATOR
In fits-keys map the separator between values and comments.

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.


defaultfits

private Map<String,String> defaultfits
The fits header data given as defaults.


addfits

private Map<String,String> addfits
The fits header data added during operation, see FitsCcd.


ccdfits

private Map<String,String> ccdfits
CCD info fits.


fixfits

private Map<String,String> fixfits
The fits header data with unchangable fits entries, keys to val/rem.


camera

private CcdDriver camera
The driver object for the camera. Convenience.


focusser

private Focusable focusser
IF I hava a telescope with focussing capabilities.


focusunit

private MomentsFocusser focusunit
Then I can focus using wifsip and fits moments.


wifsipfocus

private MomentsGeometric wifsipfocus
How I convert the focus star x/y to a readout window and extension.


exposuretable

private Map<String,Function> exposuretable
The exposure time from the focus star and filter.


colortable

private Map<String,Function> colortable
Additional correction to focus star and the color of focus star.

Constructor Detail

WifsipMaster

public WifsipMaster(Map<String,String> prop)
             throws RemoteException
Constructs a new CCD master. Default values for the times are set. If the KEY_CAMERA key is missing or the camera driver could not be contructed out of the given property, construction fails with an exception, see #initWifsipMaster. The keys GenericMaster.KEY_SET, KEY_FITSKEYS, #KEY_FITSPARAMETERS, and #KEY_FITSCOMMENTS are optional keys.
As common in final, rmi-enabled classes, the environment master calls exportObject on the UnicastRemoteObject server class.

Throws:
RemoteException
See Also:
PropertyResources.init()
Method Detail

initStep

public void initStep(int curstep)
Delay the init method of the receiver torso until we finished the initialization of the ccd master.

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

init2

private void init2()
The main initialization section. Only called after construction. In this method the camera driver is constructed and initialized. If a GenericMaster.KEY_SET is present, a parameter cluster is constructed and the camera driver is passed to the set. Additionally, the default fits header table is constructed and loaded with values pointed to by the appropriate keys. Whenever the construction of the camera driver is successful, the fits tables are at least constructed, though maybe empty.


exit

public void exit()
Stops the timer in this VM.

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

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.


rescanned

public double rescanned(String key,
                        String old,
                        String newval)
On reload, we can rebuild the fits tables. If the camera driver changed, we can cope with that, if it is an already initialized 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 ccd master. A ccd master accepts all CcdCommands.

Specified by:
accepts in interface RmiCommandListener
Throws:
RemoteException

focusOffset

public boolean focusOffset(double mm)
                    throws RemoteException
In manual mode, this is allowed.

Specified by:
focusOffset in interface FocusControlling
Throws:
RemoteException

focus

public boolean focus(double mm)
              throws RemoteException
In manual mode, this is allowed.

Specified by:
focus in interface FocusControlling
Throws:
RemoteException

autoFocus

public boolean autoFocus()
                  throws RemoteException
In manual mode, this is allowed.

Specified by:
autoFocus in interface AutoFocusControlling
Throws:
RemoteException

selectReadoutMode

public boolean selectReadoutMode(String mode)
                          throws RemoteException
In manual mode we allow this.

Specified by:
selectReadoutMode in interface ReadoutModeControlling
Throws:
RemoteException

setAutoClear

public boolean setAutoClear(boolean to)
                     throws RemoteException
In manual mode we allow this.

Specified by:
setAutoClear in interface AutoClearControlling
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 WifsipControlling
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 WifsipControlling
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 WifsipControlling
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

getBiasExposure

public boolean getBiasExposure(String fits)
                        throws RemoteException
Takes a bias image. See SesControlling.

Specified by:
getBiasExposure in interface CcdControlling
Returns:
True on success.
Throws:
RemoteException

getDarkExposure

public boolean getDarkExposure(String fits,
                               double time)
                        throws RemoteException
Takes a dark exposure. See SesControlling.

Specified by:
getDarkExposure in interface CcdControlling
Parameters:
fits - The file where the fits data is writtn to.
time - The exposure time in seconds.
Returns:
True on success.
Throws:
RemoteException

getScienceExposure

public boolean getScienceExposure(String fits,
                                  double time)
                           throws RemoteException
Takes a scientific exposure. See SesControlling.

Specified by:
getScienceExposure in interface CcdControlling
time - The exposure time in seconds.
Returns:
True on success.
Throws:
RemoteException

abortExposure

public boolean abortExposure(String writeto)
                      throws RemoteException
Supported only with with JanosDriver.

Specified by:
abortExposure in interface CcdControlling
Throws:
RemoteException

setImageGeometry

public boolean setImageGeometry(int xoff,
                                int yoff,
                                int xsize,
                                int ysize,
                                int xbin,
                                int ybin)
                         throws RemoteException
Sets the image geometry. See SesControlling.

Specified by:
setImageGeometry in interface CcdControlling
Parameters:
xoff - The offset on the CCD in x-direction, in pixel.
yoff - The offset on the CCD in y-direction, in pixel.
xsize - The size of the subframe in x-direction, in pixel.
ysize - The size of the subframe in y-direction, in pixel.
xbin - The binning factor in x-direction.
ybin - The binning factor in y-direction.
Returns:
True on success.
Throws:
RemoteException

setFullFrame

public boolean setFullFrame()
                     throws RemoteException
Resets the CCD-windowing. See SesControlling. The camera instance is always non-null.

Specified by:
setFullFrame in interface CcdControlling
Returns:
True on success.
Throws:
RemoteException

addFitsKey

public boolean addFitsKey(String key,
                          String parametername,
                          String comment)
                   throws RemoteException
Adds a key to the fits header section.

Specified by:
addFitsKey in interface CcdControlling
Parameters:
key - The fitskey.
parametername - Name of the parameter whose value should be added.
comment - A comment or the mepty string for no comment.
Throws:
RemoteException

removeFitsKey

public boolean removeFitsKey(String key)
                      throws RemoteException
Removes a fits header key. If the key is not found, false is returned.

Specified by:
removeFitsKey in interface CcdControlling
Throws:
RemoteException

removeAllFitsKeys

public boolean removeAllFitsKeys()
                          throws RemoteException
Removes all except the default fits header keys.

Specified by:
removeAllFitsKeys in interface CcdControlling
Throws:
RemoteException

quit

public void quit()
          throws RemoteException
Gracefully quite the ccd master. The CCD is parked, meaning that all native resources are freed before this method exits.

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 status information of the camera as a string. Calls the MainCamera#toString method.

Specified by:
statusMaster in class GenericMaster
Returns:
A string

resetMaster

protected boolean resetMaster()
Resets the CCD. Calls the camera head reset method in the camera dirver.

Specified by:
resetMaster in class GenericMaster

abortMaster

protected boolean abortMaster()
Aborts the CCD if possible. Currently only Interruptible drivers are supported.

Overrides:
abortMaster in class GenericMaster

parkMaster

protected boolean parkMaster()
Parks the CCD. Simply calls the #abortCCD method, then frees up the native memory. The camera driver is invalidated and must be reconstructed with #initWifsipMaster.

Specified by:
parkMaster in class GenericMaster

quitMaster

protected void quitMaster()
Quits the master. Any ongiong exposure is aborted and the camera driver is closed.

Overrides:
quitMaster in class GenericMaster

initializeMaster

protected boolean initializeMaster()
Initializes the CCD. The native driver is constructed and initialized.

Specified by:
initializeMaster in class GenericMaster

formatFitsName

private String formatFitsName(String fitsname)
Convenience method to make this a one-liner.


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.


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.


abortTake

private boolean abortTake()
Aborts the exposure. Used in automatic and manual mode.


prepareAutoFocus

private long prepareAutoFocus(AutoFocusCcd afc)
Uses the information provided in the auto-focus command to calculate a correct exposure time and readout frame. If the focus star is expected to very close to the center, then we leave it to the focusser to find the most appropriate extension.


doAutoFocus

private ErrorEvent doAutoFocus(long expt,
                               boolean extsearch)
Tries to auto focus.

Parameters:
extsearch - If true, we use the extension with the biggest moment value.

takeBias

private boolean takeBias()
Takes a bias exposure. No exposure time needed. Directly calls the MainCamera#takeBiasExposure in the MainCamera object of the CameraDriver. For the moment, synchronization is done by checking the MainCamera#isBiasExposureDone on regular intervalls, using a wait on the main camera, but notification is not yet impelmented.


takeDark

private boolean takeDark(double time)
Takes a dark exposure. Directly calls the MainCamera#takeDarkExposure in the MainCamera object of the CameraDriver. For the moment, synchronization is done by checking the MainCamera#isDarkExposureDone on regular intervalls, using a wait on the main camera, but notification is not yet impelmented.


takeExposure

private boolean takeExposure(double time)
Takes a normal exposure. Directly calls the MainCamera#takeExposure in the MainCamera object of the CameraDriver. For the moment, synchronization is done by checking the MainCamera#isExposureDone on regular intervalls, using a wait on the main camera, but notification is not yet impelmented.


writeFits

private boolean writeFits(File fits,
                          boolean science,
                          boolean surestore)
Writes the data allocated in the CcdDriver object to a fits file provided as an argument. If the argument is null this method returns immediately without writing the file. This method opens the fits file the ccd has written to and adds header information to it. It is saved to a probably different path, where intermediate storage is possible (RAID). If the copying process is successful, we delete the old file.


addHeaderKeys

private static void addHeaderKeys(nom.tam.fits.Header head,
                                  Map<String,List<Object>> javakeys)
                           throws nom.tam.fits.FitsException
Adds fits keys before the #END header keyword. The map handed over is in a special format. The map's keys are the fits header keys, linked to a List. This list consists of a mximum of three entries, the first giving the value of the keyword, the second the comment and the third the class type of the value. Null is permitted for the comment and the class type, if the latter is null, we try to deduce the type of the fits value in the following, sequential, way: From the previous, it follows that Long, Double, and String are valid class types. Additionally, Integer, Short, Byte, and Float are allowed, but inserted like a Long, respectively Double. Boolean is supported. If the class type is Date, the value is converted into a string using the special DateFormatter FITSDATE. Any other type is ignored, i.e. the value is inserted as a string.

Throws:
nom.tam.fits.FitsException

probeForType

private static Class<?> probeForType(Object val)
If no type argument is given, we try to deduce it from the value type, using the following, sequential, rules:


addCCDHeaderInfo

public static void addCCDHeaderInfo(nom.tam.fits.Header head,
                                    Map<String,String> keep,
                                    Map<String,?> ccd)
                             throws nom.tam.fits.FitsException
Adds information received from the ccd driver.

Throws:
nom.tam.fits.FitsException

addFixedHeaderInfo

public static void addFixedHeaderInfo(nom.tam.fits.Header head,
                                      Map<String,String> fix)
                               throws nom.tam.fits.FitsException
Adds data from a fixed key/value/remark mapping. The map is parsed in a way that its keys are used as the fits header keys, the string it points to is interpreted as value;remark;class-of-value

Throws:
nom.tam.fits.FitsException

addFitsHeaderInfo

public static void addFitsHeaderInfo(nom.tam.fits.Header head,
                                     Map<String,String> give,
                                     ParameterClustering set)
                              throws nom.tam.fits.FitsException
Writes fits header information. All of the datas found in the map is transfered to the fits header information in the following way: The key is the key to the fits heder entry. The value is interpreted as the name of the parameter to enter, followed by a remark. If the parameter is of Time type, we actually enter a Date formatted with FITSDATE.

Throws:
nom.tam.fits.FitsException

geometry

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


doMode

private boolean doMode(String mode)
If the camera supports mode switching, we try to switch the camera to the stated mode.


doAutoClear

private boolean doAutoClear(boolean mode)
If the camera supports auto clearing enabling and disabling, we try to switch it on or off.


fitsKey

private boolean fitsKey(String key,
                        String parameter,
                        String comment)
Adds/removes a fits header key from the customizable table. If the first argument is null, all mappings are ereased, i.e. all except the default header settings are deleted. If the second argument is null, only the mapping with the key given in the first argument is ereased. If the first to arguments are valid, a new mapping is added.


main

public static void main(String[] arg)
                 throws RemoteException
Starts the ccd master with the given properties or directly accesses a running CCD master.

Throws:
RemoteException