ucar.nc2.dt.trajectory
Class UnidataTrajectoryObsDataset2

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

public class UnidataTrajectoryObsDataset2
extends TypedDatasetImpl
implements TrajectoryObsDataset, TypedDatasetFactoryIF

Handle trajectory data files that follow the Unidata Observation Dataset convention version 1.0. Documentation on this convention is available at http://www.unidata.ucar.edu/software/netcdf-java/formats/UnidataObsConvention.html

Since:
2006-11-17T17:26:14-0700
Author:
edavis

Field Summary
protected  TrajectoryObsDataset backingTraj
           
protected  Variable elevVar
           
protected  String elevVarName
           
protected  boolean isMultiTrajStructure
           
protected  boolean isTimeDimensionFirst
           
protected  Variable latVar
           
protected  String latVarName
           
protected  Variable lonVar
           
protected  String lonVarName
           
protected  Structure recordVar
           
protected  Dimension timeDim
           
protected  String timeDimName
           
protected  Variable timeVar
           
protected  String timeVarName
           
protected  Dimension trajDim
           
protected  String trajDimName
           
protected  Variable trajVar
           
protected  String trajVarName
           
 
Fields inherited from class ucar.nc2.dt.TypedDatasetImpl
boundingBox, dataVariables, desc, endDate, location, ncfile, parseInfo, startDate, title
 
Constructor Summary
UnidataTrajectoryObsDataset2()
           
UnidataTrajectoryObsDataset2(NetcdfDataset ncd)
           
 
Method Summary
 void close()
          Close all resources associated with this dataset.
 Attribute findGlobalAttributeIgnoreCase(String name)
           
 LatLonRect getBoundingBox()
           
 VariableSimpleIF getDataVariable(String shortName)
          Get the named data Variable.
 List<VariableSimpleIF> getDataVariables()
          The data Variables available in this dataset.
 String getDescription()
           
 String getDetailInfo()
           
 Date getEndDate()
           
 List<Attribute> getGlobalAttributes()
          List of global attributes.
 String getLocation()
           
 NetcdfFile getNetcdfFile()
           
 FeatureType getScientificDataType()
          What kind of cientific data type will this return?
 Date getStartDate()
           
 String getTitle()
           
 List getTrajectories()
          Get trajectories contained in this dataset.
 TrajectoryObsDatatype getTrajectory(String trajectoryId)
          Get the named trajectory
 List<String> 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(NetcdfFile ds)
           
 TypedDataset open(NetcdfDataset ncd, CancelTask task, StringBuilder errlog)
          Open a NetcdfDataset as a TypedDataset.
protected  void setBoundingBox()
           
protected  void setEndDate()
           
protected  void setStartDate()
           
 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
getLocationURI, 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
getLocationURI
 

Field Detail

trajVar

protected Variable trajVar

trajDim

protected Dimension trajDim

timeVar

protected Variable timeVar

timeDim

protected Dimension timeDim

recordVar

protected Structure recordVar

latVar

protected Variable latVar

lonVar

protected Variable lonVar

elevVar

protected Variable elevVar

trajDimName

protected String trajDimName

trajVarName

protected String trajVarName

timeDimName

protected String timeDimName

timeVarName

protected String timeVarName

latVarName

protected String latVarName

lonVarName

protected String lonVarName

elevVarName

protected String elevVarName

isMultiTrajStructure

protected boolean isMultiTrajStructure

isTimeDimensionFirst

protected boolean isTimeDimensionFirst

backingTraj

protected TrajectoryObsDataset backingTraj
Constructor Detail

UnidataTrajectoryObsDataset2

public UnidataTrajectoryObsDataset2()

UnidataTrajectoryObsDataset2

public UnidataTrajectoryObsDataset2(NetcdfDataset ncd)
                             throws IOException
Throws:
IOException
Method Detail

isValidFile

public static boolean isValidFile(NetcdfFile ds)

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,
                         StringBuilder errlog)
                  throws 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:
IOException - on error

getScientificDataType

public FeatureType 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

getDetailInfo

public String getDetailInfo()
Specified by:
getDetailInfo in interface TypedDataset
Overrides:
getDetailInfo in class TypedDatasetImpl
Returns:
debug / underlying implementation details

getTitle

public String getTitle()
Specified by:
getTitle in interface TypedDataset
Overrides:
getTitle in class TypedDatasetImpl
Returns:
Title of the dataset.

getDescription

public String getDescription()
Specified by:
getDescription in interface TypedDataset
Overrides:
getDescription in class TypedDatasetImpl
Returns:
Text information about this dataset.

getLocation

public String getLocation()
Overrides:
getLocation in class TypedDatasetImpl

setStartDate

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

getStartDate

public Date getStartDate()
Specified by:
getStartDate in interface TypedDataset
Overrides:
getStartDate in class TypedDatasetImpl
Returns:
Start date for the entire dataset.

setEndDate

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

getEndDate

public Date getEndDate()
Specified by:
getEndDate in interface TypedDataset
Overrides:
getEndDate in class TypedDatasetImpl
Returns:
End date for the entire dataset.

setBoundingBox

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

getBoundingBox

public LatLonRect getBoundingBox()
Specified by:
getBoundingBox in interface TypedDataset
Overrides:
getBoundingBox in class TypedDatasetImpl
Returns:
the boundingBox for the entire dataset.

getGlobalAttributes

public List<Attribute> getGlobalAttributes()
Description copied from interface: TypedDataset
List of global attributes.

Specified by:
getGlobalAttributes in interface TypedDataset
Overrides:
getGlobalAttributes in class TypedDatasetImpl
Returns:
List of type ucar.nc2.Attribute

findGlobalAttributeIgnoreCase

public Attribute findGlobalAttributeIgnoreCase(String name)
Specified by:
findGlobalAttributeIgnoreCase in interface TypedDataset
Overrides:
findGlobalAttributeIgnoreCase in class TypedDatasetImpl
Parameters:
name - attribute name
Returns:
the global attribute with the given name, ingnoring case.

getDataVariables

public List<VariableSimpleIF> getDataVariables()
Description copied from interface: TypedDataset
The data Variables available in this dataset. Should just be data variable others might be searching for, not metadata or coordinate system variables, etc. The shape of this VariableSimpleIF does not necessarily match the

Specified by:
getDataVariables in interface TypedDataset
Overrides:
getDataVariables in class TypedDatasetImpl
Returns:
List of type VariableSimpleIF

getDataVariable

public VariableSimpleIF getDataVariable(String shortName)
Description copied from interface: TypedDataset
Get the named data Variable.

Specified by:
getDataVariable in interface TypedDataset
Overrides:
getDataVariable in class TypedDatasetImpl
Parameters:
shortName - of data Variable.
Returns:
VariableSimpleIF or null.

getNetcdfFile

public NetcdfFile getNetcdfFile()
Specified by:
getNetcdfFile in interface TypedDataset
Overrides:
getNetcdfFile in class TypedDatasetImpl
Returns:
underlying NetcdfFile, or null if none.

close

public void close()
           throws IOException
Description copied from interface: TypedDataset
Close all resources associated with this dataset.

Specified by:
close in interface TypedDataset
Overrides:
close in class TypedDatasetImpl
Throws:
IOException - on I/O error

getTrajectoryIds

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

Specified by:
getTrajectoryIds in interface TrajectoryObsDataset
Returns:
list of ids for this dataset

getTrajectories

public 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(String trajectoryId)
Description copied from interface: TrajectoryObsDataset
Get the named trajectory

Specified by:
getTrajectory in interface TrajectoryObsDataset
Parameters:
trajectoryId - id of trajectory
Returns:
the named trajectory

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.


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.