~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to imagery/i.atcorr/aerosolmodel.h

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef AEROSOL_MODEL_H
 
2
#define AEROSOL_MODEL_H
 
3
 
 
4
/* **********************************************************************c */
 
5
/*                                                                      c */
 
6
/*       iaer       aerosol model(type)                                 c */
 
7
/*                  --------------                                      c */
 
8
/*                                                                      c */
 
9
/*                                                                      c */
 
10
/*  you select one of the following standard aerosol models:            c */
 
11
/*         0  no aerosols                                               c */
 
12
/*         1  continental model  )                                      c */
 
13
/*         2  maritime model     )  according to sra models             c */
 
14
/*         3  urban model        )                                      c */
 
15
/*         5  shettle model for background desert aerosol               c */
 
16
/*         6  biomass burning                                           c */
 
17
/*         7  stratospheric model                                       c */
 
18
/*                                                                      c */
 
19
/*  or you define your own model using basic components: iaer=4         c */
 
20
/*         4 enter the volumic percentage of each component             c */
 
21
/*                 c(1) = volumic % of dust-like                        c */
 
22
/*                 c(2) = volumic % of water-soluble                    c */
 
23
/*                 c(3) = volumic % of oceanic                          c */
 
24
/*                 c(4) = volumic % of soot                             c */
 
25
/*                   between 0 to 1                                     c */
 
26
/*                                                                      c */
 
27
/*  or you define your own model using size distribution function:      c */
 
28
/*         8  Multimodal Log Normal distribution (up to 4 modes)        c */
 
29
/*         9  Modified gamma  distribution                              c */
 
30
/*        10  Junge Power-Law distribution                              c */
 
31
/*                                                                      c */
 
32
/*  or you define a model using sun-photometer measurements:            c */
 
33
/*        11  Sun Photometer  distribution (50 values max)              c */
 
34
/*             you have to enter:  r and d V / d (logr)                 c */
 
35
/*                  where r is the radius (in micron) and V the volume  c */
 
36
/*                  and d V / d (logr) in (cm3/cm2/micron)              c */
 
37
/*             and then you have to enter: nr and ni for each wavelengthc */
 
38
/*                  where nr and ni are respectively the real and       c */
 
39
/*                  imaginary part of the refractive index              c */
 
40
/*                                                                      c */
 
41
/*  or you can use results computed and previously saved                c */
 
42
/*        12  Reading of data previously saved into FILE                c */
 
43
/*             you have to enter the identification name FILE in the    c */
 
44
/*             next line of inputs.                                     c */
 
45
/*                                                                      c */
 
46
/*                                                                      c */
 
47
/*  iaerp and FILE  aerosol model(type)-Printing of results             c */
 
48
/*                  ---------------------------------------             c */
 
49
/*                                                                      c */
 
50
/* For iaer=8,9,10,and 11:                                              c */
 
51
/*    results from the MIE subroutine may be saved into the file        c */
 
52
/*    FILE.mie (Extinction and scattering coefficients, single          c */
 
53
/*    scattering albedo, Asymmetry parameter, phase function at         c */
 
54
/*    predefined wavelengths) and then can be re-used with the          c */
 
55
/*    option iaer=12 where FILE is an identification name you           c */
 
56
/*    have to enter.                                                    c */
 
57
/*                                                                      c */
 
58
/*    So, if you select iaer=8,9,10,or 11, next line following the      c */
 
59
/*    requested inputs by the options 8,9,10, or 11 you have to enter   c */
 
60
/*    iaerp                                                             c */
 
61
/*                                                                      c */
 
62
/*        iaerp=0    results will not be saved                          c */
 
63
/*        iaerp=1    results will be saved into the file FILE.mie       c */
 
64
/*                    next line enter FILE                              c */
 
65
/*                                                                      c */
 
66
/*                                                                      c */
 
67
/*   example for iaer and iaerp                                         c */
 
68
/* 8                      Multimodal Log-Normale distribution selected  c */
 
69
/* 0.0001 100.0 3         Rmin, Rmax, 3 components                      c */
 
70
/* 0.5000 2.99 1.66E-7    Rmean, Sigma, percentage density-1st componentc */
 
71
/* 1.53 1.53 1.53 1.53 1.53 1.53 1.52 1.40 1.22 1.27  nr-10 wavelengths c */
 
72
/* .008 .008 .008 .008 .008 .008 .008 .008 .009 .011  ni-10 wavelengths c */
 
73
/* 0.0050 2.99 0.5945     Rmean, Sigma, percentage density-2nd componentc */
 
74
/* 1.53 1.53 1.53 1.53 1.53 1.53 1.52 1.51 1.42 1.452 nr-10 wavelengths c */
 
75
/* .005 .005 .005 .005 .006 .007 .012 .023 .010 .004  ni-10 wavelengths c */
 
76
/* 0.0118 2.00 0.4055     Rmean, Sigma, percentage density-3rd componentc */
 
77
/* 1.75 1.75 1.75 1.75 1.75 1.75 1.75 1.77 1.81 1.90  nr-10 wavelengths c */
 
78
/* .46  .45  .45  .44  .43  .43  .43  .46  .50  .57   ni-10 wavelengths c */
 
79
/* 1                      Results will be saved into FILE.mie           c */
 
80
/* URBAN-WCP112           Identification of the output file called FILE c */
 
81
/*                    -> results will be saved into URBAN-WCP112.mie    c */
 
82
/*                                                                      c */
 
83
/* **********************************************************************c */
 
84
 
 
85
struct AerosolModel
 
86
{
 
87
        long int iaer;  /* aerosol model */
 
88
        float c[4];
 
89
 
 
90
private:
 
91
        double nis;
 
92
        float sca[10];
 
93
        long int iaerp;
 
94
 
 
95
        /* methods */
 
96
        void aeroso(const float xmud);
 
97
 
 
98
        string filename;
 
99
        void load();
 
100
        void save();    /* .mie file */
 
101
 
 
102
        /* defined models' initilizations */
 
103
        void bdm();
 
104
        void bbm();
 
105
        void stm();
 
106
        void dust();
 
107
        void wate();
 
108
        void ocea();
 
109
        void soot();
 
110
 
 
111
        struct Mie_in
 
112
        {
 
113
                float rmax;
 
114
                float rmin;
 
115
                float rn[10][4];
 
116
                float ri[10][4];
 
117
                float x1[4];
 
118
                float x2[4];
 
119
                float x3[4];
 
120
                float cij[4];
 
121
                float rsunph[50];
 
122
                float nrsunph[50];
 
123
 
 
124
                long int icp;
 
125
                long int irsunph;
 
126
        };
 
127
 
 
128
        Mie_in mie_in;
 
129
        void mie(float (&ex)[4][10], float (&sc)[4][10], float (&asy)[4][10]);
 
130
        void exscphase(const double alpha, const double nr, 
 
131
                                   const double ni, double& Qext, 
 
132
                                   double& Qsca, double (&p11)[83]);
 
133
 
 
134
        void parse(const float xmud);
 
135
 
 
136
        /* format 132 */
 
137
        void print132(string s);
 
138
public:
 
139
        void print();
 
140
        static AerosolModel Parse(const float xmud);
 
141
};
 
142
 
 
143
 
 
144
 
 
145
#endif /* AEROSOL_MODEL_H */