visad.georef
Class LongitudeLatitudeInterpCS

java.lang.Object
  extended by visad.CoordinateSystem
      extended by visad.georef.NavigatedCoordinateSystem
          extended by visad.georef.MapProjection
              extended by visad.georef.LongitudeLatitudeInterpCS
All Implemented Interfaces:
Serializable

public class LongitudeLatitudeInterpCS
extends MapProjection

For 2D arrays of earth observations when the navigation is not provided analytically, but a set of navigated points is given to interpolate. Particularly useful for polar swath observations with point-by-point navigation.

See Also:
Serialized Form

Constructor Summary
LongitudeLatitudeInterpCS(Linear2DSet domainSet, Gridded2DSet lonlatSet)
           
LongitudeLatitudeInterpCS(Linear2DSet domainSet, Gridded2DSet lonlatSet, boolean neg180pos180)
           
 
Method Summary
 boolean equals(Object cs)
          Indicates whether or not this instance is equal to an object (note must test for cs == null).
 double[][] fromReference(double[][] lonlat)
          Convert RealTuple values from Reference coordinates; for efficiency, input and output values are passed as double[][] arrays rather than RealTuple[] arrays; the array organization is double[tuple_dimension][number_of_tuples]; can modify and return argument array.
 float[][] fromReference(float[][] lonlat)
          Convert RealTuple values from Reference coordinates; for efficiency, input and output values are passed as float[][] arrays rather than RealTuple[] arrays; the array organization is float[tuple_dimension][number_of_tuples]; can modify and return argument array.
 Rectangle2D getDefaultMapArea()
          Get a reasonable bounding box in this coordinate system.
 Linear2DSet getDomainSet()
           
 boolean getIsExtNeg180pos180()
           
 boolean getIsNeg180pos180()
           
 Gridded2DSet getLonLatSet()
           
 void setExternalLongitudeRange(boolean isExtNeg180pos180)
           
 void setIsExtNeg180pos180(boolean yesno)
          Will convert to external (incoming/outgoing) longitude range, ie. -180 to 180 back/forth to 0 to 360.
 double[][] toReference(double[][] values)
          Convert RealTuple values to Reference coordinates; for efficiency, input and output values are passed as double[][] arrays rather than RealTuple[] arrays; the array organization is double[tuple_dimension][number_of_tuples]; can modify and return argument array.
 float[][] toReference(float[][] values)
          Convert RealTuple values to Reference coordinates; for efficiency, input and output values are passed as float[][] arrays rather than RealTuple[] arrays; the array organization is float[tuple_dimension][number_of_tuples]; can modify and return argument array.
 
Methods inherited from class visad.georef.MapProjection
getCenterLatLon, getLatLon, getXIndex, getYIndex, isLatLonOrder, isXYOrder, toString
 
Methods inherited from class visad.georef.NavigatedCoordinateSystem
getLatitudeIndex, getLongitudeIndex
 
Methods inherited from class visad.CoordinateSystem
canConvert, fromReference, fromReference, getCoordinateSystemUnits, getDimension, getReference, getReferenceUnits, toReference, toReference, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinatesFreeUnits, transformCoordinatesFreeUnits
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LongitudeLatitudeInterpCS

public LongitudeLatitudeInterpCS(Linear2DSet domainSet,
                                 Gridded2DSet lonlatSet,
                                 boolean neg180pos180)
                          throws VisADException
Parameters:
domainSet - The CoordinateSystem, eg. (line, element), (Track, XTrack)
lonlatSet - The set of earth locations to interpolate for (x,y) to/from (lon,lat). May be sampled w/respect to domainSet, eg. every fifth point. SetType must be SpatialEarth2DTuple or LatitudeLongitudeTuple.
neg180pos180 - The range of longitude values in the lonlatSet. Default is true, false is (0,+360).
Throws:
VisADException - Couldn't create necessary VisAD object or reference type (the lonlatSet type) is not SpatialEarth2DTuple or LatitudeLongitudeTuple

LongitudeLatitudeInterpCS

public LongitudeLatitudeInterpCS(Linear2DSet domainSet,
                                 Gridded2DSet lonlatSet)
                          throws VisADException
Throws:
VisADException
Method Detail

toReference

public float[][] toReference(float[][] values)
                      throws VisADException
Description copied from class: CoordinateSystem
Convert RealTuple values to Reference coordinates; for efficiency, input and output values are passed as float[][] arrays rather than RealTuple[] arrays; the array organization is float[tuple_dimension][number_of_tuples]; can modify and return argument array. This implementation converts the input array to doubles and calls CoordinateSystem.toReference(double[][]) and then returns that converted double array back as a float array. For efficiency, subclasses should override this implementation.

Overrides:
toReference in class CoordinateSystem
Parameters:
values - array of values assumed to be in coordinateSystem units. Input array is not guaranteed to be immutable and could be used for return.
Returns:
array of float values in reference coordinates and Units.
Throws:
VisADException - if problem with conversion.

toReference

public double[][] toReference(double[][] values)
                       throws VisADException
Description copied from class: CoordinateSystem
Convert RealTuple values to Reference coordinates; for efficiency, input and output values are passed as double[][] arrays rather than RealTuple[] arrays; the array organization is double[tuple_dimension][number_of_tuples]; can modify and return argument array.

Specified by:
toReference in class CoordinateSystem
Parameters:
values - array of values assumed to be in coordinateSystem units. Input array is not guaranteed to be immutable and could be used for return.
Returns:
array of double values in reference coordinates and Units.
Throws:
VisADException - if problem with conversion.

fromReference

public float[][] fromReference(float[][] lonlat)
                        throws VisADException
Description copied from class: CoordinateSystem
Convert RealTuple values from Reference coordinates; for efficiency, input and output values are passed as float[][] arrays rather than RealTuple[] arrays; the array organization is float[tuple_dimension][number_of_tuples]; can modify and return argument array. This implementation converts the input array to doubles and calls CoordinateSystem.toReference(double[][]) and then returns that converted double array back as a float array. For efficiency, subclasses should override this implementation.

Overrides:
fromReference in class CoordinateSystem
Parameters:
lonlat - array of values assumed to be in reference Units. Input array is not guaranteed to be immutable and could be used for return.
Returns:
array of float values in this CoordinateSystem Units.
Throws:
VisADException - if problem with conversion.

fromReference

public double[][] fromReference(double[][] lonlat)
                         throws VisADException
Description copied from class: CoordinateSystem
Convert RealTuple values from Reference coordinates; for efficiency, input and output values are passed as double[][] arrays rather than RealTuple[] arrays; the array organization is double[tuple_dimension][number_of_tuples]; can modify and return argument array.

Specified by:
fromReference in class CoordinateSystem
Parameters:
lonlat - array of values assumed to be in reference Units. Input array is not guaranteed to be immutable and could be used for return.
Returns:
array of double values in CoordinateSystem Units.
Throws:
VisADException - if problem with conversion.

setExternalLongitudeRange

public void setExternalLongitudeRange(boolean isExtNeg180pos180)

getDefaultMapArea

public Rectangle2D getDefaultMapArea()
Description copied from class: MapProjection
Get a reasonable bounding box in this coordinate system. MapProjections are typically specific to an area of the world; there's no bounding box that works for all projections so each subclass must implement this method. For example, the bounding box for a satellite image MapProjection might have an upper left corner of (0,0) and the width and height of the Rectangle2D would be the number of elements and lines, respectively.

Specified by:
getDefaultMapArea in class MapProjection
Returns:
the bounding box of the MapProjection

getDomainSet

public Linear2DSet getDomainSet()

getLonLatSet

public Gridded2DSet getLonLatSet()

getIsNeg180pos180

public boolean getIsNeg180pos180()

setIsExtNeg180pos180

public void setIsExtNeg180pos180(boolean yesno)
Will convert to external (incoming/outgoing) longitude range, ie. -180 to 180 back/forth to 0 to 360. Default is: external range is 0 to 360


getIsExtNeg180pos180

public boolean getIsExtNeg180pos180()

equals

public boolean equals(Object cs)
Description copied from class: CoordinateSystem
Indicates whether or not this instance is equal to an object (note must test for cs == null).

Specified by:
equals in class CoordinateSystem
Parameters:
cs - the object in question.
Returns:
true if and only if this instance equals cs.