ucar.nc2.iosp.grid
Class GridServiceProvider

java.lang.Object
  extended by ucar.nc2.iosp.AbstractIOServiceProvider
      extended by ucar.nc2.iosp.grid.GridServiceProvider
All Implemented Interfaces:
IOServiceProvider
Direct Known Subclasses:
GempakGridServiceProvider, McIDASGridServiceProvider

public abstract class GridServiceProvider
extends AbstractIOServiceProvider

An IOSP for Gempak Grid data

Version:
$Revision: 1.3 $
Author:
IDV Development Team

Field Summary
static boolean addLatLon
          TODO: flag for whether to add lat/lon coordinates
protected static boolean debugMissing
          debug flags
protected static boolean debugMissingDetails
          debug flags
protected static boolean debugOpen
          debug flags
protected static boolean debugProj
          debug flags
protected static boolean debugTiming
          debug flags
protected static boolean debugVert
          debug flags
protected  FmrcCoordSys fmrcCoordSys
          FMRC coordinate system
protected  NetcdfFile ncfile
          The netCDF file
protected  java.lang.StringBuilder parseInfo
          place to store debug stuff
protected  RandomAccessFile raf
          the file we are reading
static boolean useMaximalCoordSys
          flag for using maximal coordinate system
 
Constructor Summary
GridServiceProvider()
           
 
Method Summary
protected abstract  float[] _readData(GridRecord gr)
          Read the data for this GridRecord
 void close()
          Close this IOSP
 java.lang.String getDetailInfo()
          Get the detail information
protected abstract  void open(GridIndex index, CancelTask cancelTask)
          Open the index and create the netCDF file from that
 void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask)
          Open the service provider for reading.
 Array readData(Variable v2, Section section)
          Read the data for the variable
 java.lang.Object sendIospMessage(java.lang.Object special)
          Send an IOSP message
static void setDebugFlags(DebugFlags debugFlag)
          Set the debug flags
 boolean syncExtend()
          Sync and extend
static void useMaximalCoordSys(boolean b)
          Set whether to use the maximal coordinate system or not
 
Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
createValidNetcdfObjectName, getStructureIterator, readSection, readToByteChannel, sync, 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
isValidFile
 

Field Detail

fmrcCoordSys

protected FmrcCoordSys fmrcCoordSys
FMRC coordinate system


ncfile

protected NetcdfFile ncfile
The netCDF file


raf

protected RandomAccessFile raf
the file we are reading


parseInfo

protected java.lang.StringBuilder parseInfo
place to store debug stuff


debugOpen

protected static boolean debugOpen
debug flags


debugMissing

protected static boolean debugMissing
debug flags


debugMissingDetails

protected static boolean debugMissingDetails
debug flags


debugProj

protected static boolean debugProj
debug flags


debugTiming

protected static boolean debugTiming
debug flags


debugVert

protected static boolean debugVert
debug flags


addLatLon

public static boolean addLatLon
TODO: flag for whether to add lat/lon coordinates


useMaximalCoordSys

public static boolean useMaximalCoordSys
flag for using maximal coordinate system

Constructor Detail

GridServiceProvider

public GridServiceProvider()
Method Detail

useMaximalCoordSys

public static void useMaximalCoordSys(boolean b)
Set whether to use the maximal coordinate system or not

Parameters:
b - true to use

setDebugFlags

public static void setDebugFlags(DebugFlags debugFlag)
Set the debug flags

Parameters:
debugFlag - debug flags

open

protected abstract void open(GridIndex index,
                             CancelTask cancelTask)
                      throws java.io.IOException
Open the index and create the netCDF file from that

Parameters:
index - GridIndex to use
cancelTask - cancel task
Throws:
java.io.IOException - problem reading the file

open

public void open(RandomAccessFile raf,
                 NetcdfFile ncfile,
                 CancelTask cancelTask)
          throws java.io.IOException
Open the service provider for reading.

Parameters:
raf - file to read from
ncfile - netCDF file we are writing to (memory)
cancelTask - task for cancelling
Throws:
java.io.IOException - problem reading file

close

public void close()
           throws java.io.IOException
Close this IOSP

Throws:
java.io.IOException - problem closing file

syncExtend

public boolean syncExtend()
Sync and extend

Specified by:
syncExtend in interface IOServiceProvider
Overrides:
syncExtend in class AbstractIOServiceProvider
Returns:
false

getDetailInfo

public java.lang.String getDetailInfo()
Get the detail information

Specified by:
getDetailInfo in interface IOServiceProvider
Overrides:
getDetailInfo in class AbstractIOServiceProvider
Returns:
the detail info

sendIospMessage

public java.lang.Object sendIospMessage(java.lang.Object special)
Send an IOSP message

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

readData

public Array readData(Variable v2,
                      Section section)
               throws java.io.IOException,
                      InvalidRangeException
Read the data for the variable

Parameters:
v2 - Variable to read
section - section infomation
Returns:
Array of data
Throws:
java.io.IOException - problem reading from file
InvalidRangeException - invalid Range
See Also:
Range

_readData

protected abstract float[] _readData(GridRecord gr)
                              throws java.io.IOException
Read the data for this GridRecord

Parameters:
gr - grid identifier
Returns:
the data (or null)
Throws:
java.io.IOException - problem reading the data