Terrenus HRPT v2.2

terrenus.telemetry
Class CHRPTStream

java.lang.Object
  extended by terrenus.telemetry.AbstractTelemetryStream
      extended by terrenus.telemetry.CHRPTStream
All Implemented Interfaces:
TelemetryStream
Direct Known Subclasses:
CMA1A5CHRPTStream, QuorumCHRPTStream, RawCHRPTStream, TeraScanCHRPTStream

public abstract class CHRPTStream
extends AbstractTelemetryStream

The CHRPTStream is a telemetry stream of China Meterological Administration (CMA) CHRPT data. The stream delivers CHRPT data as described by the Dundee Satellite Receiving Station website (http://www.sat.dundee.ac.uk/hrptformat.html) as follows:

Function Number
of words
Word
Position
Description
Frame sync 6 1 1010000100
2 0101101111
3 1101011100
4 0110011101
5 1000001111
6 0010010101
ID 2 7 Bits 1-4 = Satellite ID (FY-1D = 1101, FY-1C = 1100)
8 Spare
Time code 4 9 Bits 1-9 = binary day count (in reality, zero-filled)
10 Bits 1-3 = 101, bits 4-10 = part of millisecond of day count
11 Part of millisecond
12 Remainder of millisecond
Telemetry 20 13-22 Ramp calibration of 10 channels of MVISR
23 Temperature of first stage of radiant cooler A
24 Temperature of first stage of radiant cooler B
25 Temperature of second stage of radiant cooler A
26 Temperature of second stage of radiant cooler B
27 Temp controlling voltage of 2nd stage radiant cooler A
28 Temp controlling voltage of 2nd stage radiant cooler B
29-32 Temp of sheath of radiometer, 1 word per platinium resistance bulb
Internal target data 60 33-92 6 sampling words for every channel
Space 100 93-192 10 sampling words for every channel
Spare 1408 193-1600 00000 11101
00000 01100
10010 01010
...
00100 11110
11111 11000
11000 01101
11011 00101
Earth data 20480 1601-22080 2048 words for every channel from channel 1 to channel 10. Each frame contains the data obtained during one earth scan of the MVISR sensor. Time multiplexed.
Aux. sync 100 22081-22180 11111 00010
11111 10011
01101 10101
...
01111 10000
11110 01100

The methods commit the subclass to the delivery of CHRPT minor frames in the same format as outlined in the 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 CHRPT stream.


Field Summary
static int AUX_SYNC_BLOCK
          Auxiliary sync block index.
static int[] BLOCK_LENGTHS
          The array of CHRPT frame block lengths in bytes.
static int[] BLOCK_OFFSETS
          The array of CHRPT 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 TELEMETRY_BLOCK
          Telemetry block index.
static int TIME_CODE_BLOCK
          Time code block index.
 
Fields inherited from class terrenus.telemetry.AbstractTelemetryStream
input
 
Constructor Summary
CHRPTStream()
           
 
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.
abstract  int getDayCount(int frame)
          Gets the day count for the specified 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 CHRPT frame block offsets in bytes.


BLOCK_LENGTHS

public static final int[] BLOCK_LENGTHS
The array of CHRPT 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

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

CHRPTStream

public CHRPTStream()
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()

getDayCount

public abstract int getDayCount(int frame)
                         throws java.io.IOException
Gets the day count for the specified frame. The day count is not available from the CHRPT telemetry stream from the spacecraft because the bits in the time code where the day count are supposed to be are zero filled.

Throws:
java.io.IOException

Terrenus HRPT v2.2