Package ucar.nc2.iosp.grads
Class GradsDataDescriptorFile
- java.lang.Object
-
- ucar.nc2.iosp.grads.GradsDataDescriptorFile
-
public class GradsDataDescriptorFile extends Object
Class to hold information from a GrADS Data Descriptor File- See Also:
- "http://www.iges.org/grads/gadoc/descriptorfile.html"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
GradsDataDescriptorFile.Chsub
Class to handle the CHSUB parameters
-
Field Summary
Fields Modifier and Type Field Description static String
DSET
DSET identifierstatic String
DTYPE
DTYPE identifierstatic String
EDEF
EDEF identifierstatic String
ENDEDEF
ENDEDEF identifierstatic String
ENDVARS
ENDVARS identifierstatic int
ENS_TEMPLATE
Ensemble template typestatic int
ENS_TIME_TEMPLATE
Ensemble and time template typestatic String
FILEHEADER
FILEHEADER identifierstatic String
HEADERBYTES
HEADERBYTES identifierstatic String
INDEX
INDEX identifierstatic int
NO_TEMPLATE
NO template typestatic String
OPTIONS
OPTIONS identifierstatic String
PDEF
EDEF identifierstatic String
TDEF
TDEF identifierstatic String
THEADER
THEADER identifierstatic int
TIME_TEMPLATE
time template typestatic String
TITLE
TITLE identifierstatic String
TRAILERBYTES
TRAILERBYTES identifierstatic String
UNDEF
UNDEF identifierstatic String
UNPACK
UNPACK identifierstatic String
VARS
VARS identifierstatic String
XDEF
XDEF identifierstatic String
XYHEADER
XYHEADER identifierstatic String
YDEF
YDEF identifierstatic String
ZDEF
ZDEF identifier
-
Constructor Summary
Constructors Constructor Description GradsDataDescriptorFile(String filename, int maxLines)
Create a GradsDataDescriptorFile from the file
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
failFast(RandomAccessFile raf)
List<GradsAttribute>
getAttributes()
Get the attributesString
getDataDescriptorFile()
Get the data descriptor file pathString
getDataFile()
Get the data file pathString
getDataType()
Get the data type.List<GradsDimension>
getDimensions()
Get the dimensionsGradsEnsembleDimension
getEnsembleDimension()
Get the ensemble dimensionint
getFileHeaderBytes()
Get the number of file header bytesString
getFileName(int eIndex, int tIndex)
Get the file name for the particular time and ensemble indexint
getGridsPerTimeStep()
Get the number of grids per timestepdouble
getMissingValue()
Get the missing valueint
getTemplateType()
Get the type of template this isGradsTimeDimension
getTimeDimension()
Get the time dimensionint
getTimeHeaderBytes()
Get the number of time header bytesint[]
getTimeStepsPerFile(String filename)
Get the number of timesteps per file and the starting offsetint
getTimeTrailerBytes()
Get the number of time trailer bytesString
getTitle()
Get the titleList<GradsVariable>
getVariables()
Get the variablesGradsDimension
getXDimension()
Get the X dimensionint
getXYHeaderBytes()
Get the number of xy header bytesGradsDimension
getYDimension()
Get the Y dimensionGradsDimension
getZDimension()
Get the Z dimensionboolean
hasProjection()
Get whether this is using a projection or noboolean
isBigEndian()
Is this a big endian fileboolean
isSequential()
Get whether this is a sequentially written fileboolean
isTemplate()
Get whether this is using a template or notboolean
isYReversed()
Get whether y axis is reversed or notString
toString()
Return a String representation of this object
-
-
-
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, int maxLines) throws IOException
Create a GradsDataDescriptorFile from the file- Parameters:
filename
- the name of the file- Throws:
IOException
- problem reading/parsing the file
-
-
Method Detail
-
failFast
public static boolean failFast(RandomAccessFile raf) throws IOException
- Throws:
IOException
-
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
-
getFileName
public String getFileName(int eIndex, int tIndex)
Get the file name for the particular time and ensemble index- Parameters:
eIndex
- ensemble indextIndex
- time index- Returns:
- the appropriate filename
-
-