net.sourceforge.jgrib
Class GribRecordBDS

Object
  extended by GribRecordBDS

public final class GribRecordBDS
extends Object

A class representing the binary data section (BDS) of a GRIB record.

Author:
Benjamin Stark, Simone Giannecchini

Constructor Summary
GribRecordBDS(ImageInputStream inStream, int decimalscale, GribRecordGDS gds, GribRecordBMS bms)
          DOCUMENT ME!
GribRecordBDS(int decimalScale, int datumPointBitLength, WritableRaster data, boolean isConstant, double max, double min, int numValidValues, GribRecordGDS gds, GribRecordBMS bms)
          GribRecordBDS constructor to be used when creating a GRIB from scratch.
 
Method Summary
 WritableRaster copyValues()
           
 WritableRaster copyValues(Rectangle2D roi)
           
 boolean equals(Object obj)
           
 int getBinaryScale()
          Get the binary scale factor.
 boolean getIsConstant()
          Get whether this BDS is single valued
 int getLength()
          Get the length in bytes of this section.
 double getMaxValue()
          Get maximum value
 double getMinValue()
          Get minimum value
 int getNumBits()
          Get number of bits used per parameter value.
 int getNumValidValues()
          DOCUMENT ME!
 double getReferenceValue()
          Get the reference value all data values are based on.
 WritableRaster getValues()
          Get data/parameter values as an array of double.
 WritableRaster getValues(Rectangle2D roi)
           
 String toString()
          Get a string representation of this BDS.
 void writeTo(OutputStream out)
          Serialization of BDS section with emphasis on data packing.
 
Methods inherited from class Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GribRecordBDS

public GribRecordBDS(int decimalScale,
                     int datumPointBitLength,
                     WritableRaster data,
                     boolean isConstant,
                     double max,
                     double min,
                     int numValidValues,
                     GribRecordGDS gds,
                     GribRecordBMS bms)
GribRecordBDS constructor to be used when creating a GRIB from scratch. In such a case

Parameters:
decimalScale - int >=0.
datumPointBitLength - int If 0 we will use vairbale length.
data - Raster matrix of data.
isConstant - DOCUMENT ME!
max - DOCUMENT ME!
min - DOCUMENT ME!
numValidValues - DOCUMENT ME!
gds - DOCUMENT ME!
bms - DOCUMENT ME!

GribRecordBDS

public GribRecordBDS(ImageInputStream inStream,
                     int decimalscale,
                     GribRecordGDS gds,
                     GribRecordBMS bms)
              throws IOException
DOCUMENT ME!

Parameters:
inStream -
decimalscale - DOCUMENT ME!
gds - DOCUMENT ME!
bms - DOCUMENT ME!
Throws:
IOException
NotSupportedException
Method Detail

getLength

public int getLength()
Get the length in bytes of this section.

Returns:
length in bytes of this section

getBinaryScale

public int getBinaryScale()
Get the binary scale factor.

Returns:
binary scale factor

getIsConstant

public boolean getIsConstant()
Get whether this BDS is single valued

Returns:
isConstant

getReferenceValue

public double getReferenceValue()
Get the reference value all data values are based on.

Returns:
reference value

getNumBits

public int getNumBits()
Get number of bits used per parameter value.

Returns:
number of bits used per parameter value

getValues

public WritableRaster getValues()
                         throws IOException
Get data/parameter values as an array of double.

Returns:
array of parameter values
Throws:
NoValidGribException
IOException

getValues

public WritableRaster getValues(Rectangle2D roi)
                         throws IOException
Throws:
IOException

copyValues

public final WritableRaster copyValues()
                                throws IOException
Throws:
IOException

copyValues

public WritableRaster copyValues(Rectangle2D roi)
                          throws IOException
Throws:
IOException

getMinValue

public double getMinValue()
Get minimum value

Returns:
mimimum value

getMaxValue

public double getMaxValue()
Get maximum value

Returns:
maximum value

toString

public String toString()
Get a string representation of this BDS.

Overrides:
toString in class Object
Returns:
string representation of this BDS

writeTo

public void writeTo(OutputStream out)
             throws IOException
Serialization of BDS section with emphasis on data packing.

Parameters:
out - OutputStream
Throws:
IOException - DOCUMENT ME!

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getNumValidValues

public int getNumValidValues()
DOCUMENT ME!

Returns:


Copyright © 2006-2010 GeoSolutions. All Rights Reserved.