ucar.grib.grib2
Class Grib2ExtractRawData

java.lang.Object
  extended by ucar.grib.grib2.Grib2ExtractRawData

public final class Grib2ExtractRawData
extends java.lang.Object

A class that scans a GRIB2 file stream to extract product information. Either the first record of the Grib file is returned or all the records matching a certain parameter are return. The parameter is designated by it's Discipline number, Category number, and Parameter number.


Constructor Summary
Grib2ExtractRawData(ucar.unidata.io.RandomAccessFile raf)
          Constructs a Grib2ExtractRawData object from a raf.
 
Method Summary
static void main(java.lang.String[] args)
          Outputs first record of raw data to STDOUT or parms based on discipline, category, and number
 boolean scan(int discipline, int category, int number, int forecast)
          scans the Grib2 file obtaining the first record or the data associated with a parameter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grib2ExtractRawData

public Grib2ExtractRawData(ucar.unidata.io.RandomAccessFile raf)
Constructs a Grib2ExtractRawData object from a raf.

Parameters:
raf - with GRIB content
Method Detail

scan

public final boolean scan(int discipline,
                          int category,
                          int number,
                          int forecast)
                   throws java.io.IOException
scans the Grib2 file obtaining the first record or the data associated with a parameter

Parameters:
discipline, - parameter discipline number
category, - parameter category number
number, - parameter number
forecast - extract these times
Returns:
success in reading Grib file
Throws:
NotSupportedException - NotSupportedException
java.io.IOException - on data read

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Outputs first record of raw data to STDOUT or parms based on discipline, category, and number

Parameters:
args - filename
Throws:
java.io.IOException - on data reads