optics
Class WaveLengthFunction

java.lang.Object
  extended by optics.Optics
      extended by optics.WaveLengthFunction
Direct Known Subclasses:
RefractiveIndex, WaveLengthSpectrum

public abstract class WaveLengthFunction
extends Optics

Abstract class to implement one dimensional function of wavelength. It is used for either refractive index or spectral responses It also includes the ability to plot to via the ptolemy.Plot graphical class.


Field Summary
protected  double maxPlotLambda
          Propected double the graph minumum.
protected  double minPlotLambda
          Propected double the graph minumum.
protected static int plotPoints
          Propected static to control the numbers of points on the graphs
 
Fields inherited from class optics.Optics
DEFAULT_WAVELENGTH, errorStream, fmt, MICRONS
 
Constructor Summary
WaveLengthFunction()
           
 
Method Summary
 ptolemy.plot.Plot getPlot()
          Method to get the Plot object.
 int getPlotPoints()
          Method to get the current number of points in a plot.
abstract  double getValue(double lambda)
          Method to get the value at specific wavelength.
 void setPlotPoints(int points)
          Method to set the number of point in all subsequent plots.
 void setPlotRange(double minLambda, double maxLambda)
          Method to set the range of a plot.
 void setPlotRange(WaveLengthFunction f)
          Method to set the range of a plot from another WaveLengthFunction.
 void toGraph(int ds)
          Method to plot and automatically popup a basic graph of the function using PtPlot.
 void toPlot(int ds)
          Method to plot the function to an internal Plot class.
 void toPlot(ptolemy.plot.Plot p, int ds)
          Void method to add a line to a ptplot Plot dataset using the default wavelength range.
 void toPlot(ptolemy.plot.Plot p, int ds, double minLambda, double maxLambda)
          Void method to add a line to a ptplot Plot dataset
 
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, toString, wait, wait, wait
 

Field Detail

plotPoints

protected static int plotPoints
Propected static to control the numbers of points on the graphs


minPlotLambda

protected double minPlotLambda
Propected double the graph minumum.


maxPlotLambda

protected double maxPlotLambda
Propected double the graph minumum.

Constructor Detail

WaveLengthFunction

public WaveLengthFunction()
Method Detail

getValue

public abstract double getValue(double lambda)
Method to get the value at specific wavelength. Needs to be defined in extending classes.

Parameters:
lambda - the wavelength
Returns:
double the value

getPlotPoints

public int getPlotPoints()
Method to get the current number of points in a plot.

Returns:
int number of points in a plot

setPlotPoints

public void setPlotPoints(int points)
Method to set the number of point in all subsequent plots. The default is 100.

Parameters:
points - number of points.

getPlot

public ptolemy.plot.Plot getPlot()
Method to get the Plot object. This may be null if no graph has been asked for.

Returns:
Plot the internal plot object.

setPlotRange

public void setPlotRange(double minLambda,
                         double maxLambda)
Method to set the range of a plot.

Parameters:
minLambda - minimum wavelength
maxLambda - maximum wavelnegth

setPlotRange

public void setPlotRange(WaveLengthFunction f)
Method to set the range of a plot from another WaveLengthFunction.

Parameters:
f - the WaveLengthFunction.

toPlot

public void toPlot(int ds)
Method to plot the function to an internal Plot class. If this is the first plot, then the Plot object will be automatically created.

Parameters:
ds - the data set

toPlot

public void toPlot(ptolemy.plot.Plot p,
                   int ds)
Void method to add a line to a ptplot Plot dataset using the default wavelength range.

Parameters:
p - the Plot to which it is added
ds - the dataset to hold the spectrum

toPlot

public void toPlot(ptolemy.plot.Plot p,
                   int ds,
                   double minLambda,
                   double maxLambda)
Void method to add a line to a ptplot Plot dataset

Parameters:
p - the Plot to which it is added
ds - the dataset to hold the spectrum
minLambda - minimum wavelength in microns
maxLambda - maximum wavelength in microns

toGraph

public void toGraph(int ds)
Method to plot and automatically popup a basic graph of the function using PtPlot.