public class NOAA1bFile
extends java.lang.Object
NOAA1bFile
is an interface for reading NOAA
1b weather satellite data files. The intention is to have a
uniform way of reading any NOAA 1b file format from any sensor
among the AVHRR and TOVS packages.Constructor and Description |
---|
NOAA1bFile(java.lang.String fileName)
Opens a NOAA 1b data file for reading.
|
NOAA1bFile(java.lang.String fileName,
boolean isByteSwapped)
Opens a NOAA 1b data file for reading.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the file.
|
ArchiveHeader |
getArchiveHeader()
Gets the file archive header.
|
terrenus.instrument.InstrumentData |
getData(int recordIndex)
Gets the instrument data for the specified record.
|
DataHeader |
getDataHeader()
Gets the file data header.
|
DataRecord |
getDataRecord(int recordIndex)
Gets a file data record.
|
DataRecord |
getDataRecord(int recordIndex,
boolean readFull,
java.nio.ByteBuffer inputBuffer)
Gets a file data record.
|
int |
getFormatVersion()
Gets the file format version number.
|
java.nio.ByteBuffer |
getInputBuffer(int length)
Gets an input buffer for record data with the correct byte
order.
|
terrenus.instrument.Instrument |
getInstrument()
Gets the instrument whose data is recorded in this file.
|
int |
getRecordCount()
Gets the number of data records in this file.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
public NOAA1bFile(java.lang.String fileName) throws java.io.IOException
fileName
- the NOAA 1b filename.java.io.IOException
- if an error occurred reading the file.public NOAA1bFile(java.lang.String fileName, boolean isByteSwapped) throws java.io.IOException
fileName
- the NOAA 1b filename.isByteSwapped
- the byte swapped flag, true if the data
is in little endian byte order.java.io.IOException
- if an error occurred reading the file.public int getFormatVersion()
public ArchiveHeader getArchiveHeader()
public DataHeader getDataHeader()
public java.nio.ByteBuffer getInputBuffer(int length)
length
- the length of the buffer.public DataRecord getDataRecord(int recordIndex, boolean readFull, java.nio.ByteBuffer inputBuffer) throws java.io.IOException
recordIndex
- the record to get in the range
[0..getRecordCount()
-1].readFull
- the full record flag, true to read a full data
record or false to only read the data record attributes (see
DataHeader.getRecordAttSize()
).inputBuffer
- the input buffer to use for reading or null to
create a new one.java.io.IOException
- if an error occurred reading the record.public DataRecord getDataRecord(int recordIndex) throws java.io.IOException
recordIndex
- the record to get in the range
[0..getRecordCount()
-1].java.io.IOException
- if an error occurred reading the record.public int getRecordCount()
public terrenus.instrument.Instrument getInstrument()
public terrenus.instrument.InstrumentData getData(int recordIndex) throws java.io.IOException
recordIndex
- the record index for instrument data.java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception