OB.DAAC Logo
NASA Logo
Ocean Color Science Software

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

Go to the source code of this file.

Classes

class  l1aFile
 

Macros

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

Functions

int convert_diary (int32_t npkts, uint8_t(*dstore)[71], int32_t *iyr, int32_t *iday, double *otime, float(*orb)[6], double *atime, float(*quat)[4])
 
int extract_adcs_bus (int adoffsets[4], int32_t nadc, uint8_t *astore[], int32_t nbus, uint8_t *bstore[], int32_t *iyr, int32_t *iday, double *adctime, double *bustime, uint8_t *adstate, uint8_t *admandone, int16_t *adfftid, uint8_t *adsolution, string &platform, uint16_t ngps, uint8_t *gstore[], double *gpstime)
 
int read_packet (fstream *vfileStream, uint8_t *packet, int32_t *len, int32_t *apid, int32_t *endfile)
 
int read_viirs_scan_packets (fstream *vfileStream, uint8_t *epacket, uint8_t(*pbuffer)[PBUFFER_SIZE], int32_t *npkts, int32_t *endfile)
 
int unpack_viirs_scan (int32_t npkts, uint8_t(*pbuffer)[PBUFFER_SIZE], uint16_t(*mbands)[16][6304], uint16_t(*ibands)[32][6400], uint16_t(*dnb)[16][4064], uint8_t(*mqfl)[16], uint8_t(*iqfl)[32], uint8_t(*dqfl)[16], uint8_t(*hrmet)[146])
 
int unpack_viirs_cal (int32_t npkts, uint8_t(*pbuffer)[PBUFFER_SIZE], int16_t(*sdm)[16][48], int16_t(*svm)[16][48], int16_t(*bbm)[16][48], int16_t(*sdi)[32][96], int16_t(*svi)[32][96], int16_t(*bbi)[32][96], int16_t(*sdd)[64], int16_t(*svd)[64], int16_t(*bbd)[64], uint8_t *calmet)
 
int unpack_sci (uint8_t *idat, int32_t nsamp, int16_t *scan, uint8_t *qfl)
 
int unpack_cal_sci (uint8_t *idat, int32_t nsamps, int32_t ndet, int16_t *sp, int16_t *bl, int16_t *sd)
 
uint8_t check_sum (int32_t nc, uint8_t *dat, uint8_t *chk)
 
int isleap (int year)
 
int32_t jday (int16_t i, int16_t j, int16_t k)
 
int jdate (int32_t julian, int32_t *year, int32_t *doy)
 
int yds2tai (int16_t iyr, int16_t idy, double sec, double *tai93)
 
int ccsds_to_yds (uint8_t *cctime, int32_t *iyear, int32_t *iday, double *sec)
 
int usds (int argc, char *argv[], int32_t inBytes, uint8_t *encryptData, uint16_t *decryptData)
 
long szip_uncompress_memory (int new_options_mask, int new_bits_per_pixel, int new_pixels_per_block, int new_pixels_per_scanline, const char *in, long in_bytes, void *out, long out_pixels)
 
int createNCDF (int ncid, const char *sname, const char *lname, const char *standard_name, const char *units, void *fill_value, const char *flag_values, const char *flag_meanings, double low, double high, int nt, int rank, int *dimids)
 
int jgleap (int32_t jday, int32_t *leap)
 
int scan_complete (uint8_t(*pbuffer)[PBUFFER_SIZE], int32_t npkts)
 
int expandEnvVar (string *sValue)
 

Macro Definition Documentation

◆ PBUFFER_SIZE

#define PBUFFER_SIZE   32768

Definition at line 5 of file l1agen_viirs.h.

◆ SWAP_2

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

Definition at line 113 of file l1agen_viirs.h.

◆ SWAP_4

#define SWAP_4 (   x)
Value:
( ((x) << 24) | \
(((x) << 8) & 0x00ff0000) | \
(((x) >> 8) & 0x0000ff00) | \
((x) >> 24) )

Definition at line 115 of file l1agen_viirs.h.

Function Documentation

◆ ccsds_to_yds()

int ccsds_to_yds ( uint8_t *  cctime,
int32_t *  iyear,
int32_t *  iday,
double *  sec 
)

Definition at line 5 of file ccsds_to_yds.c.

◆ check_sum()

uint8_t check_sum ( int32_t  nc,
uint8_t *  dat,
uint8_t *  chk 
)

Definition at line 1543 of file l1agen_oci.cpp.

◆ convert_diary()

int convert_diary ( int32_t  npkts,
uint8_t(*)  dstore[71],
int32_t *  iyr,
int32_t *  iday,
double *  otime,
float(*)  orb[6],
double *  atime,
float(*)  quat[4] 
)

Definition at line 1230 of file l1agen_viirs.cpp.

◆ createNCDF()

int createNCDF ( int  ncid,
const char *  sname,
const char *  lname,
const char *  standard_name,
const char *  units,
void *  fill_value,
const char *  flag_values,
const char *  flag_meanings,
double  low,
double  high,
int  nt,
int  rank,
int *  dimids 
)

Definition at line 2137 of file l1aFile.cpp.

◆ expandEnvVar()

int expandEnvVar ( string sValue)
inline

Definition at line 210 of file l1agen_viirs.h.

◆ extract_adcs_bus()

int extract_adcs_bus ( int  adoffsets[4],
int32_t  nadc,
uint8_t *  astore[],
int32_t  nbus,
uint8_t *  bstore[],
int32_t *  iyr,
int32_t *  iday,
double *  adctime,
double *  bustime,
uint8_t *  adstate,
uint8_t *  admandone,
int16_t *  adfftid,
uint8_t *  adsolution,
string platform,
uint16_t  ngps,
uint8_t *  gstore[],
double *  gpstime 
)

Definition at line 1295 of file l1agen_viirs.cpp.

◆ isleap()

int isleap ( int  year)

Definition at line 3 of file isleap.c.

◆ jdate()

int jdate ( int32_t  julian,
int32_t *  year,
int32_t *  doy 
)

Definition at line 5 of file jdate.c.

◆ jday()

int32_t jday ( int16_t  i,
int16_t  j,
int16_t  k 
)

Definition at line 4 of file jday.c.

◆ jgleap()

int jgleap ( int32_t  jday,
int32_t *  leap 
)

Definition at line 2445 of file l1aFile.cpp.

◆ read_packet()

int read_packet ( fstream *  vfileStream,
uint8_t *  packet,
int32_t *  len,
int32_t *  apid,
int32_t *  endfile 
)

Definition at line 2346 of file l1agen_viirs.cpp.

◆ read_viirs_scan_packets()

int read_viirs_scan_packets ( fstream *  vfileStream,
uint8_t *  epacket,
uint8_t(*)  pbuffer[PBUFFER_SIZE],
int32_t *  npkts,
int32_t *  endfile 
)

Definition at line 1372 of file l1agen_viirs.cpp.

◆ scan_complete()

int scan_complete ( uint8_t(*)  pbuffer[PBUFFER_SIZE],
int32_t  npkts 
)

Definition at line 2398 of file l1agen_viirs.cpp.

◆ szip_uncompress_memory()

long szip_uncompress_memory ( int  new_options_mask,
int  new_bits_per_pixel,
int  new_pixels_per_block,
int  new_pixels_per_scanline,
const char *  in,
long  in_bytes,
void *  out,
long  out_pixels 
)

◆ unpack_cal_sci()

int unpack_cal_sci ( uint8_t *  idat,
int32_t  nsamps,
int32_t  ndet,
int16_t *  sp,
int16_t *  bl,
int16_t *  sd 
)

Definition at line 2157 of file l1agen_viirs.cpp.

◆ unpack_sci()

int unpack_sci ( uint8_t *  idat,
int32_t  nsamp,
int16_t *  scan,
uint8_t *  qfl 
)

Definition at line 2015 of file l1agen_viirs.cpp.

◆ unpack_viirs_cal()

int unpack_viirs_cal ( int32_t  npkts,
uint8_t(*)  pbuffer[PBUFFER_SIZE],
int16_t(*)  sdm[16][48],
int16_t(*)  svm[16][48],
int16_t(*)  bbm[16][48],
int16_t(*)  sdi[32][96],
int16_t(*)  svi[32][96],
int16_t(*)  bbi[32][96],
int16_t(*)  sdd[64],
int16_t(*)  svd[64],
int16_t(*)  bbd[64],
uint8_t *  calmet 
)

Definition at line 1839 of file l1agen_viirs.cpp.

◆ unpack_viirs_scan()

int unpack_viirs_scan ( int32_t  npkts,
uint8_t(*)  pbuffer[PBUFFER_SIZE],
uint16_t(*)  mbands[16][6304],
uint16_t(*)  ibands[32][6400],
uint16_t(*)  dnb[16][4064],
uint8_t(*)  mqfl[16],
uint8_t(*)  iqfl[32],
uint8_t(*)  dqfl[16],
uint8_t(*)  hrmet[146] 
)

Definition at line 1526 of file l1agen_viirs.cpp.

◆ usds()

int usds ( int  argc,
char *  argv[],
int32_t  inBytes,
uint8_t *  encryptData,
uint16_t *  decryptData 
)

◆ yds2tai()

int yds2tai ( int16_t  iyr,
int16_t  idy,
double  sec,
double *  tai93 
)