OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
aerosol.c File Reference
#include <float.h>
#include "l12_proto.h"
Include dependency graph for aerosol.c:

Go to the source code of this file.

Classes

struct  aermod_struct
 
struct  aermodtab_struct
 
struct  alphaT_struct
 
struct  epsilonT_struct
 
struct  geom_strdef
 
struct  rhoaT_struct
 

Macros

#define MAXMODEL   MAXAERMOD
 
#define INDEX(iw, isol, iphi, isen)   (iw*aertab->nsolz*aertab->nphi*aertab->nsenz + isol*aertab->nphi*aertab->nsenz + iphi*aertab->nsenz + isen)
 

Functions

aermodstr * alloc_aermodstr (int nbands, int nscatt, int nphi, int nsolz, int nsenz, int ntheta)
 
int cmpfunc (const void *a, const void *b)
 
float first_deriv (float x[], float y[], int n)
 
int load_aermod (int32_t sensorID, float wave[], int32_t nwave, char *aermodfile, char models[MAXAERMOD][32], int32_t nmodels)
 
void ss_to_ms_coef (int modnum, geom_str *geom, float **a, float **b, float **c)
 
float fresnel_coef (float mu, float index)
 
void ms_eps_coef (int modnum, int32_t iwnir_l, float wave[], geom_str *geom, float **a, float **b, float **c, float **d, float **e)
 
int comp_epsilonT (epsilonTstr *x, epsilonTstr *y)
 
void model_select_ahmad (int32_t nmodels, int32_t *mindx, float eps_pred[], float eps_obs, int32_t *modmin, int32_t *modmax, float *modrat)
 
int comp_rhoa_ms_eps (int32_t nwave, float wave[], geom_str *geom, float tau_iwnir_l, int32_t modl, float tau_pred[], float rho_pred[])
 
int comp_rhoa_ms_eps_lin (int32_t nwave, float wave[], geom_str *geom, float tau_iwnir_l, int32_t modl, float tau_pred[], float rho_pred[])
 
int spectral_matching (int32_t sensorID, float wave[], int32_t nwave, int32_t iwnir_s, int32_t iwnir_l, int32_t nmodels, int32_t mindx1[], int32_t mindx2[], int32_t mindx3[], geom_str *geom, float wv, float rhoa[], float rho_aer[], int32_t *mod1_indx, int32_t *mod2_indx, float *weight, float tau_pred_min[], float tau_pred_max[], float tg_sol_sm[], float tg_sen_sm[], float Lt_sm[], int32_t ip)
 
int ahmad_atm_corr (int32_t sensorID, float wave[], int32_t nwave, int32_t iwnir_s, int32_t iwnir_l, int32_t nmodels, int32_t mindx[], geom_str *geom, float wv, float rhoa[], int32_t *modmin, int32_t *modmax, float *modrat, float *epsnir, float tau_pred_max[], float tau_pred_min[], float rho_pred_max[], float rho_pred_min[], float tau_aer[], float rho_aer[])
 
int ahmad_atm_corr_lin (int32_t sensorID, float wave[], int32_t nwave, int32_t iwnir_s, int32_t iwnir_l, int32_t nmodels, int32_t mindx[], geom_str *geom, float wv, float rhoa[], int32_t *modmin, int32_t *modmax, float *modrat, float *epsnir, float tau_pred_max[], float tau_pred_min[], float rho_pred_max[], float rho_pred_min[], float tau_aer[], float rho_aer[])
 
float * model_phase (int modnum, geom_str *geom)
 
float aeroob_cf (int modnum, geom_str *geom)
 
float aeroob (int32_t sensorID, int32_t iw, float airmass, float cf, float wv)
 
int rhoa_to_rhoas (int32_t sensorID, int modnum, geom_str *geom, float wv, float rhoa[], float wave[], int32_t nwave, int iw1, int iw2, float rhoas[])
 
void rhoas_to_rhoa (int32_t sensorID, int modnum, geom_str *geom, float wv, float rhoas[], float wave[], int32_t nwave, int iw1, int iw2, float rhoa[])
 
float * model_epsilon (int modnum, int32_t iwnir_l, float wave[], int32_t nwave, geom_str *geom)
 
int model_select_wang (int32_t sensorID, float wave[], int32_t nwave, int32_t nmodel, int32_t mindx[], geom_str *geom, float wv, float rhoa[], int32_t iwnir_s, int32_t iwnir_l, int32_t *modmin, int32_t *modmax, float *modrat, float *epsnir)
 
int compalphaT (alphaTstr *x, alphaTstr *y)
 
void model_select_angstrom (float angstrom, int32_t *modmin, int32_t *modmax, float *modrat)
 
void model_taua (int32_t sensorID, int modnum, float wave[], int32_t nwave, int32_t iwnir_l, float rhoa[], geom_str *geom, float wv, float taua[])
 
int model_taua_mseps (int32_t modl, float wave[], int32_t nwave, int32_t iwnir_l, float rhoa[], geom_str *geom, float tau_pred[])
 
void model_transmittance (int modnum, float wave[], int32_t nwave, float *theta, int gmult, float taua[], float dtran[])
 
void diff_tran (int32_t sensorID, float wave[], int32_t nwave, int32_t iwnir_l, geom_str *geom, float wv, float pr, float taur[], int32_t modmin, int32_t modmax, float modrat, float rhoa[], float taua[], float tsol[], float tsen[], float tauamin[], float tauamax[], int taua_opt)
 
int smaer (int32_t sensorID, float wave[], int32_t nwave, int32_t iwnir_s, int32_t iwnir_l, int32_t nmodels, int32_t mindx1[], int32_t mindx2[], int32_t mindx3[], geom_str *geom, float wv, float rhoa[], float rho_aer[], int32_t *modmin, int32_t *modmax, float *modrat, float tau_pred_min[], float tau_pred_max[], float tg_sol_sm[], float tg_sen_sm[], float Lt_sm[], int32_t ip)
 
int ahmadaer (int32_t sensorID, float wave[], int32_t nwave, int32_t iwnir_s, int32_t iwnir_l, int32_t nmodels, int32_t mindx[], geom_str *geom, float wv, float rhoa[], int32_t *modmin, int32_t *modmax, float *modrat, float *epsnir, float tau_pred_min[], float tau_pred_max[])
 
int wangaer (int32_t sensorID, float wave[], int32_t nwave, int32_t iwnir_s, int32_t iwnir_l, int32_t nmodels, int32_t mindx[], geom_str *geom, float wv, float rhoa[], int32_t *modmin, int32_t *modmax, float *modrat, float *epsnir, float tauamin[], float tauamax[])
 
int comp_rhoaT (rhoaTstr *x, rhoaTstr *y)
 
int model_select_franz (int32_t sensorID, float wave[], int32_t nwave, int32_t nmodel, int32_t mindx[], geom_str *geom, float wv, float rhoa[], int32_t iwnir_s, int32_t iwnir_l, int32_t *modmin, int32_t *modmax, float *modrat, float *epsnir)
 
int rhaer (int32_t sensorID, float wave[], int32_t nwave, int32_t iwnir_s, int32_t iwnir_l, geom_str *geom, float wv, float rh, float pr, float taur[], float rhoa[], int32_t *modmin1, int32_t *modmax1, float *modrat1, int32_t *modmin2, int32_t *modmax2, float *modrat2, float *eps, float taua[], float tsol[], float tsen[], float tg_sol_sm[], float tg_sen_sm[], float Lt_sm[], int32_t ip)
 
int fixedaer (int32_t sensorID, int32_t modnum, float wave[], int32_t nwave, int32_t iwnir_s, int32_t iwnir_l, char models[MAXAERMOD][32], int32_t nmodels, geom_str *geom, float wv, float rhoa[], float *epsnir)
 
int fixedmodpair (int32_t sensorID, float wave[], int32_t nwave, int32_t iwnir_s, int32_t iwnir_l, geom_str *geom, float wv, int32_t modmin, int32_t modmax, float modrat, float rhoa[], float *eps)
 
int fixedaot (int32_t sensorID, float aot[], float wave[], int32_t nwave, int32_t iwnir_s, int32_t iwnir_l, geom_str *geom, float wv, int32_t *modmin, int32_t *modmax, float *modrat, float rhoa[], float *epsnir)
 
int aerosol (l2str *l2rec, int32_t aer_opt_in, aestr *aerec, int32_t ip, float wave[], int32_t nwave, int32_t iwnir_s_in, int32_t iwnir_l_in, float F0_in[], float La1_in[], float La2_out[], float t_sol_out[], float t_sen_out[], float *eps, float taua_out[], int32_t *modmin, int32_t *modmax, float *modrat, int32_t *modmin2, int32_t *modmax2, float *modrat2)
 
void get_angstrom (l2str *l2rec, int band, float angst[])
 
void get_ms_epsilon (l2str *l2rec, float eps[])
 

Variables

geom_str geom
 

Macro Definition Documentation

◆ INDEX

#define INDEX (   iw,
  isol,
  iphi,
  isen 
)    (iw*aertab->nsolz*aertab->nphi*aertab->nsenz + isol*aertab->nphi*aertab->nsenz + iphi*aertab->nsenz + isen)

Definition at line 642 of file aerosol.c.

◆ MAXMODEL

#define MAXMODEL   MAXAERMOD

Definition at line 53 of file aerosol.c.

Function Documentation

◆ aeroob()

float aeroob ( int32_t  sensorID,
int32_t  iw,
float  airmass,
float  cf,
float  wv 
)

Definition at line 2155 of file aerosol.c.

◆ aeroob_cf()

float aeroob_cf ( int  modnum,
geom_str *  geom 
)

Definition at line 2124 of file aerosol.c.

◆ aerosol()

int aerosol ( l2str *  l2rec,
int32_t  aer_opt_in,
aestr *  aerec,
int32_t  ip,
float  wave[],
int32_t  nwave,
int32_t  iwnir_s_in,
int32_t  iwnir_l_in,
float  F0_in[],
float  La1_in[],
float  La2_out[],
float  t_sol_out[],
float  t_sen_out[],
float *  eps,
float  taua_out[],
int32_t *  modmin,
int32_t *  modmax,
float *  modrat,
int32_t *  modmin2,
int32_t *  modmax2,
float *  modrat2 
)

Definition at line 3922 of file aerosol.c.

◆ ahmad_atm_corr()

int ahmad_atm_corr ( int32_t  sensorID,
float  wave[],
int32_t  nwave,
int32_t  iwnir_s,
int32_t  iwnir_l,
int32_t  nmodels,
int32_t  mindx[],
geom_str *  geom,
float  wv,
float  rhoa[],
int32_t *  modmin,
int32_t *  modmax,
float *  modrat,
float *  epsnir,
float  tau_pred_max[],
float  tau_pred_min[],
float  rho_pred_max[],
float  rho_pred_min[],
float  tau_aer[],
float  rho_aer[] 
)

Definition at line 1696 of file aerosol.c.

◆ ahmad_atm_corr_lin()

int ahmad_atm_corr_lin ( int32_t  sensorID,
float  wave[],
int32_t  nwave,
int32_t  iwnir_s,
int32_t  iwnir_l,
int32_t  nmodels,
int32_t  mindx[],
geom_str *  geom,
float  wv,
float  rhoa[],
int32_t *  modmin,
int32_t *  modmax,
float *  modrat,
float *  epsnir,
float  tau_pred_max[],
float  tau_pred_min[],
float  rho_pred_max[],
float  rho_pred_min[],
float  tau_aer[],
float  rho_aer[] 
)

Definition at line 1847 of file aerosol.c.

◆ ahmadaer()

int ahmadaer ( int32_t  sensorID,
float  wave[],
int32_t  nwave,
int32_t  iwnir_s,
int32_t  iwnir_l,
int32_t  nmodels,
int32_t  mindx[],
geom_str *  geom,
float  wv,
float  rhoa[],
int32_t *  modmin,
int32_t *  modmax,
float *  modrat,
float *  epsnir,
float  tau_pred_min[],
float  tau_pred_max[] 
)

Definition at line 2936 of file aerosol.c.

◆ alloc_aermodstr()

aermodstr* alloc_aermodstr ( int  nbands,
int  nscatt,
int  nphi,
int  nsolz,
int  nsenz,
int  ntheta 
)

Definition at line 116 of file aerosol.c.

◆ cmpfunc()

int cmpfunc ( const void *  a,
const void *  b 
)

Definition at line 233 of file aerosol.c.

◆ comp_epsilonT()

int comp_epsilonT ( epsilonTstr *  x,
epsilonTstr *  y 
)

Definition at line 1257 of file aerosol.c.

◆ comp_rhoa_ms_eps()

int comp_rhoa_ms_eps ( int32_t  nwave,
float  wave[],
geom_str *  geom,
float  tau_iwnir_l,
int32_t  modl,
float  tau_pred[],
float  rho_pred[] 
)

Definition at line 1320 of file aerosol.c.

◆ comp_rhoa_ms_eps_lin()

int comp_rhoa_ms_eps_lin ( int32_t  nwave,
float  wave[],
geom_str *  geom,
float  tau_iwnir_l,
int32_t  modl,
float  tau_pred[],
float  rho_pred[] 
)

Definition at line 1373 of file aerosol.c.

◆ comp_rhoaT()

int comp_rhoaT ( rhoaTstr *  x,
rhoaTstr *  y 
)

Definition at line 3090 of file aerosol.c.

◆ compalphaT()

int compalphaT ( alphaTstr *  x,
alphaTstr *  y 
)

Definition at line 2557 of file aerosol.c.

◆ diff_tran()

void diff_tran ( int32_t  sensorID,
float  wave[],
int32_t  nwave,
int32_t  iwnir_l,
geom_str *  geom,
float  wv,
float  pr,
float  taur[],
int32_t  modmin,
int32_t  modmax,
float  modrat,
float  rhoa[],
float  taua[],
float  tsol[],
float  tsen[],
float  tauamin[],
float  tauamax[],
int  taua_opt 
)

Definition at line 2816 of file aerosol.c.

◆ first_deriv()

float first_deriv ( float  x[],
float  y[],
int  n 
)

Definition at line 246 of file aerosol.c.

◆ fixedaer()

int fixedaer ( int32_t  sensorID,
int32_t  modnum,
float  wave[],
int32_t  nwave,
int32_t  iwnir_s,
int32_t  iwnir_l,
char  models[MAXAERMOD][32],
int32_t  nmodels,
geom_str *  geom,
float  wv,
float  rhoa[],
float *  epsnir 
)

Definition at line 3632 of file aerosol.c.

◆ fixedaot()

int fixedaot ( int32_t  sensorID,
float  aot[],
float  wave[],
int32_t  nwave,
int32_t  iwnir_s,
int32_t  iwnir_l,
geom_str *  geom,
float  wv,
int32_t *  modmin,
int32_t *  modmax,
float *  modrat,
float  rhoa[],
float *  epsnir 
)

Definition at line 3763 of file aerosol.c.

◆ fixedmodpair()

int fixedmodpair ( int32_t  sensorID,
float  wave[],
int32_t  nwave,
int32_t  iwnir_s,
int32_t  iwnir_l,
geom_str *  geom,
float  wv,
int32_t  modmin,
int32_t  modmax,
float  modrat,
float  rhoa[],
float *  eps 
)

Definition at line 3687 of file aerosol.c.

◆ fresnel_coef()

float fresnel_coef ( float  mu,
float  index 
)

Definition at line 904 of file aerosol.c.

◆ get_angstrom()

void get_angstrom ( l2str *  l2rec,
int  band,
float  angst[] 
)

Definition at line 4529 of file aerosol.c.

◆ get_ms_epsilon()

void get_ms_epsilon ( l2str *  l2rec,
float  eps[] 
)

Definition at line 4577 of file aerosol.c.

◆ load_aermod()

int load_aermod ( int32_t  sensorID,
float  wave[],
int32_t  nwave,
char *  aermodfile,
char  models[MAXAERMOD][32],
int32_t  nmodels 
)

Definition at line 322 of file aerosol.c.

◆ model_epsilon()

float* model_epsilon ( int  modnum,
int32_t  iwnir_l,
float  wave[],
int32_t  nwave,
geom_str *  geom 
)

Definition at line 2328 of file aerosol.c.

◆ model_phase()

float* model_phase ( int  modnum,
geom_str *  geom 
)

Definition at line 2001 of file aerosol.c.

◆ model_select_ahmad()

void model_select_ahmad ( int32_t  nmodels,
int32_t *  mindx,
float  eps_pred[],
float  eps_obs,
int32_t *  modmin,
int32_t *  modmax,
float *  modrat 
)

Definition at line 1261 of file aerosol.c.

◆ model_select_angstrom()

void model_select_angstrom ( float  angstrom,
int32_t *  modmin,
int32_t *  modmax,
float *  modrat 
)

Definition at line 2561 of file aerosol.c.

◆ model_select_franz()

int model_select_franz ( int32_t  sensorID,
float  wave[],
int32_t  nwave,
int32_t  nmodel,
int32_t  mindx[],
geom_str *  geom,
float  wv,
float  rhoa[],
int32_t  iwnir_s,
int32_t  iwnir_l,
int32_t *  modmin,
int32_t *  modmax,
float *  modrat,
float *  epsnir 
)

Definition at line 3094 of file aerosol.c.

◆ model_select_wang()

int model_select_wang ( int32_t  sensorID,
float  wave[],
int32_t  nwave,
int32_t  nmodel,
int32_t  mindx[],
geom_str *  geom,
float  wv,
float  rhoa[],
int32_t  iwnir_s,
int32_t  iwnir_l,
int32_t *  modmin,
int32_t *  modmax,
float *  modrat,
float *  epsnir 
)

Definition at line 2407 of file aerosol.c.

◆ model_taua()

void model_taua ( int32_t  sensorID,
int  modnum,
float  wave[],
int32_t  nwave,
int32_t  iwnir_l,
float  rhoa[],
geom_str *  geom,
float  wv,
float  taua[] 
)

Definition at line 2613 of file aerosol.c.

◆ model_taua_mseps()

int model_taua_mseps ( int32_t  modl,
float  wave[],
int32_t  nwave,
int32_t  iwnir_l,
float  rhoa[],
geom_str *  geom,
float  tau_pred[] 
)

Definition at line 2679 of file aerosol.c.

◆ model_transmittance()

void model_transmittance ( int  modnum,
float  wave[],
int32_t  nwave,
float *  theta,
int  gmult,
float  taua[],
float  dtran[] 
)

Definition at line 2722 of file aerosol.c.

◆ ms_eps_coef()

void ms_eps_coef ( int  modnum,
int32_t  iwnir_l,
float  wave[],
geom_str *  geom,
float **  a,
float **  b,
float **  c,
float **  d,
float **  e 
)

Definition at line 931 of file aerosol.c.

◆ rhaer()

int rhaer ( int32_t  sensorID,
float  wave[],
int32_t  nwave,
int32_t  iwnir_s,
int32_t  iwnir_l,
geom_str *  geom,
float  wv,
float  rh,
float  pr,
float  taur[],
float  rhoa[],
int32_t *  modmin1,
int32_t *  modmax1,
float *  modrat1,
int32_t *  modmin2,
int32_t *  modmax2,
float *  modrat2,
float *  eps,
float  taua[],
float  tsol[],
float  tsen[],
float  tg_sol_sm[],
float  tg_sen_sm[],
float  Lt_sm[],
int32_t  ip 
)

Definition at line 3206 of file aerosol.c.

◆ rhoa_to_rhoas()

int rhoa_to_rhoas ( int32_t  sensorID,
int  modnum,
geom_str *  geom,
float  wv,
float  rhoa[],
float  wave[],
int32_t  nwave,
int  iw1,
int  iw2,
float  rhoas[] 
)

Definition at line 2205 of file aerosol.c.

◆ rhoas_to_rhoa()

void rhoas_to_rhoa ( int32_t  sensorID,
int  modnum,
geom_str *  geom,
float  wv,
float  rhoas[],
float  wave[],
int32_t  nwave,
int  iw1,
int  iw2,
float  rhoa[] 
)

Definition at line 2268 of file aerosol.c.

◆ smaer()

int smaer ( int32_t  sensorID,
float  wave[],
int32_t  nwave,
int32_t  iwnir_s,
int32_t  iwnir_l,
int32_t  nmodels,
int32_t  mindx1[],
int32_t  mindx2[],
int32_t  mindx3[],
geom_str *  geom,
float  wv,
float  rhoa[],
float  rho_aer[],
int32_t *  modmin,
int32_t *  modmax,
float *  modrat,
float  tau_pred_min[],
float  tau_pred_max[],
float  tg_sol_sm[],
float  tg_sen_sm[],
float  Lt_sm[],
int32_t  ip 
)

Definition at line 2903 of file aerosol.c.

◆ spectral_matching()

int spectral_matching ( int32_t  sensorID,
float  wave[],
int32_t  nwave,
int32_t  iwnir_s,
int32_t  iwnir_l,
int32_t  nmodels,
int32_t  mindx1[],
int32_t  mindx2[],
int32_t  mindx3[],
geom_str *  geom,
float  wv,
float  rhoa[],
float  rho_aer[],
int32_t *  mod1_indx,
int32_t *  mod2_indx,
float *  weight,
float  tau_pred_min[],
float  tau_pred_max[],
float  tg_sol_sm[],
float  tg_sen_sm[],
float  Lt_sm[],
int32_t  ip 
)

Definition at line 1425 of file aerosol.c.

◆ ss_to_ms_coef()

void ss_to_ms_coef ( int  modnum,
geom_str *  geom,
float **  a,
float **  b,
float **  c 
)

Definition at line 656 of file aerosol.c.

◆ wangaer()

int wangaer ( int32_t  sensorID,
float  wave[],
int32_t  nwave,
int32_t  iwnir_s,
int32_t  iwnir_l,
int32_t  nmodels,
int32_t  mindx[],
geom_str *  geom,
float  wv,
float  rhoa[],
int32_t *  modmin,
int32_t *  modmax,
float *  modrat,
float *  epsnir,
float  tauamin[],
float  tauamax[] 
)

Definition at line 2979 of file aerosol.c.

Variable Documentation

◆ geom

geom_str geom

Definition at line 206 of file aerosol.c.