edu.nrao.sss.model.project
Class ObserveScriptBuilder

java.lang.Object
  extended by edu.nrao.sss.model.project.AbstractScheduleIterator
      extended by edu.nrao.sss.model.project.ObserveScriptBuilder

public class ObserveScriptBuilder
extends AbstractScheduleIterator

This class provides methods for converting a scheduling block to a Jython Observe Script for the EVLA Monitor and Control system.

This class expects the M&C system to provide the generated script with this set of header code:

 from edu.nrao.evla.observe import Array
 from edu.nrao.evla.observe import Antenna
 from edu.nrao.evla.observe import LoIfSetup
 from edu.nrao.evla.observe import VLALoIfSetup
 from edu.nrao.evla.observe import Source
 from edu.nrao.evla.observe import Subarray
 from edu.nrao.evla.observe import Fringefinders
 from edu.nrao.evla.observe import VlaCorrelatorSetup
 from edu.nrao.evla.observe import Intention
 from edu.nrao.evla.observe import AzElInterferometerModel
 
as well as defining the array and subarray variables to point at appropriate edu.nrao.evla.observe.Array and edu.nrao.evla.observe.Subarray java objects.

The scripts generated by this class will also depend on standard helper scripts being available at /home/mchost/evla/include. Specifically:

ScriptUse
focus.py
nodder.py
nod.py
onsource.py
pointCycle.py
point.py
printers.py
radecname.py
raster.py
refPoint.py
sdvlbi.py
tip.py
tmjd.py
vlapoint.py
vlaraster.py


Field Summary
 
Fields inherited from class edu.nrao.sss.model.project.AbstractScheduleIterator
currentScanNumber, dynamicSched, endMjd, EVLA_LOCATION, EVLA_LST, scanCount, sim, slewTime, startMjd, SUBREFLECTOR_SLEW, totalDuration
 
Constructor Summary
ObserveScriptBuilder()
          Creates an ObserveScriptBuilder.
 
Method Summary
protected  void afterLastScanAction(Scan scan)
           
protected  void afterScanAction(Scan scan)
          Generates python code that is necessary regardless of the scan mode, that must come after each scan.
protected  void beforeIteratingAction()
           
protected  void beforeLastScanAction(Scan scan)
           
protected  void beforeScanAction(Scan scan)
          Generates python code that is necessary regardless of the scan mode, that must come before each scan.
 StringBuilder getScriptAsStringBuilder(SchedulingBlock sb)
           
 StringBuilder getScriptAsStringBuilder(SchedulingBlock sb, Date start)
          If start != null, override the SB's start time to be start even if sb is supposed to be dynamically scheduled.
protected  void scanAction(Scan s)
           
 void setSimulatorStartPosition(Angle az, Angle el)
           
 String toScript(SchedulingBlock sb)
           
 String toScript(SchedulingBlock sb, Date start)
           
 
Methods inherited from class edu.nrao.sss.model.project.AbstractScheduleIterator
afterFirstScanAction, afterScanLoopAction, beforeFirstScanAction, beforeScanLoopAction, getEndPosition, getScheduleDuration, getStartPosition, getValidatesSchedulingBlock, getValidationFailures, hasValidationErrors, hasValidationWarnings, iterateOverSchedulingBlock, setValidatesSchedulingBlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObserveScriptBuilder

public ObserveScriptBuilder()
Creates an ObserveScriptBuilder.

Method Detail

toScript

public String toScript(SchedulingBlock sb)
                throws ValidationException
Returns:
getScriptAsStringBuilder(sb).toString().
Throws:
ValidationException

toScript

public String toScript(SchedulingBlock sb,
                       Date start)
                throws ValidationException
Returns:
getScriptAsStringBuilder(sb, start).toString().
Throws:
ValidationException

getScriptAsStringBuilder

public StringBuilder getScriptAsStringBuilder(SchedulingBlock sb)
                                       throws ValidationException
Returns:
a StringBuilder holding python code that will carry out instructions represented by sb. The python code will calculate all source positions and scan start times using startTime as a reference.
Throws:
ValidationException

getScriptAsStringBuilder

public StringBuilder getScriptAsStringBuilder(SchedulingBlock sb,
                                              Date start)
                                       throws ValidationException
If start != null, override the SB's start time to be start even if sb is supposed to be dynamically scheduled. NOTE: in the event that sb is dynamic, a dynamic schedule is still generated, but start is used to calculate all slew times.

Throws:
ValidationException
See Also:
getScriptAsStringBuilder(SchedulingBlock)

setSimulatorStartPosition

public void setSimulatorStartPosition(Angle az,
                                      Angle el)
                               throws IllegalArgumentException
Throws:
IllegalArgumentException

beforeIteratingAction

protected void beforeIteratingAction()
Overrides:
beforeIteratingAction in class AbstractScheduleIterator

beforeLastScanAction

protected void beforeLastScanAction(Scan scan)
Overrides:
beforeLastScanAction in class AbstractScheduleIterator

afterLastScanAction

protected void afterLastScanAction(Scan scan)
Overrides:
afterLastScanAction in class AbstractScheduleIterator

beforeScanAction

protected void beforeScanAction(Scan scan)
Generates python code that is necessary regardless of the scan mode, that must come before each scan.

Overrides:
beforeScanAction in class AbstractScheduleIterator

scanAction

protected void scanAction(Scan s)
Overrides:
scanAction in class AbstractScheduleIterator

afterScanAction

protected void afterScanAction(Scan scan)
Generates python code that is necessary regardless of the scan mode, that must come after each scan.

Overrides:
afterScanAction in class AbstractScheduleIterator


Copyright © 2009. All Rights Reserved.