Package ucar.nc2.iosp.gempak
Class GempakGridServiceProvider
- java.lang.Object
-
- ucar.nc2.iosp.AbstractIOServiceProvider
-
- ucar.nc2.iosp.grid.GridServiceProvider
-
- ucar.nc2.iosp.gempak.GempakGridServiceProvider
-
- All Implemented Interfaces:
Comparable<IOServiceProvider>
,IOServiceProvider
public class GempakGridServiceProvider extends GridServiceProvider
An IOSP for GEMPAK Grid data
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ucar.nc2.iosp.grid.GridServiceProvider
GridServiceProvider.IndexExtendMode
-
Nested classes/interfaces inherited from interface ucar.nc2.iosp.IOServiceProvider
IOServiceProvider.SortGroup
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
extendIndex
Reread the file on a syncprotected GempakGridReader
gemreader
GEMPAK file reader-
Fields inherited from class ucar.nc2.iosp.grid.GridServiceProvider
addLatLon, alwaysInCache, debugMissing, debugMissingDetails, debugOpen, debugProj, debugTiming, debugVert, forceNewIndex, indexFileModeOnOpen, indexFileModeOnSync
-
Fields inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
location, ncfile, raf, rafOrder
-
-
Constructor Summary
Constructors Constructor Description GempakGridServiceProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected float[]
_readData(GridRecord gr)
Read the data for this GridRecordString
getFileTypeDescription()
Get a human-readable description for this file type.String
getFileTypeId()
Get a unique id for this file type.boolean
isValidFile(RandomAccessFile raf)
Is this a valid file?protected void
open(GridIndex index, CancelTask cancelTask)
Open the index and create the netCDF file from thatvoid
open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask)
Open the service provider for reading.static void
setExtendIndex(boolean b)
Extend the list of gridboolean
sync()
Sync the file-
Methods inherited from class ucar.nc2.iosp.grid.GridServiceProvider
forceNewIndex, isMissingXY, readData, setDebugFlags, setIndexAlwaysInCache, setIndexFileModeOnOpen, setIndexFileModeOnSync
-
Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
build, buildFinish, close, getDetailInfo, getFileTypeVersion, getLastModified, getStructureIterator, isBuilder, reacquire, readSection, readToByteChannel, readToOutputStream, release, sendIospMessage, setNetcdfFile, streamToByteChannel, syncExtend, toStringDebug
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ucar.nc2.iosp.IOServiceProvider
compareTo, getSortGroup
-
-
-
-
Field Detail
-
gemreader
protected GempakGridReader gemreader
GEMPAK file reader
-
extendIndex
public static boolean extendIndex
Reread the file on a sync
-
-
Method Detail
-
isValidFile
public boolean isValidFile(RandomAccessFile raf) throws IOException
Is this a valid file?- Parameters:
raf
- RandomAccessFile to check- Returns:
- true if a valid GEMPAK grid file
- Throws:
IOException
- problem reading file
-
getFileTypeId
public String getFileTypeId()
Description copied from interface:IOServiceProvider
Get a unique id for this file type.- Returns:
- registered id of the file type
- See Also:
- "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
-
getFileTypeDescription
public String getFileTypeDescription()
Description copied from interface:IOServiceProvider
Get a human-readable description for this file type.- Returns:
- description of the file type
- See Also:
- "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
-
open
public void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException
Open the service provider for reading.- Specified by:
open
in interfaceIOServiceProvider
- Overrides:
open
in classGridServiceProvider
- Parameters:
raf
- file to read fromncfile
- netCDF file we are writing to (memory)cancelTask
- task for cancelling- Throws:
IOException
- problem reading file
-
open
protected void open(GridIndex index, CancelTask cancelTask) throws IOException
Open the index and create the netCDF file from that- Specified by:
open
in classGridServiceProvider
- Parameters:
index
- GridIndex to usecancelTask
- cancel task- Throws:
IOException
- problem reading the file
-
sync
public boolean sync() throws IOException
Sync the file- Returns:
- true if needed to sync
- Throws:
IOException
- problem synching the file
-
_readData
protected float[] _readData(GridRecord gr) throws IOException
Read the data for this GridRecord- Specified by:
_readData
in classGridServiceProvider
- Parameters:
gr
- grid identifier- Returns:
- the data (or null)
- Throws:
IOException
- problem reading the data
-
setExtendIndex
public static void setExtendIndex(boolean b)
Extend the list of grid- Parameters:
b
- true to reread the grid on a sync
-
-