Class NOAA1bFile

java.lang.Object
noaa.coastwatch.io.noaa1b.NOAA1bFile

public class NOAA1bFile extends Object
The 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.
Since:
3.2.2
Author:
Peter Hollemans
  • Constructor Details

    • NOAA1bFile

      public NOAA1bFile(String fileName) throws IOException
      Opens a NOAA 1b data file for reading. The byte order is assumed to be the standard big endian order that most NOAA 1b files are stored in.
      Parameters:
      fileName - the NOAA 1b filename.
      Throws:
      IOException - if an error occurred reading the file.
    • NOAA1bFile

      public NOAA1bFile(String fileName, boolean isByteSwapped) throws IOException
      Opens a NOAA 1b data file for reading.
      Parameters:
      fileName - the NOAA 1b filename.
      isByteSwapped - the byte swapped flag, true if the data is in little endian byte order.
      Throws:
      IOException - if an error occurred reading the file.
  • Method Details

    • getFormatVersion

      public int getFormatVersion()
      Gets the file format version number.
      Returns:
      the format version in the range [1..n] where n is the latest version being produced by NOAA. The format version is obtained from the data header record.
    • getArchiveHeader

      public ArchiveHeader getArchiveHeader()
      Gets the file archive header.
      Returns:
      the archive header or null if not available.
    • getDataHeader

      public DataHeader getDataHeader()
      Gets the file data header.
      Returns:
      the data header.
    • getInputBuffer

      public ByteBuffer getInputBuffer(int length)
      Gets an input buffer for record data with the correct byte order.
      Parameters:
      length - the length of the buffer.
      Returns:
      the buffer of byte values.
    • getDataRecord

      public DataRecord getDataRecord(int recordIndex, boolean readFull, ByteBuffer inputBuffer) throws IOException
      Gets a file data record.
      Parameters:
      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.
      Returns:
      the data record.
      Throws:
      IOException - if an error occurred reading the record.
    • getDataRecord

      public DataRecord getDataRecord(int recordIndex) throws IOException
      Gets a file data record.
      Parameters:
      recordIndex - the record to get in the range [0..getRecordCount()-1].
      Returns:
      the data record.
      Throws:
      IOException - if an error occurred reading the record.
    • getRecordCount

      public int getRecordCount()
      Gets the number of data records in this file.
    • getInstrument

      public terrenus.instrument.Instrument getInstrument()
      Gets the instrument whose data is recorded in this file.
    • getData

      public terrenus.instrument.InstrumentData getData(int recordIndex) throws IOException
      Gets the instrument data for the specified record.
      Parameters:
      recordIndex - the record index for instrument data.
      Returns:
      the instrument data for the specified record.
      Throws:
      IOException
    • close

      public void close() throws IOException
      Closes the file.
      Throws:
      IOException
    • main

      public static void main(String[] argv) throws Exception
      Tests this class.
      Parameters:
      argv - the array of command line parameters.
      Throws:
      Exception