OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
common.h File Reference
#include <stdint.h>
#include <fstream>
#include <timeutils.h>
#include <netcdf>
#include <vector>
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  itab
 

Macros

#define PKTSIZE   2048
 
#define SWAP_2(x)   ( (((x) & 0xff) << 8) | ((unsigned short)(x) >> 8) )
 
#define SWAP_4(x)
 

Functions

int get_band_dims (uint8_t *apacket, uint16_t &ncp, uint16_t &nbb, uint16_t &nrb, uint16_t &nsp, uint16_t &ndc, uint16_t &nds, uint16_t *btaps, uint16_t *rtaps, itab *itable)
 
int get_anc_packet_time (uint8_t *apacket, int32_t &iyear, int32_t &iday, double &stime)
 
int read_oci_scan_packets (std::fstream *tfileStream, uint8_t *apacket, uint8_t(*pbuffer)[PKTSIZE], uint32_t &npkts, int32_t &spnum, int32_t &ancind, std::vector< int32_t > &tlmind, uint8_t &seqerr, int32_t &endfile)
 
int anc_compare (uint8_t *apacket0, uint8_t *apacket)
 
int read_packet (std::fstream *tfileStream, uint8_t *packet, uint32_t &len, uint32_t &apid, int32_t &endfile)
 
int get_swir_mode (uint8_t(*pbuffer)[PKTSIZE], uint32_t npkts, uint16_t &smode)
 

Macro Definition Documentation

◆ PKTSIZE

#define PKTSIZE   2048

Definition at line 7 of file common.h.

◆ SWAP_2

#define SWAP_2 (   x)    ( (((x) & 0xff) << 8) | ((unsigned short)(x) >> 8) )

Definition at line 16 of file common.h.

◆ SWAP_4

#define SWAP_4 (   x)
Value:
( (((x) << 24) & 0xFF000000) | \
(((x) << 8) & 0x00FF0000) | \
(((x) >> 8) & 0x0000FF00) | \
(((x) >> 24) & 0x000000FF) )

Definition at line 18 of file common.h.

Function Documentation

◆ anc_compare()

int anc_compare ( uint8_t *  apacket0,
uint8_t *  apacket 
)

Definition at line 285 of file common.cpp.

◆ get_anc_packet_time()

int get_anc_packet_time ( uint8_t *  apacket,
int32_t &  iyear,
int32_t &  iday,
double &  stime 
)

Definition at line 97 of file common.cpp.

◆ get_band_dims()

int get_band_dims ( uint8_t *  apacket,
uint16_t &  ncp,
uint16_t &  nbb,
uint16_t &  nrb,
uint16_t &  nsp,
uint16_t &  ndc,
uint16_t &  nds,
uint16_t *  btaps,
uint16_t *  rtaps,
itab itable 
)

Definition at line 17 of file common.cpp.

◆ get_swir_mode()

int get_swir_mode ( uint8_t(*)  pbuffer[PKTSIZE],
uint32_t  npkts,
uint16_t &  smode 
)

Definition at line 370 of file common.cpp.

◆ read_oci_scan_packets()

int read_oci_scan_packets ( std::fstream *  tfileStream,
uint8_t *  apacket,
uint8_t(*)  pbuffer[PKTSIZE],
uint32_t &  npkts,
int32_t &  spnum,
int32_t &  ancind,
std::vector< int32_t > &  tlmind,
uint8_t &  seqerr,
int32_t &  endfile 
)

◆ read_packet()

int read_packet ( std::fstream *  tfileStream,
uint8_t *  packet,
uint32_t &  len,
uint32_t &  apid,
int32_t &  endfile 
)