Terrenus HRPT v2.2

terrenus.telemetry
Class HRPTDecoder

java.lang.Object
  extended by terrenus.telemetry.HRPTDecoder
All Implemented Interfaces:
TelemetryDecoder

public class HRPTDecoder
extends java.lang.Object
implements TelemetryDecoder

The HRPTDecoder class uses an HRPTStream to decode NOAA HRPT data.


Constructor Summary
HRPTDecoder(HRPTStream stream)
          Create a new decoder using the specified stream.
 
Method Summary
 int getAuxSyncErrors(int frame)
          Gets the number of errors in the frame auxiliary sync bits, or 0 if no errors are present.
 int getAVHRRSyncPeriods(int frame)
          Gets the count of 0.9984 MHz AVHRR sync periods.
 InstrumentData getData(int frame, Instrument inst)
          Gets the frame data for a specific instrument.
 int getDayCount(int frame)
          Gets the frame day count.
 int getFrameSyncErrors(int frame)
          Gets the number of errors in the frame sync bits, or 0 if no errors are present.
 int getMillisecond(int frame)
          Gets the frame millisecond.
 int getMinorFrame(int frame)
          Returns the minor frame number, either 1, 2, or 3.
 Spacecraft getSpacecraft()
          Gets the spacecraft detected by this decoder.
 int getSpacecraftId()
          Gets the spacecraft address identified for this HRPT data.
 int getSpacecraftId(int frame)
          Gets the spacecraft address for the frame.
 HRPTStream getStream()
          Gets the telemetry stream used for data.
 long getTime(int frame)
          Gets the start time of frame capture in milliseconds since the epoch.
 int getTIPParityErrors(int frame)
          Gets the number of TIP words in the frame that have errors based on an even parity check over bits 1-8 with parity in bit 9.
 boolean hasErrors(int frame)
          Gets the frame error flag.
 boolean isAVHRRNormal(int frame)
          Returns true if the frame is normal AVHRR input, or false if it is pseudonoise.
 boolean isAVHRRSync(int frame)
          Returns true if the frame is an AVHRR sync, or false if it is an internal sync.
 boolean isAVHRRSyncLate(int frame)
          Returns true if the frame AVHRR sync delta is late, or false if it is early.
 boolean isChannel3a(int frame)
          Returns true if the frame contains AVHRR channel 3a data, or false if it contains AVHRR channel 3b.
 boolean isResync(int frame)
          Returns true if the frame is a resync, or false if it is stable.
static void main(java.lang.String[] argv)
          Tests this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HRPTDecoder

public HRPTDecoder(HRPTStream stream)
            throws java.io.IOException
Create a new decoder using the specified stream.

Throws:
java.io.IOException
Method Detail

hasErrors

public boolean hasErrors(int frame)
                  throws java.io.IOException
Description copied from interface: TelemetryDecoder
Gets the frame error flag.

Specified by:
hasErrors in interface TelemetryDecoder
Parameters:
frame - the frame to return the flag for in the range [0..FRAMES-1].
Returns:
the frame error flag, true if errors were detected in the frame data or false if not. Error detection usually consists of checking frame synchronization data and bit parity.
Throws:
java.io.IOException - if an error occurred reading data from the stream.

getStream

public HRPTStream getStream()
Description copied from interface: TelemetryDecoder
Gets the telemetry stream used for data.

Specified by:
getStream in interface TelemetryDecoder

getFrameSyncErrors

public int getFrameSyncErrors(int frame)
Gets the number of errors in the frame sync bits, or 0 if no errors are present. The number of errors is the total number of bits which differ between the expected frame sync bits and the actual frame sync bits.


isAVHRRSync

public boolean isAVHRRSync(int frame)
                    throws java.io.IOException
Returns true if the frame is an AVHRR sync, or false if it is an internal sync.

Throws:
java.io.IOException

getMinorFrame

public int getMinorFrame(int frame)
                  throws java.io.IOException
Returns the minor frame number, either 1, 2, or 3.

Throws:
java.io.IOException

getTime

public long getTime(int frame)
Gets the start time of frame capture in milliseconds since the epoch. This time may differ from the values returned by getDayCount(int) and getMillisecond(int) since some frames may have bit errors. The actual frame time is computed by examining a number of frame times, inferring the correct data start time from those times, and then computing the frame time using the frame index and the known frame step interval. This presents the HRPT data as a continuous, uniformly stepping set of frames and is very useful for computing correct Earth locations for every sensor scan even when the frame itself contains unusable sensor data.

Specified by:
getTime in interface TelemetryDecoder
Parameters:
frame - the frame to return the time for, starting at 0.
Returns:
the frame start time in milliseconds since the epoch. The epoch in this case is January 1, 1970 00:00:00 UTC.

getSpacecraftId

public int getSpacecraftId()
Gets the spacecraft address identified for this HRPT data. This may differ from the spacecraft address returned by getSpacecraftId(int) since some frames may have bit errors. The actual spacecraft address is detected by examining a number of HRPT minor frames.

Returns:
the actual spacecraft address for this data.

getSpacecraftId

public int getSpacecraftId(int frame)
                    throws java.io.IOException
Gets the spacecraft address for the frame.

Throws:
java.io.IOException

isResync

public boolean isResync(int frame)
                 throws java.io.IOException
Returns true if the frame is a resync, or false if it is stable.

Throws:
java.io.IOException

isAVHRRNormal

public boolean isAVHRRNormal(int frame)
                      throws java.io.IOException
Returns true if the frame is normal AVHRR input, or false if it is pseudonoise.

Throws:
java.io.IOException

isChannel3a

public boolean isChannel3a(int frame)
                    throws java.io.IOException
Returns true if the frame contains AVHRR channel 3a data, or false if it contains AVHRR channel 3b.

Throws:
java.io.IOException

getDayCount

public int getDayCount(int frame)
                throws java.io.IOException
Gets the frame day count.

Throws:
java.io.IOException

getMillisecond

public int getMillisecond(int frame)
                   throws java.io.IOException
Gets the frame millisecond.

Throws:
java.io.IOException

isAVHRRSyncLate

public boolean isAVHRRSyncLate(int frame)
                        throws java.io.IOException
Returns true if the frame AVHRR sync delta is late, or false if it is early.

Throws:
java.io.IOException

getAVHRRSyncPeriods

public int getAVHRRSyncPeriods(int frame)
                        throws java.io.IOException
Gets the count of 0.9984 MHz AVHRR sync periods.

Throws:
java.io.IOException

getTIPParityErrors

public int getTIPParityErrors(int frame)
Gets the number of TIP words in the frame that have errors based on an even parity check over bits 1-8 with parity in bit 9.


getAuxSyncErrors

public int getAuxSyncErrors(int frame)
Gets the number of errors in the frame auxiliary sync bits, or 0 if no errors are present. The number of errors is the total number of bits which differ between the expected auxiliary sync bits and the actual auxiliary sync bits.


getData

public InstrumentData getData(int frame,
                              Instrument inst)
                       throws java.io.IOException
Description copied from interface: TelemetryDecoder
Gets the frame data for a specific instrument.

Specified by:
getData in interface TelemetryDecoder
Parameters:
frame - the frame to return data for in the range [0..FRAMES-1].
inst - the instrument to return data for.
Returns:
the frame data for the specified instrument.
Throws:
java.io.IOException - if an error occurred reading the instrument data from the stream.

getSpacecraft

public Spacecraft getSpacecraft()
Description copied from interface: TelemetryDecoder
Gets the spacecraft detected by this decoder.

Specified by:
getSpacecraft in interface TelemetryDecoder

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Tests this class.

Throws:
java.lang.Exception

Terrenus HRPT v2.2