|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.splat.data.AbstractSpecDataImpl
uk.ac.starlink.splat.data.AbstractEditableSpecDataImpl
uk.ac.starlink.splat.data.MEMSpecDataImpl
public class MEMSpecDataImpl
This class provides an implementation of SpecDataImpl to access spectra stored in existing memory. All values are copied into arrays stored in memory.
The main use of this class is for temporary, generated and copied spectra. It also provides the main facilities for spectra that can be modified.
SpecDataImpl
,
EditableSpecData
,
"The Bridge Design Pattern",
Serialized FormField Summary | |
---|---|
protected uk.ac.starlink.ast.FrameSet |
astref
Reference to AST frameset. |
protected double[] |
coords
Reference to coordinates. |
protected double[] |
data
Reference to data values. |
protected double[] |
errors
Reference to data errors. |
protected String |
fullName
Reference to the full name of spectrum. |
protected nom.tam.fits.Header |
headers
Any headers that we're carrying around. |
protected String |
shortName
Reference to the symbolic name of spectrum. |
Fields inherited from class uk.ac.starlink.splat.data.AbstractSpecDataImpl |
---|
dataLabel, dataUnits, parentImpl |
Constructor Summary | |
---|---|
MEMSpecDataImpl(String name)
Constructor - just take a symbolic name for the spectrum, no other significance. |
|
MEMSpecDataImpl(String name,
SpecData spectrum)
Constructor, clone from another spectrum. |
Method Summary | |
---|---|
protected void |
clone(SpecData spectrum)
Clone this spectrum from another spectrum. |
protected void |
copyData(double[] coords,
double[] data,
double[] errors)
Make local copies of any given coordinates, data and errors. |
protected void |
createAst()
Create an default AST FrameSet when we have no information about the coordinate system or data units. |
protected void |
createAst(uk.ac.starlink.ast.Frame baseframe,
uk.ac.starlink.ast.Frame currentframe)
Create an AST FrameSet that relates the spectrum coordinate to
data values positions. |
protected void |
createAst(uk.ac.starlink.ast.FrameSet sourceSet)
Create an AST FrameSet that relates the spectrum coordinate to
data values positions. |
protected void |
createCoords()
Create a set of coordinates that match the current FrameSet. |
protected void |
finalize()
Finalise object. |
uk.ac.starlink.ast.FrameSet |
getAst()
Return reference to AST frameset that defines the coordinate relations used by this spectrum. |
double[] |
getData()
Return a copy of the spectrum data values. |
double[] |
getDataErrors()
Return a copy of the spectrum data errors. |
String |
getDataFormat()
Return the data format. |
int[] |
getDims()
Return the data array dimensionality (always length of spectrum). |
nom.tam.fits.Header |
getFitsHeaders()
Return any FITS headers we have accumulated. |
String |
getFullName()
Return the full name of spectrum. |
String |
getProperty(String prop)
Return a known descriptive label. |
String |
getShortName()
Return a symbolic name. |
void |
save()
Save is just a copy for this class. |
void |
setAst(uk.ac.starlink.ast.FrameSet frameSet)
Set the FrameSet used for the coordinate system. |
void |
setAstCopy(uk.ac.starlink.ast.FrameSet frameSet)
Accept a new FrameSet making a copy of it. |
void |
setFullData(uk.ac.starlink.ast.FrameSet frameSet,
String dataUnits,
double[] data)
Change the spectrum data and WCS. |
void |
setFullData(uk.ac.starlink.ast.FrameSet frameSet,
String dataUnits,
double[] data,
double[] errors)
Change the spectrum data and WCS. |
void |
setFullDataQuick(uk.ac.starlink.ast.FrameSet frameSet,
String dataUnits,
double[] data)
Change the spectrum data and WCS. |
void |
setFullDataQuick(uk.ac.starlink.ast.FrameSet frameSet,
String dataUnits,
double[] data,
double[] errors)
Change the complete spectrum data. |
void |
setSimpleData(double[] coords,
String dataUnits,
double[] data)
Change the complete spectrum data. |
void |
setSimpleData(double[] coords,
String dataUnits,
double[] data,
double[] errors)
Change the complete spectrum data. |
void |
setSimpleDataQuick(double[] coords,
String dataUnits,
double[] data)
Change the complete spectrum data. |
void |
setSimpleDataQuick(double[] coords,
String dataUnits,
double[] data,
double[] errors)
Change the complete spectrum data. |
void |
setSimpleUnitData(uk.ac.starlink.ast.FrameSet sourceSet,
double[] coords,
String dataUnits,
double[] data)
Change the complete spectrum data, but preserving the properties of an existing FrameSet as part of a new FrameSet. |
void |
setSimpleUnitData(uk.ac.starlink.ast.FrameSet sourceSet,
double[] coords,
String dataUnits,
double[] data,
double[] errors)
Change the complete spectrum data, but preserving the properties of an existing FrameSet as part of a new FrameSet. |
void |
setSimpleUnitDataQuick(uk.ac.starlink.ast.FrameSet sourceSet,
double[] coords,
String dataUnits,
double[] data)
Change the complete spectrum data, but preserving the properties of an existing FrameSet as part of a new FrameSet. |
void |
setSimpleUnitDataQuick(uk.ac.starlink.ast.FrameSet sourceSet,
double[] coords,
String dataUnits,
double[] data,
double[] errors)
Change the complete spectrum data, but preserving the properties of an existing FrameSet as part of a new FrameSet. |
void |
setXDataValue(int index,
double value)
Change a coordinate value. |
void |
setYDataErrorValue(int index,
double value)
Change a data error value. |
void |
setYDataValue(int index,
double value)
Change a data value. |
Methods inherited from class uk.ac.starlink.splat.data.AbstractSpecDataImpl |
---|
getColumnNames, getCoordinateColumnName, getDataColumnName, getDataErrorColumnName, getDataLabel, getDataUnits, getParentImpl, isFITSHeaderSource, setCoordinateColumnName, setDataColumnName, setDataErrorColumnName, setDataLabel, setDataUnits, setParentImpl |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface uk.ac.starlink.splat.data.SpecDataImpl |
---|
getColumnNames, getCoordinateColumnName, getDataColumnName, getDataErrorColumnName, getDataLabel, getDataUnits, getParentImpl, isFITSHeaderSource, setCoordinateColumnName, setDataColumnName, setDataErrorColumnName, setDataLabel, setDataUnits, setParentImpl |
Field Detail |
---|
protected double[] coords
protected double[] data
protected double[] errors
protected String shortName
protected String fullName
protected uk.ac.starlink.ast.FrameSet astref
protected nom.tam.fits.Header headers
Constructor Detail |
---|
public MEMSpecDataImpl(String name) throws SplatException
name
- a symbolic name for the spectrum.
SplatException
public MEMSpecDataImpl(String name, SpecData spectrum) throws SplatException
name
- a symbolic name for the spectrum.spectrum
- a SpecData object to copy.
SplatException
Method Detail |
---|
protected void clone(SpecData spectrum) throws SplatException
SplatException
public double[] getData()
getData
in interface SpecDataImpl
getData
in class AbstractSpecDataImpl
public double[] getDataErrors()
getDataErrors
in interface SpecDataImpl
getDataErrors
in class AbstractSpecDataImpl
public String getShortName()
getShortName
in interface SpecDataImpl
getShortName
in class AbstractSpecDataImpl
public String getFullName()
getFullName
in interface SpecDataImpl
getFullName
in class AbstractSpecDataImpl
public int[] getDims()
getDims
in interface SpecDataImpl
getDims
in class AbstractSpecDataImpl
public uk.ac.starlink.ast.FrameSet getAst()
getAst
in interface SpecDataImpl
getAst
in class AbstractSpecDataImpl
public String getDataFormat()
getDataFormat
in interface SpecDataImpl
getDataFormat
in class AbstractSpecDataImpl
public String getProperty(String prop)
getProperty
in interface SpecDataImpl
getProperty
in class AbstractSpecDataImpl
protected void finalize() throws Throwable
finalize
in class Object
Throwable
protected void createAst(uk.ac.starlink.ast.FrameSet sourceSet)
FrameSet
that relates the spectrum coordinate to
data values positions. Using the given FrameSet to define the
coordinate systems of the coordinates and data (the coordinate system is
the current Frame
and the data the base Frame). The FrameSet
should be 1D and if null then default systems will be created.
protected void createAst()
protected void createAst(uk.ac.starlink.ast.Frame baseframe, uk.ac.starlink.ast.Frame currentframe)
FrameSet
that relates the spectrum coordinate to
data values positions. Using the given Frame
's to define the
coordinate systems of the coordinates and data (the coordinate system
is the current and base the data). The Frames should be 1D and if null
then default systems will be created.
public void save() throws SplatException
save
in interface SpecDataImpl
save
in class AbstractSpecDataImpl
SplatException
- never thrown for this implementation.protected void copyData(double[] coords, double[] data, double[] errors) throws SplatException
SplatException
public nom.tam.fits.Header getFitsHeaders()
getFitsHeaders
in interface FITSHeaderSource
public void setSimpleData(double[] coords, String dataUnits, double[] data) throws SplatException
EditableSpecDataImpl
setSimpleData
in interface EditableSpecDataImpl
setSimpleData
in class AbstractEditableSpecDataImpl
coords
- the spectrum coordinates, one per data value.dataUnits
- the data units, if known.data
- the spectrum data values.
SplatException
public void setSimpleUnitData(uk.ac.starlink.ast.FrameSet sourceSet, double[] coords, String dataUnits, double[] data) throws SplatException
EditableSpecDataImpl
setSimpleUnitData
in interface EditableSpecDataImpl
setSimpleUnitData
in class AbstractEditableSpecDataImpl
sourceSet
- the 1D FrameSet to be used for properties. The current
Frame defines the spectrum coordinate system.coords
- the spectrum coordinates, one per data value.dataUnits
- the data units, if known.data
- the spectrum data values.
SplatException
public void setFullData(uk.ac.starlink.ast.FrameSet frameSet, String dataUnits, double[] data) throws SplatException
EditableSpecDataImpl
setFullData
in interface EditableSpecDataImpl
setFullData
in class AbstractEditableSpecDataImpl
frameSet
- the FrameSet to be used for generating
coordinates.dataUnits
- the data units, if known.data
- the spectrum data values.
SplatException
public void setSimpleDataQuick(double[] coords, String dataUnits, double[] data)
EditableSpecDataImpl
setSimpleDataQuick
in interface EditableSpecDataImpl
setSimpleDataQuick
in class AbstractEditableSpecDataImpl
coords
- the spectrum coordinates, one per data value.dataUnits
- the data units, if known.data
- the spectrum data values.public void setSimpleUnitDataQuick(uk.ac.starlink.ast.FrameSet sourceSet, double[] coords, String dataUnits, double[] data)
EditableSpecDataImpl
setSimpleUnitDataQuick
in interface EditableSpecDataImpl
setSimpleUnitDataQuick
in class AbstractEditableSpecDataImpl
sourceSet
- the 1D FrameSet to be used for properties. The current
Frame defines the spectrum coordinate system.coords
- the spectrum coordinates, one per data value.dataUnits
- the data units, if known.data
- the spectrum data values.public void setFullDataQuick(uk.ac.starlink.ast.FrameSet frameSet, String dataUnits, double[] data)
EditableSpecDataImpl
setFullDataQuick
in interface EditableSpecDataImpl
setFullDataQuick
in class AbstractEditableSpecDataImpl
frameSet
- the FrameSet to be used for generating
coordinates.dataUnits
- the data units, if known.data
- the spectrum data values.public void setSimpleData(double[] coords, String dataUnits, double[] data, double[] errors) throws SplatException
EditableSpecDataImpl
setSimpleData
in interface EditableSpecDataImpl
setSimpleData
in class AbstractEditableSpecDataImpl
coords
- the spectrum coordinates, one per data value.dataUnits
- the data units, if known.data
- the spectrum data values.errors
- the errors of the spectrum data values.
SplatException
public void setSimpleUnitData(uk.ac.starlink.ast.FrameSet sourceSet, double[] coords, String dataUnits, double[] data, double[] errors) throws SplatException
EditableSpecDataImpl
setSimpleUnitData
in interface EditableSpecDataImpl
setSimpleUnitData
in class AbstractEditableSpecDataImpl
sourceSet
- the 1D FrameSet to be used for properties. The current
Frame defines the spectrum coordinate system.coords
- the spectrum coordinates, one per data value.dataUnits
- the data units, if known.data
- the spectrum data values.errors
- the errors of the spectrum data values.
SplatException
public void setFullData(uk.ac.starlink.ast.FrameSet frameSet, String dataUnits, double[] data, double[] errors) throws SplatException
EditableSpecDataImpl
setFullData
in interface EditableSpecDataImpl
setFullData
in class AbstractEditableSpecDataImpl
frameSet
- the FrameSet to be used for generating
coordinates.dataUnits
- the data units, if known.data
- the spectrum data values.errors
- the errors of the spectrum data values.
SplatException
public void setSimpleDataQuick(double[] coords, String dataUnits, double[] data, double[] errors)
EditableSpecDataImpl
setSimpleDataQuick
in interface EditableSpecDataImpl
setSimpleDataQuick
in class AbstractEditableSpecDataImpl
coords
- the spectrum coordinates, one per data value.dataUnits
- the data units, if known.data
- the spectrum data values.errors
- the errors of the spectrum data values.public void setSimpleUnitDataQuick(uk.ac.starlink.ast.FrameSet sourceSet, double[] coords, String dataUnits, double[] data, double[] errors)
EditableSpecDataImpl
setSimpleUnitDataQuick
in interface EditableSpecDataImpl
setSimpleUnitDataQuick
in class AbstractEditableSpecDataImpl
sourceSet
- the 1D FrameSet to be used for properties. The current
Frame defines the spectrum coordinate system.coords
- the spectrum coordinates, one per data value.dataUnits
- the data units, if known.data
- the spectrum data values.errors
- the errors of the spectrum data values.public void setFullDataQuick(uk.ac.starlink.ast.FrameSet frameSet, String dataUnits, double[] data, double[] errors)
EditableSpecDataImpl
setFullDataQuick
in interface EditableSpecDataImpl
setFullDataQuick
in class AbstractEditableSpecDataImpl
frameSet
- the FrameSet to be used for generating
coordinates.dataUnits
- the data units, if known.data
- the spectrum data values.errors
- the errors of the spectrum data values.public void setXDataValue(int index, double value) throws SplatException
EditableSpecDataImpl
setXDataValue
in interface EditableSpecDataImpl
setXDataValue
in class AbstractEditableSpecDataImpl
SplatException
public void setYDataValue(int index, double value) throws SplatException
EditableSpecDataImpl
setYDataValue
in interface EditableSpecDataImpl
setYDataValue
in class AbstractEditableSpecDataImpl
SplatException
public void setYDataErrorValue(int index, double value) throws SplatException
EditableSpecDataImpl
setYDataErrorValue
in interface EditableSpecDataImpl
setYDataErrorValue
in class AbstractEditableSpecDataImpl
SplatException
public void setAst(uk.ac.starlink.ast.FrameSet frameSet) throws SplatException
EditableSpecDataImpl
setAst
in interface EditableSpecDataImpl
setAst
in class AbstractEditableSpecDataImpl
SplatException
public void setAstCopy(uk.ac.starlink.ast.FrameSet frameSet)
protected void createCoords()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |