public abstract class Wavelength1DFormula extends AbstractWavelength1D
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).
AbstractScienceObject.EventMonitor
Modifier and Type | Field and Description |
---|---|
protected Wavelength |
fMaxWavelength |
protected Wavelength |
fMinWavelength |
protected int |
fNumPoints |
fFluxUnits, MAXWAVELENGTH_PROPERTY, MINWAVELENGTH_PROPERTY, NUMPOINTS_PROPERTY
cloneIndent
DATA_SOURCE_PROPERTY, MORE_DATA_PROPERTY
NAME_PROPERTY, PENDING_PROPERTY, VALID_PROPERTY
Constructor and Description |
---|
Wavelength1DFormula()
Creates a new Wavelength1DFormula, with
default number of points (100 points), and
default wavelength range (100 to 1100 nanometers).
|
Wavelength1DFormula(int inPoints)
Creates a new Wavelength1DFormula of specified number of points,
no name, and default wavelength
range
|
Wavelength1DFormula(String inName)
Creates a new Wavelength1DFormula with specified name and default
number of points and range.
|
Wavelength1DFormula(String inProp,
Wavelength inMin,
Wavelength inMax,
int inPts)
Creates a new Wavelength1DFormula of with specified name,
number of points and wavelength range.
|
Wavelength1DFormula(Wavelength inMin,
Wavelength inMax,
int inPts)
Creates a new Wavelength1DFormula of with no name and specified
number of points and wavelength range.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones this object, and does a DEEP clone on the fChildren.
|
boolean |
equals(Object obj)
After check with superclass, returns true if objects are same Class and
have same min/max and number
of points.
|
Wavelength |
getMaxWavelength() |
Wavelength |
getMinWavelength() |
int |
getNumPoints()
returns the length of the array that would be returned by toArrayWavelengths()
and toArrayData().
|
double |
getValueAtIndex(int i)
This is a trivial implementation that returns the formula value for a
specified index.
|
Wavelength |
getWavelengthAtIndex(int index)
Returns the wavelength data value for specified index as a Wavelength
|
double |
getWavelengthAtIndexAsDouble(int index)
Returns the wavelength data value for specified index
as a double value in the current default wavelength units
|
void |
setMaxWavelength(Wavelength newWL) |
void |
setMinWavelength(Wavelength newWL) |
void |
setNumPoints(int newP)
Changes the length of the array that would be returned by toArrayWavelengths()
and toArrayData().
|
void |
setPending(boolean b)
overriding to public access
|
double[] |
toArrayData()
Returns an array of doubles containing containing the formula's value
for each wavelength returned by toArrayWavelengths().
|
double[] |
toArrayWavelengths()
Creates an array of doubles containing wavelength values at even intervals
across the min/max wavelength of the object and of size
getNumPoints()
|
calcArea, calculateArea, getArea, getArea, getArea, getArea, getFluxUnits, getIndexOf, getIndexOf, getIndexOf, getIndexOf, isEditable, setFluxUnits, setValue, toArrayData, toArrayWavelengths
addChild, getChildren, getDataSource, indexOfChild, initializeTransients, isHolding, isMoreDataAvailable, isPending, isUpToDate, isValid, namedClone, processUpdates, removeAllChildren, removeChild, repeat, replaceChild, replaceObject, requestMoreData, retrieveMoreData, saveAsText, saveAsText, setDataSource, setHolding, setMoreDataAvailable, setTracing, setUpdatesPending, update
addEventMonitor, addPropertyChangeListener, areNamesEqual, clearAllListeners, compareTo, createDefaultName, firePropertyChange, firePropertyChange, fireReplaceObject, fireReplaceObject, fireReplaceObject, fireVetoableChange, fireVetoableChange, getException, getLabel, getName, getObjectIdString, getObjectIdString, getParent, isTracing, notifyEventMonitors, propertyChange, removeEventMonitor, removePropertyChangeListener, replaceObjectNYI, setException, setName, setParent, setTraceAll, toString, writeDebug, writeError
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, getValue, removePropertyChangeListener, toArrayData, toArrayWavelengths
addChild, getChildren, getDataSource, isMoreDataAvailable, isPending, removeAllChildren, removeChild, replaceChild, requestMoreData, retrieveMoreData, setDataSource, setMoreDataAvailable
clearAllListeners, firePropertyChange, getException, getLabel, getName, getParent, isHolding, isTracing, isValid, setException, setHolding, setName, setParent, setTracing
replaceObject
propertyChange
protected Wavelength fMinWavelength
protected Wavelength fMaxWavelength
protected int fNumPoints
public Wavelength1DFormula()
public Wavelength1DFormula(int inPoints)
public Wavelength1DFormula(String inName)
public Wavelength1DFormula(Wavelength inMin, Wavelength inMax, int inPts)
inMin
- Minimum Wavelength for the datasetinMax
- Maximum Wavelength for the datasetinPts
- number of points in the datasetpublic Wavelength1DFormula(String inProp, Wavelength inMin, Wavelength inMax, int inPts)
inName
- Name of the datasetinMin
- Minimum Wavelength for the datasetinMax
- Maximum Wavelength for the datasetinPts
- number of points in the datasetpublic Object clone()
AbstractScienceObjectNode
NOTE: for subclasses! If a subclass has a separate variable or list that points at fChildren, remember that after this clone() method is completed all fChildren will have also been cloned.
So subclasses may need to "repoint" variables or elemenets of lists that reference child objects, but should NOT re-clone those children.
See ExposureGroup.clone() and Exposure.clone() as examples of classes that need to re-proint existing pointers to correctly point at the correct elements.
clone
in interface ScienceObjectModel
clone
in class AbstractScienceObjectNode
public boolean equals(Object obj)
equals
in class AbstractScienceObjectNode
public Wavelength getMinWavelength()
public Wavelength getMaxWavelength()
public void setMinWavelength(Wavelength newWL)
public void setMaxWavelength(Wavelength newWL)
public void setPending(boolean b)
setPending
in class AbstractScienceObjectNode
public double[] toArrayData()
public double[] toArrayWavelengths()
public Wavelength getWavelengthAtIndex(int index)
public double getWavelengthAtIndexAsDouble(int index)
public double getValueAtIndex(int i)
However, if you have an array of wavelength values that you are "sharing" across several different Wavelength1DFormula, then overriding this method to define the formula's functionality, and then writing getValue to reference this method may be computationally much faster. See SEA's ExpCalcSpectroscopy for an example.
public void setNumPoints(int newP)
public int getNumPoints()
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.