ocssw V2020
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 MAXSOLZ   33
 
#define MAXSENZ   35
 
#define MAXPHI   19
 
#define MAXSCATT   75
 
#define DTNTHETA   33
 
#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[])
 
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 tauaopt)
 
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 franzaer (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 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

◆ DTNTHETA

#define DTNTHETA   33

Definition at line 58 of file aerosol.c.

◆ 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 765 of file aerosol.c.

◆ MAXMODEL

#define MAXMODEL   MAXAERMOD

Definition at line 53 of file aerosol.c.

◆ MAXPHI

#define MAXPHI   19

Definition at line 56 of file aerosol.c.

◆ MAXSCATT

#define MAXSCATT   75

Definition at line 57 of file aerosol.c.

◆ MAXSENZ

#define MAXSENZ   35

Definition at line 55 of file aerosol.c.

◆ MAXSOLZ

#define MAXSOLZ   33

Definition at line 54 of file aerosol.c.

Function Documentation

◆ aeroob()

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

Definition at line 2279 of file aerosol.c.

◆ aeroob_cf()

float aeroob_cf ( int  modnum,
geom_str *  geom 
)

Definition at line 2248 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 4134 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 1820 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 1971 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 3019 of file aerosol.c.

◆ alloc_aermodstr()

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

Definition at line 108 of file aerosol.c.

◆ cmpfunc()

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

Definition at line 215 of file aerosol.c.

◆ comp_epsilonT()

int comp_epsilonT ( epsilonTstr *  x,
epsilonTstr *  y 
)

Definition at line 1380 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 1443 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 1496 of file aerosol.c.

◆ comp_rhoaT()

int comp_rhoaT ( rhoaTstr *  x,
rhoaTstr *  y 
)

Definition at line 3173 of file aerosol.c.

◆ compalphaT()

int compalphaT ( alphaTstr *  x,
alphaTstr *  y 
)

Definition at line 2691 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  tauaopt 
)

Definition at line 2905 of file aerosol.c.

◆ first_deriv()

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

Definition at line 228 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 3844 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 3975 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 3899 of file aerosol.c.

◆ franzaer()

int franzaer ( 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 3269 of file aerosol.c.

◆ fresnel_coef()

float fresnel_coef ( float  mu,
float  index 
)

Definition at line 1027 of file aerosol.c.

◆ get_angstrom()

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

Definition at line 4737 of file aerosol.c.

◆ get_ms_epsilon()

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

Definition at line 4785 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 268 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 2451 of file aerosol.c.

◆ model_phase()

float* model_phase ( int  modnum,
geom_str *  geom 
)

Definition at line 2125 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 1384 of file aerosol.c.

◆ model_select_angstrom()

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

Definition at line 2695 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 3177 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 2530 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 2747 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 2816 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 1054 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 3384 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 2328 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 2391 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 2985 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 1549 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 779 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 3062 of file aerosol.c.

Variable Documentation

◆ geom

geom_str geom

Definition at line 188 of file aerosol.c.