NASA Logo
Ocean Color Science Software

ocssw V2022
common.h File Reference
#include <iostream>
#include <stdint.h>
#include <stdlib.h>
#include <cmath>
#include <vector>
#include <netcdf>
#include <sstream>
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  geo_struct
 

Macros

#define CHUNK_CACHE_SIZE   256 * 1024 * 1024
 
#define CHUNK_CACHE_NELEMS   1033
 
#define CHUNK_CACHE_PREEMPTION   .75
 
#define VARCHUNK_CACHE_SIZE   4 * 1024 * 1024
 
#define VARCHUNK_CACHE_NELEMS   1033
 
#define VARCHUNK_CACHE_PREEMPTION   .75
 
#define CHUNKBANDS   40
 
#define CHUNKPIXELS   2000
 
#define CHUNKLINES   16
 
#define SWAP_2(x)   ( (((x) & 0xff) << 8) | ((unsigned short)(x) >> 8) )
 
#define SWAP_4(x)
 

Functions

int geolocate_oci (std::string l1a_filename, std::string geo_lut_filename, geo_struct &geoLUT, std::string l1b_filename, std::string dem_file, bool radiance, std::string doi, const std::string ephFile, std::string pversion)
 
int read_mce_tlm (netCDF::NcFile *l1afile, geo_struct &geo_lut, netCDF::NcGroup egid, uint32_t nmcescan, uint32_t nenc, int32_t &ppr_off, double &revpsec, double &secpline, int16_t &board_id, int32_t *mspin, int32_t *ot_10us, uint8_t *enc_count, float **hamenc, float **rtaenc, int16_t &iret)
 
int get_ev (double secpline, int16_t *dtype, int16_t *lines, int16_t *iagg, uint16_t &pcdim, uint16_t &psdim, double &ev_toff, float *clines, float *slines, double *deltc, double *delts, bool dark, int16_t &iret)
 
int get_oci_vecs (uint32_t nscan, uint16_t pdim, double as_planarity[5], double at_planarity[5], int32_t *rta_nadir, double ham_ct_angles[2], double ev_toff, int32_t spin, uint8_t hside, float *clines, double *delt, double revpsec, int32_t ppr_off, int16_t board_id, uint32_t nmcescan, int32_t *mspin, uint8_t *enc_count, float **hamenc, float **rtaenc, float **pview, double *theta, int16_t &iret)
 
int createField (netCDF::NcGroup &ncGrp, const char *sname, const char *lname, const char *standard_name, const char *units, const char *description, void *fill_value, const char *flag_values, const char *flag_meanings, double low, double high, double scale, double offset, int nt, std::vector< netCDF::NcDim > &varVec, std::string coordinates)
 
int get_nib_nbb (uint32_t ntaps, size_t *ia, uint32_t ntb[16], int16_t jagg[16], uint32_t &nib, uint32_t &nbb)
 
int get_agg_mat (size_t *ia, int16_t jagg[16], uint32_t ntb[16], uint32_t nib, uint32_t nbb, float **amat, float **gmat)
 
int check_scan_times (uint32_t nscan, double *sstime, short *sfl)
 

Macro Definition Documentation

◆ CHUNK_CACHE_NELEMS

#define CHUNK_CACHE_NELEMS   1033

Definition at line 11 of file common.h.

◆ CHUNK_CACHE_PREEMPTION

#define CHUNK_CACHE_PREEMPTION   .75

Definition at line 12 of file common.h.

◆ CHUNK_CACHE_SIZE

#define CHUNK_CACHE_SIZE   256 * 1024 * 1024

Definition at line 10 of file common.h.

◆ CHUNKBANDS

#define CHUNKBANDS   40

Definition at line 16 of file common.h.

◆ CHUNKLINES

#define CHUNKLINES   16

Definition at line 18 of file common.h.

◆ CHUNKPIXELS

#define CHUNKPIXELS   2000

Definition at line 17 of file common.h.

◆ SWAP_2

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

Definition at line 48 of file common.h.

◆ SWAP_4

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

Definition at line 50 of file common.h.

◆ VARCHUNK_CACHE_NELEMS

#define VARCHUNK_CACHE_NELEMS   1033

Definition at line 14 of file common.h.

◆ VARCHUNK_CACHE_PREEMPTION

#define VARCHUNK_CACHE_PREEMPTION   .75

Definition at line 15 of file common.h.

◆ VARCHUNK_CACHE_SIZE

#define VARCHUNK_CACHE_SIZE   4 * 1024 * 1024

Definition at line 13 of file common.h.

Function Documentation

◆ check_scan_times()

int check_scan_times ( uint32_t  nscan,
double *  sstime,
short *  sfl 
)

Definition at line 863 of file common.cpp.

◆ createField()

int createField ( netCDF::NcGroup &  ncGrp,
const char *  sname,
const char *  lname,
const char *  standard_name,
const char *  units,
const char *  description,
void *  fill_value,
const char *  flag_values,
const char *  flag_meanings,
double  low,
double  high,
double  scale,
double  offset,
int  nt,
std::vector< netCDF::NcDim > &  varVec,
std::string  coordinates 
)

◆ geolocate_oci()

int geolocate_oci ( std::string  l1a_filename,
std::string  geo_lut_filename,
geo_struct geoLUT,
std::string  l1b_filename,
std::string  dem_file,
bool  radiance,
std::string  doi,
const std::string  ephFile,
std::string  pversion 
)

◆ get_agg_mat()

int get_agg_mat ( size_t *  ia,
int16_t  jagg[16],
uint32_t  ntb[16],
uint32_t  nib,
uint32_t  nbb,
float **  amat,
float **  gmat 
)

Definition at line 777 of file common.cpp.

◆ get_ev()

int get_ev ( double  secpline,
int16_t *  dtype,
int16_t *  lines,
int16_t *  iagg,
uint16_t &  pcdim,
uint16_t &  psdim,
double &  ev_toff,
float *  clines,
float *  slines,
double *  deltc,
double *  delts,
bool  dark,
int16_t &  iret 
)

Definition at line 142 of file common.cpp.

◆ get_nib_nbb()

int get_nib_nbb ( uint32_t  ntaps,
size_t *  ia,
uint32_t  ntb[16],
int16_t  jagg[16],
uint32_t &  nib,
uint32_t &  nbb 
)

Definition at line 742 of file common.cpp.

◆ get_oci_vecs()

int get_oci_vecs ( uint32_t  nscan,
uint16_t  pdim,
double  as_planarity[5],
double  at_planarity[5],
int32_t *  rta_nadir,
double  ham_ct_angles[2],
double  ev_toff,
int32_t  spin,
uint8_t  hside,
float *  clines,
double *  delt,
double  revpsec,
int32_t  ppr_off,
int16_t  board_id,
uint32_t  nmcescan,
int32_t *  mspin,
uint8_t *  enc_count,
float **  hamenc,
float **  rtaenc,
float **  pview,
double *  theta,
int16_t &  iret 
)

Definition at line 195 of file common.cpp.

◆ read_mce_tlm()

int read_mce_tlm ( netCDF::NcFile *  l1afile,
geo_struct geo_lut,
netCDF::NcGroup  egid,
uint32_t  nmcescan,
uint32_t  nenc,
int32_t &  ppr_off,
double &  revpsec,
double &  secpline,
int16_t &  board_id,
int32_t *  mspin,
int32_t *  ot_10us,
uint8_t *  enc_count,
float **  hamenc,
float **  rtaenc,
int16_t &  iret 
)