ucar.unidata.data.sounding
Class TrackInfo

java.lang.Object
  extended by ucar.unidata.data.sounding.TrackInfo
Direct Known Subclasses:
CdmTrackInfo, EolDbTrackAdapter.EolDbTrackInfo

public abstract class TrackInfo
extends Object

Class TrackInfo Provides access to a track or trajectory

Version:
$Revision: 1.4 $
Author:
IDV Development Team

Field Summary
protected  TrackAdapter adapter
          The adapater
static String ALT_TYPE
          RealType name for altitude
protected  Hashtable cachedTimeVals
          cached time values
protected  ucar.ma2.Range lastSpatialSetRange
          The last range when we create the llaSet
static String LAT_TYPE
          RealType name for latitude
protected  GriddedSet llaSet
          lat/lon/altitude set
static String LON_TYPE
          RealType name for longitude
static String TIME_TYPE
          RealType name for time
protected  String trackName
          Name of track
protected  String varAltitude
          _more_
protected  List variables
          All the variables
protected  String varLatitude
          _more_
protected  String varLongitude
          _more_
protected  String varTime
          _more_
protected  ucar.unidata.geoloc.Bearing workBearing
          bearing class for bearing calculations
 
Constructor Summary
TrackInfo(TrackAdapter adapter, String name)
          ctor
 
Method Summary
protected  void addVariable(VarInfo variable)
          Add variable
protected  int countReals(List vars)
          How many of the given vars are numeric
 Data getAerologicalDiagramData()
          get the data
protected  float[] getAltitude(ucar.ma2.Range range)
          get altitude values
protected  ucar.ma2.Range getDataRange()
          Get the default range of data
protected  VarInfo getDataVariable(String variableName)
          Utility to find the variable with the given name
protected  double[] getDoubleData(ucar.ma2.Range range, String var)
          _more_
 DateTime getEndTime()
          Get the ending time of this track.
protected abstract  float[] getFloatData(ucar.ma2.Range range, String var)
          Get the data values for range and var
protected  float[] getFloatData(ucar.ma2.Range range, VarInfo var)
          Utility for getting data
protected  ucar.ma2.Range getFullRange()
          Get the full range but clipped to the adapters lastNMinutes
protected  float[] getLatitude(ucar.ma2.Range range)
          Get latitude values
protected  float[] getLongitude(ucar.ma2.Range range)
          get longitude values
 int getNumberPoints()
          How many points in track
 FieldImpl getPointObTrack(ucar.ma2.Range range)
          Take a FlatField of data and turn it into a field of PointObs.
protected  GriddedSet getSpatialSet(ucar.ma2.Range range)
          Returns the lat/lon/alt values as a GriddedSet with manifold dimension 1.
 DateTime getStartTime()
          Get the starting time of this track.
protected abstract  String[] getStringData(ucar.ma2.Range range, String var)
          Get string values
protected  String[] getStringData(ucar.ma2.Range range, VarInfo var)
          Get string values for variable
protected  double[] getTime(ucar.ma2.Range range)
          Get the time for each ob
protected  Unit getTimeUnit()
          What is the time unit
 double[] getTimeVals(ucar.ma2.Range range)
          Get the time values for the range
 FlatField getTrack(String variableName, ucar.ma2.Range range)
          Returns a track for the variable name specified.
 String getTrackName()
          Get the name of the track
 FlatField getTrackWithTime(String variable, ucar.ma2.Range range)
          Returns a track for the variable name specified.
 List<VarInfo> getVariables()
          _more_
protected  List getVarsToUse()
          Get list of VarInfos to use
protected  RealType getVarType(RealType varToCheck)
          Get the appropriate RealType for the particular variable.
protected  RealType getVarType(RealType varToCheck, Unit unit, double sampleValue)
          Get the appropriate RealType for the particular variable.
 boolean includeInPointData(String varName)
          Should we include the given var in the point data
protected  GriddedSet makeEarthDomainSet(ucar.ma2.Range range)
          Make the earth spatial domain
protected  RAOB makeRAOB()
          Make the RAOB
 void setCoordinateVars(String lon, String lat, String alt, String time)
          _more_
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

varTime

protected String varTime
_more_


varLatitude

protected String varLatitude
_more_


varLongitude

protected String varLongitude
_more_


varAltitude

protected String varAltitude
_more_


TIME_TYPE

public static final String TIME_TYPE
RealType name for time

See Also:
Constant Field Values

LAT_TYPE

public static final String LAT_TYPE
RealType name for latitude

See Also:
Constant Field Values

LON_TYPE

public static final String LON_TYPE
RealType name for longitude

See Also:
Constant Field Values

ALT_TYPE

public static final String ALT_TYPE
RealType name for altitude

See Also:
Constant Field Values

cachedTimeVals

protected Hashtable cachedTimeVals
cached time values


adapter

protected TrackAdapter adapter
The adapater


llaSet

protected GriddedSet llaSet
lat/lon/altitude set


lastSpatialSetRange

protected ucar.ma2.Range lastSpatialSetRange
The last range when we create the llaSet


workBearing

protected ucar.unidata.geoloc.Bearing workBearing
bearing class for bearing calculations


variables

protected List variables
All the variables


trackName

protected String trackName
Name of track

Constructor Detail

TrackInfo

public TrackInfo(TrackAdapter adapter,
                 String name)
          throws Exception
ctor

Parameters:
adapter - The adapter
name - name of track
Throws:
Exception - On badness
Method Detail

addVariable

protected void addVariable(VarInfo variable)
Add variable

Parameters:
variable - the variable

getVariables

public List<VarInfo> getVariables()
_more_

Returns:
_more_

getStartTime

public DateTime getStartTime()
Get the starting time of this track.

Returns:
starting time

getEndTime

public DateTime getEndTime()
Get the ending time of this track.

Returns:
ending time

getNumberPoints

public int getNumberPoints()
                    throws Exception
How many points in track

Returns:
num points in track
Throws:
Exception - _more_

makeEarthDomainSet

protected GriddedSet makeEarthDomainSet(ucar.ma2.Range range)
                                 throws Exception
Make the earth spatial domain

Parameters:
range - The data range of the request
Returns:
The spatial domain
Throws:
Exception - On badness

getTrackWithTime

public FlatField getTrackWithTime(String variable,
                                  ucar.ma2.Range range)
                           throws Exception
Returns a track for the variable name specified. Returned track is of type:
 ((Latitude, Longitude, Altitude) -> (variable, Time)
 

Parameters:
variable - variable to get
range - The data range of the request
Returns:
FlatField of the type above.
Throws:
Exception - On badness

getTimeVals

public double[] getTimeVals(ucar.ma2.Range range)
                     throws Exception
Get the time values for the range

Parameters:
range - range to use
Returns:
time values in range
Throws:
Exception - problem getting time values

getTimeUnit

protected Unit getTimeUnit()
                    throws Exception
What is the time unit

Returns:
time unit
Throws:
Exception - On badness

getTime

protected double[] getTime(ucar.ma2.Range range)
                    throws Exception
Get the time for each ob

Parameters:
range - subset on range
Returns:
time values
Throws:
Exception - On badness

getLatitude

protected float[] getLatitude(ucar.ma2.Range range)
                       throws Exception
Get latitude values

Parameters:
range - subset on range. may be null
Returns:
latitude values
Throws:
Exception - On badness

getLongitude

protected float[] getLongitude(ucar.ma2.Range range)
                        throws Exception
get longitude values

Parameters:
range - subset on range. may be null
Returns:
longitude values
Throws:
Exception - On badness

getAltitude

protected float[] getAltitude(ucar.ma2.Range range)
                       throws Exception
get altitude values

Parameters:
range - subset on range. May be null
Returns:
altitude values
Throws:
Exception - On badness

getFloatData

protected float[] getFloatData(ucar.ma2.Range range,
                               VarInfo var)
                        throws Exception
Utility for getting data

Parameters:
range - The range
var - The variable
Returns:
The data
Throws:
Exception - On badness

getStringData

protected String[] getStringData(ucar.ma2.Range range,
                                 VarInfo var)
                          throws Exception
Get string values for variable

Parameters:
range - the range. May be null
var - The var
Returns:
String values
Throws:
Exception - On badness

getFloatData

protected abstract float[] getFloatData(ucar.ma2.Range range,
                                        String var)
                                 throws Exception
Get the data values for range and var

Parameters:
range - The range. May be null.
var - The variable
Returns:
Values
Throws:
Exception - On badness

getDoubleData

protected double[] getDoubleData(ucar.ma2.Range range,
                                 String var)
                          throws Exception
_more_

Parameters:
range - _more_
var - _more_
Returns:
_more_
Throws:
Exception - _more_

getStringData

protected abstract String[] getStringData(ucar.ma2.Range range,
                                          String var)
                                   throws Exception
Get string values

Parameters:
range - The range. May be null.
var - The variable
Returns:
Values
Throws:
Exception - On badness

getPointObTrack

public FieldImpl getPointObTrack(ucar.ma2.Range range)
                          throws Exception
Take a FlatField of data and turn it into a field of PointObs.

Parameters:
range - The data range of the request
Returns:
field of PointObs
Throws:
Exception - On badness

getDataVariable

protected VarInfo getDataVariable(String variableName)
Utility to find the variable with the given name

Parameters:
variableName - The name
Returns:
The variable.

getVarType

protected RealType getVarType(RealType varToCheck)
Get the appropriate RealType for the particular variable. Used to get alternate names for lat/lon/alt

Parameters:
varToCheck - variable to check
Returns:
new variable or the original

getTrackName

public String getTrackName()
Get the name of the track

Returns:
Track name

setCoordinateVars

public void setCoordinateVars(String lon,
                              String lat,
                              String alt,
                              String time)
_more_

Parameters:
lon - _more_
lat - _more_
alt - _more_
time - _more_

getVarType

protected RealType getVarType(RealType varToCheck,
                              Unit unit,
                              double sampleValue)
Get the appropriate RealType for the particular variable. Used to get alternate names for lat/lon/alt

Parameters:
varToCheck - variable to check
unit - unit for return RealType
sampleValue - sample value for comparing RealTypes
Returns:
new variable or the original

getDataRange

protected ucar.ma2.Range getDataRange()
                               throws Exception
Get the default range of data

Returns:
range
Throws:
Exception - On badness

getFullRange

protected ucar.ma2.Range getFullRange()
                               throws Exception
Get the full range but clipped to the adapters lastNMinutes

Returns:
range
Throws:
Exception - On badness

getVarsToUse

protected List getVarsToUse()
Get list of VarInfos to use

Returns:
List of vars

countReals

protected int countReals(List vars)
How many of the given vars are numeric

Parameters:
vars - List of vars
Returns:
how many numeric

getTrack

public FlatField getTrack(String variableName,
                          ucar.ma2.Range range)
                   throws Exception
Returns a track for the variable name specified. Returned track is of type:
 ((Latitude, Longitude, Altitude) -> (variable)
 

Parameters:
variableName - variable of data
range - The data range of the request
Returns:
FlatField of the type above.
Throws:
Exception - On badness

getSpatialSet

protected GriddedSet getSpatialSet(ucar.ma2.Range range)
                            throws Exception
Returns the lat/lon/alt values as a GriddedSet with manifold dimension 1.

Parameters:
range - The data range of the request
Returns:
set of lat/lon/alt points.
Throws:
Exception - On badness

includeInPointData

public boolean includeInPointData(String varName)
Should we include the given var in the point data

Parameters:
varName - VarInfo name
Returns:
Include in point data

getAerologicalDiagramData

public Data getAerologicalDiagramData()
                               throws Exception
get the data

Returns:
the data
Throws:
Exception - On badness

makeRAOB

protected RAOB makeRAOB()
                 throws Exception
Make the RAOB

Returns:
The RAOB_
Throws:
Exception - On badness