ucar.nc2.iosp.grib
Class GribGridServiceProvider

java.lang.Object
  extended by ucar.nc2.iosp.AbstractIOServiceProvider
      extended by ucar.nc2.iosp.grid.GridServiceProvider
          extended by ucar.nc2.iosp.grib.GribGridServiceProvider
All Implemented Interfaces:
IOServiceProvider

public class GribGridServiceProvider
extends GridServiceProvider


Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.nc2.iosp.grid.GridServiceProvider
GridServiceProvider.IndexExtendMode
 
Field Summary
 
Fields inherited from class ucar.nc2.iosp.grid.GridServiceProvider
addLatLon, alwaysInCache, debugMissing, debugMissingDetails, debugOpen, debugProj, debugTiming, debugVert, fmrcCoordSys, forceNewIndex, indexFileModeOnOpen, indexFileModeOnSync, ncfile, useMaximalCoordSys
 
Fields inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
raf
 
Constructor Summary
GribGridServiceProvider()
           
 
Method Summary
protected  float[] _readData(GridRecord gr)
          Read the data for this GridRecord
 String getFileTypeDescription()
          Get a human-readable description for this file type.
 String getFileTypeId()
          Get a unique id for this file type.
protected  GridIndex getIndex(String dataLocation)
          Open the index file.
 GridTableLookup getLookup()
           
protected  GridTableLookup getLookup1()
           
protected  GridTableLookup getLookup2()
           
 boolean isValidFile(RandomAccessFile raf)
          Check if this is a valid file for this IOServiceProvider.
protected  void open(GridIndex index, CancelTask cancelTask)
          Use the given index to fill the NetcdfFile object with attributes and variables.
 void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask)
          Open the service provider for reading.
 Object sendIospMessage(Object special)
          Send an IOSP message
 boolean sync()
          Update the metadata in the NetcdfFile if the underlying dataset has changed.
 
Methods inherited from class ucar.nc2.iosp.grid.GridServiceProvider
forceNewIndex, getDetailInfo, isMissingXY, readData, setDebugFlags, setExtendIndex, setIndexAlwaysInCache, setIndexFileModeOnOpen, setIndexFileModeOnSync, useMaximalCoordSys
 
Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
close, getFileTypeVersion, getStructureIterator, readSection, readToByteChannel, syncExtend, toStringDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GribGridServiceProvider

public GribGridServiceProvider()
Method Detail

isValidFile

public boolean isValidFile(RandomAccessFile raf)
Description copied from interface: IOServiceProvider
Check if this is a valid file for this IOServiceProvider. You must make this method thread safe, ie dont keep any state.

Parameters:
raf - RandomAccessFile
Returns:
true if valid.

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:
"http://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:
"http://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"

sendIospMessage

public Object sendIospMessage(Object special)
Description copied from class: GridServiceProvider
Send an IOSP message

Specified by:
sendIospMessage in interface IOServiceProvider
Overrides:
sendIospMessage in class GridServiceProvider
Parameters:
special - isn't that special?
Returns:
opaque return, may be null.

open

public void open(RandomAccessFile raf,
                 NetcdfFile ncfile,
                 CancelTask cancelTask)
          throws IOException
Description copied from class: GridServiceProvider
Open the service provider for reading.

Specified by:
open in interface IOServiceProvider
Overrides:
open in class GridServiceProvider
Parameters:
raf - file to read from
ncfile - 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
Description copied from class: GridServiceProvider
Use the given index to fill the NetcdfFile object with attributes and variables.

Specified by:
open in class GridServiceProvider
Parameters:
index - GridIndex to use
cancelTask - cancel task
Throws:
IOException - problem reading the file

getLookup

public GridTableLookup getLookup()
                          throws IOException
Throws:
IOException

getLookup2

protected GridTableLookup getLookup2()
                              throws IOException
Throws:
IOException

getLookup1

protected GridTableLookup getLookup1()
                              throws IOException
Throws:
IOException

getIndex

protected GridIndex getIndex(String dataLocation)
                      throws IOException
Open the index file. If not exists, create it. When writing use DiskCache, to make sure location is writeable.

Parameters:
dataLocation - location of the file. The index file has ".gbx" appended.
Returns:
ucar.grib.Index
Throws:
IOException - on io error

sync

public boolean sync()
             throws IOException
Description copied from interface: IOServiceProvider
Update the metadata in the NetcdfFile if the underlying dataset has changed.

Specified by:
sync in interface IOServiceProvider
Overrides:
sync in class AbstractIOServiceProvider
Returns:
true if the NetcdfFile was changed.
Throws:
IOException - if a read error occured when accessing the underlying dataset.

_readData

protected float[] _readData(GridRecord gr)
                     throws IOException
Description copied from class: GridServiceProvider
Read the data for this GridRecord

Specified by:
_readData in class GridServiceProvider
Parameters:
gr - grid identifier
Returns:
the data (or null)
Throws:
IOException - problem reading the data


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.