ucar.nc2.dt.trajectory
Class ARMTrajectoryObsDataset

java.lang.Object
  extended by ucar.nc2.dt.TypedDatasetImpl
      extended by ucar.nc2.dt.trajectory.ARMTrajectoryObsDataset
All Implemented Interfaces:
TrajectoryObsDataset, TypedDataset, TypedDatasetFactoryIF

public class ARMTrajectoryObsDataset
extends TypedDatasetImpl
implements TypedDatasetFactoryIF

Implements TrajectoryDataset for datasets with these characteristics:

Since:
Feb 22, 2005T5:37:14 PM
Author:
edavis

Nested Class Summary
static class SingleTrajectoryObsDataset.Config
           
 
Field Summary
protected  Variable elevVar
           
protected  double elevVarUnitsConversionFactor
           
protected  Variable latVar
           
protected  Variable lonVar
           
protected static SimpleUnit meterUnit
           
protected  Structure recordVar
           
protected  Dimension timeDim
           
protected  Variable timeVar
           
protected  java.lang.String timeVarUnitsString
           
protected  TrajectoryObsDatatype trajectory
           
protected  java.lang.String trajectoryId
           
protected  int trajectoryNumPoint
           
protected  java.util.HashMap trajectoryVarsMap
           
 
Fields inherited from class ucar.nc2.dt.TypedDatasetImpl
boundingBox, dataVariables, desc, endDate, location, ncfile, parseInfo, startDate, title
 
Constructor Summary
ARMTrajectoryObsDataset()
           
ARMTrajectoryObsDataset(NetcdfDataset ncd)
           
 
Method Summary
 java.lang.String getDetailInfo()
          Show debug / underlying implementation details
protected static double getMetersConversionFactor(java.lang.String unitsString)
           
 DataType getScientificDataType()
          What kind of cientific data type will this return?
 java.util.List getTrajectories()
          Get trajectories contained in this dataset.
 TrajectoryObsDatatype getTrajectory(java.lang.String trajectoryId)
          Get the named trajectory
 java.util.List getTrajectoryIds()
          Get a list of String IDs for the available trajectories.
 boolean isMine(NetcdfDataset ds)
          Determine if this dataset belongs to you
static boolean isValidFile(NetcdfDataset ncd)
           
 TypedDataset open(NetcdfDataset ncd, CancelTask task, java.lang.StringBuffer errlog)
          Open a NetcdfDataset as a TypedDataset.
protected  void setBoundingBox()
           
protected  void setEndDate()
           
protected  void setStartDate()
           
 void setTrajectoryInfo(SingleTrajectoryObsDataset.Config trajConfig)
          Setup needed for all SingleTrajectoryObsDatatypes.
 boolean syncExtend()
          Syncronize with the underlying dataset if it has been extended in a way that is compatible with the existing structural metadata (for instance, if the unlimited dimension has grown).
 
Methods inherited from class ucar.nc2.dt.TypedDatasetImpl
close, findGlobalAttributeIgnoreCase, getBoundingBox, getDataVariable, getDataVariables, getDescription, getEndDate, getGlobalAttributes, getLocationURI, getNetcdfFile, getStartDate, getTitle, removeDataVariable, setDescription, setLocationURI, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ucar.nc2.dt.TypedDataset
close, findGlobalAttributeIgnoreCase, getBoundingBox, getDataVariable, getDataVariables, getDescription, getEndDate, getGlobalAttributes, getLocationURI, getNetcdfFile, getStartDate, getTitle
 

Field Detail

trajectoryId

protected java.lang.String trajectoryId

trajectoryNumPoint

protected int trajectoryNumPoint

trajectoryVarsMap

protected java.util.HashMap trajectoryVarsMap

timeDim

protected Dimension timeDim

timeVar

protected Variable timeVar

recordVar

protected Structure recordVar

latVar

protected Variable latVar

lonVar

protected Variable lonVar

elevVar

protected Variable elevVar

timeVarUnitsString

protected java.lang.String timeVarUnitsString

elevVarUnitsConversionFactor

protected double elevVarUnitsConversionFactor

trajectory

protected TrajectoryObsDatatype trajectory

meterUnit

protected static SimpleUnit meterUnit
Constructor Detail

ARMTrajectoryObsDataset

public ARMTrajectoryObsDataset()

ARMTrajectoryObsDataset

public ARMTrajectoryObsDataset(NetcdfDataset ncd)
                        throws java.io.IOException
Throws:
java.io.IOException
Method Detail

isValidFile

public static boolean isValidFile(NetcdfDataset ncd)

isMine

public boolean isMine(NetcdfDataset ds)
Description copied from interface: TypedDatasetFactoryIF
Determine if this dataset belongs to you

Specified by:
isMine in interface TypedDatasetFactoryIF
Parameters:
ds - examine this NetcdfDataset to see if it belongs to this class.
Returns:
true if this class knows how to create a TypedDataset out of this NetcdfDataset.

open

public TypedDataset open(NetcdfDataset ncd,
                         CancelTask task,
                         java.lang.StringBuffer errlog)
                  throws java.io.IOException
Description copied from interface: TypedDatasetFactoryIF
Open a NetcdfDataset as a TypedDataset.

Specified by:
open in interface TypedDatasetFactoryIF
Parameters:
ncd - already opened NetcdfDataset.
task - use may cancel
errlog - place errors here
Returns:
a subclass of TypedDataset
Throws:
java.io.IOException - on error

getScientificDataType

public DataType getScientificDataType()
Description copied from interface: TypedDatasetFactoryIF
What kind of cientific data type will this return?

Specified by:
getScientificDataType in interface TypedDatasetFactoryIF
Returns:
scientific data type

setTrajectoryInfo

public void setTrajectoryInfo(SingleTrajectoryObsDataset.Config trajConfig)
                       throws java.io.IOException
Setup needed for all SingleTrajectoryObsDatatypes. Can only be called once. Units of time varible must be udunits time units. Units of latitude variable must be convertible to "degrees_north" by udunits. Units of longitude variable must be convertible to "degrees_east" by udunits. Units of altitude variable must be convertible to "meters" by udunits.

Throws:
java.lang.IllegalArgumentException - if units of time, latitude, longitude, or altitude variables are not as required.
java.lang.IllegalStateException - if this method has already been called.
java.io.IOException

getMetersConversionFactor

protected static double getMetersConversionFactor(java.lang.String unitsString)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

setStartDate

protected void setStartDate()
Specified by:
setStartDate in class TypedDatasetImpl

setEndDate

protected void setEndDate()
Specified by:
setEndDate in class TypedDatasetImpl

setBoundingBox

protected void setBoundingBox()
Specified by:
setBoundingBox in class TypedDatasetImpl

getTrajectoryIds

public java.util.List getTrajectoryIds()
Description copied from interface: TrajectoryObsDataset
Get a list of String IDs for the available trajectories.

Specified by:
getTrajectoryIds in interface TrajectoryObsDataset

getTrajectories

public java.util.List getTrajectories()
Description copied from interface: TrajectoryObsDataset
Get trajectories contained in this dataset.

Specified by:
getTrajectories in interface TrajectoryObsDataset
Returns:
List of type TrajectoryObsDatatype.

getTrajectory

public TrajectoryObsDatatype getTrajectory(java.lang.String trajectoryId)
Description copied from interface: TrajectoryObsDataset
Get the named trajectory

Specified by:
getTrajectory in interface TrajectoryObsDataset

getDetailInfo

public java.lang.String getDetailInfo()
Description copied from interface: TypedDataset
Show debug / underlying implementation details

Specified by:
getDetailInfo in interface TypedDataset
Overrides:
getDetailInfo in class TypedDatasetImpl

syncExtend

public boolean syncExtend()
Description copied from interface: TrajectoryObsDataset
Syncronize with the underlying dataset if it has been extended in a way that is compatible with the existing structural metadata (for instance, if the unlimited dimension has grown). Return true if syncronization was needed and sucessful. Otherwise, return false. NOTE: For now, assuming growth of the unlimited dimension only allowed change. To get range for new extent only, use getRange( oldNumPoints + 1, newNumPoints, 1)

Specified by:
syncExtend in interface TrajectoryObsDataset
Returns:
true if syncronization was needed and sucessful, otherwise false.