net.talvi.puffinplot.data
Class Correction

java.lang.Object
  extended by net.talvi.puffinplot.data.Correction

public class Correction
extends java.lang.Object

This class represents the corrections which may be applied to the measured remanence to estimate the true remanence. The main corrections are the orientation corrections for sample and formation orientations. The class also contains facilities for handling tray corrections (subtracting the tray remanence) and empty-slot corrections (monitoring the measured remanence of an empty measurement slot to correct for instrument drift). At present, these are not actually used by PuffinPlot: the tray correction is applied when the data file is first loaded, and the empty-slot correction is not implemented.

Note that this class does not contain any of the data for actually applying to corrections; it just determines which corrections should be applied.


Nested Class Summary
static class Correction.Rotation
          An enumeration of the types of rotation correction which may be applied to a sample's data.
 
Field Summary
static Correction NONE
           
 
Constructor Summary
Correction(boolean tray, boolean empty, Correction.Rotation rotation, boolean magDevAppliedToFormation)
          Creates a new set of corrections
 
Method Summary
static Correction fromString(java.lang.String string)
          Creates a correction from the supplied string.
 java.lang.String getDescription()
          Returns a user-friendly string describing this correction.
 Correction.Rotation getRotation()
          Returns the rotation correction.
 boolean includesEmpty()
          Returns true if this correction includes an empty-slot correction.
 boolean includesFormation()
          Returns true if this correction includes a rotation for formation orientation.
 boolean includesSample()
          Returns true if this correction includes a rotation for sample orientation.
 boolean includesTray()
          Returns true if this correction includes a correction for tray remanence.
 boolean isMagDevAppliedToFormation()
           
 void setMagDevAppliedToFormation(boolean magDevAppliedToFormation)
           
 void setRotation(Correction.Rotation rotation)
          Sets the rotation correction.
 java.lang.String toString()
          Returns a parseable string representation of this correction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final Correction NONE
Constructor Detail

Correction

public Correction(boolean tray,
                  boolean empty,
                  Correction.Rotation rotation,
                  boolean magDevAppliedToFormation)
Creates a new set of corrections

Parameters:
tray - true to use the tray correction
empty - true} to use the empty slot correction
rotation - the type of rotation correction to use
Method Detail

setRotation

public void setRotation(Correction.Rotation rotation)
Sets the rotation correction.

Parameters:
rotation - the type of rotation correction to use

getRotation

public Correction.Rotation getRotation()
Returns the rotation correction.

Returns:
the type of rotation correction currently in use

isMagDevAppliedToFormation

public boolean isMagDevAppliedToFormation()
Returns:
the magDevAppliedToFormation

setMagDevAppliedToFormation

public void setMagDevAppliedToFormation(boolean magDevAppliedToFormation)
Parameters:
magDevAppliedToFormation - the magDevAppliedToFormation to set

getDescription

public java.lang.String getDescription()
Returns a user-friendly string describing this correction.

Returns:
user-friendly string describing this correction

includesSample

public boolean includesSample()
Returns true if this correction includes a rotation for sample orientation. This is the case if the rotation is SAMPLE or FORMATION.

Returns:
true if this correction includes a rotation for sample orientation

includesFormation

public boolean includesFormation()
Returns true if this correction includes a rotation for formation orientation. This is the case if the rotation is FORMATION.

Returns:
true if this correction includes a rotation for formation orientation

includesTray

public boolean includesTray()
Returns true if this correction includes a correction for tray remanence.

Returns:
true if this correction includes a correction for tray remanence

includesEmpty

public boolean includesEmpty()
Returns true if this correction includes an empty-slot correction.

Returns:
true if this correction includes an empty-slot correction

toString

public java.lang.String toString()
Returns a parseable string representation of this correction. The string is intended for storing and restoring state and is not user-friendly. Use getDescription() for a user-friendly description.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this correction
See Also:
getDescription(), fromString(java.lang.String)

fromString

public static Correction fromString(java.lang.String string)
Creates a correction from the supplied string. The string should be in the format produced by toString().

Parameters:
string - a string representation of the correction to be created
Returns:
a correction created according to the provided string
See Also:
toString()