|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mavis.MeasurementResult
public class MeasurementResult
A set of X, Y and Z values measured by the magnetometer. The raw XYZ values will be rotated in 3D space by using a transformation matrix. The project will set and update the transformation whenever its parameters are changed.
All units are mA/m.
Nested Class Summary | |
---|---|
static class |
MeasurementResult.Type
|
Field Summary | |
---|---|
private javax.vecmath.Vector3d |
geographicVector
The measurements in geographic coordinates. |
private javax.vecmath.Vector3d |
rawVector
The unmodified measurements recieved from the squid. |
private int |
rotation
The rotation that the sample holder was in when this result was measured. |
private javax.vecmath.Vector3d |
sampleVector
The measurements in sample coordinates. |
private MeasurementResult.Type |
type
The type of this result. |
Constructor Summary | |
---|---|
MeasurementResult(org.w3c.dom.Element element)
Creates a measurement result from the specified element. |
|
MeasurementResult(MeasurementResult.Type type,
int rotation,
double x,
double y,
double z)
Creates a new measurement result. |
Method Summary | |
---|---|
protected void |
applyFixes(MeasurementStep step)
Applies the holder, noise and rotation fixes and saves the results as the sample vector. |
org.w3c.dom.Element |
getElement(org.w3c.dom.Document document)
Exports this result to a DOM element. |
protected javax.vecmath.Vector3d |
getGeographicVector()
Returns a pointer to the geographic vector. |
double |
getGeographicX()
Returns the noise fixed, rotated and transformed X coordinate of this result. |
double |
getGeographicY()
Returns the noise fixed, rotated and transformed Y coordinate of this result. |
double |
getGeographicZ()
Returns the noise fixed, rotated and transformed Z coordinate of this result. |
protected javax.vecmath.Vector3d |
getRawVector()
Returns a pointer to the raw vector. |
double |
getRawX()
Returns the unmodified X coordinate of this result. |
double |
getRawY()
Returns the unmodified Y coordinate of this result. |
double |
getRawZ()
Returns the unmodified Z coordinate of this result. |
int |
getRotation()
Returns the rotation of this result. |
protected javax.vecmath.Vector3d |
getSampleVector()
Returns a pointer to the sample vector. |
double |
getSampleX()
Returns the noise fixed and rotated X coordinate of this result. |
double |
getSampleY()
Returns the noise fixed and rotated Y coordinate of this result. |
double |
getSampleZ()
Returns the noise fixed and rotated Z coordinate of this result. |
MeasurementResult.Type |
getType()
Returns the type of this result. |
protected void |
setTransform(javax.vecmath.Matrix3d transform)
Applies a transformation matrix to the sample vector and saves the results as the geographic vector. |
protected javax.vecmath.Vector3d |
toTranslatedVector(javax.vecmath.Vector3d sampleVector,
int rotat)
Applies rotational translation to the input vector, i.e. preserves z but corrects the sign of x and y and also swaps them out if necessary. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final MeasurementResult.Type type
private final int rotation
private final javax.vecmath.Vector3d rawVector
private final javax.vecmath.Vector3d sampleVector
private final javax.vecmath.Vector3d geographicVector
Constructor Detail |
---|
public MeasurementResult(MeasurementResult.Type type, int rotation, double x, double y, double z)
type
- the type (background or rotation) of this result.rotation
- the rotation of the sample holder in degrees (0..360).x
- the measured X coordinate value.y
- the measured Y coordinate value.z
- the measured Z coordinate value.
java.lang.NullPointerException
- if type is null.
java.lang.IllegalArgumentException
- if the type is NOISE or HOLDER, but rotation is non-zero.public MeasurementResult(org.w3c.dom.Element element)
element
- the element from which this result will be created.
java.lang.NullPointerException
- if element is null.
java.lang.IllegalArgumentException
- if the element was not in the right format.Method Detail |
---|
public org.w3c.dom.Element getElement(org.w3c.dom.Document document)
document
- the document that will contain this element.protected void applyFixes(MeasurementStep step)
step
- the measurement step that includes the holder and noise calibration values. If null, the holder and
noise fixes are not applied.protected javax.vecmath.Vector3d toTranslatedVector(javax.vecmath.Vector3d sampleVector, int rotat) throws java.lang.IllegalStateException
sampleVector
- as the input vector, rotat as the raw data rotation in degrees
java.lang.IllegalStateException
protected void setTransform(javax.vecmath.Matrix3d transform)
transform
- the matrix to be applied. If null, will assume identity matrix.public MeasurementResult.Type getType()
public int getRotation()
public double getGeographicX()
java.lang.IllegalStateException
- if this result's type is not SAMPLE, in which case it should make no sense to call
this method.public double getGeographicY()
java.lang.IllegalStateException
- if this result's type is not SAMPLE, in which case it should make no sense to call
this method.public double getGeographicZ()
java.lang.IllegalStateException
- if this result's type is not SAMPLE, in which case it should make no sense to call
this method.protected javax.vecmath.Vector3d getGeographicVector()
public double getSampleX()
public double getSampleY()
public double getSampleZ()
protected javax.vecmath.Vector3d getSampleVector()
public double getRawX()
public double getRawY()
public double getRawZ()
protected javax.vecmath.Vector3d getRawVector()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |