Terrenus HRPT v2.2

terrenus.instrument
Class CWHDFDataWriter

java.lang.Object
  extended by terrenus.instrument.AbstractRadiometerDataWriter
      extended by terrenus.instrument.CWHDFDataWriter
All Implemented Interfaces:
RadiometerDataWriter

public class CWHDFDataWriter
extends AbstractRadiometerDataWriter

The CWHDFDataWriter class writes radiometer data to Hierachical Data Format (HDF) version 4 files. All available radiometer channels are written in units specified by the AbstractRadiometerDataWriter.writeData(terrenus.telemetry.TelemetryDecoder, terrenus.instrument.Radiometer, int, int, terrenus.instrument.RadiometerCalibrator.CalibrationType, terrenus.instrument.RadiometerCalibrator.CalibrationType) method. The metadata written conforms to the CoastWatch HDF version 3.4 specificaion. Latitude, longitude, satellite zenith, solar zenith, and relative azimuth data are also computed and written in degrees. Latitude and longitude variables are written as HDF 32-bit floats, and all other angle data and radiometer channels as HDF 16-bit signed integers scaled by 0.01.


Field Summary
 
Fields inherited from class terrenus.instrument.AbstractRadiometerDataWriter
history, origin
 
Constructor Summary
CWHDFDataWriter(java.lang.String output)
          Creates a new writer.
 
Method Summary
protected  void closeOutput()
          Closes the output sink for radiometer data.
protected  void createVariables(java.util.List<java.lang.String> varNames, java.util.List<java.lang.String> varUnits, int[] dims)
          Creates the specified set of variables in the output.
protected  void openOutput(TelemetryDecoder decoder, Radiometer radiometer, int startFrame, int endFrame)
          Opens a new output sink for radiometer data.
protected  void writeLineData(int varIndex, int line, double[] lineData)
          Writes a line of variable data to the output.
protected  void writeMissingLineData(int varIndex, int line)
          Writes a line of missing variable data to the output.
 
Methods inherited from class terrenus.instrument.AbstractRadiometerDataWriter
setHistory, setOrigin, writeData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CWHDFDataWriter

public CWHDFDataWriter(java.lang.String output)
Creates a new writer.

Method Detail

createVariables

protected void createVariables(java.util.List<java.lang.String> varNames,
                               java.util.List<java.lang.String> varUnits,
                               int[] dims)
                        throws java.io.IOException
Description copied from class: AbstractRadiometerDataWriter
Creates the specified set of variables in the output.

Specified by:
createVariables in class AbstractRadiometerDataWriter
Parameters:
varNames - the list of variable names to create.
varUnits - the list of units for each variable.
dims - the variable dimensions as [lines, samples].
Throws:
java.io.IOException - if an error occurred creating the variables.

writeMissingLineData

protected void writeMissingLineData(int varIndex,
                                    int line)
                             throws java.io.IOException
Description copied from class: AbstractRadiometerDataWriter
Writes a line of missing variable data to the output.

Specified by:
writeMissingLineData in class AbstractRadiometerDataWriter
Parameters:
varIndex - the variable index from the AbstractRadiometerDataWriter.createVariables(java.util.List, java.util.List, int[]) name list.
line - the line to write data for.
Throws:
java.io.IOException

writeLineData

protected void writeLineData(int varIndex,
                             int line,
                             double[] lineData)
                      throws java.io.IOException
Description copied from class: AbstractRadiometerDataWriter
Writes a line of variable data to the output.

Specified by:
writeLineData in class AbstractRadiometerDataWriter
Parameters:
varIndex - the variable index from the AbstractRadiometerDataWriter.createVariables(java.util.List, java.util.List, int[]) name list.
line - the line to write data for.
lineData - the data to write for the line.
Throws:
java.io.IOException

openOutput

protected void openOutput(TelemetryDecoder decoder,
                          Radiometer radiometer,
                          int startFrame,
                          int endFrame)
                   throws java.io.IOException
Description copied from class: AbstractRadiometerDataWriter
Opens a new output sink for radiometer data.

Specified by:
openOutput in class AbstractRadiometerDataWriter
Parameters:
decoder - the stream decoder to read data from.
radiometer - the radiometer instrument to write data for.
startFrame - the starting data frame to write.
endFrame - the ending data frame to write.
Throws:
java.io.IOException - if an error occurred opening the output sink.

closeOutput

protected void closeOutput()
                    throws java.io.IOException
Description copied from class: AbstractRadiometerDataWriter
Closes the output sink for radiometer data.

Specified by:
closeOutput in class AbstractRadiometerDataWriter
Throws:
java.io.IOException - if an error occurred closing the output sink.

Terrenus HRPT v2.2