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 booleangetlastRecordReadstatic Grib2RecordlastRecordReadintrepeat
-
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheck(ucar.unidata.io.RandomAccessFile raf, Formatter f)GribData.InfogetBinaryDataInfo(ucar.unidata.io.RandomAccessFile raf)Grib2SectionBitMapgetBitmapSection()Grib2SectionDataRepresentationgetDataRepresentationSection()Grib2SectionDatagetDataSection()intgetDiscipline()intgetFile()Grib2GdsgetGDS()Grib2SectionGridDefinitiongetGDSsection()byte[]getHeader()Grib2SectionIdentificationgetId()Grib2SectionIndicatorgetIs()Grib2SectionLocalUsegetLocalUseSection()Grib2PdsgetPDS()Grib2SectionProductDefinitiongetPDSsection()ucar.nc2.time.CalendarDategetReferenceDate()intgetScanMode()booleanhasLocalUseSection()booleanisBmsReplaced()float[]readData(ucar.unidata.io.RandomAccessFile raf)float[]readData(ucar.unidata.io.RandomAccessFile raf, long drsPos)Read data arraystatic float[]readData(ucar.unidata.io.RandomAccessFile raf, long drsPos, long bmsPos, int gdsNumberPoints, int scanMode, int nx, int ny, int[] nptsInLine)Read data array: use when you want to be independent of the GribRecordGrib2Drs.Type40readDataTest(ucar.unidata.io.RandomAccessFile raf)int[]readRawData(ucar.unidata.io.RandomAccessFile raf)voidsetBms(Grib2SectionBitMap bms, boolean replaced)voidsetDataSection(Grib2SectionData dataSection)voidsetDrs(Grib2SectionDataRepresentation drs)voidsetFile(int file)voidsetGdss(Grib2SectionGridDefinition gdss)voidsetLus(Grib2SectionLocalUse lus)voidsetPdss(Grib2SectionProductDefinition pdss)voidshow(Formatter f)StringtoString()
-
-
-
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 ucar.nc2.time.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(ucar.unidata.io.RandomAccessFile raf) throws IOException- Throws:
IOException
-
readRawData
@Nullable public int[] readRawData(ucar.unidata.io.RandomAccessFile raf) throws IOException- Throws:
IOException
-
readDataTest
@Nullable public Grib2Drs.Type40 readDataTest(ucar.unidata.io.RandomAccessFile raf) throws IOException
- Throws:
IOException
-
readData
public float[] readData(ucar.unidata.io.RandomAccessFile raf, long drsPos) throws IOExceptionRead 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(ucar.unidata.io.RandomAccessFile raf, long drsPos, long bmsPos, int gdsNumberPoints, int scanMode, int nx, int ny, int[] nptsInLine) throws IOExceptionRead 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(ucar.unidata.io.RandomAccessFile raf, Formatter f) throws IOException- Throws:
IOException
-
getBinaryDataInfo
public GribData.Info getBinaryDataInfo(ucar.unidata.io.RandomAccessFile raf) throws IOException
- Throws:
IOException
-
-