Class ProfileData

java.lang.Object
xal.extension.wirescan.profile.ProfileData

public class ProfileData extends 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.

Author:
Christopher K. Allen
  • Constructor Details

    • ProfileData

      @Deprecated protected ProfileData(int szArrData)
      Deprecated.
      Create a new, uninitialized instance of ProfileData, reserving the given amount of space for data.
      Parameters:
      szArrData - the size of each data array
    • ProfileData

      protected ProfileData(String strDevId, Date dateTmStamp, int szArrData)
      Create a new, uninitialized instance of ProfileData, reserving the given amount of space for data.
      Parameters:
      strDevId - profile measurement device identifier
      dateTmStamp - measurement date of data
      szArrData - the size of each data array
  • Method Details

    • create

      public static ProfileData create(String strDevId, Date dateTmStamp, int szArrData)

      Create a new, uninitialized instance of ProfileData, reserving the given amount of space for data.

      Parameters:
      strDevId - profile measurement device identifier
      dateTmStamp - measurement date of data
      szArrData - the size of each data array
      Returns:
      An empty single-device data structure ready for population.
    • copy

      public static ProfileData copy(ProfileData dataOrg)
      Make and return a deep copy of the given data set.
      Parameters:
      dataOrg - original data set
      Returns:
      deep copy of given data
    • setActuatorPositionAt

      public void setActuatorPositionAt(int index, double dblVal) throws ArrayIndexOutOfBoundsException
      Set the actuator position for the given sample index.
      Parameters:
      index - index of the actuator position array
      dblVal - new value for the actuator position
      Throws:
      ArrayIndexOutOfBoundsException - index larger than storage capacity
    • setActuatorPositions

      public void setActuatorPositions(double[] arrVals) throws ArrayIndexOutOfBoundsException
      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 by ProfileData#allocStorage(int).
      Parameters:
      arrVals - array of actuator positions
      Throws:
      ArrayIndexOutOfBoundsException - list size not equal storage allocated
    • setActuatorPositions

      public void setActuatorPositions(List<Double> lstVals) throws ArrayIndexOutOfBoundsException
      Set the entire actuator position vector. Note that the given list must have length equal to the storage specified by ProfileData#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 angle
      index - index of the axis position array
      dblVal - 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 by ProfileData#allocStorage(int).
      Parameters:
      view - viewing angle
      arrVals - 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 by ProfileData#allocStorage.
      Parameters:
      view - viewing angle
      lstVals - 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 angle
      index - index of the profile array
      dblVal - 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 per ProfileData.View.
      Parameters:
      index - index of the axis position array
      argPrj - projection values, one for each projection view
      Throws:
      ArrayIndexOutOfBoundsException - index larger than storage capacity
      IllegalArgumentException - 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 by ProfileData#allocStorage(int).
      Parameters:
      view - projection view angle
      arrVals - 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 by ProfileData#allocStorage(int).
      Parameters:
      view - projection view angle
      lstVals - ordered list of projection data
      Throws:
      ArrayIndexOutOfBoundsException - list size not equal storage allocated
    • getDeviceId

      public String getDeviceId()
      Return measurement device for this data.
      Returns:
      the device identifier associated with this data
    • getDeviceType

      public ProfileData.DeviceType 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. If true then this data set contains missing points which are represented with the value Double.NaN. Otherwise, the data set is complete.
      Returns:
      true if data set contains missing data points.
    • getTimeStamp

      public Date 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

      public String 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

      public double[] getAxisPositions(ProfileData.Angle view)
      Returns the vector array of axis positions for each data value.
      Parameters:
      view - projection viewing angle
      Returns:
      array of axis positions
    • getAxisPositionAt

      public 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.

      Parameters:
      view - projection viewing angle
      index - index of the position vector
      Returns:
      axis position at index
    • getProjection

      public double[] getProjection(ProfileData.Angle view)
      Returns the projection data array for the given viewing angle.
      Parameters:
      view - projection viewing angle
      Returns:
      projection data array
    • getProjectionAt

      public 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.

      Parameters:
      view - projection viewing angle
      index - index of the projection data vector
      Returns:
      projection data value at index
    • equals

      public boolean equals(Object objData)
      Check to see that given object is either this object, or contains exactly the same data.
      Overrides:
      equals in class Object
      Parameters:
      objData - object under comparison
      Returns:
      true if objData is this or contains the same data
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Since:
      Feb 3, 2015 by Christopher K. Allen
      See Also:
    • toString

      public String toString()
      Write out the contents of this data structure to a string.
      Overrides:
      toString in class Object
      See Also: