mavis
Class ComponentCalculation

java.lang.Object
  extended by mavis.ComponentCalculation

public final class ComponentCalculation
extends java.lang.Object

This class is used to calculate the properties of magnetic components.


Nested Class Summary
static class ComponentCalculation.Axis
           
 
Constructor Summary
private ComponentCalculation()
           
 
Method Summary
private static double[] calculate(java.util.Vector osteps)
          Private method for calculating values needed in declination and inclination calculations.
static double calculateAoE(java.util.Vector steps)
          Returns angle of error (Maximum Angular Deviation) of component.
static double calculateAvgIntensity(java.util.Vector steps)
          Returns average intensity of steps included in the component.
private static javax.vecmath.Vector3d calculateCenterOfMass(java.util.Vector osteps)
          Private method for calculating the center point (average) of the steps' magnetic vectors.
static double calculateDeclination(java.util.Vector steps)
          Returns component declination.
static javax.vecmath.Vector3d calculateEnd(java.util.Vector steps)
          Returns the 3D end point for drawing a line of the magnetic component.
static javax.vecmath.Vector2d calculateEnd2D(java.util.Vector steps, ComponentCalculation.Axis viewedFromAxis)
          Returns the 2D end point for drawing a line of the magnetic component.
static double calculateInclination(java.util.Vector steps)
          Returns component inclination.
static double calculateLength(java.util.Vector steps)
          Calculates the 3D start and end point of the component, then returns the length of the interconnecting line.
static double calculateMaxIntensity(java.util.Vector steps)
          Returns maximum measurement amplitude of assigned steps.
static double calculateMinIntensity(java.util.Vector steps)
          Returns minimum measurement amplitude of assigned steps.
static double calculatePoleLat(java.util.Vector steps, Project project)
          Returns ancient pole latitude.
static double calculatePoleLong(java.util.Vector steps, Project project)
          Returns ancient pole longitude.
static javax.vecmath.Vector3d calculateStart(java.util.Vector steps)
          Returns the 3D starting point for drawing a line of the magnetic component.
static javax.vecmath.Vector2d calculateStart2D(java.util.Vector steps, ComponentCalculation.Axis viewedFromAxis)
          Returns the 2D starting point for drawing a line of the magnetic component.
static boolean containsOrigo(java.util.Vector steps)
          Returns true if the steps contain an origo step at either the start or end.
private static javax.vecmath.Vector3d getLineProjectionEndpoint(java.util.Vector osteps, boolean startNotEnd)
          Does some vector maths to project Zplot-normalised measurement step values onto the 3D component vector, then returns either start or end point.
private static javax.vecmath.Vector2d getLineProjectionEndpoint2D(java.util.Vector osteps, boolean startNotEnd, ComponentCalculation.Axis viewedFromAxis)
          Does some vector maths to project Zplot-normalised measurement step values onto the component vector, as viewed from the specified axis, and then returns the 2D start or end point.
static java.util.Vector getStepsWithoutOrigo(java.util.Vector steps)
          Returns true if the steps contain an origo step at either the start or end.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentCalculation

private ComponentCalculation()
Method Detail

calculateMaxIntensity

public static double calculateMaxIntensity(java.util.Vector steps)
Returns maximum measurement amplitude of assigned steps.

Parameters:
steps - component steps
Returns:
maximum amplitude

calculateMinIntensity

public static double calculateMinIntensity(java.util.Vector steps)
Returns minimum measurement amplitude of assigned steps.

Parameters:
steps - component steps
Returns:
minimum amplitude

calculateAvgIntensity

public static double calculateAvgIntensity(java.util.Vector steps)
Returns average intensity of steps included in the component.

Parameters:
steps - component steps
Returns:
average intensity

calculateCenterOfMass

private static javax.vecmath.Vector3d calculateCenterOfMass(java.util.Vector osteps)
Private method for calculating the center point (average) of the steps' magnetic vectors.

Returns a Vector3d pointing to the center of mass.

Parameters:
osteps - component steps
Returns:
vector to center of mass, or null on errors

calculate

private static double[] calculate(java.util.Vector osteps)
Private method for calculating values needed in declination and inclination calculations.

Returns array of l,m,n values and eigenvalue variances.

Parameters:
osteps - component steps
Returns:
l, m, n values and eigenvalue variances in double array

calculateDeclination

public static double calculateDeclination(java.util.Vector steps)
Returns component declination.

Parameters:
steps - component steps
Returns:
declination

calculateInclination

public static double calculateInclination(java.util.Vector steps)
Returns component inclination.

Parameters:
steps - component steps
Returns:
inclination

calculateAoE

public static double calculateAoE(java.util.Vector steps)
Returns angle of error (Maximum Angular Deviation) of component.

Parameters:
steps - component steps
Returns:
angle of error

calculatePoleLat

public static double calculatePoleLat(java.util.Vector steps,
                                      Project project)
Returns ancient pole latitude.

Parameters:
steps - component steps
project - the project
Returns:
ancient pole latitude

calculatePoleLong

public static double calculatePoleLong(java.util.Vector steps,
                                       Project project)
Returns ancient pole longitude.

Parameters:
steps - component steps
project - the project
Returns:
ancient pole longitude

calculateStart

public static javax.vecmath.Vector3d calculateStart(java.util.Vector steps)
Returns the 3D starting point for drawing a line of the magnetic component. The line starting point is the farthest point into the same/positive direction of the component vector.

To get the point for plotting etc, use Session.getStartAndEndpoints which adds some origo-step inclusion logic.

Parameters:
steps -
Returns:
start point

calculateEnd

public static javax.vecmath.Vector3d calculateEnd(java.util.Vector steps)
Returns the 3D end point for drawing a line of the magnetic component. The line end point is the farthest point into the opposite/negative direction of the component vector.

To get the point for plotting etc, use Session.getStartAndEndpoints which adds some origo-step inclusion logic.

Parameters:
steps -
Returns:
end point

getLineProjectionEndpoint

private static javax.vecmath.Vector3d getLineProjectionEndpoint(java.util.Vector osteps,
                                                                boolean startNotEnd)
Does some vector maths to project Zplot-normalised measurement step values onto the 3D component vector, then returns either start or end point.

To get the point for plotting etc, use Session.getStartAndEndpoints which adds some origo-step inclusion logic.

Parameters:
osteps - the steps, startNotEnd set to true if starting point should be returned
Returns:
start or end point, null on error

calculateStart2D

public static javax.vecmath.Vector2d calculateStart2D(java.util.Vector steps,
                                                      ComponentCalculation.Axis viewedFromAxis)
Returns the 2D starting point for drawing a line of the magnetic component. The line starting point is the farthest point into the same/positive direction of the component vector. TODO: very much incomplete and untested, though luckily also unused :)

Parameters:
steps - the measurement steps viewedFromAxis e.g. Axis.X, direction of view
Returns:
start point

calculateEnd2D

public static javax.vecmath.Vector2d calculateEnd2D(java.util.Vector steps,
                                                    ComponentCalculation.Axis viewedFromAxis)
Returns the 2D end point for drawing a line of the magnetic component. The line end point is the farthest point into the opposite/negative direction of the component vector. TODO: very much incomplete and untested, though luckily also unused :)

Parameters:
steps - the measurement steps viewedFromAxis e.g. Axis.X, direction of view
Returns:
end point

getLineProjectionEndpoint2D

private static javax.vecmath.Vector2d getLineProjectionEndpoint2D(java.util.Vector osteps,
                                                                  boolean startNotEnd,
                                                                  ComponentCalculation.Axis viewedFromAxis)
Does some vector maths to project Zplot-normalised measurement step values onto the component vector, as viewed from the specified axis, and then returns the 2D start or end point. TODO: very much incomplete and untested, though luckily also unused :)

Parameters:
osteps - the steps, startNotEnd set to true if starting point should be returned
Returns:
start or end point, null on error

calculateLength

public static double calculateLength(java.util.Vector steps)
Calculates the 3D start and end point of the component, then returns the length of the interconnecting line. TODO: it is still unclear whether this length has any physical meaning

Parameters:
steps -
Returns:
line length

containsOrigo

public static boolean containsOrigo(java.util.Vector steps)
Returns true if the steps contain an origo step at either the start or end.

Parameters:
steps -
Returns:
true if start or end is origo

getStepsWithoutOrigo

public static java.util.Vector getStepsWithoutOrigo(java.util.Vector steps)
Returns true if the steps contain an origo step at either the start or end.

Parameters:
steps - MeasurementStep steps in a vector
Returns:
vector with the input steps sans any origo steps