AdaptiveOpticsControl
AtmosphereModel.c File Reference

Functions

int_fast8_t AtmosphereModel_Create_from_CONF_cli ()
 
int_fast8_t init_AtmosphereModel ()
 
int ATMOSPHEREMODEL_loadRIA_readsize (const char *fname)
 
int ATMOSPHEREMODEL_loadRIA (const char *fname, double *lptr, double *RIptr, double *absptr)
 
void tselec (struct nrlmsise_flags *flags)
 
void glatf (double lat, double *gv, double *reff)
 
double ccor (double alt, double r, double h1, double zh)
 
double ccor2 (double alt, double r, double h1, double zh, double h2)
 
double scalh (double alt, double xm, double temp)
 
double dnet (double dd, double dm, double zhm, double xmm, double xm)
 
void splini (double *xa, double *ya, double *y2a, int n, double x, double *y)
 
void splint (double *xa, double *ya, double *y2a, int n, double x, double *y)
 
void spline (double *x, double *y, int n, double yp1, double ypn, double *y2)
 
__inline_double zeta (double zz, double zl)
 
double densm (double alt, double d0, double xm, double *tz, int mn3, double *zn3, double *tn3, double *tgn3, int mn2, double *zn2, double *tn2, double *tgn2)
 
double densu (double alt, double dlb, double tinf, double tlb, double xm, double alpha, double *tz, double zlb, double s2, int mn1, double *zn1, double *tn1, double *tgn1)
 
__inline_double g0 (double a, double *p)
 
__inline_double sumex (double ex)
 
__inline_double sg0 (double ex, double *p, double *ap)
 
double globe7 (double *p, struct nrlmsise_input *input, struct nrlmsise_flags *flags)
 
double glob7s (double *p, struct nrlmsise_input *input, struct nrlmsise_flags *flags)
 
void gtd7 (struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrlmsise_output *output)
 
void gtd7d (struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrlmsise_output *output)
 
void ghp7 (struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrlmsise_output *output, double press)
 
void gts7 (struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrlmsise_output *output)
 
double AirMixture_N (double lambda, double dens_N2, double dens_O2, double dens_Ar, double dens_H2O, double dens_CO2, double dens_Ne, double dens_He, double dens_CH4, double dens_Kr, double dens_H2, double dens_O3, double dens_N, double dens_O, double dens_H)
 
float AtmosphereModel_stdAtmModel_N (float alt, float lambda, int mode)
 
double AtmosphereModel_H2O_Saturation (double T)
 
int AtmosphereModel_save_stdAtmModel (const char *fname)
 
int AtmosphereModel_build_stdAtmModel (const char *fname)
 
int AtmosphereModel_load_stdAtmModel (const char *fname)
 
int AtmosphereModel_Create_from_CONF (const char *CONFFILE, float slambda)
 read configuration file and create atmosphere model More...
 
double AtmosphereModel_RefractionPath (double lambda, double Zangle, int WritePath)
 

Variables

DATA data
 System includes. More...
 
static float ZenithAngle
 
static int TimeDayOfYear
 
static float TimeLocalSolarTime
 
static float SiteLat
 
static float SiteLong
 
static float SiteAlt
 
static float CO2_ppm
 
static int SiteTPauto
 
static float SiteTemp
 
static float SitePress
 
static float SiteH2OMethod
 
static float SiteTPW
 
static float SiteRH
 
static float SitePWSH
 
static float alpha1H2O
 
static int initAtmosphereModel = 0
 
static float * densN2
 
static float * densO2
 
static float * densAr
 
static float * densH2O
 
static float * densCO2
 
static float * densNe
 
static float * densHe
 
static float * densCH4
 
static float * densKr
 
static float * densH2
 
static float * densO3
 
static float * densN
 
static float * densO
 
static float * densH
 
static float * denstot
 
static float * density
 
static float * temperature
 
static float * pressure
 
static float * RH
 
static float dens0
 
static double v_ABSCOEFF = 0.0
 
static double v_TRANSM = 1.0
 
static long RIA_NBpts
 
static double RIA_lambda_min
 
static double RIA_lambda_max
 
static int initRIA_N2 = 0
 
static long RIA_N2_NBpts
 
static double * RIA_N2_lambda
 
static double * RIA_N2_ri
 
static double * RIA_N2_abs
 
static int initRIA_O2 = 0
 
static long RIA_O2_NBpts
 
static double * RIA_O2_lambda
 
static double * RIA_O2_ri
 
static double * RIA_O2_abs
 
static int initRIA_Ar = 0
 
static long RIA_Ar_NBpts
 
static double * RIA_Ar_lambda
 
static double * RIA_Ar_ri
 
static double * RIA_Ar_abs
 
static int initRIA_H2O = 0
 
static long RIA_H2O_NBpts
 
static double * RIA_H2O_lambda
 
static double * RIA_H2O_ri
 
static double * RIA_H2O_abs
 
static int initRIA_CO2 = 0
 
static long RIA_CO2_NBpts
 
static double * RIA_CO2_lambda
 
static double * RIA_CO2_ri
 
static double * RIA_CO2_abs
 
static int initRIA_Ne = 0
 
static long RIA_Ne_NBpts
 
static double * RIA_Ne_lambda
 
static double * RIA_Ne_ri
 
static double * RIA_Ne_abs
 
static int initRIA_He = 0
 
static long RIA_He_NBpts
 
static double * RIA_He_lambda
 
static double * RIA_He_ri
 
static double * RIA_He_abs
 
static int initRIA_CH4 = 0
 
static long RIA_CH4_NBpts
 
static double * RIA_CH4_lambda
 
static double * RIA_CH4_ri
 
static double * RIA_CH4_abs
 
static int initRIA_Kr = 0
 
static long RIA_Kr_NBpts
 
static double * RIA_Kr_lambda
 
static double * RIA_Kr_ri
 
static double * RIA_Kr_abs
 
static int initRIA_H2 = 0
 
static long RIA_H2_NBpts
 
static double * RIA_H2_lambda
 
static double * RIA_H2_ri
 
static double * RIA_H2_abs
 
static int initRIA_O3 = 0
 
static long RIA_O3_NBpts
 
static double * RIA_O3_lambda
 
static double * RIA_O3_ri
 
static double * RIA_O3_abs
 
static int initRIA_N = 0
 
static long RIA_N_NBpts
 
static double * RIA_N_lambda
 
static double * RIA_N_ri
 
static double * RIA_N_abs
 
static int initRIA_O = 0
 
static long RIA_O_NBpts
 
static double * RIA_O_lambda
 
static double * RIA_O_ri
 
static double * RIA_O_abs
 
static int initRIA_H = 0
 
static long RIA_H_NBpts
 
static double * RIA_H_lambda
 
static double * RIA_H_ri
 
static double * RIA_H_abs
 
static long NB_comp_array
 
static double * comp_array_lambda
 
static long * comp_array_lli
 
static int lliprecomp = -1
 
static int lliprecompN2 = -1
 
static int lliprecompO2 = -1
 
static int lliprecompAr = -1
 
static int lliprecompH2O = -1
 
static int lliprecompCO2 = -1
 
static int lliprecompNe = -1
 
static int lliprecompHe = -1
 
static int lliprecompCH4 = -1
 
static int lliprecompKr = -1
 
static int lliprecompH2 = -1
 
static int lliprecompO3 = -1
 
static int lliprecompO = -1
 
static int lliprecompN = -1
 
static int lliprecompH = -1
 
static double gsurf
 
static double re
 
static double dd
 
static double dm04
 
static double dm16
 
static double dm28
 
static double dm32
 
static double dm40
 
static double dm01
 
static double dm14
 
static double meso_tn1 [5]
 
static double meso_tn2 [4]
 
static double meso_tn3 [5]
 
static double meso_tgn1 [2]
 
static double meso_tgn2 [2]
 
static double meso_tgn3 [2]
 
double pt [150]
 
double pd [9][150]
 
double ps [150]
 
double pdl [2][25]
 
double ptm [50]
 
double pdm [8][10]
 
double ptl [4][100]
 
double pma [10][100]
 
double sam [100]
 
double pavgm [10]
 
static double dfa
 
static double plg [4][9]
 
static double ctloc
 
static double stloc
 
static double c2tloc
 
static double s2tloc
 
static double s3tloc
 
static double c3tloc
 
static double apdf
 
static double apt [4]
 

Function Documentation

double AirMixture_N ( double  lambda,
double  dens_N2,
double  dens_O2,
double  dens_Ar,
double  dens_H2O,
double  dens_CO2,
double  dens_Ne,
double  dens_He,
double  dens_CH4,
double  dens_Kr,
double  dens_H2,
double  dens_O3,
double  dens_N,
double  dens_O,
double  dens_H 
)
int AtmosphereModel_build_stdAtmModel ( const char *  fname)
int AtmosphereModel_Create_from_CONF ( const char *  CONFFILE,
float  slambda 
)

read configuration file and create atmosphere model

int_fast8_t AtmosphereModel_Create_from_CONF_cli ( )
double AtmosphereModel_H2O_Saturation ( double  T)

using " The IAPWS Formulation 1995 for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific Use ", Journal of Physical and Chemical Reference Data, June 2002 ,Volume 31, Issue 2, pp. 387535 output : saturation H2O pressure [Pa]

int AtmosphereModel_load_stdAtmModel ( const char *  fname)

load atmosphere model ASCII file model lists concentration of atmosphere components, temperature, pressure one line every 10m of elevation, 10000 lines (0-100km)

int ATMOSPHEREMODEL_loadRIA ( const char *  fname,
double *  lptr,
double *  RIptr,
double *  absptr 
)
int ATMOSPHEREMODEL_loadRIA_readsize ( const char *  fname)
double AtmosphereModel_RefractionPath ( double  lambda,
double  Zangle,
int  WritePath 
)

lambda in m if WritePath = 1, write light path in output ASCII file return atm refraction value [arcsec]

int AtmosphereModel_save_stdAtmModel ( const char *  fname)
float AtmosphereModel_stdAtmModel_N ( float  alt,
float  lambda,
int  mode 
)
double ccor ( double  alt,
double  r,
double  h1,
double  zh 
)
double ccor2 ( double  alt,
double  r,
double  h1,
double  zh,
double  h2 
)
double densm ( double  alt,
double  d0,
double  xm,
double *  tz,
int  mn3,
double *  zn3,
double *  tn3,
double *  tgn3,
int  mn2,
double *  zn2,
double *  tn2,
double *  tgn2 
)
double densu ( double  alt,
double  dlb,
double  tinf,
double  tlb,
double  xm,
double  alpha,
double *  tz,
double  zlb,
double  s2,
int  mn1,
double *  zn1,
double *  tn1,
double *  tgn1 
)
double dnet ( double  dd,
double  dm,
double  zhm,
double  xmm,
double  xm 
)
__inline_double g0 ( double  a,
double *  p 
)
void ghp7 ( struct nrlmsise_input input,
struct nrlmsise_flags flags,
struct nrlmsise_output output,
double  press 
)
void glatf ( double  lat,
double *  gv,
double *  reff 
)
double glob7s ( double *  p,
struct nrlmsise_input input,
struct nrlmsise_flags flags 
)
double globe7 ( double *  p,
struct nrlmsise_input input,
struct nrlmsise_flags flags 
)
void gtd7 ( struct nrlmsise_input input,
struct nrlmsise_flags flags,
struct nrlmsise_output output 
)
void gtd7d ( struct nrlmsise_input input,
struct nrlmsise_flags flags,
struct nrlmsise_output output 
)
void gts7 ( struct nrlmsise_input input,
struct nrlmsise_flags flags,
struct nrlmsise_output output 
)
int_fast8_t init_AtmosphereModel ( )
double scalh ( double  alt,
double  xm,
double  temp 
)
__inline_double sg0 ( double  ex,
double *  p,
double *  ap 
)
void spline ( double *  x,
double *  y,
int  n,
double  yp1,
double  ypn,
double *  y2 
)
void splini ( double *  xa,
double *  ya,
double *  y2a,
int  n,
double  x,
double *  y 
)
void splint ( double *  xa,
double *  ya,
double *  y2a,
int  n,
double  x,
double *  y 
)
__inline_double sumex ( double  ex)
void tselec ( struct nrlmsise_flags flags)
__inline_double zeta ( double  zz,
double  zl 
)

Variable Documentation

float alpha1H2O
static
double apdf
static
double apt[4]
static
double c2tloc
static
double c3tloc
static
float CO2_ppm
static
double* comp_array_lambda
static
long* comp_array_lli
static
double ctloc
static
DATA data

System includes.

External libraries

double dd
static
float dens0
static
float* densAr
static
float* densCH4
static
float* densCO2
static
float* densH
static
float* densH2
static
float* densH2O
static
float* densHe
static
float* density
static
float* densKr
static
float* densN
static
float* densN2
static
float* densNe
static
float* densO
static
float* densO2
static
float* densO3
static
float* denstot
static
double dfa
static
double dm01
static
double dm04
static
double dm14
static
double dm16
static
double dm28
static
double dm32
static
double dm40
static
double gsurf
static
int initAtmosphereModel = 0
static
int initRIA_Ar = 0
static
int initRIA_CH4 = 0
static
int initRIA_CO2 = 0
static
int initRIA_H = 0
static
int initRIA_H2 = 0
static
int initRIA_H2O = 0
static
int initRIA_He = 0
static
int initRIA_Kr = 0
static
int initRIA_N = 0
static
int initRIA_N2 = 0
static
int initRIA_Ne = 0
static
int initRIA_O = 0
static
int initRIA_O2 = 0
static
int initRIA_O3 = 0
static
int lliprecomp = -1
static
int lliprecompAr = -1
static
int lliprecompCH4 = -1
static
int lliprecompCO2 = -1
static
int lliprecompH = -1
static
int lliprecompH2 = -1
static
int lliprecompH2O = -1
static
int lliprecompHe = -1
static
int lliprecompKr = -1
static
int lliprecompN = -1
static
int lliprecompN2 = -1
static
int lliprecompNe = -1
static
int lliprecompO = -1
static
int lliprecompO2 = -1
static
int lliprecompO3 = -1
static
double meso_tgn1[2]
static
double meso_tgn2[2]
static
double meso_tgn3[2]
static
double meso_tn1[5]
static
double meso_tn2[4]
static
double meso_tn3[5]
static
long NB_comp_array
static
double pavgm[10]
Initial value:
= {
2.61000E+02, 2.64000E+02, 2.29000E+02, 2.17000E+02, 2.17000E+02,
2.23000E+02, 2.86760E+02,-2.93940E+00, 2.50000E+00, 0.00000E+00
}
double pd[9][150]
double pdl[2][25]
Initial value:
= {
{ 1.09930E+00, 3.90631E+00, 3.07165E+00, 9.86161E-01, 1.63536E+01,
4.63830E+00, 1.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
0.00000E+00, 0.00000E+00, 1.28840E+00, 3.10302E-02, 1.18339E-01
},
{ 1.00000E+00, 7.00000E-01, 1.15020E+00, 3.44689E+00, 1.28840E+00,
1.00000E+00, 1.08738E+00, 1.22947E+00, 1.10016E+00, 7.34129E-01,
1.15241E+00, 2.22784E+00, 7.95046E-01, 4.01612E+00, 4.47749E+00,
1.23435E+02,-7.60535E-02, 1.68986E-06, 7.44294E-01, 1.03604E+00,
1.72783E+02, 1.15020E+00, 3.44689E+00,-7.46230E-01, 9.49154E-01
}
}
double pdm[8][10]
Initial value:
= {
{ 2.45600E+07, 6.71072E-06, 1.00000E+02, 0.00000E+00, 1.10000E+02,
1.00000E+01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
},\
{ 8.59400E+10, 1.00000E+00, 1.05000E+02,-8.00000E+00, 1.10000E+02,
1.00000E+01, 9.00000E+01, 2.00000E+00, 0.00000E+00, 0.00000E+00
},\
{ 2.81000E+11, 0.00000E+00, 1.05000E+02, 2.80000E+01, 2.89500E+01,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
},
{ 3.30000E+10, 2.68270E-01, 1.05000E+02, 1.00000E+00, 1.10000E+02,
1.00000E+01, 1.10000E+02,-1.00000E+01, 0.00000E+00, 0.00000E+00
},
{ 1.33000E+09, 1.19615E-02, 1.05000E+02, 0.00000E+00, 1.10000E+02,
1.00000E+01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
},
{ 1.76100E+05, 1.00000E+00, 9.50000E+01,-8.00000E+00, 1.10000E+02,
1.00000E+01, 9.00000E+01, 2.00000E+00, 0.00000E+00, 0.00000E+00,
},
{ 1.00000E+07, 1.00000E+00, 1.05000E+02,-8.00000E+00, 1.10000E+02,
1.00000E+01, 9.00000E+01, 2.00000E+00, 0.00000E+00, 0.00000E+00
},
{ 1.00000E+06, 1.00000E+00, 1.05000E+02,-8.00000E+00, 5.50000E+02,
7.60000E+01, 9.00000E+01, 2.00000E+00, 0.00000E+00, 4.00000E+03
}
}
double plg[4][9]
static
double pma[10][100]
float* pressure
static
double ps[150]
double pt[150]
double ptl
double ptm[50]
Initial value:
= {
1.04130E+03, 3.86000E+02, 1.95000E+02, 1.66728E+01, 2.13000E+02,
1.20000E+02, 2.40000E+02, 1.87000E+02,-2.00000E+00, 0.00000E+00
}
double re
static
float* RH
static
double* RIA_Ar_abs
static
double* RIA_Ar_lambda
static
long RIA_Ar_NBpts
static
double* RIA_Ar_ri
static
double* RIA_CH4_abs
static
double* RIA_CH4_lambda
static
long RIA_CH4_NBpts
static
double* RIA_CH4_ri
static
double* RIA_CO2_abs
static
double* RIA_CO2_lambda
static
long RIA_CO2_NBpts
static
double* RIA_CO2_ri
static
double* RIA_H2_abs
static
double* RIA_H2_lambda
static
long RIA_H2_NBpts
static
double* RIA_H2_ri
static
double* RIA_H2O_abs
static
double* RIA_H2O_lambda
static
long RIA_H2O_NBpts
static
double* RIA_H2O_ri
static
double* RIA_H_abs
static
double* RIA_H_lambda
static
long RIA_H_NBpts
static
double* RIA_H_ri
static
double* RIA_He_abs
static
double* RIA_He_lambda
static
long RIA_He_NBpts
static
double* RIA_He_ri
static
double* RIA_Kr_abs
static
double* RIA_Kr_lambda
static
long RIA_Kr_NBpts
static
double* RIA_Kr_ri
static
double RIA_lambda_max
static
double RIA_lambda_min
static
double* RIA_N2_abs
static
double* RIA_N2_lambda
static
long RIA_N2_NBpts
static
double* RIA_N2_ri
static
double* RIA_N_abs
static
double* RIA_N_lambda
static
long RIA_N_NBpts
static
double* RIA_N_ri
static
long RIA_NBpts
static
double* RIA_Ne_abs
static
double* RIA_Ne_lambda
static
long RIA_Ne_NBpts
static
double* RIA_Ne_ri
static
double* RIA_O2_abs
static
double* RIA_O2_lambda
static
long RIA_O2_NBpts
static
double* RIA_O2_ri
static
double* RIA_O3_abs
static
double* RIA_O3_lambda
static
long RIA_O3_NBpts
static
double* RIA_O3_ri
static
double* RIA_O_abs
static
double* RIA_O_lambda
static
long RIA_O_NBpts
static
double* RIA_O_ri
static
double s2tloc
static
double s3tloc
static
double sam[100]
Initial value:
= {
1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
}
float SiteAlt
static
float SiteH2OMethod
static
float SiteLat
static
float SiteLong
static
float SitePress
static
float SitePWSH
static
float SiteRH
static
float SiteTemp
static
int SiteTPauto
static
float SiteTPW
static
double stloc
static
float* temperature
static
int TimeDayOfYear
static
float TimeLocalSolarTime
static
double v_ABSCOEFF = 0.0
static
double v_TRANSM = 1.0
static
float ZenithAngle
static