org.wdssii.core
Class LatLonGrid

java.lang.Object
  extended by org.wdssii.core.DataType
      extended by org.wdssii.core.LatLonGrid

public class LatLonGrid
extends DataType

A regularly spaced grid where the first dimension is latitude and the second dimension is longitude. The (0,0) location is the north-west corner. In the first dimension, latitude decreases (southward) and in the second dimension, longitude increases (eastward).

Author:
lakshman

Nested Class Summary
static class LatLonGrid.Pixel
           
 
Field Summary
private  float deltaLat
           
private  float deltaLon
           
private static org.apache.commons.logging.Log log
           
private  float[][] values
           
 
Fields inherited from class org.wdssii.core.DataType
attributes, DataUnavailable, MissingData, originLocation, RangeFolded, startTime, typeName
 
Constructor Summary
LatLonGrid(LatLonGrid master)
          
LatLonGrid(Location nwCorner, Date time, String typeName, float deltaLat, float deltaLon, float[][] values)
           
LatLonGrid(Location nwCorner, Date time, String typeName, float deltaLat, float deltaLon, int numLat, int numLon)
          All the values are initialized to zero
 
Method Summary
 void convertToUnit(ucar.units.Unit toUnit)
          Converts all the values in this grid to the specified unit.
 float getDeltaLat()
          positive number that indicates the size of a pixel in lat-direction
 float getDeltaLon()
          positive number that indicates the size of a pixel in lon-direction
 int getNumLat()
           
 int getNumLon()
           
 LatLonGrid.Pixel getPixel(Location loc)
          returns the Pixel corresponding to the location.
 float getValue(LatLonGrid.Pixel p)
           
 float getValue(Location loc)
          Get the value at a Location.
 float[][] getValues()
           
 void setValues(float[][] values2)
          Can be used to set all the values of the grid at once.
 
Methods inherited from class org.wdssii.core.DataType
addAttributes, copyOf, getAttribute, getAttributes, getLocation, getTime, getTypeName, getUnit, getUTC, setAttribute, setAttributes, setTypeName, toStringDB
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

deltaLat

private final float deltaLat

deltaLon

private final float deltaLon

values

private float[][] values
Constructor Detail

LatLonGrid

public LatLonGrid(LatLonGrid master)


LatLonGrid

public LatLonGrid(Location nwCorner,
                  Date time,
                  String typeName,
                  float deltaLat,
                  float deltaLon,
                  float[][] values)

LatLonGrid

public LatLonGrid(Location nwCorner,
                  Date time,
                  String typeName,
                  float deltaLat,
                  float deltaLon,
                  int numLat,
                  int numLon)
All the values are initialized to zero

Method Detail

getValues

public float[][] getValues()

getNumLat

public int getNumLat()

getNumLon

public int getNumLon()

getDeltaLat

public float getDeltaLat()
positive number that indicates the size of a pixel in lat-direction


getDeltaLon

public float getDeltaLon()
positive number that indicates the size of a pixel in lon-direction


convertToUnit

public void convertToUnit(ucar.units.Unit toUnit)
Converts all the values in this grid to the specified unit.

Parameters:
grid -
toUnit - Use UdUnits.parse() to create this Unit
See Also:
UdUnits.parse()

getValue

public float getValue(Location loc)
Get the value at a Location. The height is ignored and MissingData is returned for values outside


getPixel

public LatLonGrid.Pixel getPixel(Location loc)
returns the Pixel corresponding to the location. The height is ignored but a null value is returned if the location is outside the grid.


getValue

public float getValue(LatLonGrid.Pixel p)

setValues

public void setValues(float[][] values2)
Can be used to set all the values of the grid at once.