Package ucar.nc2.iosp.gempak
Class AbstractGempakStationFileReader
- java.lang.Object
-
- ucar.nc2.iosp.gempak.GempakFileReader
-
- ucar.nc2.iosp.gempak.AbstractGempakStationFileReader
-
- All Implemented Interfaces:
GempakConstants
- Direct Known Subclasses:
GempakSoundingFileReader
,GempakSurfaceFileReader
public abstract class AbstractGempakStationFileReader extends GempakFileReader
Class to hold common methods for reading surface and sounding files
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ucar.nc2.iosp.gempak.GempakFileReader
GempakFileReader.DMFileHeaderInfo, GempakFileReader.DMHeaders, GempakFileReader.DMKeys, GempakFileReader.DMParam, GempakFileReader.DMPart, GempakFileReader.Key, GempakFileReader.PackingInfo, GempakFileReader.RData
-
-
Field Summary
Fields Modifier and Type Field Description static String
DATE
date key identifierprotected String
subType
The file subtypestatic String
TIME
time key identifier-
Fields inherited from class ucar.nc2.iosp.gempak.GempakFileReader
dmLabel, fileHeaderInfo, fileSize, headers, keys, MTMACH, mvmst, needToSwap, parts, rf
-
Fields inherited from interface ucar.nc2.iosp.gempak.GempakConstants
COL, IMISSD, LLGDHD, LLNANL, LLNNAV, LLSTHL, MBLKSZ, MDCHAR, MDGDEC, MDGDIF, MDGGRB, MDGNMC, MDGNON, MDGRB2, MDGRID, MDINTG, MDREAL, MDRPCK, MFGD, MFSF, MFSN, MTALPH, MTAPOL, MTHP, MTIBM, MTIGPH, MTIRIS, MTLNUX, MTSUN, MTULTX, MTVAX, RDIFFD, RMISSD, ROW
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
findStationIndex(String id)
Find the station index for the specified station id.List<Date>
getDates()
Get the list of dates in this file.protected String
getDateString(int index)
Get the date string at the indexprotected String
getFileSubType()
Get the file sub typeString
getFileType()
Get the type for this fileList<GempakParameter>
getParameters(String partName)
Get the list of parameters for the partList<String>
getStationKeyNames()
Get the station key namesList<GempakStation>
getStations()
Get the list of stations in this file.protected boolean
init()
Initialize this reader.protected boolean
init(boolean fullCheck)
Initialize this reader.protected List<String>
makeDateList(boolean unique)
Get the list of datesprotected abstract void
makeFileSubType()
Subclasses need to set the subtype.void
printDates()
Print the list of dates in the filevoid
printStations(boolean list)
Print the list of dates in the fileprotected boolean
readStationsAndTimes(boolean uniqueTimes)
Read in the stations and times.-
Methods inherited from class ucar.nc2.iosp.gempak.GempakFileReader
DM_RDTR, DM_RDTR, DM_RFLT, DM_RFLT, DM_RFLT, DM_RINT, DM_RINT, DM_RINT, DM_RPKG, DM_RSTR, DM_RSTR, DM_UNPK, findFileHeader, findKey, getBits, getByteOrder, getByteOrder, getDataPointer, getErrorMessage, getFile, getFileHeader, getFilename, getInitFileSize, getInstance, getOffset, getPart, getPartNumber, init, logError, printFileLabel, printHeaders, printKeys, printParts, readFileHeaderInfo, readHeaders, readKeys, readParts
-
-
-
-
Field Detail
-
DATE
public static final String DATE
date key identifier- See Also:
- Constant Field Values
-
TIME
public static final String TIME
time key identifier- See Also:
- Constant Field Values
-
subType
protected String subType
The file subtype
-
-
Method Detail
-
init
protected boolean init() throws IOException
Initialize this reader. Read all the metadata- Overrides:
init
in classGempakFileReader
- Returns:
- true if successful
- Throws:
IOException
- problem reading the data
-
init
protected boolean init(boolean fullCheck) throws IOException
Initialize this reader. Get the Grid specific info- Overrides:
init
in classGempakFileReader
- Parameters:
fullCheck
- check to make sure there are grids we can handle- Returns:
- true if successful
- Throws:
IOException
- problem reading the data
-
readStationsAndTimes
protected boolean readStationsAndTimes(boolean uniqueTimes)
Read in the stations and times. Subclasses should call this during init()- Parameters:
uniqueTimes
- make a set of unique times- Returns:
- true if stations and times were read okay.
-
makeDateList
protected List<String> makeDateList(boolean unique)
Get the list of dates- Parameters:
unique
- true for unique list- Returns:
- the list of dates
-
getParameters
public List<GempakParameter> getParameters(String partName)
Get the list of parameters for the part- Parameters:
partName
- name of the part- Returns:
- list of parameters
-
getStationKeyNames
public List<String> getStationKeyNames()
Get the station key names- Returns:
- the list of station key names
-
getStations
public List<GempakStation> getStations()
Get the list of stations in this file.- Returns:
- list of stations.
-
getDateString
protected String getDateString(int index)
Get the date string at the index- Parameters:
index
- index (row or column)- Returns:
- the date at that index
-
printDates
public void printDates()
Print the list of dates in the file
-
printStations
public void printStations(boolean list)
Print the list of dates in the file- Parameters:
list
- true to list each station, false to list summary
-
findStationIndex
public int findStationIndex(String id)
Find the station index for the specified station id.- Parameters:
id
- station id (case sensitive)- Returns:
- index or -1 if not found.
-
getFileType
public String getFileType()
Get the type for this file- Returns:
- file type
-
makeFileSubType
protected abstract void makeFileSubType()
Subclasses need to set the subtype. This is an abstract method so users will implement something to set the type.
-
getFileSubType
protected String getFileSubType()
Get the file sub type- Returns:
- the subtype.
-
-