spv.spectrum
Class SpectrumDecorator

java.lang.Object
  extended by java.util.Observable
      extended by spv.spectrum.SpectrumDecorator
All Implemented Interfaces:
java.lang.Cloneable, java.util.Observer, Spectrum
Direct Known Subclasses:
PlottableSpectrum, RangeSpectrum

public abstract class SpectrumDecorator
extends java.util.Observable
implements Spectrum

This abstract class can be extended by classes that act as decorators for Spectrum objects.

This class is just a convenience class that implements all methods defined in the Spectrum interface to make them execute the corresponding method in the decorated object. Thus, real decorator classes that extend this class do not have to re-implement all methods, but just override the ones specific to implement their functionality.

Notice that this class extends Observable, so every decorated object inherits observable properties.

Version:
1.3 - 03Jun04, 1.2 - 11Jul03, 1.1 - 22Nov99, 1.0 - 02Nov99
Author:
Ivo Busko (Space Telescope Science Institute)

Field Summary
protected  boolean notify
           
 Spectrum sp
           
 
Fields inherited from interface spv.spectrum.Spectrum
REST_SUFFIX
 
Constructor Summary
SpectrumDecorator()
           
 
Method Summary
 void addMetaParameter(java.lang.String utype, MetaParameter parameter)
          Adds a meta parameter.
 void addMetaParameter(java.lang.String utype, java.lang.String value)
          Adds a meta parameter.
 void addMetaParameter(java.lang.String utype, java.lang.String value, java.lang.String units)
          Adds a meta parameter.
 void addRadialVelocity(RadialVelocity rv)
          Add a radial velocity object.
 void addSpectrum(java.lang.Object spid, Spectrum sp)
          Adds a Spectrum instance to this object.
 java.lang.Object clone()
          Creates a clone copy of this object.
 void enableNotifications(boolean notify)
          Enables/disables notifications to listeners.
 java.util.List explodeSpectrum()
          Returns a list with all internal Spectrum instances in this.
 DQBits[] getArrayDQBits()
          Returns the list of supported DQ bits in each element of the composite.
 int[] getArrayDQMask()
          Gets the current DQ mask value in each element of the composite.
 double getAverageDispersion()
          Returns the average dispersion.
 double getAverageValue()
          Gets the average value obtained in the last integration operation.
 Spectrum getChild()
          Gets the child spectrum.
 Spectrum getDecoratedSpectrum()
          Returns the decorated spectrum.
 int[] getDQ()
          Returns an array with all DQ flags stored in the currently selected array.
 DQBits getDQBits()
          Returns the list of supported DQ bits in this object.
 java.util.Enumeration getDQList()
          Returns an Enumeration with the String objects that identify the data quality arrays stored in this object.
 int getDQMask()
          Gets the current DQ mask value.
 double[] getErrors()
          Returns an array with all errors stored in the currently selected array.
 double getExtremumPosition()
          Gets the extremum position obtained in the last integration operation.
 double getFluxWeightedPosition()
          Gets the flux weighted position obtained in the last integration operation.
 double getFluxWeightedPositionError()
          Gets the error associated with the flux weighted position obtained in the last integration operation.
 SpectrumHeader getHeader()
          Returns the SpectrumHeader associated with this spectrum.
 double getIntegralError()
          Gets the error of the integral obtained in the last integration operation.
 int getIntegrationBins()
          Gets the number of bins used in the last integration operation.
 java.util.Enumeration getIntensityList()
          Returns an Enumeration with the String objects that identify the intensity arrays stored in this object.
 double getMaxWavelength()
          Returns the maximum wavelength.
 java.util.Map getMetaParameters()
          Gets the meta parameters.
 double getMinWavelength()
          Returns the minimum wavelength.
 java.lang.String getName()
          Returns the spectrum's name.
 int getNBins()
          Returns the total number of bins in this spectrum.
 DataTableModel getNewTableModel()
          Returns a new table model that represents the spectrum contents.
 int getNumberOfSpectra()
          Returns the number of spectra (leaves) in the composite.
 Units getOriginalUnits()
          Returns the original Units associated with the selected intensity array in this spectrum.
 Units getOriginalWavelengthUnits()
          Returns the original Units associated with the wavelength array in this spectrum.
 java.util.List getRadialVelocities()
          Gets a list of all available radial velocity objects.
 double[] getRestWavelengths()
          Returns an array with rest wavelength values.
 java.lang.String getSelectedDQID()
          Gets the current DQ array ID.
 java.lang.String getSelectedIntensityID()
          Gets the current intensity array ID.
 RadialVelocity getSelectedRadialVelocity()
          Gets the currently selected radial velocity object.
 double getSigma()
          Gets the standard deviation obtained in the last integration operation.
 Spectrum getSpectrum(java.lang.Object spid)
          Returns the specified Spectrum object.
 java.util.Enumeration getSpectrumList()
          Returns an Enumeration with the ids of all internal Spectrum instances stored in this object.
 java.util.List getSpectrumListAsList()
          Returns a List with the id objetcs of the Spectrum instances stored in this object.
 DataTableModel getTableModel()
          Returns a table model that represents the spectrum contents.
 java.lang.String getTag()
          Returns the tag associated with this spectrum.
 java.lang.String getTargetName()
          Returns the target name.
 Units getUnits()
          Returns the Units associated with the selected intensity array in this spectrum.
 double[] getValues()
          Returns an array with all values stored in the currently selected array.
 java.lang.String getWavelengthID()
          Gets the wavelength ID.
 double[] getWavelengths()
          Returns an array with all wavelength values stored in this spectrum.
 Units getWavelengthUnits()
          Returns the Units associated with the wavelength array in this spectrum.
 double getX(double wavelength)
          Returns the (fractional) bin number corresponding to the wavelength.
 void initializeParametersFromMap(java.util.Map map)
          Initializes spectrum parameters from a map.
 double integrate(double w1, double w2)
          Integrate the selected array between given wavelengths.
 boolean isEquallySpaced()
          Is the wavelength array equally spaced ?
 boolean isEvenlySampled()
          Is the wavelength array evenly sampled ?
 boolean isMultiSegment()
          Is spectrum multi-segment?
 boolean isNormalizable()
          Checks if the spectrum instance is bormalizable.
 boolean isRestWavelengths()
          Gets the rest wavelengths flag.
 boolean isSpectrogram()
          Is spectrum a spectrogram?
 void maskAll()
          Sets all DQ masks.
 void normalize(double wave, double flux, Units ounits)
          Normalize the selected flux array to the given value
 void process(Command command)
          Executes a process encapsulated inside a Command object, using "this" as argument to the process.
 void removeMetaParameter(java.lang.String utype)
          Removes a meta parameter.
 void removeRadialVelocity(RadialVelocity rv)
          Remove a radial velocity object.
 void removeSpectrum(java.lang.Object spid)
          Removes a Spectrum instance from this object.
 void renormalize(double wave, double flux, java.lang.Object spid)
          Renormalize the selected flux array to the new (wave,flux) point.
 void reorderWavelengths()
          If wavelength array is arranged in decreasing wavelength order, reorder it and all other arrays in increasing wavelength order.
 void resetArraySelection()
          Resets array selection.
 void saveAsSED(java.lang.String filename)
          Saves spectrum as a SED document.
 void saveSpectrumParameters(com.sun.xml.tree.XmlDocument document, com.sun.xml.tree.ElementNode parent)
          Saves spectrum parameters in a XML file.
 void selectDQ(java.lang.String arrayid)
          Selects DQ array.
 void selectIntensity(java.lang.String arrayid)
          Selects intensity array.
 void selectRadialVelocity(RadialVelocity rv)
          Selects a radial velocity object.
 void setChild(Spectrum child)
          Sets a reference to a child spectrum, that is, a different instance of Spectrum that was derived from this instance.
 void setDQBits(DQBits dqbits)
          Stores a copy of the DQBits/code> object.
 void setDQMask(int mask)
          Sets the DQ mask value used in subsequent data retrieval operations.
 void setDQMasks(int[] masks)
          Sets the DQ masks into each element of the composite.
 void setHeader(SpectrumHeader header)
          Stores a copy of the SpectrumHeader object.
 void setMultiSegment(boolean multi_segment)
          Sets the multi-segment flag.
 void setName(java.lang.String name)
          Sets the spectrum's name.
 void setNormalizable(boolean normalizable)
          Sets the normalizable state of the spectrum.
 void setRestWavelengthsFlag(boolean flag)
          Sets a flag that tells that rest wavelengths are to be gotten from this spectrum.
 void setSpectrogram(boolean spectrogram)
          Sets the spectrogram mode.
 void setTargetName(java.lang.String targetName)
          Sets the target name.
 void setUnits(Units units)
          Stores physical units in the currently selected intensity array.
 void setWavelengthID(java.lang.String waveid)
          Sets the wavelength ID.
 void setWavelengths(double[] wavelengths)
          Sets a new wavelength array.
 void setWavelengthUnits(Units units)
          Stores wavelength current physical units.
 boolean supportsRadialVelocity()
          Returns true for spectral data that can be represented in a rest wavelength frame.
 void update(java.util.Observable obs, java.lang.Object arg)
          Implements update from the Observer interface.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface spv.spectrum.Spectrum
addObserver, deleteObserver
 

Field Detail

sp

public Spectrum sp

notify

protected boolean notify
Constructor Detail

SpectrumDecorator

public SpectrumDecorator()
Method Detail

getDecoratedSpectrum

public Spectrum getDecoratedSpectrum()
Returns the decorated spectrum.

Returns:
the decorated spectrum

getName

public java.lang.String getName()
Returns the spectrum's name.

Specified by:
getName in interface Spectrum
Returns:
the spectrum's name

getTag

public java.lang.String getTag()
Returns the tag associated with this spectrum.

A tag is an auxiliary string used for internal identification purposes.

Specified by:
getTag in interface Spectrum
Returns:
the tag

isSpectrogram

public boolean isSpectrogram()
Is spectrum a spectrogram?

Specified by:
isSpectrogram in interface Spectrum
Returns:
true if spectrum is a spectrogram

setSpectrogram

public void setSpectrogram(boolean spectrogram)
Sets the spectrogram mode.

Specified by:
setSpectrogram in interface Spectrum
Parameters:
spectrogram - the spectrogram mode

getTargetName

public java.lang.String getTargetName()
Returns the target name. If the header is null, or the appropriate keyword is not found, an empty string is returned.

Specified by:
getTargetName in interface Spectrum
Returns:
the target name

setTargetName

public void setTargetName(java.lang.String targetName)
Sets the target name.

Specified by:
setTargetName in interface Spectrum
Parameters:
targetName - the target name

getHeader

public SpectrumHeader getHeader()
Returns the SpectrumHeader associated with this spectrum.

Specified by:
getHeader in interface Spectrum
Returns:
a reference to the header stored in this object

getDQBits

public DQBits getDQBits()
Returns the list of supported DQ bits in this object.

Specified by:
getDQBits in interface Spectrum
Returns:
list of supported DQ bits in this object

getArrayDQBits

public DQBits[] getArrayDQBits()
Returns the list of supported DQ bits in each element of the composite.

Specified by:
getArrayDQBits in interface Spectrum
Returns:
list of supported DQ bits in each element of the composite

getDQMask

public int getDQMask()
Gets the current DQ mask value.

Specified by:
getDQMask in interface Spectrum
Returns:
the current DQ mask value

getArrayDQMask

public int[] getArrayDQMask()
Gets the current DQ mask value in each element of the composite.

Specified by:
getArrayDQMask in interface Spectrum
Returns:
the current DQ mask value in each element of the composite

getNBins

public int getNBins()
Returns the total number of bins in this spectrum.

Specified by:
getNBins in interface Spectrum
Returns:
the total number of bins stored in this object

getSelectedRadialVelocity

public RadialVelocity getSelectedRadialVelocity()
Gets the currently selected radial velocity object.

Specified by:
getSelectedRadialVelocity in interface Spectrum
Returns:
the currently selected radial velocity object

getRadialVelocities

public java.util.List getRadialVelocities()
Gets a list of all available radial velocity objects.

Specified by:
getRadialVelocities in interface Spectrum
Returns:
a list of all available radial velocity objects

selectRadialVelocity

public void selectRadialVelocity(RadialVelocity rv)
Selects a radial velocity object.

Specified by:
selectRadialVelocity in interface Spectrum
Parameters:
rv - the radial velocity to be selected

getTableModel

public DataTableModel getTableModel()
Returns a table model that represents the spectrum contents.

Specified by:
getTableModel in interface Spectrum
Returns:
a table model that represents the spectrum contents

getNewTableModel

public DataTableModel getNewTableModel()
Returns a new table model that represents the spectrum contents.

This method should be used when changes in the internal spectrum contents took place.

Specified by:
getNewTableModel in interface Spectrum
Returns:
a table model that represents the spectrum contents

integrate

public double integrate(double w1,
                        double w2)
Integrate the selected array between given wavelengths.

Specified by:
integrate in interface Spectrum
Parameters:
w1 - wavelength limit for integration, in standard units
w2 - wavelength limit for integration, in standard units
Returns:
the integral of the elected array between w1 and w2

normalize

public void normalize(double wave,
                      double flux,
                      Units ounits)
Normalize the selected flux array to the given value

Specified by:
normalize in interface Spectrum
Parameters:
wave - the wavelength were to normalize
flux - the resulting flux density at that wavelength
ounits - the original units to be associated with the new flux, or null if none.

renormalize

public void renormalize(double wave,
                        double flux,
                        java.lang.Object spid)
Renormalize the selected flux array to the new (wave,flux) point.

Specified by:
renormalize in interface Spectrum
Parameters:
wave - the reference wavelength
flux - the new flux at the reference wavelength
spid - the spectrum identification object. If non-null, the method should act on the specified element only.

getIntegralError

public double getIntegralError()
Gets the error of the integral obtained in the last integration operation.

Specified by:
getIntegralError in interface Spectrum
Returns:
the error of the integral obtained in the last integration operation

getAverageValue

public double getAverageValue()
Gets the average value obtained in the last integration operation.

Specified by:
getAverageValue in interface Spectrum
Returns:
the average value obtained in the last integration operation

getSigma

public double getSigma()
Gets the standard deviation obtained in the last integration operation.

Specified by:
getSigma in interface Spectrum
Returns:
the standard deviation obtained in the last integration operation

getFluxWeightedPosition

public double getFluxWeightedPosition()
Gets the flux weighted position obtained in the last integration operation.

Specified by:
getFluxWeightedPosition in interface Spectrum
Returns:
the flux weighted position obtained in the last integration operation

getFluxWeightedPositionError

public double getFluxWeightedPositionError()
Gets the error associated with the flux weighted position obtained in the last integration operation.

Specified by:
getFluxWeightedPositionError in interface Spectrum
Returns:
the error associated with the flux weighted position

getExtremumPosition

public double getExtremumPosition()
Gets the extremum position obtained in the last integration operation.

Specified by:
getExtremumPosition in interface Spectrum
Returns:
the extremum position obtained in the last integration operation

getIntegrationBins

public int getIntegrationBins()
Gets the number of bins used in the last integration operation.

Specified by:
getIntegrationBins in interface Spectrum
Returns:
the number of bins used in the last integration operation

addRadialVelocity

public void addRadialVelocity(RadialVelocity rv)
Add a radial velocity object.

Specified by:
addRadialVelocity in interface Spectrum
Parameters:
rv - a radial velocity object

removeRadialVelocity

public void removeRadialVelocity(RadialVelocity rv)
Remove a radial velocity object.

Specified by:
removeRadialVelocity in interface Spectrum
Parameters:
rv - a radial velocity object

getIntensityList

public java.util.Enumeration getIntensityList()
Returns an Enumeration with the String objects that identify the intensity arrays stored in this object.

Specified by:
getIntensityList in interface Spectrum
Returns:
the list with String instances

getDQList

public java.util.Enumeration getDQList()
Returns an Enumeration with the String objects that identify the data quality arrays stored in this object.

Specified by:
getDQList in interface Spectrum
Returns:
Enumeration with array names

getUnits

public Units getUnits()
Returns the Units associated with the selected intensity array in this spectrum.

Specified by:
getUnits in interface Spectrum
Returns:
a reference to a Units instance

getWavelengthUnits

public Units getWavelengthUnits()
Returns the Units associated with the wavelength array in this spectrum.

Specified by:
getWavelengthUnits in interface Spectrum
Returns:
a reference to a Units instance

getOriginalUnits

public Units getOriginalUnits()
Returns the original Units associated with the selected intensity array in this spectrum.

Specified by:
getOriginalUnits in interface Spectrum
Returns:
a reference to a Units instance

getOriginalWavelengthUnits

public Units getOriginalWavelengthUnits()
Returns the original Units associated with the wavelength array in this spectrum.

Specified by:
getOriginalWavelengthUnits in interface Spectrum
Returns:
a reference to a Units instance

getSpectrumList

public java.util.Enumeration getSpectrumList()
Returns an Enumeration with the ids of all internal Spectrum instances stored in this object.

Specified by:
getSpectrumList in interface Spectrum
Returns:
the list with Spectrum instances

getSpectrumListAsList

public java.util.List getSpectrumListAsList()
Returns a List with the id objetcs of the Spectrum instances stored in this object.

This method was introduced for efficiency purposes.

Specified by:
getSpectrumListAsList in interface Spectrum
Returns:
the list with Spectrum instances

getNumberOfSpectra

public int getNumberOfSpectra()
Returns the number of spectra (leaves) in the composite.

Specified by:
getNumberOfSpectra in interface Spectrum
Returns:
the number of spectra in the composite

explodeSpectrum

public java.util.List explodeSpectrum()
Returns a list with all internal Spectrum instances in this.

Specified by:
explodeSpectrum in interface Spectrum
Returns:
a list with all internal Spectrum instances in this

getSpectrum

public Spectrum getSpectrum(java.lang.Object spid)
Returns the specified Spectrum object.

Specified by:
getSpectrum in interface Spectrum
Parameters:
spid - the spectrum identification object
Returns:
the Spectrum instance

getWavelengths

public double[] getWavelengths()
Returns an array with all wavelength values stored in this spectrum.

Specified by:
getWavelengths in interface Spectrum
Returns:
the reference to the array with wavelength values

getRestWavelengths

public double[] getRestWavelengths()
Returns an array with rest wavelength values.

Specified by:
getRestWavelengths in interface Spectrum
Returns:
an array with rest wavelength values.

setRestWavelengthsFlag

public void setRestWavelengthsFlag(boolean flag)
Sets a flag that tells that rest wavelengths are to be gotten from this spectrum.

Specified by:
setRestWavelengthsFlag in interface Spectrum
Parameters:
flag - a flag that tells that rest wavelengths are to be gotten from this spectrum

isRestWavelengths

public boolean isRestWavelengths()
Gets the rest wavelengths flag.

Specified by:
isRestWavelengths in interface Spectrum
Returns:
the rest wavelength flag

isNormalizable

public boolean isNormalizable()
Checks if the spectrum instance is bormalizable.

Specified by:
isNormalizable in interface Spectrum
Returns:
returns true if the spectrum is normalizable

setNormalizable

public void setNormalizable(boolean normalizable)
Sets the normalizable state of the spectrum.

Specified by:
setNormalizable in interface Spectrum
Parameters:
normalizable - the normalizable state of the spectrum

getX

public double getX(double wavelength)
Returns the (fractional) bin number corresponding to the wavelength.

Note that the concept only applies if the wavelengths are monotonically sorted. If not, this method may deliver bogus results.

Specified by:
getX in interface Spectrum
Returns:
the (fractional) bin number corresponding to the wavelength

getMinWavelength

public double getMinWavelength()
Returns the minimum wavelength.

Specified by:
getMinWavelength in interface Spectrum
Returns:
the minimum wavelength.

getMaxWavelength

public double getMaxWavelength()
Returns the maximum wavelength.

Specified by:
getMaxWavelength in interface Spectrum
Returns:
the maximum wavelength.

getAverageDispersion

public double getAverageDispersion()
Returns the average dispersion.

Specified by:
getAverageDispersion in interface Spectrum
Returns:
the average dispersion

getValues

public double[] getValues()
Returns an array with all values stored in the currently selected array.

Specified by:
getValues in interface Spectrum
Returns:
the reference to the array with spectral values

getErrors

public double[] getErrors()
Returns an array with all errors stored in the currently selected array.

Specified by:
getErrors in interface Spectrum
Returns:
the reference to the array with errors values

getDQ

public int[] getDQ()
Returns an array with all DQ flags stored in the currently selected array.

Specified by:
getDQ in interface Spectrum
Returns:
the reference to the array with DQ values

isMultiSegment

public boolean isMultiSegment()
Is spectrum multi-segment?

This flag does *NOT* overlap with spectrum types that have internal structure. It is designed to tell to external software (such as a graphics library) taht the spectrum must be depicted explictly with a multi-segment glyph.

Specified by:
isMultiSegment in interface Spectrum
Returns:
true if the spectrum must be depicted has a multi-segment entity.

setMultiSegment

public void setMultiSegment(boolean multi_segment)
Sets the multi-segment flag.

Specified by:
setMultiSegment in interface Spectrum
Parameters:
multi_segment - the multi-segment flag

isEvenlySampled

public boolean isEvenlySampled()
Is the wavelength array evenly sampled ?

Specified by:
isEvenlySampled in interface Spectrum
Returns:
true if the wavelength array returned by this object is more or less evenly sampled.

isEquallySpaced

public boolean isEquallySpaced()
Is the wavelength array equally spaced ?

Specified by:
isEquallySpaced in interface Spectrum
Returns:
true if the wavelength array returned by this object is sampled with a uniform step.

getWavelengthID

public java.lang.String getWavelengthID()
Gets the wavelength ID.

Specified by:
getWavelengthID in interface Spectrum
Returns:
the wavelength ID

setWavelengthID

public void setWavelengthID(java.lang.String waveid)
Sets the wavelength ID.

Specified by:
setWavelengthID in interface Spectrum
Parameters:
waveid - the wavelength ID

setWavelengths

public void setWavelengths(double[] wavelengths)
                    throws SpectrumException
Sets a new wavelength array.

This method causes the entire spectrum to be resanpled at the new wavelength values.

Specified by:
setWavelengths in interface Spectrum
Parameters:
wavelengths - the new wavelength array
Throws:
SpectrumException - if the provided array is not compatible with the existing wavelength array

setName

public void setName(java.lang.String name)
Sets the spectrum's name.

Specified by:
setName in interface Spectrum
Parameters:
name - the spectrum's name

setHeader

public void setHeader(SpectrumHeader header)
Stores a copy of the SpectrumHeader object.

Specified by:
setHeader in interface Spectrum
Parameters:
header - the object to be stored

setDQBits

public void setDQBits(DQBits dqbits)
Stores a copy of the DQBits/code> object.

Specified by:
setDQBits in interface Spectrum
Parameters:
dqbits - the object to be stored

setDQMask

public void setDQMask(int mask)
Sets the DQ mask value used in subsequent data retrieval operations.

Specified by:
setDQMask in interface Spectrum
Parameters:
mask - the DQ mask value

setDQMasks

public void setDQMasks(int[] masks)
Sets the DQ masks into each element of the composite.

Specified by:
setDQMasks in interface Spectrum
Parameters:
masks - array with the DQ masks

maskAll

public void maskAll()
Sets all DQ masks.

Specified by:
maskAll in interface Spectrum

getSelectedIntensityID

public java.lang.String getSelectedIntensityID()
Gets the current intensity array ID.

Specified by:
getSelectedIntensityID in interface Spectrum
Returns:
the current intensity array ID

getSelectedDQID

public java.lang.String getSelectedDQID()
Gets the current DQ array ID.

Specified by:
getSelectedDQID in interface Spectrum
Returns:
the current intensity array ID

selectIntensity

public void selectIntensity(java.lang.String arrayid)
Selects intensity array. Once an array is selected, all array-dependent methods act on the selected array only.

Specified by:
selectIntensity in interface Spectrum
Parameters:
arrayid - the array identification

selectDQ

public void selectDQ(java.lang.String arrayid)
Selects DQ array. Once an array is selected, all array-dependent methods act on the selected array only.

Specified by:
selectDQ in interface Spectrum
Parameters:
arrayid - the array identification

resetArraySelection

public void resetArraySelection()
Resets array selection.

Specified by:
resetArraySelection in interface Spectrum

setUnits

public void setUnits(Units units)
Stores physical units in the currently selected intensity array.

Specified by:
setUnits in interface Spectrum
Parameters:
units - the physical units to be stored as current

setWavelengthUnits

public void setWavelengthUnits(Units units)
Stores wavelength current physical units.

Specified by:
setWavelengthUnits in interface Spectrum
Parameters:
units - the physical units to be stored as current

enableNotifications

public void enableNotifications(boolean notify)
Enables/disables notifications to listeners.

Specified by:
enableNotifications in interface Spectrum
Parameters:
notify - true if notifications are to be enabled, false otherwise.

process

public void process(Command command)
Executes a process encapsulated inside a Command object, using "this" as argument to the process.

Specified by:
process in interface Spectrum
Parameters:
command - the command object that encapsulates the processor algorithm

addSpectrum

public void addSpectrum(java.lang.Object spid,
                        Spectrum sp)
Adds a Spectrum instance to this object.

Specified by:
addSpectrum in interface Spectrum
Parameters:
spid - the identification
sp - the Spectrum instance to be added

removeSpectrum

public void removeSpectrum(java.lang.Object spid)
Removes a Spectrum instance from this object.

Specified by:
removeSpectrum in interface Spectrum
Parameters:
spid - the identification

reorderWavelengths

public void reorderWavelengths()
If wavelength array is arranged in decreasing wavelength order, reorder it and all other arrays in increasing wavelength order.

Specified by:
reorderWavelengths in interface Spectrum

initializeParametersFromMap

public void initializeParametersFromMap(java.util.Map map)
Initializes spectrum parameters from a map.

This operation should be handled by a single base class; therefore decorator should,'t propagate it. This method is a no-op.

Specified by:
initializeParametersFromMap in interface Spectrum
Parameters:
map - the map, ignored

saveSpectrumParameters

public void saveSpectrumParameters(com.sun.xml.tree.XmlDocument document,
                                   com.sun.xml.tree.ElementNode parent)
Saves spectrum parameters in a XML file.

This operation should be handled by a single base class; therefore decorator should,'t propagate it. This method is a no-op.

Specified by:
saveSpectrumParameters in interface Spectrum
Parameters:
document - the DOM document, ignored.
parent - the parent node, ignored.

saveAsSED

public void saveAsSED(java.lang.String filename)
Saves spectrum as a SED document.

Specified by:
saveAsSED in interface Spectrum
Parameters:
filename - the SED file name

getMetaParameters

public java.util.Map getMetaParameters()
Gets the meta parameters.

Specified by:
getMetaParameters in interface Spectrum
Returns:
a map with the meta parameters

addMetaParameter

public void addMetaParameter(java.lang.String utype,
                             java.lang.String value)
Adds a meta parameter.

Specified by:
addMetaParameter in interface Spectrum
Parameters:
utype - the utype
value - the value

addMetaParameter

public void addMetaParameter(java.lang.String utype,
                             java.lang.String value,
                             java.lang.String units)
Adds a meta parameter.

Specified by:
addMetaParameter in interface Spectrum
Parameters:
utype - the utype
value - the value
units - the units

addMetaParameter

public void addMetaParameter(java.lang.String utype,
                             MetaParameter parameter)
Adds a meta parameter.

Specified by:
addMetaParameter in interface Spectrum
Parameters:
utype - the utype
parameter - the parameter

removeMetaParameter

public void removeMetaParameter(java.lang.String utype)
Removes a meta parameter.

Specified by:
removeMetaParameter in interface Spectrum
Parameters:
utype - the utype

supportsRadialVelocity

public boolean supportsRadialVelocity()
Returns true for spectral data that can be represented in a rest wavelength frame.

Specified by:
supportsRadialVelocity in interface Spectrum
Returns:
true for spectral data that can be represented in a rest wavelength frame

setChild

public void setChild(Spectrum child)
Sets a reference to a child spectrum, that is, a different instance of Spectrum that was derived from this instance.

Specified by:
setChild in interface Spectrum
Parameters:
child - the child spectrum

getChild

public Spectrum getChild()
Gets the child spectrum.

Specified by:
getChild in interface Spectrum
Returns:
the child spectrum

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates a clone copy of this object.

Specified by:
clone in interface Spectrum
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

update

public void update(java.util.Observable obs,
                   java.lang.Object arg)
Implements update from the Observer interface. This method intercept update requests from the decorated spectrum and just passes them up to observers, without any processing.

The Observable object that sent the update request is compared with the decorated spectrum object. The request is propagated upwards only if they are the same object.

Specified by:
update in interface java.util.Observer
Parameters:
obs - the object that notifies this
arg - the optional object used to convey state info