public class TreatmentStep
extends java.lang.Object
Sample
in a
later version of PuffinPlot.
TreatmentStep is a mutable container class which is intended to be instantiated with no or very little data. Most of the fields can be set after instantiation using setter methods.
In terms of PuffinPlot's user interface, a TreatmentStep often defines the position and appearance of a point on one or more of the plots.
TreatmentParameter
Modifier and Type | Class and Description |
---|---|
static class |
TreatmentStep.Reader
This class allows TreatmentStep objects to be created from string
representations of a specified format.
|
Constructor and Description |
---|
TreatmentStep()
Creates a treatment step with no data.
|
TreatmentStep(double x,
double y,
double z)
Creates a treatment step with a specified magnetization vector.
|
TreatmentStep(Vec3 vector)
Creates a treatment step with a supplied magnetization vector.
|
Modifier and Type | Method and Description |
---|---|
static java.util.Set<MeasurementType> |
collectMeasurementTypes(java.util.Collection<TreatmentStep> steps)
Returns a set of all the measurement types of the supplied
treatment steps.
|
java.lang.String |
exportFieldValues(java.util.Collection<TreatmentParameter> fields,
java.lang.String delimiter)
Produces a string containing string representations of the contents
of selected data fields.
|
double |
getAfX()
For AF or ARM treatment, returns the x-axis AF field strength in tesla.
|
double |
getAfY()
For AF or ARM treatment, returns the y-axis AF field strength in tesla.
|
double |
getAfZ()
For AF or ARM treatment, returns the z-axis AF field strength in tesla.
|
double |
getArea()
For continuous measurements, returns the cross-sectional area of the
core.
|
ArmAxis |
getArmAxis()
For ARM treatment, returns the axis of the ARM field.
|
double |
getArmField()
For ARM treatment, returns the ARM bias field strength.
|
java.lang.String |
getDepth()
For continuous measurements, returns the depth of this measurement within
the core.
|
java.lang.String |
getDiscreteId()
For discrete samples, returns the sample identifier (name).
|
java.lang.String |
getFormattedTreatmentLevel()
Returns the treatment level formatted as a string.
|
double |
getFormAz()
Returns the formation dip azimuth.
|
double |
getFormDip()
Returns the formation dip angle.
|
double |
getFormStrike()
Returns the formation strike for this treatment step.
|
java.lang.String |
getIdOrDepth()
Returns sample identifier or measurement depth.
|
double |
getIntensity()
Returns the magnitude of the magnetic dipole moment per unit volume in
A/m.
|
double |
getIrmField()
For IRM treatment, returns the IRM field strength in tesla.
|
Line |
getLine()
Returns the measurement's data-file line.
|
double |
getMagDev()
Returns the local geomagnetic field declination for the sampling site.
|
double |
getMagSus()
Returns the magnetic susceptibility of the sample at this stage of
treatment
|
MeasurementType |
getMeasurementType()
Returns the type of this measurement (discrete or continuous).
|
Vec3 |
getMoment()
Strictly speaking, the name is not quite accurate: we do not deal with
magnetic moment (which would be in Am2) but in magnetic dipole
moment per unit volume (in A/m).
|
Vec3 |
getMoment(Correction correction)
Returns the measured magnetic dipole moment per unit volume, as modified
by the supplied correction.
|
int |
getRunNumber()
Returns the number of the machine run during which this measurement was
made.
|
double |
getSampAz()
Returns the sample's dip azimuth.
|
double |
getSampDip()
Returns the sample's dip angle.
|
double |
getSampHade()
Returns the sample hade for this treatment step.
|
Sample |
getSample()
Returns the sample of which this measurement was made.
|
int |
getSlotNumber()
Returns the number of the measurement tray slot in which the sample was
measured.
|
Suite |
getSuite()
Returns the data suite containing this measurement.
|
double |
getTemperature()
For thermal treatment, returns the temperature in degrees Celsius.
|
java.lang.String |
getTimestamp()
Returns the timestamp of this measurement.
|
double |
getTreatmentLevel()
Returns a numerical representation of the intensity of the treatment
which was applied immediately before this measurement.
|
TreatmentType |
getTreatmentType()
Returns the treatment applied before this measurement (AF, thermal,
etc.).
|
java.lang.String |
getValue(TreatmentParameter field)
Returns a String representation of a value from a specified data field.
|
double |
getVolume()
For discrete measurements, returns the volume of the sample.
|
double |
getXDrift()
Returns the x drift correction value.
|
double |
getYDrift()
Returns the y drift correction value.
|
double |
getZDrift()
Returns the z drift correction value.
|
boolean |
hasMagMoment()
Reports whether the treatment step contains a magnetic moment
measurement.
|
boolean |
hasMagSus()
Reports whether this treatment step has any magnetic susceptibility data.
|
boolean |
ignoreOnLoading()
Returns
true if this treatment step should be ignored (thrown
away) when loading a data file. |
boolean |
isHidden()
Reports whether this treatment step should be hidden on plots.
|
boolean |
isInPca()
Reports whether this measurement is used for a PCA fit.
|
boolean |
isMagSusOnly()
Reports whether this treatment step has magnetic susceptibility but not
magnetic moment data.
|
boolean |
isOnCircle()
Reports whether this measurement is used for a great-circle fit.
|
boolean |
isPcaAnchored()
Reports whether PCA fits for this point should be anchored.
|
boolean |
isSelected()
Reports whether this treatment step is selected.
|
static double |
maxIntensity(java.util.Collection<TreatmentStep> data)
Returns the maximum magnitude of magnetic dipole moment per unit volume
within the supplied group of treatment step objects.
|
static double |
maxMagSus(java.util.Collection<TreatmentStep> data)
Returns the maximum magnetic susceptibility within the supplied group of
treatment step objects.
|
static double |
maxTreatmentLevel(java.util.Collection<TreatmentStep> data)
Returns the maximum treatment level within the supplied group of
treatment step objects.
|
void |
rot180(MeasurementAxis axis)
Rotates magnetic moment data 180 degrees about the specified axis.
|
void |
setAfX(double v)
For AF or ARM treatment, sets the x-axis AF field strength in tesla.
|
void |
setAfY(double v)
For AF or ARM treatment, sets the y-axis AF field strength in tesla.
|
void |
setAfZ(double v)
For AF or ARM treatment, sets the z-axis AF field strength in tesla.
|
void |
setArea(double newArea)
For continuous measurements, sets the cross-sectional area of the core.
|
void |
setArmAxis(ArmAxis axis)
For ARM treatment, sets the axis of the ARM field.
|
void |
setArmField(double field)
For ARM treatment, sets the ARM bias field strength.
|
void |
setDepth(java.lang.String newDepth)
For continuous measurements, sets the depth of this measurement within
the core.
|
void |
setDiscreteId(java.lang.String id)
For discrete samples, sets the sample identifier (name).
|
void |
setFormAz(double azimuth)
Sets the formation dip azimuth.
|
void |
setFormDip(double dip)
Sets the formation dip angle.
|
void |
setFormStrike(double strikeDeg)
Sets the formation strike for this treatment step.
|
void |
setHidden(boolean newHidden)
Sets whether this treatment step should be hidden on plots.
|
void |
setInPca(boolean v)
Sets whether this measurement is to be used for a PCA fit.
|
void |
setIrmField(double field)
For IRM treatment, sets the IRM field strength in tesla.
|
void |
setLine(Line newLine)
Sets the measurement's data-file line.
|
void |
setMagDev(double azimuth)
Sets the local geomagnetic field declination for the sampling site.
|
void |
setMagSus(double newMagSus)
Sets the magnetic susceptibility of the sample at this stage of
treatment.
|
void |
setMeasurementType(MeasurementType type)
Sets the type of this measurement (discrete or continuous).
|
void |
setMoment(Vec3 v)
Sets the sample's magnetic dipole moment per unit volume
in A/m.
|
void |
setMomentToMean(java.util.List<TreatmentStep> treatmentSteps)
Sets the magnetization vector of this datum to the mean of the
magnetization vectors of
data . |
void |
setOnCircle(boolean v)
Sets whether this measurement is to be used for a great-circle fit.
|
void |
setPcaAnchored(boolean isAnchored)
Sets whether PCA fits for this point should be anchored.
|
void |
setRunNumber(int newRunNumber)
Sets the number of the machine run during which this measurement was
made.
|
void |
setSampAz(double v)
Sets the sample's dip azimuth.
|
void |
setSampDip(double dip)
Sets the sample's dip angle.
|
void |
setSampHade(double hadeDeg)
Sets the sample hade for this treatment step.
|
void |
setSample(Sample newSample)
Sets the sample on which this measurement was made.
|
void |
setSelected(boolean v)
Sets the selection state of this treatment step.
|
void |
setSlotNumber(int v)
Sets the number of the measurement tray slot in which the sample was
measured.
|
void |
setSuite(Suite newSuite)
Sets the data suite containing this measurement.
|
void |
setTemperature(double newTemperature)
For thermal treatment, sets the temperature in degrees Celsius.
|
void |
setTimestamp(java.lang.String newTimestamp)
Sets the timestamp of this measurement.
|
void |
setTreatmentType(TreatmentType type)
Sets the treatment applied before this measurement (AF, thermal, etc.).
|
void |
setValue(TreatmentParameter field,
java.lang.String value,
double factor)
Sets the value of a specified treatment parameter using a string.
|
void |
setVolume(double newVolume)
For discrete measurements, sets the volume of the sample.
|
void |
setXDrift(double v)
Sets the x drift correction value.
|
void |
setYDrift(double v)
Sets the y drift correction value.
|
void |
setZDrift(double v)
Sets the z drift correction value.
|
void |
toggleSelected()
Toggles the treatment step's selection state.
|
java.util.List<java.lang.String> |
toStrings()
Produces a list of strings representing the data values within this
treatment step object.
|
java.lang.String |
toSummaryString()
Produce a string summarizing the most important characteristics of this
treatment step: step number, treatment type and level, moment vector (as
declination, inclination, and intensity), and magnetic susceptibility.
|
void |
touch()
Sets this tratment steps's suite as "modified".
|
public TreatmentStep(double x, double y, double z)
x
- x component of the magnetization vectory
- y component of the magnetization vectorz
- z component of the magnetization vectorpublic TreatmentStep(Vec3 vector)
vector
- the magnetization vectorpublic TreatmentStep()
public boolean isSelected()
true
if this treatment step is selectedpublic void setSelected(boolean v)
v
- true
to select this treatment step, false
to
deselectpublic double getSampAz()
public void setSampAz(double v)
v
- the sample dip azimuth to set, in degreespublic double getSampDip()
public void setSampDip(double dip)
dip
- the sample dip angle to set, in degreespublic double getFormAz()
public void setFormAz(double azimuth)
azimuth
- the formation dip azimuth to set, in degreespublic double getFormDip()
public void setFormDip(double dip)
dip
- the formation dip angle to set, in degreespublic double getMagDev()
public void setMagDev(double azimuth)
azimuth
- the local geomagnetic field declination to set, in degreespublic boolean isPcaAnchored()
true
if PCA fits to this point should be anchoredpublic void setPcaAnchored(boolean isAnchored)
isAnchored
- true
to set PCA fits for this point to be
anchoredpublic Line getLine()
public void setLine(Line newLine)
newLine
- the data-file line to set for this measurement; not
currently usedpublic Sample getSample()
public void setSample(Sample newSample)
newSample
- the sample on which this measurement was madepublic boolean isHidden()
true
if this treatment step should not be displayed on
plotspublic void setHidden(boolean newHidden)
newHidden
- true
if this treatment step should not be
displayed on plotspublic java.lang.String getDepth()
public void setDepth(java.lang.String newDepth)
newDepth
- for continuous measurements, the depth of this
measurement within the corepublic double getMagSus()
public void setMagSus(double newMagSus)
newMagSus
- the magnetic susceptibility of the sample at this stage
of treatmentpublic MeasurementType getMeasurementType()
public void setMeasurementType(MeasurementType type)
type
- the type of this measurement (discrete or continuous)public java.lang.String getDiscreteId()
public void setDiscreteId(java.lang.String id)
id
- for discrete samples, the identifier (name) of the samplepublic TreatmentType getTreatmentType()
public void setTreatmentType(TreatmentType type)
type
- the treatment applied before this measurement (AF, thermal,
etc.)public double getAfX()
public void setAfX(double v)
v
- for AF or ARM treatment, the AF field strength in the x axispublic double getAfY()
public void setAfY(double v)
v
- for AF or ARM treatment, the AF field strength in the y axispublic double getAfZ()
public void setAfZ(double v)
v
- for AF or ARM treatment, the AF field strength in the z axispublic double getIrmField()
public void setIrmField(double field)
field
- for IRM treatment, the IRM field strengthpublic double getArmField()
public void setArmField(double field)
field
- for ARM treatment, the ARM bias field strengthpublic ArmAxis getArmAxis()
public void setArmAxis(ArmAxis axis)
axis
- for ARM treatment, the axis of the ARM fieldpublic double getTemperature()
public void setTemperature(double newTemperature)
newTemperature
- for thermal treatment, the temperature in degrees
Celsiuspublic double getArea()
public void setArea(double newArea)
newArea
- the cross-sectional area of the corepublic double getVolume()
public void setVolume(double newVolume)
newVolume
- for discrete measurements, the volume of the samplepublic int getRunNumber()
public void setRunNumber(int newRunNumber)
newRunNumber
- the number of the machine run during which this
measurement was madepublic java.lang.String getTimestamp()
public void setTimestamp(java.lang.String newTimestamp)
newTimestamp
- the timestamp of this measurementpublic double getXDrift()
public void setXDrift(double v)
v
- the x drift correction valuepublic double getYDrift()
public void setYDrift(double v)
v
- the y drift correction valuepublic double getZDrift()
public void setZDrift(double v)
v
- the z drift correction valuepublic int getSlotNumber()
public void setSlotNumber(int v)
v
- the number of the measurement tray slot in which the sample was
measuredpublic Suite getSuite()
public void setSuite(Suite newSuite)
newSuite
- the data suite containing this measurementpublic boolean isOnCircle()
true
if this measurement is used for a great-circle fitpublic void setOnCircle(boolean v)
v
- true
to use this measurement for a great-circle fitpublic boolean isInPca()
true
if this measurement is used for a PCA fitpublic void setInPca(boolean v)
v
- true
to use this measurement for a PCA fitpublic double getSampHade()
public void setSampHade(double hadeDeg)
hadeDeg
- the hade to set, in degreespublic double getFormStrike()
public void setFormStrike(double strikeDeg)
strikeDeg
- the formation strike, in degreespublic java.lang.String getIdOrDepth()
public boolean hasMagSus()
true
if there is magnetic susceptibility data in this
treatment steppublic boolean isMagSusOnly()
true
if this treatment step contains magnetic
susceptibility data and does not contain magnetic moment datapublic Vec3 getMoment()
getMagneticDipoleMomentPerUnitVolumeInAm
would be an
inconveniently long method name.public void setMoment(Vec3 v)
v
- the magnetic dipole moment per unit volume in A/mpublic Vec3 getMoment(Correction correction)
correction
- the corrections to apply to the magnetic moment
measurementpublic void rot180(MeasurementAxis axis)
axis
- the axis about which to perform the rotationpublic void toggleSelected()
step.toggleSelected()
is functionally equivalent to
step.setSelected(!datum.isSelected()
.public double getTreatmentLevel()
For ARM treatment, this method returns the strength of the alternating field rather than the DC bias field.
public java.lang.String getFormattedTreatmentLevel()
public static double maxTreatmentLevel(java.util.Collection<TreatmentStep> data)
data
- a list of treatment step objects; must be non-nulljava.lang.NullPointerException
- if data
is nullpublic static double maxIntensity(java.util.Collection<TreatmentStep> data)
data
- a list of treatment step objects; must be non-nulljava.lang.NullPointerException
- if data
is nullpublic static double maxMagSus(java.util.Collection<TreatmentStep> data)
data
- a list of treatment step objects; must be non-nulljava.lang.NullPointerException
- if data
is nullpublic double getIntensity()
public boolean ignoreOnLoading()
true
if this treatment step should be ignored (thrown
away) when loading a data file. Currently, this method returns true if
the measurement type is NONE
– that is, there is no data within
the object.true
if this treatment step should be ignored when
loading a filepublic boolean hasMagMoment()
true
if the treatment step contains a magnetic moment
measurementpublic java.lang.String getValue(TreatmentParameter field)
field
- the field to read (non-null)java.lang.NullPointerException
- if field
is nullpublic void setValue(TreatmentParameter field, java.lang.String value, double factor)
TreatmentParameter.DEPTH
is
handled as a string, not a double; additionally, supplying a string
containing the text "null"
as a value for the depth will set the
depth to an actual null, not to the string "null"
. For double
and integer fields, the special string "NA" will set the field to
its default value.field
- the field to set the value of (non-null)value
- a string representation of the value to set the field to
(non-null)factor
- conversion factor for double valuesjava.lang.NullPointerException
- if field
or value
is nullpublic java.util.List<java.lang.String> toStrings()
TreatmentParameter.realFields
.public java.lang.String exportFieldValues(java.util.Collection<TreatmentParameter> fields, java.lang.String delimiter)
fields
- the fields for which values should be produceddelimiter
- the string which should separate the valuespublic void touch()
public static java.util.Set<MeasurementType> collectMeasurementTypes(java.util.Collection<TreatmentStep> steps)
steps
- a collection of treatment stepspublic void setMomentToMean(java.util.List<TreatmentStep> treatmentSteps)
data
.treatmentSteps
- steps from which to calculate the mean
magnetization vector; must be non-null and non-emptypublic java.lang.String toSummaryString()