public class ProfileData
extends java.lang.Object
Encapsulation of generic beam profile measurement data. This data set consists of
sampled data representing projections of the beam distribution from multiple
viewing angles. The number of angles depends upon the number of "wire" orientations
available on the diagnostic device. Currently the viewing angles are enumerated with
the Java enumeration Angle
.
Also contained in this data set are the axes positions for each projection sample. Specifically, each projection has an associated vector of axis positions where the sample was taken. Moreover, a time stamp for the data and the device identifier for the source of the data is stored.
NOTES:
- Currently there are no initializing constructors, or public constructors
for that matter. There is a create(String, Date, int)
static method for
directly instantiating objects of this type. The thinking here is that sub-classes
for the particular diagnostic device will handle initializing construction. Thus, if
you wish to create a ProfileData
object directly, you must call the factory
method create(String, Data, int)
then pack the data using the setter methods.
Modifier and Type | Class and Description |
---|---|
static class |
ProfileData.Angle
Enumeration of supported projection-data view angles.
|
static class |
ProfileData.DeviceType
Enumeration of known profile measurement device types.
|
Modifier | Constructor and Description |
---|---|
protected |
ProfileData(int szArrData)
Deprecated.
|
protected |
ProfileData(java.lang.String strDevId,
java.util.Date dateTmStamp,
int szArrData)
Create a new, uninitialized instance of
ProfileData , reserving
the given amount of space for data. |
Modifier and Type | Method and Description |
---|---|
static ProfileData |
copy(ProfileData dataOrg)
Make and return a deep copy of the given data set.
|
static ProfileData |
create(java.lang.String strDevId,
java.util.Date dateTmStamp,
int szArrData)
Create a new, uninitialized instance of
ProfileData , reserving
the given amount of space for data. |
boolean |
equals(java.lang.Object objData)
Check to see that given object is either this object, or contains
exactly the same data.
|
double |
getActuatorPositionAt(int index)
Returns the actuator position at given index.
|
double[] |
getActuatorPositions()
Returns the vector array of axis positions for each data value.
|
double |
getAxisPositionAt(ProfileData.Angle view,
int index)
Returns the axis position at given index for the given viewing
angle.
|
double[] |
getAxisPositions(ProfileData.Angle view)
Returns the vector array of axis positions for each data value.
|
java.lang.String |
getComment()
Return the comment string associated with this data.
|
int |
getDataSize()
Return the size of each data vector.
|
java.lang.String |
getDeviceId()
Return measurement device for this data.
|
ProfileData.DeviceType |
getDeviceType()
Return the measurement device type for this data.
|
double[] |
getProjection(ProfileData.Angle view)
Returns the projection data array for the given viewing angle.
|
double |
getProjectionAt(ProfileData.Angle view,
int index)
Returns the value of given projection data at given index.
|
int |
getPvLoggerId()
Return the Process Variable Logger (PVLogger) record identifier
for the machine configuration when this data was taken
|
java.util.Date |
getTimeStamp()
Returns the time and date when the measurement was initiated.
|
int |
hashCode() |
boolean |
hasMissingData()
Return the missing data flag.
|
void |
setActuatorPositionAt(int index,
double dblVal)
Set the actuator position for the given sample index.
|
void |
setActuatorPositions(double[] arrVals)
Set the entire actuator position vector.
|
void |
setActuatorPositions(java.util.List<java.lang.Double> lstVals)
Set the entire actuator position vector.
|
void |
setAllProjectionsAt(int index,
java.lang.Double... argPrj)
Sets all the projection data at the given index.
|
void |
setAxisPositionAt(ProfileData.Angle view,
int index,
double dblVal)
Set axis position at the given index.
|
void |
setAxisPositions(ProfileData.Angle view,
double[] arrVals)
Set the entire axis position vector for the given viewing angle.
|
void |
setAxisPositions(ProfileData.Angle view,
java.util.List<java.lang.Double> lstVals)
Set the entire axis position data array for the given projection angle.
|
void |
setProjection(ProfileData.Angle view,
double[] arrVals)
Set the entire projection data array.
|
void |
setProjection(ProfileData.Angle view,
java.util.List<java.lang.Double> lstVals)
Set the entire projection data array.
|
void |
setProjectionAt(ProfileData.Angle view,
int index,
double dblVal)
Set given view profile value at index.
|
java.lang.String |
toString()
Write out the contents of this data structure to a string.
|
@Deprecated protected ProfileData(int szArrData)
ProfileData
, reserving
the given amount of space for data.szArrData
- the size of each data arrayprotected ProfileData(java.lang.String strDevId, java.util.Date dateTmStamp, int szArrData)
ProfileData
, reserving
the given amount of space for data.strDevId
- profile measurement device identifierdateTmStamp
- measurement date of dataszArrData
- the size of each data arraypublic static ProfileData create(java.lang.String strDevId, java.util.Date dateTmStamp, int szArrData)
Create a new, uninitialized instance of ProfileData
, reserving
the given amount of space for data.
strDevId
- profile measurement device identifierdateTmStamp
- measurement date of dataszArrData
- the size of each data arraypublic static ProfileData copy(ProfileData dataOrg)
dataOrg
- original data setpublic void setActuatorPositionAt(int index, double dblVal) throws java.lang.ArrayIndexOutOfBoundsException
index
- index of the actuator position arraydblVal
- new value for the actuator positionjava.lang.ArrayIndexOutOfBoundsException
- index larger than storage capacitypublic void setActuatorPositions(double[] arrVals) throws java.lang.ArrayIndexOutOfBoundsException
ProfileData#allocStorage(int)
.arrVals
- array of actuator positionsjava.lang.ArrayIndexOutOfBoundsException
- list size not equal storage allocatedpublic void setActuatorPositions(java.util.List<java.lang.Double> lstVals) throws java.lang.ArrayIndexOutOfBoundsException
ProfileData#allocStorage(int)
.lstVals
- ordered list of actuator positionsjava.lang.ArrayIndexOutOfBoundsException
- list size not equal storage allocatedpublic void setAxisPositionAt(ProfileData.Angle view, int index, double dblVal) throws java.lang.ArrayIndexOutOfBoundsException
view
- viewing angleindex
- index of the axis position arraydblVal
- new value for the position at indexjava.lang.ArrayIndexOutOfBoundsException
- index larger than storage capacitypublic void setAxisPositions(ProfileData.Angle view, double[] arrVals) throws java.lang.ArrayIndexOutOfBoundsException
ProfileData#allocStorage(int)
.view
- viewing anglearrVals
- array of axis positionsjava.lang.ArrayIndexOutOfBoundsException
- list size not equal storage allocatedpublic void setAxisPositions(ProfileData.Angle view, java.util.List<java.lang.Double> lstVals) throws java.lang.ArrayIndexOutOfBoundsException
ProfileData#allocStorage
.view
- viewing anglelstVals
- ordered list of axis positionsjava.lang.ArrayIndexOutOfBoundsException
- list size not equal storage allocatedpublic void setProjectionAt(ProfileData.Angle view, int index, double dblVal) throws java.lang.ArrayIndexOutOfBoundsException
view
- viewing angleindex
- index of the profile arraydblVal
- new value of profile at indexjava.lang.ArrayIndexOutOfBoundsException
- index larger than storage capacitypublic void setAllProjectionsAt(int index, java.lang.Double... argPrj) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
ProfileData.View
.index
- index of the axis position arrayargPrj
- projection values, one for each projection viewjava.lang.ArrayIndexOutOfBoundsException
- index larger than storage capacityjava.lang.IllegalArgumentException
- wrong number of projection valuesgov.sns.tools.data.profile.ProfileData.Angle
public void setProjection(ProfileData.Angle view, double[] arrVals) throws java.lang.ArrayIndexOutOfBoundsException
ProfileData#allocStorage(int)
.view
- projection view anglearrVals
- array of projection datajava.lang.ArrayIndexOutOfBoundsException
- data size not equal storage allocatedpublic void setProjection(ProfileData.Angle view, java.util.List<java.lang.Double> lstVals) throws java.lang.ArrayIndexOutOfBoundsException
ProfileData#allocStorage(int)
.view
- projection view anglelstVals
- ordered list of projection datajava.lang.ArrayIndexOutOfBoundsException
- list size not equal storage allocatedpublic java.lang.String getDeviceId()
public ProfileData.DeviceType getDeviceType()
public boolean hasMissingData()
true
then this
data set contains missing points which are represented with the
value Double.NaN
. Otherwise, the data set is
complete.public java.util.Date getTimeStamp()
public int getPvLoggerId()
public java.lang.String getComment()
public int getDataSize()
public double[] getActuatorPositions()
public double getActuatorPositionAt(int index)
Returns the actuator position at given index.
NOTE: For the sake of speed, there is no error checking here. Any bounds overruns bubble up from here.
index
- index of the position vectorpublic double[] getAxisPositions(ProfileData.Angle view)
view
- projection viewing anglepublic double getAxisPositionAt(ProfileData.Angle view, int index)
Returns the axis position at given index for the given viewing angle.
NOTE: For the sake of speed, there is no error checking here. Any bounds overruns bubble up from here.
view
- projection viewing angleindex
- index of the position vectorpublic double[] getProjection(ProfileData.Angle view)
view
- projection viewing anglepublic double getProjectionAt(ProfileData.Angle view, int index)
Returns the value of given projection data at given index.
NOTE: For the sake of speed, there is no error checking here. Any bounds overruns bubble up from here.
view
- projection viewing angleindex
- index of the projection data vectorpublic boolean equals(java.lang.Object objData)
equals
in class java.lang.Object
objData
- object under comparisonthis
or contains the same dataObject.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()