public abstract class GempakStationFileIOSP extends AbstractIOServiceProvider
| Modifier and Type | Field and Description |
|---|---|
protected static Dimension |
DIM_LEN2
static for shared dimension of length 2
|
protected static Dimension |
DIM_LEN4
static for shared dimension of length 4
|
protected static Dimension |
DIM_LEN8
static for shared dimension of length 4
|
protected AbstractGempakStationFileReader |
gemreader
Gempak file reader
|
protected static java.lang.Number |
IMISS
Integer missing attribute
|
protected static java.lang.String |
MISSING_VAR
name for the time variable
|
protected NetcdfFile |
ncfile
The netCDF file
|
protected java.lang.StringBuilder |
parseInfo
place to store debug stuff
|
protected RandomAccessFile |
raf
the file we are reading
|
protected static java.lang.Number |
RMISS
Float missing attribute
|
protected static java.lang.String |
TIME_VAR
name for the time variable
|
| Constructor and Description |
|---|
GempakStationFileIOSP() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addGlobalAttributes()
Add on global attributes for all types
|
protected void |
buildNCFile()
Build the netCDF file
|
void |
close()
Close this IOSP
|
protected abstract void |
fillNCFile()
Fill the contents of the netCDF file.
|
java.lang.String |
getCFFeatureType()
Get the CF feature type, subclasses should override
|
java.lang.String |
getConventions()
Get the netCDF conventions identifier.
|
java.lang.String |
getDetailInfo()
Get the detail information
|
protected java.lang.String |
getStackTrace()
Return the stack trace of this calling thread
|
protected int |
getStnVarSize(java.lang.String name)
Get the size of a particular station variable
|
boolean |
isValidFile(RandomAccessFile raf)
Is this a valid file?
|
protected Variable |
makeMissingVariable()
Make the missing variable
|
protected Variable |
makeParamVariable(GempakParameter param,
java.util.List<Dimension> dims)
Make a variable from a GempakParmaeter
|
protected abstract AbstractGempakStationFileReader |
makeStationReader()
Make the appropriate station file reader, subclasses need to implement
this
|
protected Variable |
makeStationVariable(java.lang.String varname,
Dimension firstDim)
Make a station variable
|
protected java.util.List<Variable> |
makeStationVars(java.util.List<GempakStation> stations,
Dimension dim)
Make the station variables from a representative station
|
protected Structure |
makeStructure(java.lang.String partName,
java.util.List dimensions,
boolean includeMissing)
Make a structure for the part
|
void |
open(RandomAccessFile raf,
NetcdfFile ncfile,
CancelTask cancelTask)
Open the service provider for reading.
|
protected void |
printStack(java.lang.String msg,
int maxLines)
Print the stack trace for a given line of code.
|
boolean |
sync()
Sync the file
|
boolean |
syncExtend()
Sync and extend
|
getFileTypeVersion, getStructureIterator, readSection, readToByteChannel, sendIospMessage, toStringDebugclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFileTypeDescription, getFileTypeId, readDataprotected NetcdfFile ncfile
protected RandomAccessFile raf
protected AbstractGempakStationFileReader gemreader
protected java.lang.StringBuilder parseInfo
protected static final java.lang.Number RMISS
protected static final java.lang.Number IMISS
protected static final Dimension DIM_LEN8
protected static final Dimension DIM_LEN4
protected static final Dimension DIM_LEN2
protected static final java.lang.String TIME_VAR
protected static final java.lang.String MISSING_VAR
public boolean isValidFile(RandomAccessFile raf) throws java.io.IOException
raf - RandomAccessFile to checkjava.io.IOException - problem reading fileprotected abstract AbstractGempakStationFileReader makeStationReader()
public void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws java.io.IOException
open in interface IOServiceProvideropen in class AbstractIOServiceProviderraf - file to read fromncfile - netCDF file we are writing to (memory)cancelTask - task for cancellingjava.io.IOException - problem reading filepublic void close()
throws java.io.IOException
close in interface IOServiceProviderclose in class AbstractIOServiceProviderjava.io.IOException - problem closing filepublic boolean syncExtend()
syncExtend in interface IOServiceProvidersyncExtend in class AbstractIOServiceProviderpublic java.lang.String getDetailInfo()
getDetailInfo in interface IOServiceProvidergetDetailInfo in class AbstractIOServiceProviderpublic boolean sync()
throws java.io.IOException
sync in interface IOServiceProvidersync in class AbstractIOServiceProviderjava.io.IOException - problem synching the fileprotected void buildNCFile()
throws java.io.IOException
java.io.IOException - problem reading the fileprotected abstract void fillNCFile()
throws java.io.IOException
java.io.IOException - problem reading the fileprotected Structure makeStructure(java.lang.String partName, java.util.List dimensions, boolean includeMissing)
partName - partnamedimensions - dimensions for the structureincludeMissing - true to include the missing variableprotected Variable makeMissingVariable()
protected Variable makeParamVariable(GempakParameter param, java.util.List<Dimension> dims)
param - GempakParameterdims - Variable dimensionsprotected void addGlobalAttributes()
public java.lang.String getConventions()
public java.lang.String getCFFeatureType()
protected int getStnVarSize(java.lang.String name)
name - name of the variable (key)protected java.util.List<Variable> makeStationVars(java.util.List<GempakStation> stations, Dimension dim)
stations - list of stationsdim - station dimensionprotected Variable makeStationVariable(java.lang.String varname, Dimension firstDim)
varname - variable namefirstDim - station dimensionprotected void printStack(java.lang.String msg,
int maxLines)
msg - message to printmaxLines - number of lines in the stack to printprotected java.lang.String getStackTrace()