OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
HawkeyeDecode.h
Go to the documentation of this file.
1 /*
2  HawkeyeDecode.h
3 
4  Matt Longmire
5  Cloudland Instruments
6 
7  Contains the interface to the utility functions for
8  decoding a Hawkeye Format Image file (stream).
9 
10 
11 */
12 
13 #ifndef _HAWKEYE_DECODE_
14 #define _HAWKEYE_DECODE_
15 
16 #include "Hawkeye.h"
17 
18 #define MAX_FINDERSCOPE_IMAGES 25
19 #define MAX_TELEMETRY_RECORDS 12
20 #define INCLUDE_GPS 0 // set to 1 to decode binaries with GPS data
21 
23 
25 
26 typedef struct {
27  uint32_t recordNo;
29  uint16_t blockLen;
30 } HeaderInfo;
31 
32 typedef struct {
33  uint32_t timeStamp;
34  int height, width;
39 
40 typedef struct {
41  uint32_t timeStamp;
42  uint16_t noChannels;
45 
46 typedef struct {
47  uint16_t errorCode;
48  uint32_t exposureID;
49  uint32_t imageID;
50  uint64_t epochT0;
51  uint32_t hostDeltaEpoch;
53  uint16_t spectralBinning;
55  uint16_t channelBitfield;
56  uint16_t ccd1Exposure;
57  uint16_t ccd2Exposure;
58  uint16_t ccd3Exposure;
59  uint16_t ccd4Exposure;
60  uint16_t height;
61  uint16_t darkHeight;
62  uint16_t interval;
63  uint16_t oversampling;
67  uint16_t darkSubtracted;
68  uint16_t shutterSolenoid;
69  uint16_t readoutOrder;
70 #if INCLUDE_GPS
71  uint8_t gpsBinary[116];
72 #endif
74 
75 typedef struct {
76  uint32_t streamLength;
77  uint32_t noRecords;
78  uint32_t noUnknownRecords;
79  uint32_t noMissingRecords;
80  uint32_t noBadRecords;
81  uint32_t noMissingBytes;
84  HawkeyeBandInfo spectralInfo[8];
89  char missionLog[MISSION_LOG_LENGTH];
90  uint32_t hebBufSize;
92 
93 #ifdef __cplusplus
94 
95 extern "C" HAWKEYE_STREAM_ERROR HawkeyeScanStream(uint8_t *stream, uint32_t streamLength, HawkeyeStreamInfo *streamInfo);
96 extern "C" HAWKEYE_STREAM_ERROR HawkeyeDecodeSpectralImage(uint16_t bandNo, uint16_t *pixels, uint32_t pixelLength,
97  uint16_t *averageDarkPixels, uint16_t averageDarkPixelLength);
98 extern "C" HAWKEYE_STREAM_ERROR HawkeyeDecodeFinderscopeImage(uint16_t imageNo, uint16_t *pixels, uint32_t pixelLength);
99 
100 #else
101 
102 extern HAWKEYE_STREAM_ERROR HawkeyeScanStream(uint8_t *stream, uint32_t streamLength, HawkeyeStreamInfo *streamInfo);
103 extern HAWKEYE_STREAM_ERROR HawkeyeDecodeSpectralImage(uint16_t bandNo, uint16_t *pixels, uint32_t pixelLength,
104  uint16_t *averageDarkPixels, uint16_t averageDarkPixelLength);
105 extern HAWKEYE_STREAM_ERROR HawkeyeDecodeFinderscopeImage(uint16_t imageNo, uint16_t *pixels, uint32_t pixelLength);
106 
107 #endif
108 
109 #endif // _HAWKEYE_DECODE_
110 
uint16_t spectralBinning
Definition: HawkeyeDecode.h:53
HawkeyeImageInfo imageInfo
Definition: HawkeyeDecode.h:82
@ EBT_EOF
Definition: HawkeyeDecode.h:24
uint32_t noBadRecords
Definition: HawkeyeDecode.h:80
uint16_t channelBitfield
Definition: HawkeyeDecode.h:55
uint32_t recordNo
Definition: HawkeyeDecode.h:27
uint16_t errorCode
Definition: HawkeyeDecode.h:47
uint16_t ccd1Exposure
Definition: HawkeyeDecode.h:56
uint32_t noUnknownRecords
Definition: HawkeyeDecode.h:78
uint16_t finderscopeExposure
Definition: HawkeyeDecode.h:64
uint16_t darkSubtracted
Definition: HawkeyeDecode.h:67
double electronicGain
Definition: HawkeyeDecode.h:37
uint16_t shutterSolenoid
Definition: HawkeyeDecode.h:68
uint16_t ccd4Exposure
Definition: HawkeyeDecode.h:59
#define MAX_FINDERSCOPE_IMAGES
Definition: HawkeyeDecode.h:18
#define MAX_TELEMETRY_RECORDS
Definition: HawkeyeDecode.h:19
uint16_t darkHeight
Definition: HawkeyeDecode.h:61
@ EBT_COMPRESSED
Definition: HawkeyeDecode.h:24
ENCODED_BLOCK_TYPE blockType
Definition: HawkeyeDecode.h:28
HAWKEYE_STREAM_ERROR HawkeyeDecodeFinderscopeImage(uint16_t imageNo, uint16_t *pixels, uint32_t pixelLength)
uint16_t ccd3Exposure
Definition: HawkeyeDecode.h:58
@ EBT_UNCOMPRESSED
Definition: HawkeyeDecode.h:24
uint32_t streamLength
Definition: HawkeyeDecode.h:76
@ HSE_NO_IMAGE_PARAMETERS
Definition: HawkeyeDecode.h:22
uint32_t exposureID
Definition: HawkeyeDecode.h:48
uint16_t oversampling
Definition: HawkeyeDecode.h:63
@ HSE_NO_HEADER_FOUND
Definition: HawkeyeDecode.h:22
uint32_t hawkeyeDeltaEpoch
Definition: HawkeyeDecode.h:52
#define MISSION_LOG_LENGTH
Definition: Hawkeye.h:63
uint32_t noMissingBytes
Definition: HawkeyeDecode.h:81
GetTelemetryResponse telemetry
Definition: HawkeyeDecode.h:43
@ EBT_NULL
Definition: HawkeyeDecode.h:24
uint16_t finderscopeBinning
Definition: HawkeyeDecode.h:54
@ EBT_IMAGE_PARAMS
Definition: HawkeyeDecode.h:24
uint32_t timeStamp
Definition: HawkeyeDecode.h:33
HAWKEYE_STREAM_ERROR HawkeyeScanStream(uint8_t *stream, uint32_t streamLength, HawkeyeStreamInfo *streamInfo)
uint16_t blockLen
Definition: HawkeyeDecode.h:29
DATA_COMPRESSION compression
Definition: HawkeyeDecode.h:66
HAWKEYE_STREAM_ERROR HawkeyeDecodeSpectralImage(uint16_t bandNo, uint16_t *pixels, uint32_t pixelLength, uint16_t *averageDarkPixels, uint16_t averageDarkPixelLength)
@ EBT_MISSION_LOG
Definition: HawkeyeDecode.h:24
@ EBT_TELEMETRY
Definition: HawkeyeDecode.h:24
uint16_t readoutOrder
Definition: HawkeyeDecode.h:69
HAWKEYE_STREAM_ERROR
Definition: HawkeyeDecode.h:22
uint32_t hostDeltaEpoch
Definition: HawkeyeDecode.h:51
@ HSE_NO_ERROR
Definition: HawkeyeDecode.h:22
uint32_t noMissingRecords
Definition: HawkeyeDecode.h:79
uint16_t ccd2Exposure
Definition: HawkeyeDecode.h:57
DATA_COMPRESSION
Definition: Hawkeye.h:99
uint16_t noFinderscopeImages
Definition: HawkeyeDecode.h:65
ENCODED_BLOCK_TYPE
Definition: HawkeyeDecode.h:24