Class ProfileData
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.
- Author:
- Christopher K. Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration of supported projection-data view angles.static enum
Enumeration of known profile measurement device types. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ProfileData
(int szArrData) Deprecated.protected
ProfileData
(String strDevId, Date dateTmStamp, int szArrData) Create a new, uninitialized instance ofProfileData
, reserving the given amount of space for data. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProfileData
copy
(ProfileData dataOrg) Make and return a deep copy of the given data set.static ProfileData
Create a new, uninitialized instance ofProfileData
, reserving the given amount of space for data.boolean
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[]
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[]
Returns the vector array of axis positions for each data value.Return the comment string associated with this data.int
Return the size of each data vector.Return measurement device for this data.Return the measurement device type for this data.double[]
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
Return the Process Variable Logger (PVLogger) record identifier for the machine configuration when this data was takenReturns the time and date when the measurement was initiated.int
hashCode()
boolean
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
(List<Double> lstVals) Set the entire actuator position vector.void
setAllProjectionsAt
(int index, 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, List<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, List<Double> lstVals) Set the entire projection data array.void
setProjectionAt
(ProfileData.Angle view, int index, double dblVal) Set given view profile value at index.toString()
Write out the contents of this data structure to a string.
-
Constructor Details
-
ProfileData
Deprecated.Create a new, uninitialized instance ofProfileData
, reserving the given amount of space for data.- Parameters:
szArrData
- the size of each data array
-
ProfileData
Create a new, uninitialized instance ofProfileData
, reserving the given amount of space for data.- Parameters:
strDevId
- profile measurement device identifierdateTmStamp
- measurement date of dataszArrData
- the size of each data array
-
-
Method Details
-
create
Create a new, uninitialized instance of
ProfileData
, reserving the given amount of space for data.- Parameters:
strDevId
- profile measurement device identifierdateTmStamp
- measurement date of dataszArrData
- the size of each data array- Returns:
- An empty single-device data structure ready for population.
-
copy
Make and return a deep copy of the given data set.- Parameters:
dataOrg
- original data set- Returns:
- deep copy of given data
-
setActuatorPositionAt
Set the actuator position for the given sample index.- Parameters:
index
- index of the actuator position arraydblVal
- new value for the actuator position- Throws:
ArrayIndexOutOfBoundsException
- index larger than storage capacity
-
setActuatorPositions
Set the entire actuator position vector. This is a copy operation, not a set by reference. Note further that the given array must have length equal to the storage specified byProfileData#allocStorage(int)
.- Parameters:
arrVals
- array of actuator positions- Throws:
ArrayIndexOutOfBoundsException
- list size not equal storage allocated
-
setActuatorPositions
Set the entire actuator position vector. Note that the given list must have length equal to the storage specified byProfileData#allocStorage(int)
.- Parameters:
lstVals
- ordered list of actuator positions- Throws:
ArrayIndexOutOfBoundsException
- list size not equal storage allocated
-
setAxisPositionAt
public void setAxisPositionAt(ProfileData.Angle view, int index, double dblVal) throws ArrayIndexOutOfBoundsException Set axis position at the given index.- Parameters:
view
- viewing angleindex
- index of the axis position arraydblVal
- new value for the position at index- Throws:
ArrayIndexOutOfBoundsException
- index larger than storage capacity
-
setAxisPositions
public void setAxisPositions(ProfileData.Angle view, double[] arrVals) throws ArrayIndexOutOfBoundsException Set the entire axis position vector for the given viewing angle. This is a copy operation, not a set by reference. Note further that the given array must have length equal to the storage specified byProfileData#allocStorage(int)
.- Parameters:
view
- viewing anglearrVals
- array of axis positions- Throws:
ArrayIndexOutOfBoundsException
- list size not equal storage allocated
-
setAxisPositions
public void setAxisPositions(ProfileData.Angle view, List<Double> lstVals) throws ArrayIndexOutOfBoundsException Set the entire axis position data array for the given projection angle. Note that the given list must have length equal to the storage specified byProfileData#allocStorage
.- Parameters:
view
- viewing anglelstVals
- ordered list of axis positions- Throws:
ArrayIndexOutOfBoundsException
- list size not equal storage allocated
-
setProjectionAt
public void setProjectionAt(ProfileData.Angle view, int index, double dblVal) throws ArrayIndexOutOfBoundsException Set given view profile value at index.- Parameters:
view
- viewing angleindex
- index of the profile arraydblVal
- new value of profile at index- Throws:
ArrayIndexOutOfBoundsException
- index larger than storage capacity
-
setAllProjectionsAt
public void setAllProjectionsAt(int index, Double... argPrj) throws ArrayIndexOutOfBoundsException, IllegalArgumentException Sets all the projection data at the given index. The variable argument list must contain only entry perProfileData.View
.- Parameters:
index
- index of the axis position arrayargPrj
- projection values, one for each projection view- Throws:
ArrayIndexOutOfBoundsException
- index larger than storage capacityIllegalArgumentException
- wrong number of projection values- See Also:
-
gov.sns.tools.data.profile.ProfileData.Angle
-
setProjection
public void setProjection(ProfileData.Angle view, double[] arrVals) throws ArrayIndexOutOfBoundsException Set the entire projection data array. This is a copy operation, not a set by reference. Note further that the given array must have length equal to the storage specified byProfileData#allocStorage(int)
.- Parameters:
view
- projection view anglearrVals
- array of projection data- Throws:
ArrayIndexOutOfBoundsException
- data size not equal storage allocated
-
setProjection
public void setProjection(ProfileData.Angle view, List<Double> lstVals) throws ArrayIndexOutOfBoundsException Set the entire projection data array. Note that the given list must have length equal to the storage specified byProfileData#allocStorage(int)
.- Parameters:
view
- projection view anglelstVals
- ordered list of projection data- Throws:
ArrayIndexOutOfBoundsException
- list size not equal storage allocated
-
getDeviceId
Return measurement device for this data.- Returns:
- the device identifier associated with this data
-
getDeviceType
Return the measurement device type for this data.- Returns:
- the device type associated with this data
-
hasMissingData
public boolean hasMissingData()Return the missing data flag. Iftrue
then this data set contains missing points which are represented with the valueDouble.NaN
. Otherwise, the data set is complete.- Returns:
- true if data set contains missing data points.
-
getTimeStamp
Returns the time and date when the measurement was initiated.- Returns:
- the time stamp of this data
-
getPvLoggerId
public int getPvLoggerId()Return the Process Variable Logger (PVLogger) record identifier for the machine configuration when this data was taken- Returns:
- PVLogger snapshot id
-
getComment
Return the comment string associated with this data.- Returns:
- user comment string or null if none
-
getDataSize
public int getDataSize()Return the size of each data vector.- Returns:
- data vector length.
-
getActuatorPositions
public double[] getActuatorPositions()Returns the vector array of axis positions for each data value.- Returns:
- array of axis positions
-
getActuatorPositionAt
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.
- Parameters:
index
- index of the position vector- Returns:
- axis position at index
-
getAxisPositions
Returns the vector array of axis positions for each data value.- Parameters:
view
- projection viewing angle- Returns:
- array of axis positions
-
getAxisPositionAt
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.
- Parameters:
view
- projection viewing angleindex
- index of the position vector- Returns:
- axis position at index
-
getProjection
Returns the projection data array for the given viewing angle.- Parameters:
view
- projection viewing angle- Returns:
- projection data array
-
getProjectionAt
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.
- Parameters:
view
- projection viewing angleindex
- index of the projection data vector- Returns:
- projection data value at index
-
equals
Check to see that given object is either this object, or contains exactly the same data. -
hashCode
public int hashCode() -
toString
Write out the contents of this data structure to a string.
-