public class SensorLengths
extends java.lang.Object
Represents the effective SQUID sensor lengths of a magnetometer, as determined by the response curves of the SQUID sensors. These sensor lengths are used when loading 2G long core magnetometer data, since in this case the components of the magnetic moment measurements are not pre-corrected for effective sensor length.
Hard-coded, pre-defined sets of sensor lengths can be selected by name, but SensorLengths can also represent any ‘custom’ set of sensor lengths.
Modifier and Type | Method and Description |
---|---|
static SensorLengths |
fromPrefs(java.util.prefs.Preferences prefs)
Creates a sensor lengths object from a string representation in
a
Preferences object. |
static SensorLengths |
fromPresetName(java.lang.String name)
Creates a sensor lengths object with lengths determined by a named preset.
|
static SensorLengths |
fromString(java.lang.String string)
Creates a new sensor lengths object from a string definition.
|
static SensorLengths |
fromStrings(java.lang.String x,
java.lang.String y,
java.lang.String z)
Creates a new sensor lengths object from three strings specifying
the individual sensor lengths.
|
java.util.List<java.lang.String> |
getLengths()
Returns a list of string representations of the sensor lengths in
the order x, y, z.
|
java.lang.String |
getPreset()
Returns the name of the preset sensor lengths, if any.
|
static java.lang.String[] |
getPresetNames()
Returns the names of the hard-coded preset sensor lengths.
|
void |
save(java.util.prefs.Preferences prefs)
Writes a string representation of the sensor lengths to
a specified
Preferences object. |
java.lang.String |
toString()
Returns a string representation of this object.
|
Vec3 |
toVector()
Returns the sensor lengths as a three-dimensional vector.
|
public java.util.List<java.lang.String> getLengths()
public Vec3 toVector()
public void save(java.util.prefs.Preferences prefs)
Preferences
object. The value is
stored under the key sensorLengths
.prefs
- the preferences object to which to store the sensor lengthspublic static SensorLengths fromPrefs(java.util.prefs.Preferences prefs)
Preferences
object. The string is read from the key
sensorLengths
. If there is no such key in the preferences
object, each sensor length defaults to 1.prefs
- a preferences object from which to read the definitionpublic java.lang.String toString()
fromString(java.lang.String)
to reconstruct
the original object.toString
in class java.lang.Object
public static SensorLengths fromString(java.lang.String string)
toString()
.string
- a string definitionjava.lang.IllegalArgumentException
- if the string is null or not recognizedpublic static SensorLengths fromStrings(java.lang.String x, java.lang.String y, java.lang.String z)
x
- x sensor lengthy
- y sensor lengthz
- z sensor lengthpublic static java.lang.String[] getPresetNames()
public static SensorLengths fromPresetName(java.lang.String name)
name
- a named presetpublic java.lang.String getPreset()
null
.