Package ucar.nc2.grib.grib2
Class Grib2Record
- java.lang.Object
-
- ucar.nc2.grib.grib2.Grib2Record
-
public class Grib2Record extends Object
Read one Record from a GRIB-2 files- Since:
- 3/28/11
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
getlastRecordRead
static Grib2Record
lastRecordRead
int
repeat
-
Constructor Summary
Constructors Constructor Description Grib2Record(byte[] header, Grib2SectionIndicator is, Grib2SectionIdentification id, Grib2SectionLocalUse lus, Grib2SectionGridDefinition gdss, Grib2SectionProductDefinition pdss, Grib2SectionDataRepresentation drs, Grib2SectionBitMap bms, Grib2SectionData dataSection, boolean bmsReplaced, int scanMode)
Construction for Grib2Record.
-
Method Summary
-
-
-
Field Detail
-
repeat
public int repeat
-
getlastRecordRead
public static boolean getlastRecordRead
-
lastRecordRead
public static Grib2Record lastRecordRead
-
-
Constructor Detail
-
Grib2Record
public Grib2Record(byte[] header, Grib2SectionIndicator is, Grib2SectionIdentification id, Grib2SectionLocalUse lus, Grib2SectionGridDefinition gdss, Grib2SectionProductDefinition pdss, Grib2SectionDataRepresentation drs, Grib2SectionBitMap bms, Grib2SectionData dataSection, boolean bmsReplaced, int scanMode)
Construction for Grib2Record.- Parameters:
header
- Grib headeris
- Grib2IndicatorSectionid
- Grib2IdentificationSectionlus
- raw bytes of local use sectiongdss
- Grib2GridDefinitionSectionpdss
- Grib2ProductDefinitionSectiondrs
- Grib2SectionDataRepresentationbms
- Grib2SectionBitMapdataSection
- Grib2SectionDatabmsReplaced
- Grib2SectionDatascanMode
- from GDS of this record
-
-
Method Detail
-
getHeader
public byte[] getHeader()
-
getIs
public Grib2SectionIndicator getIs()
-
getId
public Grib2SectionIdentification getId()
-
hasLocalUseSection
public boolean hasLocalUseSection()
-
getLocalUseSection
public Grib2SectionLocalUse getLocalUseSection()
-
getGDSsection
public Grib2SectionGridDefinition getGDSsection()
-
getPDSsection
public Grib2SectionProductDefinition getPDSsection()
-
getDataRepresentationSection
public Grib2SectionDataRepresentation getDataRepresentationSection()
-
getBitmapSection
public Grib2SectionBitMap getBitmapSection()
-
getDataSection
public Grib2SectionData getDataSection()
-
getDiscipline
public int getDiscipline()
-
getReferenceDate
public CalendarDate getReferenceDate()
-
getPDS
public Grib2Pds getPDS()
-
getGDS
public Grib2Gds getGDS()
-
getScanMode
public int getScanMode()
-
show
public void show(Formatter f)
-
setLus
public void setLus(Grib2SectionLocalUse lus)
-
setGdss
public void setGdss(Grib2SectionGridDefinition gdss)
-
setPdss
public void setPdss(Grib2SectionProductDefinition pdss)
-
setDrs
public void setDrs(Grib2SectionDataRepresentation drs)
-
setBms
public void setBms(Grib2SectionBitMap bms, boolean replaced)
-
setDataSection
public void setDataSection(Grib2SectionData dataSection)
-
getFile
public int getFile()
-
setFile
public void setFile(int file)
-
isBmsReplaced
public boolean isBmsReplaced()
-
readData
public float[] readData(RandomAccessFile raf) throws IOException
- Throws:
IOException
-
readRawData
@Nullable public int[] readRawData(RandomAccessFile raf) throws IOException
- Throws:
IOException
-
readDataTest
@Nullable public Grib2Drs.Type40 readDataTest(RandomAccessFile raf) throws IOException
- Throws:
IOException
-
readData
public float[] readData(RandomAccessFile raf, long drsPos) throws IOException
Read data array- Parameters:
raf
- from this RandomAccessFiledrsPos
- Grib2SectionDataRepresentation starts here- Returns:
- data as float[] array
- Throws:
IOException
- on read error
-
readData
public static float[] readData(RandomAccessFile raf, long drsPos, long bmsPos, int gdsNumberPoints, int scanMode, int nx, int ny, int[] nptsInLine) throws IOException
Read data array: use when you want to be independent of the GribRecord- Parameters:
raf
- from this RandomAccessFiledrsPos
- Grib2SectionDataRepresentation starts herebmsPos
- if non-zero, use the bms that starts heregdsNumberPoints
- gdss.getNumberPoints()scanMode
- gds.scanModenx
- gds.nx- Returns:
- data as float[] array
- Throws:
IOException
- on read error
-
check
public void check(RandomAccessFile raf, Formatter f) throws IOException
- Throws:
IOException
-
getBinaryDataInfo
public GribData.Info getBinaryDataInfo(RandomAccessFile raf) throws IOException
- Throws:
IOException
-
-