ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/atmos.h
Revision: 2.1
Committed: Fri Jul 5 18:04:36 2024 UTC (9 months, 4 weeks ago) by greg
Content type: text/plain
Branch: MAIN
Log Message:
feat(genssky): Taoning Wang added utility for generating spectral skies

File Contents

# Content
1 #ifndef ATMOS_H
2 #define ATMOS_H
3
4 #include "color.h"
5 #include "data.h"
6 #include "fvect.h"
7 #include "paths.h"
8 #include "rtio.h"
9 #include "rtmath.h"
10 #include "sun.h"
11
12 #define NSSAMP 20
13
14 typedef struct {
15 double width;
16 double exp_term;
17 double exp_scale;
18 double linear_term;
19 double constant_term;
20 } DensityProfileLayer;
21
22 typedef struct {
23 DensityProfileLayer layers[2];
24 } DensityProfile;
25
26 typedef struct {
27 DensityProfile rayleigh_density;
28 DensityProfile ozone_density;
29 const float *beta_r0;
30 float beta_scale;
31 DATARRAY *beta_m;
32 const double grefl;
33 } Atmosphere;
34
35 typedef struct {
36 char tau[PATH_MAX];
37 char scat[PATH_MAX];
38 char scat1m[PATH_MAX];
39 char irrad[PATH_MAX];
40 } DpPaths;
41
42 extern const double ER;
43 extern const double AH;
44 extern const double HR_MS;
45 extern const double HR_MW;
46 extern const double HR_SS;
47 extern const double HR_SW;
48 extern const double HR_T;
49 extern const int WVLSPAN;
50 extern const float EXTSOL[NSSAMP];
51 extern const float BR0_MS[NSSAMP];
52 extern const float BR0_MW[NSSAMP];
53 extern const float BR0_SS[NSSAMP];
54 extern const float BR0_SW[NSSAMP];
55 extern const float BR0_T[NSSAMP];
56 extern const float BCLOUD;
57 extern const double AOD0_CA;
58 extern const double SOLOMG;
59
60 extern void get_rmumusnu(FVECT vpt, FVECT vdir, FVECT sundir, double *r,
61 double *mu, double *mu_s, double *nu);
62
63 extern void get_transmittance_to_sun(DATARRAY *tau_dp, const double r,
64 const double mu_s, double *result);
65
66 extern void get_sky_transmittance(DATARRAY *tau, double r, double mu, float *result);
67
68 extern void get_sky_radiance(DATARRAY *scat, DATARRAY *scat1m, const double radius,
69 const double mu, const double mu_s, const double nu, float *result);
70
71 extern void get_solar_radiance(DATARRAY *tau, DATARRAY *scat, DATARRAY *scat1m, const FVECT sundir, const double radius, const double sun_ct, double *sun_radiance);
72
73 extern void get_ground_radiance(DATARRAY *tau, DATARRAY *scat, DATARRAY *scat1m, DATARRAY *irrad,
74 const FVECT view_point, const FVECT view_direction, const double radius, const double mu, const double sun_ct, const double nu,
75 const double grefl, const FVECT sundir, float *result);
76
77 extern void add_cloud_radiance(DATARRAY *scat, double nu, double pt[4],
78 float *result);
79
80 extern int compute_sundir(const int year, const int month, const int day,
81 const double hour, const int tsolar,
82 double sundir[3]);
83
84 extern int precompute(const int sorder, const DpPaths dppaths, const Atmosphere *atmos,
85 int num_threads);
86
87 #endif // ATMOS_H