stella.command
Class OffsetTest

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.OffsetTest
All Implemented Interfaces:
Serializable, TelescopeCommand

public class OffsetTest
extends CommandEvent
implements TelescopeCommand

A test command to offset the telescope for a random amount. The offset is a gaussian-distributed value scaled to MAXAZOFFSET and MAXALTOFFSET.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class stella.CommandEvent
CommandEvent.Create
 
Field Summary
private  double altoffset
          The offset in altitude, in degrees.
private  double azoffset
          The offset in azimuth, in degrees.
private static String FAKETYPE
          The fake type.
private static Random GAUSSIAN
          The random object for generating gaussian noise.
static double MAXALTOFFSET
          The maximum offset in degrees in altitude.
static double MAXAZOFFSET
          The maximum offset in degrees in azimuth.
 
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
OffsetTest(Object src)
          Constructs a abort adapter telescope, grabbing the type from the class name and setting the command time to the current system time.
OffsetTest(Object src, String id, long time)
          Constructs a new offset telescope command.
 
Method Summary
 String[] getLine()
          Returns the command line of the move telescope command.
 double getOffsetAltitude()
          Returns the y-offset of the target star.
 double getOffsetAzimuth()
          Returns the x-offset of the target star.
 String getType()
          Fake the type to be of OFFSET_TELESCOPE.
 boolean parseLine(String[] all)
          Parse the command line into ra and dec of the move command.
 void setOffset(double xoff, double yoff)
          Sets the offsets in x and y.
 
Methods inherited from class stella.CommandEvent
classNameToTemplate, createCommand, createCommand, createJCommand, extractType, getExpectedAcknowledgeNumber, parseForStrings, templateToClassName
 
Methods inherited from class stella.MessageEvent
checkType, equals, equalTime, equalTime, fromAscii, getAllCommandLines, getExecuteGroupKey, getHead, getNr, getTime, 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

MAXAZOFFSET

public static final double MAXAZOFFSET
The maximum offset in degrees in azimuth.

See Also:
Constant Field Values

MAXALTOFFSET

public static final double MAXALTOFFSET
The maximum offset in degrees in altitude.

See Also:
Constant Field Values

FAKETYPE

private static final String FAKETYPE
The fake type.

See Also:
Constant Field Values

GAUSSIAN

private static final Random GAUSSIAN
The random object for generating gaussian noise.


azoffset

private double azoffset
The offset in azimuth, in degrees.


altoffset

private double altoffset
The offset in altitude, in degrees.

Constructor Detail

OffsetTest

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


OffsetTest

public OffsetTest(Object src,
                  String id,
                  long time)
Constructs a new offset telescope command. The command only gets valid when either its parseLine(java.lang.String[]) or the setOffset(double, double) method are called.
To mark both offsets invalid, NaN is assigned to them.

Method Detail

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.

setOffset

public void setOffset(double xoff,
                      double yoff)
Sets the offsets in x and y. The offsets are pixels on the CCD, divided by the scale factor of the guiding CCD.


getOffsetAzimuth

public double getOffsetAzimuth()
Returns the x-offset of the target star. If the command is invalid, NaN is returned.


getOffsetAltitude

public double getOffsetAltitude()
Returns the y-offset of the target star. If the command is invalid, NaN is returned.


getType

public String getType()
Fake the type to be of OFFSET_TELESCOPE.

Overrides:
getType in class MessageEvent