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 classGradsDataDescriptorFile.ChsubClass to handle the CHSUB parameters
-
Field Summary
Fields Modifier and Type Field Description static StringDSETDSET identifierstatic StringDTYPEDTYPE identifierstatic StringEDEFEDEF identifierstatic StringENDEDEFENDEDEF identifierstatic StringENDVARSENDVARS identifierstatic intENS_TEMPLATEEnsemble template typestatic intENS_TIME_TEMPLATEEnsemble and time template typestatic StringFILEHEADERFILEHEADER identifierstatic StringHEADERBYTESHEADERBYTES identifierstatic StringINDEXINDEX identifierstatic intNO_TEMPLATENO template typestatic StringOPTIONSOPTIONS identifierstatic StringPDEFEDEF identifierstatic StringTDEFTDEF identifierstatic StringTHEADERTHEADER identifierstatic intTIME_TEMPLATEtime template typestatic StringTITLETITLE identifierstatic StringTRAILERBYTESTRAILERBYTES identifierstatic StringUNDEFUNDEF identifierstatic StringUNPACKUNPACK identifierstatic StringVARSVARS identifierstatic StringXDEFXDEF identifierstatic StringXYHEADERXYHEADER identifierstatic StringYDEFYDEF identifierstatic StringZDEFZDEF 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 booleanfailFast(ucar.unidata.io.RandomAccessFile raf)List<GradsAttribute>getAttributes()Get the attributesStringgetDataDescriptorFile()Get the data descriptor file pathStringgetDataFile()Get the data file pathStringgetDataType()Get the data type.List<GradsDimension>getDimensions()Get the dimensionsGradsEnsembleDimensiongetEnsembleDimension()Get the ensemble dimensionintgetFileHeaderBytes()Get the number of file header bytesStringgetFileName(int eIndex, int tIndex)Get the file name for the particular time and ensemble indexintgetGridsPerTimeStep()Get the number of grids per timestepdoublegetMissingValue()Get the missing valueintgetTemplateType()Get the type of template this isGradsTimeDimensiongetTimeDimension()Get the time dimensionintgetTimeHeaderBytes()Get the number of time header bytesint[]getTimeStepsPerFile(String filename)Get the number of timesteps per file and the starting offsetintgetTimeTrailerBytes()Get the number of time trailer bytesStringgetTitle()Get the titleList<GradsVariable>getVariables()Get the variablesGradsDimensiongetXDimension()Get the X dimensionintgetXYHeaderBytes()Get the number of xy header bytesGradsDimensiongetYDimension()Get the Y dimensionGradsDimensiongetZDimension()Get the Z dimensionbooleanhasProjection()Get whether this is using a projection or nobooleanisBigEndian()Is this a big endian filebooleanisSequential()Get whether this is a sequentially written filebooleanisTemplate()Get whether this is using a template or notbooleanisYReversed()Get whether y axis is reversed or notStringtoString()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(ucar.unidata.io.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
-
-