edu.nrao.sss.model.resource
Class SpectralLineSpecification

java.lang.Object
  extended by edu.nrao.sss.model.resource.SpectralLineSpecification
All Implemented Interfaces:
Cloneable

public class SpectralLineSpecification
extends Object
implements Cloneable

A specification for observing a spectral transition in a distance object. Instances of this class are used to help choose and configure instrumentation that can obtain data that conform to the encapsulated specifications.

Version Info:

$Revision: 1709 $
$Date: 2008-11-14 11:22:37 -0700 (Fri, 14 Nov 2008) $
$Author: dharland $

Since:
2007-01-29
Author:
David M. Harland

Constructor Summary
SpectralLineSpecification()
          Creates a new instance.
 
Method Summary
 SpectralLineSpecification adjustVelocityForSkyFrequencyOf(FrequencyRange skyFreqRange)
          Alters the velocity values of this specification so that its sky frequencies equal the endpoints of skyFreqRange.
 SpectralLineSpecification clone()
          Returns a specification that is a copy of this one.
 boolean equals(Object o)
          Returns true if o is equal to this specification.
 SpectralLine getLine()
          Returns the spectral line of this specification.
 SortedSet<StokesParameter> getPolarizationProducts()
          Returns the polarization products requested by this specification.
 LinearVelocity getSourceVelocity()
          Returns the velocity of the source of this spectral line.
 TimeDuration getTimeResolution()
          Returns the time resolution of this specification.
 LinearVelocity getVelocityBandwidth()
          Returns the width of the velocity range that is centered on getSourceVelocity().
 LinearVelocity getVelocityResolution()
          Returns the velocity resolution of this specification.
 int hashCode()
          Returns a hash code value for this specification.
 void setLine(SpectralLine newLine)
          Sets the spectral line of this specification.
 void setPolarizationProducts(SortedSet<StokesParameter> newSet)
          Sets the polarization products requested by this specification.
 void setSourceVelocity(LinearVelocity newVelocity)
          Sets the velocity of the source of this spectral line away from or toward the observer.
 void setTimeResolution(TimeDuration resolution)
          Sets the time resolution of this specification.
 void setVelocityBandwidth(LinearVelocity newBandwidth)
          Helps set the minimum and maximum velocities for this observation.
 void setVelocityResolution(LinearVelocity newResolution)
          Sets velocity resolution of this specification.
 SkyFrequencySpecification toSkyFrequencySpecification()
          Returns a sky frequency specification that corresponds to this spectral line specification.
 String toString()
          Returns a text representation of this specification.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpectralLineSpecification

public SpectralLineSpecification()
Creates a new instance.

Method Detail

toSkyFrequencySpecification

public SkyFrequencySpecification toSkyFrequencySpecification()
Returns a sky frequency specification that corresponds to this spectral line specification.

Returns:
a new sky frequency specification derived from this specification.

adjustVelocityForSkyFrequencyOf

public SpectralLineSpecification adjustVelocityForSkyFrequencyOf(FrequencyRange skyFreqRange)
Alters the velocity values of this specification so that its sky frequencies equal the endpoints of skyFreqRange. Only the velocity range is changed; the rest frequency and resolutions of this specification are unaltered. If this specification's rest frequency is zero, this method does nothing.

Parameters:
skyFreqRange - the range of sky frequencies to which the rest frequency of this specification is constrained.
Returns:
this specification.

setLine

public void setLine(SpectralLine newLine)
Sets the spectral line of this specification.

This specification will hold a reference to newLine (unless it is null), so any changes made to it after this call will be reflected in this specification.

Parameters:
newLine - the spectral line of this specification. If this value is null, it will be replaced with new SpectralLine().

getLine

public SpectralLine getLine()
Returns the spectral line of this specification.

The returned line is the one held by this specification, so any changes made to it will be reflected in this object. This value is guaranteed to be non-null.

Returns:
the spectral line of this specification.

setSourceVelocity

public void setSourceVelocity(LinearVelocity newVelocity)
Sets the velocity of the source of this spectral line away from or toward the observer.

Unless newVelocity is null, this object will hold a reference to the parameter, so any changes made to it will be reflected in this object. A value of null will be interpreted as a velocity of zero kilometers per second.

Parameters:
newVelocity - the velocity of the source of this spectral line away from or toward the observer.

getSourceVelocity

public LinearVelocity getSourceVelocity()
Returns the velocity of the source of this spectral line. The velocity returned is the component that is either away from or toward the observer.

Note that the returned velocity is the one held by this specification, so any changes made to it will be reflected in this object. This value is guaranteed to be non-null.

Returns:
the velocity of the source of this spectral line.

setVelocityBandwidth

public void setVelocityBandwidth(LinearVelocity newBandwidth)
Helps set the minimum and maximum velocities for this observation. The minimum (maximum) velocity is the source velocity minus (plus) one-half of newBandwidth. If newBandwidth is null, this method does nothing.

Unless newBandwidth is null, this object will hold a reference to the parameter, so any changes made to it will be reflected in this object. A value of null will be interpreted as a bandwidth of zero kilometers per second.

Parameters:
newBandwidth - the width of the velocity range that is centered on getSourceVelocity().

getVelocityBandwidth

public LinearVelocity getVelocityBandwidth()
Returns the width of the velocity range that is centered on getSourceVelocity().

Note that the returned width is the one held by this specification, so any changes made to it will be reflected in this object. This value is guaranteed to be non-null.

Returns:
the width of the velocity range that is centered on getSourceVelocity().
See Also:
setVelocityBandwidth(LinearVelocity)

setVelocityResolution

public void setVelocityResolution(LinearVelocity newResolution)
Sets velocity resolution of this specification.

Unless newResolution is null, this object will hold a reference to the parameter, so any changes made to it will be reflected in this object. A value of null will be interpreted as a resolution equal to that of this specification's current bandwidth.

Parameters:
newResolution - velocity resolution of this specification.

getVelocityResolution

public LinearVelocity getVelocityResolution()
Returns the velocity resolution of this specification.

Note that the returned resolution is the one held by this specification, so any changes made to it will be reflected in this object. This value is guaranteed to be non-null.

Returns:
the velocity resolution of this specification.

setTimeResolution

public void setTimeResolution(TimeDuration resolution)
Sets the time resolution of this specification.

Unless resolution is null, this object will hold a reference to the parameter, so any changes made to it will be reflected in this object. A value of null will be interpreted as a duration of zero milliseconds.

Parameters:
resolution - the time resolution of this specification.

getTimeResolution

public TimeDuration getTimeResolution()
Returns the time resolution of this specification.

Note that the returned duration is the one held by this specification, so any changes made to it will be reflected in this object. This value is guaranteed to be non-null.

Returns:
the time resolution of this specification.

setPolarizationProducts

public void setPolarizationProducts(SortedSet<StokesParameter> newSet)
Sets the polarization products requested by this specification.

Unless newSet is null, this object will hold a reference to the parameter, so any changes made to it will be reflected in this object. A value of null will be interpreted as a new empty set.

Parameters:
newSet - the polarizations requested by this specification. If this value is null, it will be interpreted as an empty set.

getPolarizationProducts

public SortedSet<StokesParameter> getPolarizationProducts()
Returns the polarization products requested by this specification.

Note that the returned set is the one held by this specification, so any changes made to it will be reflected in this object. This set is guaranteed to be non-null, but it may be empty.

Returns:
the polarization products requested by this specification.

toString

public String toString()
Returns a text representation of this specification.

Overrides:
toString in class Object
Returns:
a text representation of this specification.

clone

public SpectralLineSpecification clone()
Returns a specification that is a copy of this one.

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

Overrides:
clone in class Object

equals

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

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hash code value for this specification.

Overrides:
hashCode in class Object


Copyright © 2009. All Rights Reserved.