edu.nrao.sss.model.project.scan
Class PointingScan

java.lang.Object
  extended by edu.nrao.sss.model.project.scan.ScanLoopElement
      extended by edu.nrao.sss.model.project.scan.Scan
          extended by edu.nrao.sss.model.project.scan.PointingScan
All Implemented Interfaces:
UserAccountable, Identifiable, Cloneable

public class PointingScan
extends Scan

A scan that holds a list of pointing positions.

CVS Info:

$Revision: 161 $
$Date: 2006-12-15 11:48:34 -0700 (Fri, 15 Dec 2006) $
$Author: btruitt $

Since:
2006-07-10
Author:
David M. Harland

Field Summary
 
Fields inherited from class edu.nrao.sss.model.project.scan.Scan
DEFAULT_NAME
 
Fields inherited from interface edu.nrao.sss.util.Identifiable
UNIDENTIFIED
 
Fields inherited from interface edu.nrao.sss.model.UserAccountable
NULL_USER_ID
 
Method Summary
 PointingScan clone()
          Returns a pointing scan that is a copy of this one.
static PointingScan create(ScanMode scanMode, String nameOfStandardPattern, TimeDuration timeAtPosition)
          Creates a new pointing scan based on the given pattern name.
 boolean equals(Object o)
          Returns true if o is equal to this pointing scan.
static PointingScan fromXml(Reader reader)
          Creates a new scan based on the XML data read from reader.
static PointingScan fromXml(String xmlFile)
          Creates a new scan from the XML data in the given file.
 CelestialCoordinateSystem getCoordinateSystem()
          Returns the coordinate system for this scan.
static SortedSet<String> getNamesOfStandardPatterns()
          Returns the names of NRAO's standard pointing patterns.
 List<PointingPosition> getPositions()
          Returns the list of pointing positions held by this scan.
 PositionType getPositionType()
          Returns the type of positions contained by this scan.
 int hashCode()
          Returns a hash code value for this scan loop element.
 void setCoordinateSystem(CelestialCoordinateSystem system)
          Sets the coordinate system for this scan.
 void setPositions(List<PointingPosition> replacementList)
          Sets the list of pointing positions held by this scan.
 void setPositions(String nameOfStandardPattern, TimeDuration timeAtPosition)
          Replaces this scan's list of positions with a list based on the given pattern.
 void setPositionType(PositionType posType)
          Sets the type of positions contained by this scan.
 String toSummaryString()
          Returns a short textual description of this scan loop element.
 
Methods inherited from class edu.nrao.sss.model.project.scan.Scan
clearId, createFor, fromXml, fromXml, getAllowOverTheTop, getAntennaWrap, getApplyLastPhase, getApplyLastReferenceDelay, getApplyLastReferenceFocus, getApplyLastReferencePointing, getDopplerSpecs, getDopplerSpecs, getDopplerTracker, getIntents, getLongName, getMode, getReferenceAntennas, getResource, getShortName, getSolarObserving, getSource, getSource, getSourceCatalogEntry, getSubarray, getTimeSpec, getUseResourceOfPriorScan, removeDopplerSpecs, reset, setAllowOverTheTop, setAntennaWrap, setApplyLastPhase, setApplyLastReferenceDelay, setApplyLastReferenceFocus, setApplyLastReferencePointing, setDopplerSpecs, setIntents, setLongName, setResource, setShortName, setSolarObserving, setSourceCatalogEntry, setUseResourceOfPriorScan
 
Methods inherited from class edu.nrao.sss.model.project.scan.ScanLoopElement
appendComments, getComments, getCreatedBy, getCreatedOn, getId, getLastUpdatedBy, getLastUpdatedOn, getName, getProgramBlock, getProject, getSchedulingBlock, hasSchedulingBlock, setComments, setCreatedBy, setCreatedOn, setId, setLastUpdatedBy, setLastUpdatedOn, setName, setSchedulingBlock, toString, toXml, writeAsXmlTo
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

setPositions

public void setPositions(String nameOfStandardPattern,
                         TimeDuration timeAtPosition)
Replaces this scan's list of positions with a list based on the given pattern. If the name is that of a standard pattern, this scan will be updated with pointing positions that emulate the pattern. Each position will have its duration set to timeAtPosition. If the name is not recognized this scan will contain an empty list of positions.

Side Effects:

  1. This scan's celestial coordinate system will be updated to match that of the standard pattern. If the given name was not a standard pattern, the default coordinate system will be used.
  2. This scan's position type will be set to OFFSET.

Parameters:
nameOfStandardPattern - the name of a standard NRAO pointing pattern.
timeAtPosition - the amount of time to spend at each position in the pattern. A null value will be treated as a duration of zero length.
See Also:
getNamesOfStandardPatterns()

setPositions

public void setPositions(List<PointingPosition> replacementList)
Sets the list of pointing positions held by this scan. A null replacementList will be interpreted as a new empty list.

This scan will hold a reference to replacementList (unless it is null), so any changes made to the list after calling this method will be reflected in this object.

Parameters:
replacementList - a list of pointing positions to be held by this scan.

getPositions

public List<PointingPosition> getPositions()
Returns the list of pointing positions held by this scan. The returned list is guaranteed to be non-null, but may be empty.

The returned list is the actual list held by this scan, so changes made to the list will be reflected in this object.

Returns:
the list of pointing positions held by this scan.

setPositionType

public void setPositionType(PositionType posType)
Sets the type of positions contained by this scan. The position type will be used for interpreting the contained positions as either absolute positions, or as positions that are offsets from this scan's central position.

If posType is null, it will be iterpreted as PositionType.OFFSET.

Parameters:
posType - the type of positions contained by this scan.

getPositionType

public PositionType getPositionType()
Returns the type of positions contained by this scan. See setPositionType(PositionType) for details.

Returns:
the type of positions contained by this scan.

setCoordinateSystem

public void setCoordinateSystem(CelestialCoordinateSystem system)
Sets the coordinate system for this scan. The coordinate system will be used for interpreting latitudinal and longitudinal values in the position elements.

If system is null, it will be iterpreted as the default coordinate system.

Parameters:
system - the coordinate system for this scan.

getCoordinateSystem

public CelestialCoordinateSystem getCoordinateSystem()
Returns the coordinate system for this scan. See setCoordinateSystem(CelestialCoordinateSystem) for details.

Returns:
the coordinate system for this scan.

toSummaryString

public String toSummaryString()
Description copied from class: ScanLoopElement
Returns a short textual description of this scan loop element.

Overrides:
toSummaryString in class Scan
Returns:
a short textual description of this scan loop element.

fromXml

public static PointingScan fromXml(String xmlFile)
                            throws JAXBException,
                                   XMLStreamException,
                                   FileNotFoundException
Creates a new scan from the XML data in the given file.

Parameters:
xmlFile - the name of an XML file. This method will attempt to locate the file by using Class.getResource(String).
Returns:
a new scan from the XML data in the given file.
Throws:
FileNotFoundException - if the XML file cannot be found.
JAXBException - if the schema file used (if any) is malformed, if the XML file cannot be read, or if the XML file is not schema-valid.
XMLStreamException - if there is a problem opening the XML file, if the XML is not well-formed, or for some other "unexpected processing conditions".

fromXml

public static PointingScan fromXml(Reader reader)
                            throws JAXBException,
                                   XMLStreamException
Creates a new scan based on the XML data read from reader.

Parameters:
reader - the source of the XML data. If this value is null, null is returned.
Returns:
a new scan based on the XML data read from reader.
Throws:
XMLStreamException - if the XML is not well-formed, or for some other "unexpected processing conditions".
JAXBException - if anything else goes wrong during the transformation.

clone

public PointingScan clone()
Returns a pointing scan that is a copy of this one.

The returned scan is, for the most part, a deep copy of this one. However, there are a few exceptions noted in the clone method of this class's parent.

If anything goes wrong during the cloning procedure, a RuntimeException will be thrown.

Overrides:
clone in class Scan

equals

public boolean equals(Object o)
Returns true if o is equal to this pointing scan.

In order for o to be equal to this scan, it must have equal pointing positions in the same order as those of this scan. It must also follow the rules set forth in the equals method of this class's parent.

Overrides:
equals in class Scan

hashCode

public int hashCode()
Description copied from class: ScanLoopElement
Returns a hash code value for this scan loop element.

Overrides:
hashCode in class Scan

getNamesOfStandardPatterns

public static SortedSet<String> getNamesOfStandardPatterns()
Returns the names of NRAO's standard pointing patterns.

Returns:
the names of NRAO's standard pointing patterns.

create

public static PointingScan create(ScanMode scanMode,
                                  String nameOfStandardPattern,
                                  TimeDuration timeAtPosition)
Creates a new pointing scan based on the given pattern name. If the name is that of a standard pattern, the returned scan will contain pointing positions that emulate the pattern. Each position will have its duration set to timeAtPosition. If the name is not recognized the returned scan will contain no positions.

Parameters:
scanMode - the observation mode for which a scan is desired.
nameOfStandardPattern - the name of a standard NRAO pointing pattern.
timeAtPosition - the amount of time to spend at each position in the pattern. A null value will be treated as a duration of zero length.
Returns:
a new pointing scan.
See Also:
getNamesOfStandardPatterns()


Copyright © 2009. All Rights Reserved.