public class Grib2Index extends GribIndex
GribIndex index = new GribIndex();
if (!index.readIndex(path))
index.makeIndex(path);
for (Grib2SectionGridDefinition gds : index.getGds()) {
if (gdsSet.get(gds.calcCRC()) == null)
gdsSet.put(gds.calcCRC(), gds);
}
for (Grib2Record gr : index.getRecords()) {
gr.setFile(fileno);
Grib2Pds pds = gr.getPDSsection().getPDS();
int discipline = gr.getDiscipline();
int id = gr.cdmVariableHash();
Grib2ParameterBean bean = pdsSet.get(id);
if (bean == null) {
bean = new Grib2ParameterBean(gr);
pdsSet.put(id, bean);
params.add(bean);
}
bean.addRecord(gr);
}
| Modifier and Type | Field and Description |
|---|---|
static int |
grib2index_proto_version |
static String |
MAGIC_START |
static int |
ScanModeMissing |
| Constructor and Description |
|---|
Grib2Index() |
| Modifier and Type | Method and Description |
|---|---|
List<Grib2SectionGridDefinition> |
getGds() |
int |
getNRecords()
The number of records in the index.
|
List<Grib2Record> |
getRecords() |
static void |
main(String[] args) |
boolean |
makeIndex(String filename,
ucar.unidata.io.RandomAccessFile dataRaf)
Make the gbx9 index file.
|
boolean |
readIndex(String filename,
long gribLastModified) |
boolean |
readIndex(String filename,
long gribLastModified,
thredds.inventory.CollectionUpdateType force)
Read the gbx9 index file.
|
getChangeChecker, open, readOrCreateIndexFromSingleFilepublic static final String MAGIC_START
public static final int ScanModeMissing
public static final int grib2index_proto_version
public List<Grib2SectionGridDefinition> getGds()
public List<Grib2Record> getRecords()
public int getNRecords()
GribIndexgetNRecords in class GribIndexpublic boolean readIndex(String filename, long gribLastModified) throws IOException
IOExceptionpublic boolean readIndex(String filename, long gribLastModified, thredds.inventory.CollectionUpdateType force) throws IOException
GribIndexreadIndex in class GribIndexfilename - location of the data filegribLastModified - last modified date of the data fileforce - rewrite? always, test, nocheck, neverIOException - on io errorpublic boolean makeIndex(String filename, ucar.unidata.io.RandomAccessFile dataRaf) throws IOException
GribIndexmakeIndex in class GribIndexfilename - location of the data filedataRaf - already opened data raf (leave open); if null, makeIndex opens and closes)IOException - on io errorpublic static void main(String[] args) throws IOException
IOException