Terrenus HRPT v2.2

terrenus.instrument
Class AbstractRadiometerDataWriter

java.lang.Object
  extended by terrenus.instrument.AbstractRadiometerDataWriter
All Implemented Interfaces:
RadiometerDataWriter
Direct Known Subclasses:
CWHDFDataWriter, CWNCDataWriter

public abstract class AbstractRadiometerDataWriter
extends java.lang.Object
implements RadiometerDataWriter

The AbstractRadiometerDataWriter class implements the main method for the RadiometerDataWriter class and provides basic writing services. The child class must implement the various format-specific methods.


Field Summary
protected  java.lang.String history
          The history of the data.
protected  java.lang.String origin
          The origin of the data.
 
Constructor Summary
AbstractRadiometerDataWriter()
           
 
Method Summary
protected abstract  void closeOutput()
          Closes the output sink for radiometer data.
protected abstract  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 abstract  void openOutput(TelemetryDecoder decoder, Radiometer radiometer, int startFrame, int endFrame)
          Opens a new output sink for radiometer data.
 void setHistory(java.lang.String history)
          Sets the history string for the data.
 void setOrigin(java.lang.String origin)
          Sets the origin string for the data.
 void writeData(TelemetryDecoder decoder, Radiometer radiometer, int startFrame, int endFrame, RadiometerCalibrator.CalibrationType visibleCalType, RadiometerCalibrator.CalibrationType thermalCalType)
          Writes radiometer channel and location data to a data output sink.
protected abstract  void writeLineData(int varIndex, int line, double[] lineData)
          Writes a line of variable data to the output.
protected abstract  void writeMissingLineData(int varIndex, int line)
          Writes a line of missing variable data to the output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

origin

protected java.lang.String origin
The origin of the data.


history

protected java.lang.String history
The history of the data.

Constructor Detail

AbstractRadiometerDataWriter

public AbstractRadiometerDataWriter()
Method Detail

setOrigin

public void setOrigin(java.lang.String origin)
Sets the origin string for the data. The origin is an organization abbreviation that appears on data plots to indicate tha the data was captured and processed by a certain organization.

Parameters:
origin - the data origin.

setHistory

public void setHistory(java.lang.String history)
Sets the history string for the data. The history string is a list of the versions and parameters of software used for processing the data.

Parameters:
history - the data history.

createVariables

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

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.

writeLineData

protected abstract void writeLineData(int varIndex,
                                      int line,
                                      double[] lineData)
                               throws java.io.IOException
Writes a line of variable data to the output.

Parameters:
varIndex - the variable index from the 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:
IOExeption - if an error occurred writing the line data.
java.io.IOException

writeMissingLineData

protected abstract void writeMissingLineData(int varIndex,
                                             int line)
                                      throws java.io.IOException
Writes a line of missing variable data to the output.

Parameters:
varIndex - the variable index from the createVariables(java.util.List, java.util.List, int[]) name list.
line - the line to write data for.
Throws:
IOExeption - if an error occurred writing the line data.
java.io.IOException

openOutput

protected abstract void openOutput(TelemetryDecoder decoder,
                                   Radiometer radiometer,
                                   int startFrame,
                                   int endFrame)
                            throws java.io.IOException
Opens a new output sink for radiometer data.

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 abstract void closeOutput()
                             throws java.io.IOException
Closes the output sink for radiometer data.

Throws:
java.io.IOException - if an error occurred closing the output sink.

writeData

public void writeData(TelemetryDecoder decoder,
                      Radiometer radiometer,
                      int startFrame,
                      int endFrame,
                      RadiometerCalibrator.CalibrationType visibleCalType,
                      RadiometerCalibrator.CalibrationType thermalCalType)
               throws java.io.IOException
Description copied from interface: RadiometerDataWriter
Writes radiometer channel and location data to a data output sink.

Specified by:
writeData in interface RadiometerDataWriter
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.
visibleCalType - the visible channel calibration type.
thermalCalType - the thermal channel calibration type.
Throws:
java.io.IOException - if an error occurred reading the telemetry stream or writing radiometer data.

Terrenus HRPT v2.2