|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.science.AbstractScienceObject
jsky.science.AbstractScienceObjectNode
jsky.science.AbstractWavelength1D
public abstract class AbstractWavelength1D
Abstract class that provides initial functionality for Wavelength1DModel without committing to the underlying storage structure of the dataset.
This code was originally developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project for Next Generation Space Telescope (NGST).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class jsky.science.AbstractScienceObject |
---|
AbstractScienceObject.EventMonitor |
Field Summary | |
---|---|
protected java.lang.String |
fFluxUnits
|
static java.lang.String |
MAXWAVELENGTH_PROPERTY
|
static java.lang.String |
MINWAVELENGTH_PROPERTY
|
static java.lang.String |
NUMPOINTS_PROPERTY
|
Fields inherited from class jsky.science.AbstractScienceObjectNode |
---|
cloneIndent |
Fields inherited from interface jsky.science.ScienceObjectNodeModel |
---|
DATA_SOURCE_PROPERTY, MORE_DATA_PROPERTY |
Fields inherited from interface jsky.science.ScienceObjectModel |
---|
NAME_PROPERTY, PENDING_PROPERTY, VALID_PROPERTY |
Constructor Summary | |
---|---|
AbstractWavelength1D()
|
|
AbstractWavelength1D(java.lang.String name)
|
Method Summary | |
---|---|
protected double |
calcArea(double xl,
double xr,
double yl,
double yr,
boolean interpolate)
Calculates the area under a curve of rectangle define by lower left and upper right coordinates. |
protected double |
calculateArea(double[] wlArray,
double[] dataArray,
Wavelength minWl,
Wavelength maxWl,
boolean interpolate)
|
double |
getArea()
Calls getArea(true); |
double |
getArea(boolean interpolate)
Returns the area "under the curve" of the model from the specified minimum to maximum wavelengths. |
double |
getArea(Wavelength minWl,
Wavelength maxWl)
use getArea( minwavelength, maxwavelength, interpolate) instead |
double |
getArea(Wavelength minWl,
Wavelength maxWl,
boolean interpolate)
Returns the area "under the curve" of the model from the specified minimum to maximum wavelengths. |
java.lang.String |
getFluxUnits()
returns the units string for the data values in the model. |
protected int |
getIndexOf(double wl,
double[] wlArray)
Looks up the index of a specified wavelength in the dataset to have a wavelength greater/equal to specified wavelength. |
protected int |
getIndexOf(double targetWl,
double[] wlArray,
boolean exactOnly)
Looks up the index of a specified wavelength in the dataset to have a wavelength greater/equal to specified wavelength (as a double). |
protected int |
getIndexOf(Wavelength wl,
double[] wlArray)
Looks up the index of a specified wavelength in the dataset to have a wavelength greater/equal to specified wavelength. |
protected int |
getIndexOf(Wavelength wl,
double[] wlArray,
boolean exactOnly)
Looks up the index of a specified wavelength in the dataset to have a wavelength greater/equal to specified wavelength. |
boolean |
isEditable()
Default implementation: returns false |
void |
setFluxUnits(java.lang.String units)
a DUMMY implementation: Saves the string but does NOTHING with it. |
void |
setValue(Wavelength inWl,
double newVal)
default implementation, does nothing |
double[] |
toArrayData(double[] wllist)
Default implementation for returning an array of data values for a specified set of wavelength values. |
double[] |
toArrayWavelengths(Wavelength minWL,
Wavelength maxWL,
int nPts)
passes current default wavelength units down into the real workhorse |
Methods inherited from class jsky.science.AbstractScienceObjectNode |
---|
addChild, clone, equals, getChildren, getDataSource, indexOfChild, initializeTransients, isHolding, isMoreDataAvailable, isPending, isUpToDate, isValid, namedClone, processUpdates, removeAllChildren, removeChild, repeat, replaceChild, replaceObject, requestMoreData, retrieveMoreData, saveAsText, saveAsText, setDataSource, setHolding, setMoreDataAvailable, setPending, setTracing, setUpdatesPending, update |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jsky.science.Wavelength1DModel |
---|
addPropertyChangeListener, getNumPoints, getValue, removePropertyChangeListener, toArrayData, toArrayWavelengths |
Methods inherited from interface jsky.science.ScienceObjectNodeModel |
---|
addChild, getChildren, getDataSource, isMoreDataAvailable, isPending, removeAllChildren, removeChild, replaceChild, requestMoreData, retrieveMoreData, setDataSource, setMoreDataAvailable |
Methods inherited from interface jsky.science.ScienceObjectModel |
---|
clearAllListeners, clone, firePropertyChange, getException, getLabel, getName, getParent, isHolding, isTracing, isValid, setException, setHolding, setName, setParent, setTracing |
Methods inherited from interface jsky.util.ReplaceablePropertyChangeListener |
---|
replaceObject |
Methods inherited from interface java.beans.PropertyChangeListener |
---|
propertyChange |
Field Detail |
---|
public static final java.lang.String NUMPOINTS_PROPERTY
public static final java.lang.String MINWAVELENGTH_PROPERTY
public static final java.lang.String MAXWAVELENGTH_PROPERTY
protected java.lang.String fFluxUnits
Constructor Detail |
---|
public AbstractWavelength1D()
public AbstractWavelength1D(java.lang.String name)
Method Detail |
---|
public double getArea()
getArea
in interface Wavelength1DModel
public double getArea(Wavelength minWl, Wavelength maxWl)
getArea
in interface Wavelength1DModel
public double getArea(boolean interpolate)
getArea
in interface Wavelength1DModel
interpolate
- when true, the data points are treated as points
on a curve and the area calculation uses linear interpolation between
points. When false, the data points are treated as "bins" with no
interpolation between points.public double getArea(Wavelength minWl, Wavelength maxWl, boolean interpolate)
getArea
in interface Wavelength1DModel
minWl
- the starting wavelength for areamaxWl
- the maximum wavelength for calculations.interpolate
- When true, the data points are treated as points
on a curve and the area calculation uses linear interpolation between
points. When false, the data points are treated as "bins" with no
interpolation between points.
This method may be overridden by subclasses (such as Wavelength1DArray) to create a more efficient array of wavelengths and data values to pass to the main calculateArea() method
protected double calculateArea(double[] wlArray, double[] dataArray, Wavelength minWl, Wavelength maxWl, boolean interpolate)
wlArray
- array of doubles representing the wavelength valuesdataArray
- minWl
- the starting wavelength for areamaxWl
- the maximum wavelength for calculations.interpolate
- When true, the data points are treated as points
on a curve and the area calculation uses linear interpolation between
points. When false, the data points are treated as "bins" with no
interpolation between points.protected double calcArea(double xl, double xr, double yl, double yr, boolean interpolate)
protected int getIndexOf(Wavelength wl, double[] wlArray)
Note: this implementation assumes that the wavelength points are monotonically increasing.
wl
- is a target Wavelength in the default units of the datasetwlArray
- is the array of wavelength in double units in which to lockprotected int getIndexOf(double wl, double[] wlArray)
wl
- is a target Wavelength as a double value in the default units of the datasetwlArray
- is the array of wavelength in double units in which to lockprotected int getIndexOf(Wavelength wl, double[] wlArray, boolean exactOnly)
wl
- is a target Wavelength in the default units of the datasetwlArray
- is the array of wavelength in double units in which to lockexactOnly
- when true only exact wavelength matches will be returned, when
false the index of first wavelength >= target will be returned.
search is done on a binary basis for efficiencyprotected int getIndexOf(double targetWl, double[] wlArray, boolean exactOnly)
targetWl
- is a double of the wavelength in the default units of the datasetwlArray
- is the array of wavelength in which to lockexactOnly
- when true only exact wavelength matches will be returned, when
false the index of first wavelength >= target will be returned.
search is done on a binary basis for efficiencypublic boolean isEditable()
isEditable
in interface Wavelength1DModel
public void setValue(Wavelength inWl, double newVal)
setValue
in interface Wavelength1DModel
public double[] toArrayWavelengths(Wavelength minWL, Wavelength maxWL, int nPts)
toArrayWavelengths
in interface Wavelength1DModel
public double[] toArrayData(double[] wllist)
Note: subclasses may be able to override this "brute force" implementation with less resource-intensive implementation
toArrayData
in interface Wavelength1DModel
public void setFluxUnits(java.lang.String units) throws UnitsNotSupportedException
setFluxUnits
in interface Wavelength1DModel
UnitsNotSupportedException
public java.lang.String getFluxUnits()
Wavelength1DModel
getFluxUnits
in interface Wavelength1DModel
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |