# Class GridWeight

java.lang.Object
gov.sandia.gnem.slbmjni.GridWeight

public class GridWeight extends Object
Stores the weight assigned to each grid node that was touched by the GreatCircle that was in memory the last time `SlbmInterface.getWeights()` was called.

When `SlbmInterface.getWeights()` is called, a map which associates an instance of a GreatCircle object with a double weight is initialized. Then every LayerProfile on the head wave interface between the source and receiver is visited and the angular distance, d, that the ray traveled in the horizontal segment is retreived. If d > 0, then the neighboring GridProfile objects that contributed to the interpolated value of the LayerProfile are visited. The product of d * R * C is added to the weight associated with that GridProfile object, where R is the radius of the head wave interface for the LayerProfile object being evaluated, and C is the interpolation coefficient for the GridProfile - LayerProfile pair under consideration. Then, all the GridProfile objects in the map are visited, the grid node IDs extracted into int array node, and the weight extracted into double array weight.

Note: Only grid nodes touched by the GreatCircle currently in memory are included in the output. Each grid node is included only once, even though more than one LayerProfile object may have contributed some weight to it. The sum of all the weights will equal the horizontal distance traveled by the ray along the head wave interface, from the source pierce point to the receiver pierce point, in km.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `int[]`
  `node`
  The IDs of the grid nodes that were 'touched' by the current GreatCircle.
  `double[]`
  `weight`
  The weight accumulated by each node.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GridWeight()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `getSum()`
  Retrieve the sum of the weights.
  `String`
  `toString()`
  Retrieve a formatted String representation of the information in this GridProfile object.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### node

    public int[] node
    The IDs of the grid nodes that were 'touched' by the current GreatCircle.

  - ### weight

    public double[] weight
    The weight accumulated by each node.

- ## Constructor Details

  - ### GridWeight

    public GridWeight()

- ## Method Details

  - ### getSum

    public double getSum()
    Retrieve the sum of the weights. This should be equal to getHeadwaveDistanceKm();
    Returns:
      the sum of the weights

  - ### toString

    public String toString()
    Retrieve a formatted String representation of the information in this GridProfile object.
    Overrides:
      `toString` in class `Object`
    Returns:
      String a formatted String representation of the information in this GridProfile object.