edu.nrao.sss.astronomy
Class SpectralLine

java.lang.Object
  extended by edu.nrao.sss.astronomy.SpectralLine
All Implemented Interfaces:
Cloneable

public class SpectralLine
extends Object
implements Cloneable

A spectral line caused by emission or absorption of a photon.

This class is based on the definition of a spectral line used by the Splatalogue.

Version Info:

$Revision: 1951 $
$Date: 2009-02-03 16:26:19 -0700 (Tue, 03 Feb 2009) $
$Author: dharland $

Since:
2007-02-28
Author:
David M. Harland

Constructor Summary
SpectralLine()
          Creates a new instance.
 
Method Summary
 SpectralLine clone()
          Returns a spectral line that is a copy of this one.
 boolean equals(Object o)
          Returns true if o is equal to this spectral line.
 Frequency getFrequency()
          Returns the frequency of this line.
 Frequency getShiftedFrequency(LinearVelocity radialVelocity, VelocityConvention convention)
          Returns the apparent frequency of this line if its source is moving relative to the observer.
 String getSourceOfInformation()
          Returns the source of information of this line.
 String getSpecies()
          Returns the atom or molecule that generates this line.
 String getTransition()
          Returns the transition that causes this line.
 Frequency getUncertainty()
          Returns the uncertainty in the frequency of this line.
 int hashCode()
          Returns a hash code value for this spectral line.
 void setFrequency(Frequency newFrequency)
          Sets the frequency for this line.
 void setSourceOfInformation(String newSource)
          Sets the source of information for this line.
 void setSpecies(String newSpecies)
          Sets the species for this line.
 void setTransition(String newTransition)
          Sets the transition for this line.
 void setUncertainty(Frequency newValue)
          Sets the uncertainty in the frequency of this line.
 String toString()
          Returns a text representation of this spectral line.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpectralLine

public SpectralLine()
Creates a new instance.

Method Detail

setFrequency

public void setFrequency(Frequency newFrequency)
Sets the frequency for this line.

Parameters:
newFrequency - the frequency for this line. If this value is null, it will be replaced with new Frequency().

getFrequency

public Frequency getFrequency()
Returns the frequency of this line.

Returns:
the frequency of this line.

setSourceOfInformation

public void setSourceOfInformation(String newSource)
Sets the source of information for this line. In Splatalogue this corresponds to Line List.

Parameters:
newSource - the source of information for this line. If this value is null, it will be replaced with the empty string ("").

getSourceOfInformation

public String getSourceOfInformation()
Returns the source of information of this line.

Returns:
the source of information of this line.

setSpecies

public void setSpecies(String newSpecies)
Sets the species for this line. This is the atom or molecule that causes this line

Parameters:
newSpecies - the source of this line. If this value is null, it will be replaced with the empty string ("").

getSpecies

public String getSpecies()
Returns the atom or molecule that generates this line.

Returns:
the atom or molecule that generates this line.

setTransition

public void setTransition(String newTransition)
Sets the transition for this line.

Parameters:
newTransition - the transition that causes this line. If this value null, it will be replaced with the empty string ("").

getTransition

public String getTransition()
Returns the transition that causes this line.

Returns:
the transition that causes this line.

setUncertainty

public void setUncertainty(Frequency newValue)
Sets the uncertainty in the frequency of this line.

Parameters:
newValue - the uncertainty in the frequency of this line. If this value is null, it will be replaced with new Frequency().

getUncertainty

public Frequency getUncertainty()
Returns the uncertainty in the frequency of this line.

Returns:
the uncertainty in the frequency of this line.

getShiftedFrequency

public Frequency getShiftedFrequency(LinearVelocity radialVelocity,
                                     VelocityConvention convention)
Returns the apparent frequency of this line if its source is moving relative to the observer.

Parameters:
radialVelocity - the velocity of the source of this line away from (positive values) or toward (negative values) the observer. Note that this is the component of the source's velocity directly away from or toward the observer. If this value is null it will be treated as a velocity of zero.
convention - the convention to use when using radialVelocity to calculate the shifted frequency. If this value is null, the redshift convention will be used if the velocity is in units of Z and the radio convention will be used if it is in any other units.
Returns:
the frequency of this line shifted for the given velocity.

toString

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

Overrides:
toString in class Object

clone

public SpectralLine clone()
Returns a spectral line 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 spectral line.

Overrides:
equals in class Object

hashCode

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

Overrides:
hashCode in class Object


Copyright © 2009. All Rights Reserved.