Aether  0.0
Ionosphere-Thermosphere model
euv.h
1 // Copyright 2020, the Aether Development Team (see doc/dev_team.md for members)
2 // Full license can be found in License.md
3 
4 #ifndef INCLUDE_EUV_H_
5 #define INCLUDE_EUV_H_
6 
7 /**************************************************************
8  * \class Euv
9  *
10  * \brief Defines the Extreme Ultraviolet radiation above the atmosphere
11  *
12  * The Euv class defines the EUV environment above the atmosphere. It
13  * does this through the use of a CSV file that contains a bunch of
14  * information. Namely:
15  * - Upper and lower wavelengths of bins in the EUV spectrum
16  * - How to relate the wavelengths to brightness (using a model like EUVAC)
17  * - Absorption, ionization, and dissociation cross sections for species
18  *
19  * \author Aaron Ridley
20  *
21  * \date 2021/03/28
22  *
23  **************************************************************/
24 
25 #include <vector>
26 #include <string>
27 
28 class Euv {
29 
30 public:
31 
33  int nWavelengths;
34 
35  // number of lines in the EUV CSV file:
36  int nLines;
37 
39  struct waveinfotype {
41  std::string name;
43  std::string to;
45  std::string type;
47  std::string units;
49  std::string note;
51  std::vector<float> values;
52  };
53 
55  std::vector<waveinfotype> waveinfo;
56 
58  std::vector<float> wavelengths_short;
59 
61  std::vector<float> wavelengths_long;
62 
64  std::vector<float> wavelengths_energy;
65 
67  std::vector<float> wavelengths_intensity_1au;
68 
70  std::vector<float> wavelengths_intensity_top;
71 
73  std::vector<float> euvac_f74113;
75  std::vector<float> euvac_afac;
76 
77  // --------------------------------------------------------------------
78  // Functions:
79 
80  /**********************************************************************
81  \brief Initialize the Euv class
82  \param input info about how user has configured things
83  \param report allow reporting to occur
84  **/
85  Euv(Inputs args, Report report);
86 
87  /**********************************************************************
88  \brief Compute the EUV spectrum given F107 and F107a
89  \param time The times within the model (dt is needed)
90  \param indices Need the F107 and F107a
91  \param report allow reporting to occur
92  **/
93  int euvac(Times time, Indices indices, Report &report);
94 
95  /**********************************************************************
96  \brief Scale the EUV spectrum given the star - planet distance
97  \param planet needed to compute the star - planet distance
98  \param time Needed to compute orbital position around star
99  \param report allow reporting to occur
100  **/
101  int scale_from_1au(Planets planet, Times time, Report report);
102 
103  /**********************************************************************
104  \brief Pairs rows in the EUV CSV file with neutral and ions
105 
106  Reads through each row in the EUV CSV file and figures out whether
107  the row is abs, ion, diss, and then figures out which neutral it is
108  acting on and which neutral or ion results from the action
109  (e.g. O + photon -> O+, identifies O as ionization "loss" and
110  O+ as an ionization "source")
111 
112  \param neutrals Needs names of the neutrals, stores lines in Neutrals
113  \param ions Needs names of the ions
114  \param report allow reporting to occur
115  **/
116  int pair_euv(Neutrals &neutrals, Ions ions, Report report);
117 
118 private:
119 
120  /**********************************************************************
121  \brief Read in the EUV CSV file
122 
123  Read in the EUV CSV file that describes all of the wavelengths and
124  cross sections (and any other EUV - related things that are a
125  function of wavelength)
126 
127  \param input info about how user has configured things
128  \param report allow reporting to occur
129  **/
130  int read_file(Inputs args, Report report);
131 
132  /**********************************************************************
133  \brief Interprets the EUV CSV rows and returns the relevant row
134 
135  Find the correct row in the EUV CSV file information, and return
136  the values in that row.
137 
138  \param item The string value to search for in the first column
139  \param item2 If not blank, the string value to search for in the 2nd col.
140  \return values The values in the CSV row that matches the item (and item2)
141  \param report Allow reporting to occur
142  **/
143  int slot_euv(std::string item,
144  std::string item2,
145  std::vector<float> &values,
146  Report report);
147 };
148 
149 #endif // INCLUDE_EUV_H_
Euv::wavelengths_energy
std::vector< float > wavelengths_energy
EUV Spectrum, energy of bin:
Definition: euv.h:80
Euv::euvac_f74113
std::vector< float > euvac_f74113
EUVAC model linear coefficients (1):
Definition: euv.h:89
Euv::waveinfotype::note
std::string note
Any notes for the particular row:
Definition: euv.h:65
Euv::wavelengths_intensity_top
std::vector< float > wavelengths_intensity_top
EUV Spectrum, intensity flux of each spectral bin scaled to Earth:
Definition: euv.h:86
Euv::waveinfotype::units
std::string units
Unit of cross-section, wavelength, etc (in the row):
Definition: euv.h:63
Euv::nWavelengths
int nWavelengths
number of wavelengths in spectrum:
Definition: euv.h:49
Euv::waveinfotype
struct to describe a single line in the EUV CSV file:
Definition: euv.h:55
Euv::waveinfotype::values
std::vector< float > values
The actual numerical values of the cross-section/wavelength/whatever.
Definition: euv.h:67
Planets
Definition: planets.h:16
Euv::euvac_afac
std::vector< float > euvac_afac
EUVAC model linear coefficients (2):
Definition: euv.h:91
Inputs
Definition: inputs.h:10
Euv::waveinfotype::type
std::string type
Type of cross-section (abs, ion, diss):
Definition: euv.h:61
Euv::waveinfo
std::vector< waveinfotype > waveinfo
All of the information in the EUV CSV file.
Definition: euv.h:71
Report
Definition: report.h:28
Euv::wavelengths_long
std::vector< float > wavelengths_long
EUV Spectrum, upper wavelength of the bins:
Definition: euv.h:77
Euv::waveinfotype::to
std::string to
If a cross-section, what is species becoming:
Definition: euv.h:59
Euv::wavelengths_short
std::vector< float > wavelengths_short
EUV Spectrum, lower wavelength of the bins:
Definition: euv.h:74
Euv::waveinfotype::name
std::string name
Key name of the line (describes wavelength or species acting upon):
Definition: euv.h:57
Ions
Definition: ions.h:10
Euv::wavelengths_intensity_1au
std::vector< float > wavelengths_intensity_1au
EUV Spectrum, intensity flux of each spectral bin at 1 AU:
Definition: euv.h:83
Euv
Definition: euv.h:28
Times
Definition: times.h:21
Neutrals
Definition: neutrals.h:26
Indices
Definition: indices.h:63