edu.nrao.sss.astronomy
Enum VelocityConvention

java.lang.Object
  extended by java.lang.Enum<VelocityConvention>
      extended by edu.nrao.sss.astronomy.VelocityConvention
All Implemented Interfaces:
Serializable, Comparable<VelocityConvention>

public enum VelocityConvention
extends Enum<VelocityConvention>

A convention used to convert a rest frequency to a sky frequency.

A discussion of these conventions may be found at http://iram.fr/IRAMFR/ARN/may95/node4.html and http://www.gb.nrao.edu/~fghigo/gbtdoc/doppler.html.

Version Info:

$Revision: 1572 $
$Date: 2008-09-22 16:52:39 -0600 (Mon, 22 Sep 2008) $
$Author: dharland $

Since:
2006-03-31
Author:
David M. Harland

Enum Constant Summary
OPTICAL
          The optical astronomy convention for converting a rest frequency to a sky frequency.
RADIO
          The radio astronomy convention for converting a rest frequency to a sky frequency.
REDSHIFT
          The red shift convention for converting a rest frequency to a sky frequency.
RELATIVISTIC
          The relativistic convention for converting a rest frequency to a sky frequency.
 
Method Summary
static VelocityConvention fromString(String text)
          Returns the velocity convention represented by text.
static VelocityConvention getDefault()
          Returns a default velocity convention.
 LinearVelocityUnits getDefaultUnits()
          Returns the default velocity units used by this convention.
abstract  BigDecimal getFrequencyShiftFactor(BigDecimal velocityInDefaultUnits)
          Returns a factor that can be used to shift a rest frequency to one appropriate for the given velocity.
 BigDecimal getFrequencyShiftFactor(LinearVelocity velocity)
          Returns a factor that can be used to shift a rest frequency to one appropriate for the given velocity.
abstract  LinearVelocity getVelocity(BigDecimal shiftFactor)
          Returns the velocity for the given shift factor.
 String toString()
          Returns a text representation of this enumeration constant.
static VelocityConvention valueOf(String name)
          Returns the enum constant of this type with the specified name.
static VelocityConvention[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

OPTICAL

public static final VelocityConvention OPTICAL
The optical astronomy convention for converting a rest frequency to a sky frequency.

Convention:

fsky = frest * (1 + v/c)-1


RADIO

public static final VelocityConvention RADIO
The radio astronomy convention for converting a rest frequency to a sky frequency.

Convention:

fsky = frest * (1 - v/c)


REDSHIFT

public static final VelocityConvention REDSHIFT
The red shift convention for converting a rest frequency to a sky frequency.

Convention:

fsky = frest * (1 + z)-1


RELATIVISTIC

public static final VelocityConvention RELATIVISTIC
The relativistic convention for converting a rest frequency to a sky frequency.

Convention:

fsky = frest * (1 - (v/c)2)½ / (1 + v/c)

Method Detail

values

public static VelocityConvention[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (VelocityConvention c : VelocityConvention.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static VelocityConvention valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getDefaultUnits

public LinearVelocityUnits getDefaultUnits()
Returns the default velocity units used by this convention.

Returns:
the default velocity units used by this convention.

getFrequencyShiftFactor

public abstract BigDecimal getFrequencyShiftFactor(BigDecimal velocityInDefaultUnits)
Returns a factor that can be used to shift a rest frequency to one appropriate for the given velocity. The velocity value sent to this method will be assumed to be in the default units of this convention.

See the descriptions of the individual elements of this enumeration for the formula used by a given convention.

Parameters:
velocityInDefaultUnits - the velocity, in the default units of this convention, for which a frequency-shifting factor is desired.

getVelocity

public abstract LinearVelocity getVelocity(BigDecimal shiftFactor)
Returns the velocity for the given shift factor. Positive values represent motion away from the observer.

Parameters:
shiftFactor - the ratio between the observed frequency and the rest frequency.
Returns:
the velocity for the given shift factor.

getFrequencyShiftFactor

public BigDecimal getFrequencyShiftFactor(LinearVelocity velocity)
Returns a factor that can be used to shift a rest frequency to one appropriate for the given velocity.

Parameters:
velocity - the velocity for which a frequency-shifting factor is desired.
Returns:
a factor that can be used to shift a rest frequency to one appropriate for the given velocity. If velocity is null, a factor of one will be returned.

getDefault

public static VelocityConvention getDefault()
Returns a default velocity convention.

Returns:
a default velocity convention.

toString

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

Overrides:
toString in class Enum<VelocityConvention>
Returns:
a text representation of this enumeration constant.

fromString

public static VelocityConvention fromString(String text)
Returns the velocity convention represented by text.

For details about the transformation, see EnumerationUtility.enumFromString(Class, String).

Parameters:
text - a text representation of a velocity convention.
Returns:
the velocity convention represented by text.


Copyright © 2009. All Rights Reserved.