|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.model.project.scan.ScanLoopElement edu.nrao.sss.model.project.scan.Scan
public abstract class Scan
A sequence of one or more observations that share a single goal. A scan is made up of a target source, a calibrator, resources, timing information, and an observing mode.
A Scan
is usually an observation of a single target source
or calibrator, but may involve different pointing and focus
patterns.
Version Info:
$Revision: 2277 $ |
$Date: 2009-04-29 11:19:38 -0600 (Wed, 29 Apr 2009) $ |
$Author: dharland $ |
Field Summary | |
---|---|
static String |
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 | ||
---|---|---|
void |
clearId()
Resets this scan's id to UNIDENTIFIED, an similarly resets it's source catalog entry and resource id's. |
|
Scan |
clone()
Returns a scan that is a copy of this one. |
|
static Scan |
createFor(ScanMode scanMode)
A factory method for creating a new scan. |
|
boolean |
equals(Object o)
Returns true if o is equal to this scan. |
|
static
|
fromXml(Class<T> scanType,
Reader reader)
Creates a new scan based on the XML data read from reader . |
|
static
|
fromXml(Class<T> scanType,
String xmlFile)
Creates a new scan from the XML data in the given file. |
|
boolean |
getAllowOverTheTop()
Returns true if this scan allows the telescope to tip beyond the zenith. |
|
AntennaWrap |
getAntennaWrap()
Returns the antenna wrapping direction for this scan. |
|
boolean |
getApplyLastPhase()
Returns true if this scan should apply the most recent set of phase offsets. |
|
boolean |
getApplyLastReferenceDelay()
Returns true if this scan should apply the most recent set of reference delays. |
|
boolean |
getApplyLastReferenceFocus()
Returns true if this scan should apply the most recent set of reference focus offsets. |
|
boolean |
getApplyLastReferencePointing()
Returns true if this scan should apply the most recent set of reference pointing offsets. |
|
Map<String,ScanDopplerSpecs> |
getDopplerSpecs()
Returns a copy of this scan's map of Doppler tracking information. |
|
ScanDopplerSpecs |
getDopplerSpecs(String key)
Returns the Doppler tracking information associated with key ,
if any. |
|
DopplerTracker |
getDopplerTracker(String key,
Date dateTime,
Frequency restFrequency)
Returns a new Doppler tracker based on the given parameters and the properties of this scan. |
|
Set<ScanIntent> |
getIntents()
Returns a set of the purposes for which this scan is intended. |
|
String |
getLongName()
Deprecated. |
|
ScanMode |
getMode()
Returns the mode of this scan. |
|
AntennaSelection |
getReferenceAntennas()
Returns a set of antennas to be used as references for this scan. |
|
Resource |
getResource()
Returns the resource to use for this scan, or null if one cannot be found. |
|
String |
getShortName()
Deprecated. |
|
boolean |
getSolarObserving()
Returns true if this scan is for solar observing. |
|
Source |
getSource()
Returns the source to use at the current time. |
|
Source |
getSource(Date dateTime)
Returns the source to use at the given time. |
|
SourceCatalogEntry |
getSourceCatalogEntry()
Returns either the Source or SourceLookupTable that is the
focus of this scan. |
|
AntennaSelection |
getSubarray()
Returns the antennas selected for a subarray. |
|
ScanTimeSpecification |
getTimeSpec()
Returns the timing specification for this scan. |
|
boolean |
getUseResourceOfPriorScan()
Indicates whether this scan should use its own hardware configuration or that of the prior scan. |
|
int |
hashCode()
Returns a hash code value for this scan loop element. |
|
void |
removeDopplerSpecs(String key)
Removes the Doppler tracking information stored previously with the given key. |
|
void |
reset()
Resets this scan to its initial state. |
|
void |
setAllowOverTheTop(boolean allow)
Indicates whether or not this scan will allow the telescope to tip beyond the zenith. |
|
void |
setAntennaWrap(AntennaWrap wrap)
Sets the antenna wrapping direction for this scan. |
|
void |
setApplyLastPhase(boolean apply)
Tells this scan whether or not it should apply the most recent set of phase offsets. |
|
void |
setApplyLastReferenceDelay(boolean apply)
Tells this scan whether or not is should apply the most recent set of reference delays. |
|
void |
setApplyLastReferenceFocus(boolean apply)
Tells this scan whether or not is should apply the most recent set of reference focus offsets. |
|
void |
setApplyLastReferencePointing(boolean apply)
Tells this scan whether or not is should apply the most recent set of reference pointing offsets. |
|
void |
setDopplerSpecs(String key,
ScanDopplerSpecs dopplerInfo)
Saves Doppler tracking specifications using the given key. |
|
void |
setIntents(Set<ScanIntent> replacementSet)
Sets the purposes for which this scan is intended. |
|
void |
setLongName(String newName)
Deprecated. |
|
void |
setResource(Resource newResource)
Sets the resource to be used for this scan. |
|
void |
setShortName(String newName)
Deprecated. |
|
void |
setSolarObserving(boolean solar)
Indicates whether or not this scan is for solar observing. |
|
void |
setSourceCatalogEntry(SourceCatalogEntry sourceOrTable)
Sets either the Source or SourceLookupTable that is the
focus of this scan. |
|
void |
setUseResourceOfPriorScan(boolean usePriorResource)
Indicates whether this scan should use its own hardware configuration or that of the prior scan. |
|
String |
toSummaryString()
Returns a short textual description of this scan loop element. |
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 |
Field Detail |
---|
public static final String DEFAULT_NAME
Method Detail |
---|
public static Scan createFor(ScanMode scanMode)
scanMode
- the observation mode for which a scan is desired.
IllegalArgumentException
- if scanMode
is null.public void reset()
reset
in class ScanLoopElement
public void clearId()
clearId
in class ScanLoopElement
@Deprecated public String getLongName()
@Deprecated public void setLongName(String newName)
@Deprecated public String getShortName()
@Deprecated public void setShortName(String newName)
public ScanMode getMode()
public ScanTimeSpecification getTimeSpec()
public Source getSource()
public Source getSource(Date dateTime)
dateTime
- the time for which the source is needed.
public void setSourceCatalogEntry(SourceCatalogEntry sourceOrTable)
Source
or SourceLookupTable
that is the
focus of this scan.
sourceOrTable
- the Source
or SourceLookupTable
to
use for this scan.public SourceCatalogEntry getSourceCatalogEntry()
Source
or SourceLookupTable
that is the
focus of this scan. The returned value may be null.
Source
or SourceLookupTable
used for this scan,
or null if this scan has neither.public void setUseResourceOfPriorScan(boolean usePriorResource)
Calling this method has no impact on the value of the
resource
property.
usePriorResource
- true if this scan should the hardware configuration of the
prior scan, false if it should use its own configuration.setResource(Resource)
public boolean getUseResourceOfPriorScan()
getResource()
public void setResource(Resource newResource)
The newResource should be used only if the value returned
by getUseResourceOfPriorScan()
is true.
Calling this method has no impact on the value of the
use-resource-of-prior-scan
property.
newResource
- the resource to be used for this scan.setUseResourceOfPriorScan(boolean)
public Resource getResource()
getUseResourceOfPriorScan()
and then call this method only if
the value returned by that method is true.
Note that this method may return a non-null resource even when getUseResourceOfPriorScan returns false.
public AntennaSelection getSubarray()
public AntennaSelection getReferenceAntennas()
public void setDopplerSpecs(String key, ScanDopplerSpecs dopplerInfo)
key
- the key for retrieving dopplerInfo
from this scan.
See the description of the key
parameter to the
getDopplerTracker(String, Date, Frequency)
method
for important information.dopplerInfo
- information regarding doppler tracking for this scan.public void removeDopplerSpecs(String key)
key
- a key used previously in setDopplerSpecs(String, ScanDopplerSpecs)
for storing Doppler tracking information.
See the description of the key
parameter to the
getDopplerTracker(String, Date, Frequency)
method
for important information.public ScanDopplerSpecs getDopplerSpecs(String key)
key
,
if any.
key
- a key used previously in setDopplerSpecs(String, ScanDopplerSpecs)
for storing Doppler tracking information.
See the description of the key
parameter to the
getDopplerTracker(String, Date, Frequency)
method
for important information.
key
, if any.
If no Doppler information exists for key
, null is returned.public Map<String,ScanDopplerSpecs> getDopplerSpecs()
The returned map is not reference by this scan, so changes made to it will not be reflected herein. The returned map might be empty but will never be null.
public DopplerTracker getDopplerTracker(String key, Date dateTime, Frequency restFrequency)
This method first looks for a ScanDopplerSpecs object associated
with key
. If one is found, it is queried for source position and
velocity information. If the found specification is missing position or
velocity information, that information is sought from this scan's source.
If no Doppler specs are found for key
, this method will again
use this scan's source for the needed information. The
EarthPosition used in the returned DopplerTracker
comes from the telescope used by this scan's Resource.
If this scan's resource is null, the DopplerTracker
will use a default position.
It is important to note that this method makes no determination about whether or not Doppler tracking should be used; that decision is up to the client. This method will never return a null tracker.
key
- a key used previously for
storing Doppler
specifications
.
At this point the key can be any arbitrary text chosen by clients.
We would like in the future, though, to use the name of a signal
as the key. By "signal" we mean one of the outputs from the
antenna electronics of this scan's resource. If we were to
adopt this convention, we could eliminate the
restFrequency
parameter (see below).
The hardware configuration code is not yet ready for this,
so clients currently have the inconvenience of furnishing
a rest frequency.dateTime
- used to fetch the source from this scan.
If this parameter is null the current system time is used.restFrequency
- an optional parameter that is used only if this method needs to fetch
velocity information from this scan's source. If this scan has
Doppler tracking information for signalName
, and if that
object has velocity information, this parameter will not be used.
Ideally this parameter should not be needed, and if we enhance
the Resource class or one of its components, we should
be able to eliminate it. If the key
parameter is
truly the name of a signal, this method should be able to talk to
its resource, get the named signal, and fetch the central frequency
from it.
public void setIntents(Set<ScanIntent> replacementSet)
replacementSet
is null, it will be intrepreted as
a new, empty, set.
This scan will hold a reference to replacementSet
(unless it is null), so any changes made to the set
after calling this method will be reflected in this object.
replacementSet
- a set of the purposes for which this scan is intended.public Set<ScanIntent> getIntents()
The returned set is the actual set held by this scan, so changes made to the set will be reflected in this object.
public void setApplyLastPhase(boolean apply)
apply
- true if this scan should apply the most recent set of
phase offsets.public boolean getApplyLastPhase()
public void setApplyLastReferencePointing(boolean apply)
apply
- true if this scan should apply the most recent set of
reference pointing offsets.public boolean getApplyLastReferencePointing()
public void setApplyLastReferenceFocus(boolean apply)
apply
- true if this scan should apply the most recent set of
reference focus offsets.public boolean getApplyLastReferenceFocus()
public void setApplyLastReferenceDelay(boolean apply)
apply
- true if this scan should apply the most recent set of
reference delays.public boolean getApplyLastReferenceDelay()
public void setSolarObserving(boolean solar)
solar
- true if this scan is for solar observing.public boolean getSolarObserving()
public void setAllowOverTheTop(boolean allow)
allow
- true if this scan allows the telescope to tip beyond
the zenith.public boolean getAllowOverTheTop()
public void setAntennaWrap(AntennaWrap wrap)
wrap
- the antenna wrapping direction for this scan.public AntennaWrap getAntennaWrap()
public String toSummaryString()
ScanLoopElement
toSummaryString
in class ScanLoopElement
public static <T extends Scan> T fromXml(Class<T> scanType, String xmlFile) throws JAXBException, XMLStreamException, FileNotFoundException
Sample usage:
FocusScan myScan = Scan.fromXml(FocusScan.class, myFile);
T
- the particular subclass of Scan
returned.scanType
- the Class
of an object that extends Scan
.xmlFile
- the name of an XML file. This method will attempt to locate
the file by using Class.getResource(String)
.
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".public static <T extends Scan> T fromXml(Class<T> scanType, Reader reader) throws JAXBException, XMLStreamException
reader
.
Sample usage:
DelayScan myScan = Scan.fromXml(DelayScan.class, myReader);
T
- the particular subclass of Scan
returned.scanType
- the Class
of an object that extends Scan
.reader
- the source of the XML data.
If this value is null, null is returned.
reader
.
XMLStreamException
- if the XML is not well-formed,
or for some other "unexpected processing conditions".
JAXBException
- if anything else goes wrong during the
transformation.public Scan clone()
The returned scan is, for the most part, a deep copy of this one. However, there are a few exceptions:
Identifiable.UNIDENTIFIED
.
If anything goes wrong during the cloning procedure,
a RuntimeException
will be thrown.
clone
in class ScanLoopElement
public boolean equals(Object o)
o
is equal to this scan.
In order to be equal to this element, o
must be non-null and
of the same class as this element. Equality is determined by examining
the equality of corresponding attributes, with the following exceptions,
which are ignored when assessing equality:
equals
in class ScanLoopElement
public int hashCode()
ScanLoopElement
hashCode
in class ScanLoopElement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |