optics
Class CompoundSpectrum

java.lang.Object
  extended by optics.Optics
      extended by optics.WaveLengthFunction
          extended by optics.WaveLengthSpectrum
              extended by optics.CompoundSpectrum

public class CompoundSpectrum
extends WaveLengthSpectrum

Class to implement a compound wavelength spectrum being combination of spectrums than can be added, subtracted and multiplied together.


Field Summary
static int ADD
          Static to specify Added spectrum
static int BASE
          Static to specify base spectrum
static int MULTIPLY
          Static to specify a Multiplied spectum
static int SUBTRACT
          Static to specify Substracted spectrum
 
Fields inherited from class optics.WaveLengthFunction
maxPlotLambda, minPlotLambda, plotPoints
 
Fields inherited from class optics.Optics
DEFAULT_WAVELENGTH, errorStream, fmt, MICRONS
 
Constructor Summary
CompoundSpectrum()
          Form a blank CompoundSpectrum with no specified based spectrum.
CompoundSpectrum(WaveLengthSpectrum base)
          Form a CompoundSpectrum with a specified base spectrum.
 
Method Summary
 void addSpectrum(WaveLengthSpectrum s, int a)
          Add a spectrum with a specified action.
 double getIntensity(double lambda)
          Method to get the intensity at specifed wavelength
 void remove(int i)
          Method to remove a spectrum from the component list.
 java.lang.String toString()
          Standard toString method to print information
 
Methods inherited from class optics.WaveLengthSpectrum
getValue
 
Methods inherited from class optics.WaveLengthFunction
getPlot, getPlotPoints, setPlotPoints, setPlotRange, setPlotRange, toGraph, toPlot, toPlot, toPlot
 
Methods inherited from class optics.Optics
getDefaultWaveLength, getErrorStream, getFormatString, getName, getStaticName, getVersion, printError, setDefaultWaveLength, setErrorStream, setFormatString, setMicrons
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BASE

public static final int BASE
Static to specify base spectrum

See Also:
Constant Field Values

ADD

public static final int ADD
Static to specify Added spectrum

See Also:
Constant Field Values

SUBTRACT

public static final int SUBTRACT
Static to specify Substracted spectrum

See Also:
Constant Field Values

MULTIPLY

public static final int MULTIPLY
Static to specify a Multiplied spectum

See Also:
Constant Field Values
Constructor Detail

CompoundSpectrum

public CompoundSpectrum(WaveLengthSpectrum base)
Form a CompoundSpectrum with a specified base spectrum.

Parameters:
base - the base spectrum

CompoundSpectrum

public CompoundSpectrum()
Form a blank CompoundSpectrum with no specified based spectrum.

Note a base spectrum must added before sensible values be obtained.

Method Detail

addSpectrum

public void addSpectrum(WaveLengthSpectrum s,
                        int a)
Add a spectrum with a specified action.

Note the order of spectrums is essentail if there is a mixture of ADD and MULTIPLY. The spectrums are applied in the order they were added.

Parameters:
s - the spectrum
a - the action to be applied

getIntensity

public double getIntensity(double lambda)
Method to get the intensity at specifed wavelength

Specified by:
getIntensity in class WaveLengthSpectrum
Parameters:
lambda - the wavelength in microns
Returns:
double the intensity

remove

public void remove(int i)
Method to remove a spectrum from the component list. If the requested index does not exist the call will be ignored

Parameters:
i - the component index

toString

public java.lang.String toString()
Standard toString method to print information

Overrides:
toString in class java.lang.Object