stella.command
Class ScientificCcd

java.lang.Object
  extended by java.util.EventObject
      extended by util.rmi.RmiEvent
          extended by stella.MessageEvent
              extended by stella.CommandEvent
                  extended by stella.command.ScientificCcd
All Implemented Interfaces:
Serializable, CcdCommand, InitializerDepending, SequencerDepending, TargetDependingCommand, ParameterDepending

public class ScientificCcd
extends CommandEvent
implements CcdCommand, TargetDependingCommand, ParameterDepending, InitializerDepending, SequencerDepending

Takes a scientific exposure with the given exposure time. Only if a second argument on the command line is present and giving a fits file name the data is saved.

There are several ways to define this command with none-fixed exposure times.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class stella.CommandEvent
CommandEvent.Create
 
Field Summary
private static ExposureTime calc
          The exposure time calculator.
private  int current
          Current active filter.
private  Number expose
          The exposure time in seconds.
private  String fitsname
          The fits file where to save the ccd data in.
private  List<Double> increase
          The exposure time increase in fractions.
private  Map<String,Object> parameters
          The parameter handed over.
private  boolean store
          If false, data is not stored permanently.
 
Fields inherited from class stella.CommandEvent
COMMANDPACKAGE, JVIEWPACKAGE, TYPESEPARATOR
 
Fields inherited from class stella.MessageEvent
SEPCHAR
 
Fields inherited from class util.rmi.RmiEvent
localHost, sourceName
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ScientificCcd(Object src)
          Constructs a abort adapter telescope, grabbing the type from the class name and setting the command time to the current system time.
ScientificCcd(Object src, String type, long time)
          Constructs a new exposure abort command.
 
Method Summary
 int getExpectedAcknowledgeNumber()
          Returns the number of acknowledge events this command is expected to follow.
 double getExposureTime()
          Returns the exposure time asociated with the darktime command.
 String getFitsName()
          Returns the fits file asociated with the abort command.
 String[] getLine()
          Returns the command line of the move telescope command.
 void initWith(String init)
          Registers an initializer which is a sequence of filter names, separated by a colon.
 boolean isStore()
          Returns true, if data should be stored.
 boolean parseLine(String[] all)
          Parse the command line into ra and dec of the move command.
 void registerParameter(Parameter what)
          Registers a parameter to this command.
 void registerSequencingParameters(Map<String,Object> loop)
          Sets the sequence loop, but subtracts one from it as the first loop index is 1.
 void registerTargetProperties(Object setup)
          Calculates the command line from the properties registered.
private  void setExposureTime(double to)
          Sets the exposure time.
private  void setFitsName(String to)
          Sets the fits file name.
 
Methods inherited from class stella.CommandEvent
classNameToTemplate, createCommand, createCommand, createJCommand, extractType, parseForStrings, templateToClassName
 
Methods inherited from class stella.MessageEvent
checkType, equals, equalTime, equalTime, fromAscii, getAllCommandLines, getExecuteGroupKey, getHead, getNr, getTime, getType, hashCode, isValid, parseFromSingleString, readFromBufferedStream, setNr, setTime, setType, setValid, toString
 
Methods inherited from class util.rmi.RmiEvent
getHost, getSourceName, setSourceName
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

expose

private Number expose
The exposure time in seconds.


increase

private List<Double> increase
The exposure time increase in fractions.


current

private int current
Current active filter.


fitsname

private String fitsname
The fits file where to save the ccd data in. Augmented by Unique.


store

private boolean store
If false, data is not stored permanently.


parameters

private Map<String,Object> parameters
The parameter handed over.


calc

private static ExposureTime calc
The exposure time calculator.

Constructor Detail

ScientificCcd

public ScientificCcd(Object src)
Constructs a abort adapter telescope, grabbing the type from the class name and setting the command time to the current system time.


ScientificCcd

public ScientificCcd(Object src,
                     String type,
                     long time)
Constructs a new exposure abort command. Per default no fits file is set.

Method Detail

initWith

public void initWith(String init)
Registers an initializer which is a sequence of filter names, separated by a colon.

Specified by:
initWith in interface InitializerDepending

registerParameter

public void registerParameter(Parameter what)
Registers a parameter to this command. All parameters handed over are stored in a list for later evaluation. If the parameter defines an exposure time, we query that and use that as an exposure time.

Specified by:
registerParameter in interface ParameterDepending

registerSequencingParameters

public void registerSequencingParameters(Map<String,Object> loop)
Sets the sequence loop, but subtracts one from it as the first loop index is 1.

Specified by:
registerSequencingParameters in interface SequencerDepending

registerTargetProperties

public void registerTargetProperties(Object setup)
Calculates the command line from the properties registered. Scans for the exposure time, ReservedConstants.EXPOSURETIME. Aditionally, scans for the fitsname-item, ReservedConstants.FITSNAME. If this key is present, a fits file name is generated according to FitsNameGenerator.getAbortFits(java.lang.String), otherwise the file name is set to null. A not-defined file name results in the data to be ereased.

Specified by:
registerTargetProperties in interface TargetDependingCommand
See Also:
FitsNameGenerator

getLine

public String[] getLine()
Returns the command line of the move telescope command.

Specified by:
getLine in class MessageEvent
Returns:
An array containing all command lines.

parseLine

public boolean parseLine(String[] all)
Parse the command line into ra and dec of the move command.

Specified by:
parseLine in class MessageEvent
Returns:
True, if parsing was successful.

getFitsName

public String getFitsName()
Returns the fits file asociated with the abort command.


getExposureTime

public double getExposureTime()
Returns the exposure time asociated with the darktime command.


isStore

public boolean isStore()
Returns true, if data should be stored.


setExposureTime

private void setExposureTime(double to)
Sets the exposure time.


setFitsName

private void setFitsName(String to)
Sets the fits file name.


getExpectedAcknowledgeNumber

public int getExpectedAcknowledgeNumber()
Returns the number of acknowledge events this command is expected to follow. Used for test case only. If not overriden, this method will return one.

Overrides:
getExpectedAcknowledgeNumber in class CommandEvent
Returns:
Three.