ucar.nc2.iosp.grads
Class GradsDataDescriptorFile

java.lang.Object
  extended by ucar.nc2.iosp.grads.GradsDataDescriptorFile

public class GradsDataDescriptorFile
extends Object

Class to hold information from a GrADS Data Descriptor File

Author:
Don Murray - CU/CIRES
See Also:
"http://www.iges.org/grads/gadoc/descriptorfile.html"

Nested Class Summary
protected  class GradsDataDescriptorFile.Chsub
          Class to handle the CHSUB parameters
 
Field Summary
static String DSET
          DSET identifier
static String DTYPE
          DTYPE identifier
static String EDEF
          EDEF identifier
static String ENDEDEF
          ENDEDEF identifier
static String ENDVARS
          ENDVARS identifier
static int ENS_TEMPLATE
          Ensemble template type
static int ENS_TIME_TEMPLATE
          Ensemble and time template type
static String FILEHEADER
          FILEHEADER identifier
static String HEADERBYTES
          HEADERBYTES identifier
static String INDEX
          INDEX identifier
static int NO_TEMPLATE
          NO template type
static String OPTIONS
          OPTIONS identifier
static String PDEF
          EDEF identifier
static String TDEF
          TDEF identifier
static String THEADER
          THEADER identifier
static int TIME_TEMPLATE
          time template type
static String TITLE
          TITLE identifier
static String TRAILERBYTES
          TRAILERBYTES identifier
static String UNDEF
          UNDEF identifier
static String UNPACK
          UNPACK identifier
static String VARS
          VARS identifier
static String XDEF
          XDEF identifier
static String XYHEADER
          XYHEADER identifier
static String YDEF
          YDEF identifier
static String ZDEF
          ZDEF identifier
 
Constructor Summary
GradsDataDescriptorFile(String filename)
          Create a GradsDataDescriptorFile from the file
 
Method Summary
 List<GradsAttribute> getAttributes()
          Get the attributes
 String getDataDescriptorFile()
          Get the data descriptor file path
 String getDataFile()
          Get the data file path
 String getDataType()
          Get the data type.
 List<GradsDimension> getDimensions()
          Get the dimensions
 GradsEnsembleDimension getEnsembleDimension()
          Get the ensemble dimension
 int getFileHeaderBytes()
          Get the number of file header bytes
 String getFileName(int eIndex, int tIndex)
          Get the file name for the particular time and ensemble index
 int getGridsPerTimeStep()
          Get the number of grids per timestep
 double getMissingValue()
          Get the missing value
 int getTemplateType()
          Get the type of template this is
 GradsTimeDimension getTimeDimension()
          Get the time dimension
 int getTimeHeaderBytes()
          Get the number of time header bytes
 int[] getTimeStepsPerFile(String filename)
          Get the number of timesteps per file and the starting offset
 int getTimeTrailerBytes()
          Get the number of time trailer bytes
 String getTitle()
          Get the title
 List<GradsVariable> getVariables()
          Get the variables
 GradsDimension getXDimension()
          Get the X dimension
 int getXYHeaderBytes()
          Get the number of xy header bytes
 GradsDimension getYDimension()
          Get the Y dimension
 GradsDimension getZDimension()
          Get the Z dimension
 boolean hasProjection()
          Get whether this is using a projection or no
 boolean isBigEndian()
          Is this a big endian file
 boolean isSequential()
          Get whether this is a sequentially written file
 boolean isTemplate()
          Get whether this is using a template or not
 boolean isYReversed()
          Get whether y axis is reversed or not
static void main(String[] args)
          For testing
 String toString()
          Return a String representation of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DSET

public static final String DSET
DSET identifier

See Also:
Constant Field Values

DTYPE

public static final String DTYPE
DTYPE identifier

See Also:
Constant Field Values

INDEX

public static final String INDEX
INDEX identifier

See Also:
Constant Field Values

TITLE

public static final String TITLE
TITLE identifier

See Also:
Constant Field Values

UNDEF

public static final String UNDEF
UNDEF identifier

See Also:
Constant Field Values

UNPACK

public static final String UNPACK
UNPACK identifier

See Also:
Constant Field Values

FILEHEADER

public static final String FILEHEADER
FILEHEADER identifier

See Also:
Constant Field Values

XYHEADER

public static final String XYHEADER
XYHEADER identifier

See Also:
Constant Field Values

THEADER

public static final String THEADER
THEADER identifier

See Also:
Constant Field Values

HEADERBYTES

public static final String HEADERBYTES
HEADERBYTES identifier

See Also:
Constant Field Values

TRAILERBYTES

public static final String TRAILERBYTES
TRAILERBYTES identifier

See Also:
Constant Field Values

OPTIONS

public static final String OPTIONS
OPTIONS identifier

See Also:
Constant Field Values

XDEF

public static final String XDEF
XDEF identifier

See Also:
Constant Field Values

YDEF

public static final String YDEF
YDEF identifier

See Also:
Constant Field Values

ZDEF

public static final String ZDEF
ZDEF identifier

See Also:
Constant Field Values

TDEF

public static final String TDEF
TDEF identifier

See Also:
Constant Field Values

EDEF

public static final String EDEF
EDEF identifier

See Also:
Constant Field Values

PDEF

public static final String PDEF
EDEF identifier

See Also:
Constant Field Values

ENDEDEF

public static final String ENDEDEF
ENDEDEF identifier

See Also:
Constant Field Values

VARS

public static final String VARS
VARS identifier

See Also:
Constant Field Values

ENDVARS

public static final String ENDVARS
ENDVARS identifier

See Also:
Constant Field Values

NO_TEMPLATE

public static final int NO_TEMPLATE
NO template type

See Also:
Constant Field Values

TIME_TEMPLATE

public static final int TIME_TEMPLATE
time template type

See Also:
Constant Field Values

ENS_TEMPLATE

public static final int ENS_TEMPLATE
Ensemble template type

See Also:
Constant Field Values

ENS_TIME_TEMPLATE

public static final int ENS_TIME_TEMPLATE
Ensemble and time template type

See Also:
Constant Field Values
Constructor Detail

GradsDataDescriptorFile

public GradsDataDescriptorFile(String filename)
                        throws IOException
Create a GradsDataDescriptorFile from the file

Parameters:
filename - the name of the file
Throws:
IOException - problem reading/parsing the file
Method Detail

getDimensions

public List<GradsDimension> getDimensions()
Get the dimensions

Returns:
the dimensions

getVariables

public List<GradsVariable> getVariables()
Get the variables

Returns:
the variables

getAttributes

public List<GradsAttribute> getAttributes()
Get the attributes

Returns:
the attributes

getEnsembleDimension

public GradsEnsembleDimension getEnsembleDimension()
Get the ensemble dimension

Returns:
the ensemble dimension

getTimeDimension

public GradsTimeDimension getTimeDimension()
Get the time dimension

Returns:
the time dimension

getZDimension

public GradsDimension getZDimension()
Get the Z dimension

Returns:
the Z dimension

getYDimension

public GradsDimension getYDimension()
Get the Y dimension

Returns:
the Y dimension

getXDimension

public GradsDimension getXDimension()
Get the X dimension

Returns:
the X dimension

getDataFile

public String getDataFile()
Get the data file path

Returns:
the data file path

getDataDescriptorFile

public String getDataDescriptorFile()
Get the data descriptor file path

Returns:
the data descriptor file path

getMissingValue

public double getMissingValue()
Get the missing value

Returns:
the missing value

getGridsPerTimeStep

public int getGridsPerTimeStep()
Get the number of grids per timestep

Returns:
the number of grids per timestep

getTimeStepsPerFile

public int[] getTimeStepsPerFile(String filename)
Get the number of timesteps per file and the starting offset

Parameters:
filename - the filename to check
Returns:
the starting index and number of times in that file

isTemplate

public boolean isTemplate()
Get whether this is using a template or not

Returns:
whether this is using a template or not

getTemplateType

public int getTemplateType()
Get the type of template this is

Returns:
the type of template

hasProjection

public boolean hasProjection()
Get whether this is using a projection or no

Returns:
whether this is using a projection or not

isSequential

public boolean isSequential()
Get whether this is a sequentially written file

Returns:
true if this is sequential

isYReversed

public boolean isYReversed()
Get whether y axis is reversed or not

Returns:
whether y axis is reversed or not

getXYHeaderBytes

public int getXYHeaderBytes()
Get the number of xy header bytes

Returns:
the number of xy header bytes

getFileHeaderBytes

public int getFileHeaderBytes()
Get the number of file header bytes

Returns:
the number of file header bytes

getTimeHeaderBytes

public int getTimeHeaderBytes()
Get the number of time header bytes

Returns:
the number of time header bytes

getTimeTrailerBytes

public int getTimeTrailerBytes()
Get the number of time trailer bytes

Returns:
the number of time trailer bytes

isBigEndian

public boolean isBigEndian()
Is this a big endian file

Returns:
true if big endian

getTitle

public String getTitle()
Get the title

Returns:
the title

getDataType

public String getDataType()
Get the data type. Only support raw binary

Returns:
type or null

toString

public String toString()
Return a String representation of this object

Overrides:
toString in class Object
Returns:
a String representation of this object

main

public static void main(String[] args)
                 throws Exception
For testing

Parameters:
args - the filename
Throws:
Exception - problem reading the file

getFileName

public String getFileName(int eIndex,
                          int tIndex)
Get the file name for the particular time and ensemble index

Parameters:
eIndex - ensemble index
tIndex - time index
Returns:
the appropriate filename


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