Terrenus HRPT v2.2

terrenus.telemetry
Class HRPTStream

java.lang.Object
  extended by terrenus.telemetry.AbstractTelemetryStream
      extended by terrenus.telemetry.HRPTStream
All Implemented Interfaces:
TelemetryStream
Direct Known Subclasses:
CMA1A5HRPTStream, GlobalHRPTStream, NOAA1bHRPTStream, QuorumHRPTStream, RawHRPTStream, TeraScanHRPTStream, TeraScanSwapHRPTStream

public abstract class HRPTStream
extends AbstractTelemetryStream

The HRPTStream is a telemetry stream of NOAA HRPT data. The stream delivers HRPT data as detailed in "NOAA Technical Memorandum NESS 107 - Rev. 1, Data Extraction and Calibration of TIROS-N/NOAA Radiometers, Walter G. Planet, Washington, D.C., November 1979 (Revised October 1988)".

The methods commit the subclass to the delivery of HRPT minor frames in the same format as outlined in the NOAA documentation, regardless of the underlying capture station storage format. In the case where the storage format does not store some part of the data, the methods may create artificial data (such as the frame synchronization) or may resort to zero-filling if there is no reasonable alternative. The only modification to the original documented format is that words returned by the methods contain data in the least significant 10 bits of a 16-bit value rather than the original 10-bit word.

Subclasses must implement the TelemetryStream.getFormat() method and override any other methods such as AbstractTelemetryStream.getFramePosition(int) that would required changes if the file format is structurally very different from a broadcast HRPT stream.


Field Summary
static int AUX_SYNC_BLOCK
          Auxiliary sync block index.
static int[] BLOCK_LENGTHS
          The array of HRPT frame block lengths in bytes.
static int[] BLOCK_OFFSETS
          The array of HRPT frame block offsets in bytes.
static int EARTH_BLOCK
          Earth data block index.
static int FRAME_SYNC_BLOCK
          Frame sync block index.
static int ID_BLOCK
          ID block index.
static int INTERNAL_TARGET_BLOCK
          Internal target block index.
static int SPACE_BLOCK
          Space data block index.
static int SPARE_BLOCK
          Spare words block index.
static int SYNC_DELTA_BLOCK
          Sync delta block index.
static int TELEMETRY_BLOCK
          Telemetry block index.
static int TIME_CODE_BLOCK
          Time code block index.
static int TIP_BLOCK
          TIP data block index.
 
Fields inherited from class terrenus.telemetry.AbstractTelemetryStream
input
 
Constructor Summary
HRPTStream()
           
 
Method Summary
protected  boolean checkFrame(int frame)
          Checks a frame for errors.
 int getBlockCount()
          Gets the number of blocks per frame.
protected  int getBlockLength(int block)
          Gets the length of a block.
protected  int getBlockPosition(int block)
          Gets the position of a block within a frame.
 TelemetryDecoder getDecoder()
          Gets a decoder for the stream data.
 
Methods inherited from class terrenus.telemetry.AbstractTelemetryStream
checkStream, getBlock, getDayCount, getFrameCount, getFramePosition, getInputBuffer, getYear, initStream, main, setDayCount, setYear
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface terrenus.telemetry.TelemetryStream
getFormat
 

Field Detail

BLOCK_OFFSETS

public static final int[] BLOCK_OFFSETS
The array of HRPT frame block offsets in bytes.


BLOCK_LENGTHS

public static final int[] BLOCK_LENGTHS
The array of HRPT frame block lengths in bytes.


FRAME_SYNC_BLOCK

public static final int FRAME_SYNC_BLOCK
Frame sync block index.

See Also:
Constant Field Values

ID_BLOCK

public static final int ID_BLOCK
ID block index.

See Also:
Constant Field Values

TIME_CODE_BLOCK

public static final int TIME_CODE_BLOCK
Time code block index.

See Also:
Constant Field Values

TELEMETRY_BLOCK

public static final int TELEMETRY_BLOCK
Telemetry block index.

See Also:
Constant Field Values

INTERNAL_TARGET_BLOCK

public static final int INTERNAL_TARGET_BLOCK
Internal target block index.

See Also:
Constant Field Values

SPACE_BLOCK

public static final int SPACE_BLOCK
Space data block index.

See Also:
Constant Field Values

SYNC_DELTA_BLOCK

public static final int SYNC_DELTA_BLOCK
Sync delta block index.

See Also:
Constant Field Values

TIP_BLOCK

public static final int TIP_BLOCK
TIP data block index.

See Also:
Constant Field Values

SPARE_BLOCK

public static final int SPARE_BLOCK
Spare words block index.

See Also:
Constant Field Values

EARTH_BLOCK

public static final int EARTH_BLOCK
Earth data block index.

See Also:
Constant Field Values

AUX_SYNC_BLOCK

public static final int AUX_SYNC_BLOCK
Auxiliary sync block index.

See Also:
Constant Field Values
Constructor Detail

HRPTStream

public HRPTStream()
Method Detail

getBlockCount

public int getBlockCount()
Description copied from interface: TelemetryStream
Gets the number of blocks per frame.


getBlockPosition

protected int getBlockPosition(int block)
Description copied from class: AbstractTelemetryStream
Gets the position of a block within a frame.

Specified by:
getBlockPosition in class AbstractTelemetryStream
Parameters:
block - the block in question.
Returns:
the position in bytes, relative to the end of any frame header data.

getBlockLength

protected int getBlockLength(int block)
Description copied from class: AbstractTelemetryStream
Gets the length of a block.

Specified by:
getBlockLength in class AbstractTelemetryStream
Parameters:
block - the block in question.
Returns:
the length of the block in bytes.

getDecoder

public TelemetryDecoder getDecoder()
                            throws java.io.IOException
Description copied from interface: TelemetryStream
Gets a decoder for the stream data.

Throws:
java.io.IOException - if an error occurred decoding the stream data.

checkFrame

protected boolean checkFrame(int frame)
Description copied from class: AbstractTelemetryStream
Checks a frame for errors. The check procedure may involve looking for expected patterns such as synchronization bytes.

Specified by:
checkFrame in class AbstractTelemetryStream
Parameters:
frame - the frame number to check.
Returns:
true if the frame check was successful, or false if it failed.
See Also:
AbstractTelemetryStream.checkStream()

Terrenus HRPT v2.2