Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ikayaki.MeasurementValue< T > Class Reference

List of all members.

Public Member Functions

 MeasurementValue (String caption, String unit, String description)
abstract T getValue (MeasurementStep step)
String getCaption (Project project)
String getUnit (Project project)
String getDescription (Project project)

Static Public Attributes

static final MeasurementValue<
Double > 
GEOGRAPHIC_X
static final MeasurementValue<
Double > 
GEOGRAPHIC_Y
static final MeasurementValue<
Double > 
GEOGRAPHIC_Z
static final MeasurementValue<
Double > 
SAMPLE_X
static final MeasurementValue<
Double > 
SAMPLE_Y
static final MeasurementValue<
Double > 
SAMPLE_Z
static final MeasurementValue<
Double > 
GEOGRAPHIC_X_NORMALIZED
static final MeasurementValue<
Double > 
GEOGRAPHIC_Y_NORMALIZED
static final MeasurementValue<
Double > 
GEOGRAPHIC_Z_NORMALIZED
static final MeasurementValue<
Double > 
SAMPLE_X_NORMALIZED
static final MeasurementValue<
Double > 
SAMPLE_Y_NORMALIZED
static final MeasurementValue<
Double > 
SAMPLE_Z_NORMALIZED
static final MeasurementValue<
Double > 
DECLINATION
static final MeasurementValue<
Double > 
INCLINATION
static final MeasurementValue<
Double > 
MOMENT
static final MeasurementValue<
Double > 
MAGNETIZATION
static final MeasurementValue<
Double > 
RELATIVE_MAGNETIZATION
static final MeasurementValue<
Double > 
THETA63
static final MeasurementValue<
Double > 
SIGNAL_TO_NOISE
static final MeasurementValue<
Double > 
SIGNAL_TO_DRIFT
static final MeasurementValue<
Double > 
SIGNAL_TO_HOLDER

Private Attributes

final String caption
final String unit
final String description

Detailed Description

Algorithms for calculating values from the measurements. A MeasurementValue object will be passed to the getValue() method of a project to retrieve the desired value.

Author:
Esko Luontola

Definition at line 38 of file MeasurementValue.java.


Member Function Documentation

String ikayaki.MeasurementValue< T >.getCaption Project  project  ) 
 

Returns a short name for the value.

Parameters:
project the currently active project, or null if no project is active. Used for returning a different text depending on the project.

Definition at line 498 of file MeasurementValue.java.

String ikayaki.MeasurementValue< T >.getDescription Project  project  ) 
 

Returns a long description of the value.

Parameters:
project the currently active project, or null if no project is active. Used for returning a different text depending on the project.

Definition at line 518 of file MeasurementValue.java.

String ikayaki.MeasurementValue< T >.getUnit Project  project  ) 
 

Returns the unit of the value.

Parameters:
project the currently active project, or null if no project is active. Used for returning a different text depending on the project.

Definition at line 508 of file MeasurementValue.java.

abstract T ikayaki.MeasurementValue< T >.getValue MeasurementStep  step  )  [pure virtual]
 

Calculates a specific value from a measurement step.

Parameters:
step the step from which the value will be calculated.
Returns:
the calculated value, or null if it was not possible to calculate it.
Exceptions:
NullPointerException if step is null.

ikayaki.MeasurementValue< T >.MeasurementValue String  caption,
String  unit,
String  description
 

Creates a new measurement value.

Parameters:
caption a short name for the value.
unit the unit of the value.
description a long description of the value.
Exceptions:
NullPointerException if any of the arguments is null.

Definition at line 474 of file MeasurementValue.java.


Member Data Documentation

final String ikayaki.MeasurementValue< T >.caption [private]
 

A short name for the value.

Definition at line 454 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.DECLINATION [static]
 

Initial value:

            new MeasurementValue<Double>("D", "\u00b0", "Geographic declination") {
                public Double getValue(MeasurementStep step) {
                    Double x = GEOGRAPHIC_X.getValue(step);
                    Double y = GEOGRAPHIC_Y.getValue(step);
                    if (x == null || y == null) {
                        return null;
                    } else {
                        double d = atan2(y, x);
                        if (d < 0.0) {
                            d += PI * 2;
                        }
                        return Math.toDegrees(d);
                    }
                }
            }
Calculates the declination from the component averages in geographic coordinates.

Definition at line 247 of file MeasurementValue.java.

final String ikayaki.MeasurementValue< T >.description [private]
 

A long description of the value.

Definition at line 464 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.GEOGRAPHIC_X [static]
 

Initial value:

            new MeasurementValue<Double>("X'", "Am\u00B2", "Average X (geographic coordinates)") {
                public Double getValue(MeasurementStep step) {
                    double sum = 0.0;
                    int count = 0;
                    for (int i = 0; i < step.getResults(); i++) {
                        MeasurementResult r = step.getResult(i);
                        if (r.getType() != SAMPLE) {
                            continue;
                        }
                        sum += r.getGeographicX();
                        count++;
                    }
                    if (count > 0) {
                        return new Double(sum / count);
                    } else {
                        return null;
                    }
                }
            }
Calculates the average of all X components in geographic coordinates.

Definition at line 43 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.GEOGRAPHIC_X_NORMALIZED [static]
 

Initial value:

            new NormalizedValue("X'", "Normalized average X (geographic coordinates)") {
                protected Double getValue0(MeasurementStep step) {
                    return GEOGRAPHIC_X.getValue(step);
                }
            }
Calculates the normalized average of all X components in geographic coordinates.

Definition at line 187 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.GEOGRAPHIC_Y [static]
 

Initial value:

            new MeasurementValue<Double>("Y'", "Am\u00B2", "Average Y (geographic coordinates)") {
                public Double getValue(MeasurementStep step) {
                    double sum = 0.0;
                    int count = 0;
                    for (int i = 0; i < step.getResults(); i++) {
                        MeasurementResult r = step.getResult(i);
                        if (r.getType() != SAMPLE) {
                            continue;
                        }
                        sum += r.getGeographicY();
                        count++;
                    }
                    if (count > 0) {
                        return new Double(sum / count);
                    } else {
                        return null;
                    }
                }
            }
Calculates the average of all Y components in geographic coordinates.

Definition at line 67 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.GEOGRAPHIC_Y_NORMALIZED [static]
 

Initial value:

            new NormalizedValue("Y'", "Normalized average Y (geographic coordinates)") {
                protected Double getValue0(MeasurementStep step) {
                    return GEOGRAPHIC_Y.getValue(step);
                }
            }
Calculates the normalized average of all Y components in geographic coordinates.

Definition at line 197 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.GEOGRAPHIC_Z [static]
 

Initial value:

            new MeasurementValue<Double>("Z'", "Am\u00B2", "Average Z (geographic coordinates)") {
                public Double getValue(MeasurementStep step) {
                    double sum = 0.0;
                    int count = 0;
                    for (int i = 0; i < step.getResults(); i++) {
                        MeasurementResult r = step.getResult(i);
                        if (r.getType() != SAMPLE) {
                            continue;
                        }
                        sum += r.getGeographicZ();
                        count++;
                    }
                    if (count > 0) {
                        return new Double(sum / count);
                    } else {
                        return null;
                    }
                }
            }
Calculates the average of all Z components in geographic coordinates.

Definition at line 91 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.GEOGRAPHIC_Z_NORMALIZED [static]
 

Initial value:

            new NormalizedValue("Z'", "Normalized average Z (geographic coordinates)") {
                protected Double getValue0(MeasurementStep step) {
                    return GEOGRAPHIC_Z.getValue(step);
                }
            }
Calculates the normalized average of all Z components in geographic coordinates.

Definition at line 207 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.INCLINATION [static]
 

Initial value:

            new MeasurementValue<Double>("I", "\u00b0", "Geographic inclination") {
                public Double getValue(MeasurementStep step) {
                    Double x = GEOGRAPHIC_X.getValue(step);
                    Double y = GEOGRAPHIC_Y.getValue(step);
                    Double z = GEOGRAPHIC_Z.getValue(step);
                    if (x == null || y == null || z == null) {
                        return null;
                    } else {
                        if (x == 0.0) {
                            x = 0.000000000001;
                        }
                        if (y == 0.0) {
                            y = 0.000000000001;
                        }
                        double d = atan(z / sqrt(pow(x, 2) + pow(y, 2)));
                        return Math.toDegrees(d);
                    }
                }
            }
Calculates the inclination from the component averages in geographic coordinates.

Definition at line 267 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.MAGNETIZATION [static]
 

Initial value:

            new NormalizedValue("J", "Magnetic intensity") { 
                protected Double getValue0(MeasurementStep step) {
                    return MOMENT.getValue(step);
                }
            }
Calculates the magnetic intensity (or remanence) from the moment and the sample's volume or mass (depending on the selected normalization).

Definition at line 309 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.MOMENT [static]
 

Initial value:

            new MeasurementValue<Double>("M", "Am\u00B2", "Magnetic moment") {
                public Double getValue(MeasurementStep step) {
                    Double x = SAMPLE_X.getValue(step);
                    Double y = SAMPLE_Y.getValue(step);
                    Double z = SAMPLE_Z.getValue(step);
                    if (x == null || y == null || z == null) {
                        return null;
                    } else {
                        return sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2));
                    }
                }
            }
Calculates the length of the vector from the component averages.

Definition at line 291 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.RELATIVE_MAGNETIZATION [static]
 

Initial value:

            new MeasurementValue<Double>("J/Jo", "", "Relative magnetic intensity") {
                public Double getValue(MeasurementStep step) {
                    Project project = step.getProject();
                    if (project == null) {
                        return null;
                    }
                    Double j = MAGNETIZATION.getValue(step);
                    Double j0 = MAGNETIZATION.getValue(project.getStep(0));     
                    if (j == null || j0 == null) {
                        return null;
                    } else {
                        return j.doubleValue() / j0.doubleValue();
                    }
                }
            }
Calculates the magnetic intensity (or remanence) relative to the first measurement's magnetic intensity.

Definition at line 319 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.SAMPLE_X [static]
 

Initial value:

            new MeasurementValue<Double>("X", "Am\u00B2", "Average X (sample coordinates)") {
                public Double getValue(MeasurementStep step) {
                    double sum = 0.0;
                    int count = 0;
                    for (int i = 0; i < step.getResults(); i++) {
                        MeasurementResult r = step.getResult(i);
                        if (r.getType() != SAMPLE) {
                            continue;
                        }
                        sum += r.getSampleX();
                        count++;
                    }
                    if (count > 0) {
                        return new Double(sum / count);
                    } else {
                        return null;
                    }
                }
            }
Calculates the average of all X components in sample coordinates.

Definition at line 115 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.SAMPLE_X_NORMALIZED [static]
 

Initial value:

            new NormalizedValue("X", "Normalized average X (sample coordinates)") {
                protected Double getValue0(MeasurementStep step) {
                    return SAMPLE_X.getValue(step);
                }
            }
Calculates the normalized average of all X components in sample coordinates.

Definition at line 217 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.SAMPLE_Y [static]
 

Initial value:

            new MeasurementValue<Double>("Y", "Am\u00B2", "Average Y (sample coordinates)") {
                public Double getValue(MeasurementStep step) {
                    double sum = 0.0;
                    int count = 0;
                    for (int i = 0; i < step.getResults(); i++) {
                        MeasurementResult r = step.getResult(i);
                        if (r.getType() != SAMPLE) {
                            continue;
                        }
                        sum += r.getSampleY();
                        count++;
                    }
                    if (count > 0) {
                        return new Double(sum / count);
                    } else {
                        return null;
                    }
                }
            }
Calculates the average of all Y components in sample coordinates.

Definition at line 139 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.SAMPLE_Y_NORMALIZED [static]
 

Initial value:

            new NormalizedValue("Y", "Normalized average Y (sample coordinates)") {
                protected Double getValue0(MeasurementStep step) {
                    return SAMPLE_Y.getValue(step);
                }
            }
Calculates the normalized average of all Y components in sample coordinates.

Definition at line 227 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.SAMPLE_Z [static]
 

Initial value:

            new MeasurementValue<Double>("Z", "Am\u00B2", "Average Z (sample coordinates)") {
                public Double getValue(MeasurementStep step) {
                    double sum = 0.0;
                    int count = 0;
                    for (int i = 0; i < step.getResults(); i++) {
                        MeasurementResult r = step.getResult(i);
                        if (r.getType() != SAMPLE) {
                            continue;
                        }
                        sum += r.getSampleZ();
                        count++;
                    }
                    if (count > 0) {
                        return new Double(sum / count);
                    } else {
                        return null;
                    }
                }
            }
Calculates the average of all Z components in sample coordinates.

Definition at line 163 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.SAMPLE_Z_NORMALIZED [static]
 

Initial value:

            new NormalizedValue("Z", "Normalized average Z (sample coordinates)") {
                protected Double getValue0(MeasurementStep step) {
                    return SAMPLE_Z.getValue(step);
                }
            }
Calculates the normalized average of all Z components in sample coordinates.

Definition at line 237 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.SIGNAL_TO_DRIFT [static]
 

Initial value:

            new MeasurementValue<Double>("caption", "unit", "description") {
                public Double getValue(MeasurementStep step) {
                    if (step == null) {
                        return null;
                    }
                    Double signal = MOMENT.getValue(step);
                    if (signal == null) {
                        return null;
                    }
                    double d = step.getNoise().length();
                    if (d == 0.0) {
                        return null;
                    }
                    return signal.doubleValue() / d;
                }
            }
TODO: enter description

Definition at line 409 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.SIGNAL_TO_HOLDER [static]
 

Initial value:

            new MeasurementValue<Double>("caption", "unit", "description") {
                public Double getValue(MeasurementStep step) {
                    if (step == null) {
                        return null;
                    }
                    Double signal = MOMENT.getValue(step);
                    if (signal == null) {
                        return null;
                    }
                    double d = step.getHolder().length();
                    if (d == 0.0) {
                        return null;
                    }
                    return signal.doubleValue() / d;
                }
            }
TODO: enter description

Definition at line 430 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.SIGNAL_TO_NOISE [static]
 

Initial value:

            new MeasurementValue<Double>("caption", "unit", "description") {
                public Double getValue(MeasurementStep step) {
                    if (step == null) {
                        return null;
                    }

                    
                    int count = 0;
                    double lengthSum = 0.0;
                    for (MeasurementResult r : step) {
                        lengthSum += r.getSampleVector().length();
                        count++;
                    }
                    if (count < 2) {
                        return null;
                    }
                    double lengthAvg = lengthSum / count;

                    
                    double squareSum = 0.0;
                    for (MeasurementResult r : step) {
                        double d = r.getSampleVector().length() - lengthAvg;
                        squareSum += (d * d);
                    }
                    double stdev = Math.sqrt(squareSum / (count - 1));

                    return lengthAvg / stdev;
                }
            }
TODO: enter description

Definition at line 375 of file MeasurementValue.java.

final MeasurementValue<Double> ikayaki.MeasurementValue< T >.THETA63 [static]
 

Calculates the angular standard deviation (Theta 63) from the measurement result set.

Definition at line 339 of file MeasurementValue.java.

final String ikayaki.MeasurementValue< T >.unit [private]
 

The unit of the value.

Definition at line 459 of file MeasurementValue.java.


The documentation for this class was generated from the following file:
Generated on Fri May 6 16:00:41 2005 for Squid by  doxygen 1.4.1