jsky.science
Class Passband

java.lang.Object
  extended by jsky.science.AbstractScienceObject
      extended by jsky.science.Passband
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener, ScienceObjectModel, ReplaceablePropertyChangeListener

public class Passband
extends AbstractScienceObject

Passband class provides support for range of wavelengths. Including a static list of standard passbands (U B V for example).

This code was developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project for Next Generation Space Telescope (NGST).

Version:
2000.05.03
Author:
T. Brooks and S. Grosvenor
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jsky.science.AbstractScienceObject
AbstractScienceObject.EventMonitor
 
Field Summary
static java.lang.String HIGH_PROPERTY
          bound property change name for change in the HighWavelength
static java.lang.String LOW_PROPERTY
          bound property change name for change in the LowWavelength
static java.lang.String MIDDLE_PROPERTY
          bound property change name for change in the MiddleWavelength
 
Fields inherited from interface jsky.science.ScienceObjectModel
NAME_PROPERTY, PENDING_PROPERTY, VALID_PROPERTY
 
Constructor Summary
Passband()
           
Passband(java.lang.String val)
          Creates a new Passband from a string specifying the range in nanometers.
Passband(java.lang.String inName, Wavelength inLowWL, Wavelength inHighWL, Wavelength inMiddleWL)
          Creates a new Passband with low, high and middle values specified in Wavelengths.
Passband(Wavelength inLowWL, Wavelength inHighWL)
          Creates a new Passband with low and high values specified in Wavelengths.
Passband(Wavelength inLowWL, Wavelength inHighWL, Wavelength inMiddleWL)
          Creates a new Passband with low, high and middle values specified in Wavelengths.
 
Method Summary
 boolean contains(Wavelength inWL)
          Returns true if passband contains specified wavelength
 boolean equals(java.lang.Object inO)
          Default implementation: checks for same name only
static Passband findStandardContaining(Wavelength inWL)
          Returns the first standard passband that contains the specified wavelength.
 Wavelength getHighWavelength()
          Returns high end of the passband as a Wavelength
 Wavelength getLowWavelength()
          Returns low end of the passband as a Wavelength
 Wavelength getMiddleWavelength()
          Returns middle or central Wavelength.
static java.lang.String[] getStandardBroadBands()
          Returns array of Strings containing (arbitrarily) only the names of Passbands where the length of the name is a single character
static Passband getStandardPassband(java.lang.String pName)
          Returns the Passband in the standard list by name.
static java.lang.String[] getStdBands()
          Returns String array containing the names of the defined standard passbands
 void setHighWavelength(Wavelength inWL)
          Sets the Wavelength marking the high end of the Passband.
 void setLowWavelength(Wavelength inWL)
          Sets the Wavelength marking the low end of the Passband.
 void setMiddleWavelength(Wavelength inWL)
          Sets the Wavelength marking the middle of the Passband.
static void setStdBands(java.lang.String[] bands)
          Replaces the standard pass band list with elements parsed from the specified array of strings.
 
Methods inherited from class jsky.science.AbstractScienceObject
addEventMonitor, addPropertyChangeListener, areNamesEqual, clearAllListeners, clone, compareTo, createDefaultName, firePropertyChange, firePropertyChange, fireReplaceObject, fireReplaceObject, fireReplaceObject, fireVetoableChange, fireVetoableChange, getException, getLabel, getName, getObjectIdString, getObjectIdString, getParent, isHolding, isPending, isTracing, isValid, notifyEventMonitors, propertyChange, removeEventMonitor, removePropertyChangeListener, replaceObject, replaceObjectNYI, setException, setHolding, setName, setParent, setTraceAll, setTracing, toString, writeDebug, writeError
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOW_PROPERTY

public static final java.lang.String LOW_PROPERTY
bound property change name for change in the LowWavelength

See Also:
Constant Field Values

MIDDLE_PROPERTY

public static final java.lang.String MIDDLE_PROPERTY
bound property change name for change in the MiddleWavelength

See Also:
Constant Field Values

HIGH_PROPERTY

public static final java.lang.String HIGH_PROPERTY
bound property change name for change in the HighWavelength

See Also:
Constant Field Values
Constructor Detail

Passband

public Passband()

Passband

public Passband(Wavelength inLowWL,
                Wavelength inHighWL)
Creates a new Passband with low and high values specified in Wavelengths. Name is set to string of "inLow-inHigh"


Passband

public Passband(Wavelength inLowWL,
                Wavelength inHighWL,
                Wavelength inMiddleWL)
Creates a new Passband with low, high and middle values specified in Wavelengths. Name is set to string of "inLowNano-inHighNano"


Passband

public Passband(java.lang.String inName,
                Wavelength inLowWL,
                Wavelength inHighWL,
                Wavelength inMiddleWL)
Creates a new Passband with low, high and middle values specified in Wavelengths. Name is taken from first parameter


Passband

public Passband(java.lang.String val)
         throws java.lang.NumberFormatException
Creates a new Passband from a string specifying the range in nanometers. The middle is set to the average of the low and high. If only a low is specified, middle and high values are set to the low value.

Parameters:
val - String containing the range in the form "low-high" or "low"
Throws:
java.lang.NumberFormatException - if it finds invalid numbers
Method Detail

equals

public boolean equals(java.lang.Object inO)
Description copied from class: AbstractScienceObject
Default implementation: checks for same name only

Overrides:
equals in class AbstractScienceObject

getStdBands

public static java.lang.String[] getStdBands()
Returns String array containing the names of the defined standard passbands


getStandardBroadBands

public static java.lang.String[] getStandardBroadBands()
Returns array of Strings containing (arbitrarily) only the names of Passbands where the length of the name is a single character


setStdBands

public static void setStdBands(java.lang.String[] bands)
Replaces the standard pass band list with elements parsed from the specified array of strings. Each string is assumed to contain a passband parsable by the constructor new Passband( String).


getStandardPassband

public static Passband getStandardPassband(java.lang.String pName)
Returns the Passband in the standard list by name. Returns null if bandname is not found


findStandardContaining

public static Passband findStandardContaining(Wavelength inWL)
Returns the first standard passband that contains the specified wavelength. Returns null if no match is found.


contains

public boolean contains(Wavelength inWL)
Returns true if passband contains specified wavelength


getHighWavelength

public Wavelength getHighWavelength()
Returns high end of the passband as a Wavelength


setHighWavelength

public void setHighWavelength(Wavelength inWL)
Sets the Wavelength marking the high end of the Passband.

Parameters:
inWL - middle value as a Wavelength

getLowWavelength

public Wavelength getLowWavelength()
Returns low end of the passband as a Wavelength


setLowWavelength

public void setLowWavelength(Wavelength inWL)
Sets the Wavelength marking the low end of the Passband.

Parameters:
inWL - middle value as a Wavelength

getMiddleWavelength

public Wavelength getMiddleWavelength()
Returns middle or central Wavelength.


setMiddleWavelength

public void setMiddleWavelength(Wavelength inWL)
Sets the Wavelength marking the middle of the Passband. By default, this is the average of the low and high. But may be set to a different central point at developer's discretion

Parameters:
inWL - middle value as a Wavelength