OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
l1agen_viirs.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <unistd.h>
#include <sstream>
#include <iomanip>
#include <getopt.h>
#include "l1agen_viirs.h"
#include "netcdf.h"
#include "timeutils.h"
Include dependency graph for l1agen_viirs.cpp:

Go to the source code of this file.

Macros

#define VERSION   "2.13"
 
#define MAX_PKTS_PER_SCAN   513
 

Functions

int main (int argc, char *argv[])
 
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_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 nsamp, int32_t ndet, int16_t *sp, int16_t *bl, int16_t *sd)
 
int read_packet (fstream *vfileStream, uint8_t *packet, int32_t *len, int32_t *apid, int32_t *endfile)
 
uint8_t check_sum (int32_t nc, uint8_t *dat, uint8_t *chk)
 
int scan_complete (uint8_t(*pbuffer)[PBUFFER_SIZE], int32_t npkts)
 

Macro Definition Documentation

◆ MAX_PKTS_PER_SCAN

#define MAX_PKTS_PER_SCAN   513

Definition at line 209 of file l1agen_viirs.cpp.

◆ VERSION

#define VERSION   "2.13"

Definition at line 17 of file l1agen_viirs.cpp.

Function Documentation

◆ check_sum()

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

Definition at line 2376 of file l1agen_viirs.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.

◆ 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.

◆ main()

int main ( int  argc,
char *  argv[] 
)

An implementation of a Lon/Lat to UTM zone code written by Chuck Gantz chuck.nosp@m..gan.nosp@m.tz@gl.nosp@m.obal.nosp@m.star..nosp@m.com ...in 1998...found on http://www.gpsy.com/gpsinfo/geotoutm/, a site published by Karen Nakamura, last updated 22 June 2000.

Minor modifications to the code were made to eliminate deprecation warnings

Definition at line 211 of file l1agen_viirs.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.

◆ unpack_cal_sci()

int unpack_cal_sci ( uint8_t *  idat,
int32_t  nsamp,
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.