ucar.nc2.iosp.grid
Class GridServiceProvider

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

public abstract class GridServiceProvider
extends java.lang.Object
implements IOServiceProvider

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.StringBuffer 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, java.util.List section)
          Read the data for the variable
 Array readNestedData(Variable v2, java.util.List section)
          Read nested data
static void setDebugFlags(DebugFlags debugFlag)
          Set the debug flags
 void setSpecial(java.lang.Object special)
          Set the special object on this IOSP
 boolean syncExtend()
          Sync and extend
 java.lang.String toStringDebug(java.lang.Object o)
          Debug string info (why is this in the interface?)
static void useMaximalCoordSys(boolean b)
          Set whether to use the maximal coordinate system or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ucar.nc2.IOServiceProvider
isValidFile, sync
 

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.StringBuffer 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.

Specified by:
open in interface IOServiceProvider
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

Specified by:
close in interface IOServiceProvider
Throws:
java.io.IOException - problem closing file

syncExtend

public boolean syncExtend()
Sync and extend

Specified by:
syncExtend in interface IOServiceProvider
Returns:
false

getDetailInfo

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

Specified by:
getDetailInfo in interface IOServiceProvider
Returns:
the detail info

toStringDebug

public java.lang.String toStringDebug(java.lang.Object o)
Debug string info (why is this in the interface?)

Specified by:
toStringDebug in interface IOServiceProvider
Parameters:
o - object to debug
Returns:
string rep of the object in question

readNestedData

public Array readNestedData(Variable v2,
                            java.util.List section)
                     throws java.io.IOException,
                            InvalidRangeException
Read nested data

Specified by:
readNestedData in interface IOServiceProvider
Parameters:
v2 - Variable to read
section - section info
Returns:
Array of data
Throws:
java.io.IOException - problem reading file
InvalidRangeException - invalid range

setSpecial

public void setSpecial(java.lang.Object special)
Set the special object on this IOSP

Specified by:
setSpecial in interface IOServiceProvider
Parameters:
special - isn't that special?

readData

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

Specified by:
readData in interface IOServiceProvider
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