pyeuvac 0.0.6b0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyeuvac-0.0.6b0/LICENSE.txt +13 -0
- pyeuvac-0.0.6b0/PKG-INFO +206 -0
- pyeuvac-0.0.6b0/README.md +180 -0
- pyeuvac-0.0.6b0/pyproject.toml +47 -0
- pyeuvac-0.0.6b0/setup.cfg +4 -0
- pyeuvac-0.0.6b0/src/pyeuvac/__init__.py +1 -0
- pyeuvac-0.0.6b0/src/pyeuvac/_coeffs/euvac_bands_coeffs.nc +0 -0
- pyeuvac-0.0.6b0/src/pyeuvac/_coeffs/euvac_lines_coeffs.nc +0 -0
- pyeuvac-0.0.6b0/src/pyeuvac/_euvac.py +135 -0
- pyeuvac-0.0.6b0/src/pyeuvac/_misc.py +11 -0
- pyeuvac-0.0.6b0/src/pyeuvac.egg-info/PKG-INFO +206 -0
- pyeuvac-0.0.6b0/src/pyeuvac.egg-info/SOURCES.txt +13 -0
- pyeuvac-0.0.6b0/src/pyeuvac.egg-info/dependency_links.txt +1 -0
- pyeuvac-0.0.6b0/src/pyeuvac.egg-info/requires.txt +5 -0
- pyeuvac-0.0.6b0/src/pyeuvac.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright (с) 2024 Tatarnikov Anton, Zolotov Oleg
|
|
2
|
+
|
|
3
|
+
pyeuvac package is licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
pyeuvac-0.0.6b0/PKG-INFO
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: pyeuvac
|
|
3
|
+
Version: 0.0.6b0
|
|
4
|
+
Summary: Python3 implementation of EUVAC - extreme ultraviolet (EUV) flux model for aeronomic calculations.
|
|
5
|
+
Author-email: Anton Tatarnikov <tatarnikoffanton@yandex.ru>, Oleg Zolotov <ovz.office@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/klklklo/pyeuvac
|
|
7
|
+
Keywords: Solar radiation model,EUV
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
18
|
+
Requires-Python: >=3.7
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE.txt
|
|
21
|
+
Requires-Dist: importlib-resources
|
|
22
|
+
Requires-Dist: netcdf4
|
|
23
|
+
Requires-Dist: numpy
|
|
24
|
+
Requires-Dist: pandas
|
|
25
|
+
Requires-Dist: xarray
|
|
26
|
+
|
|
27
|
+
# pyeuvac
|
|
28
|
+
<!--Basic information-->
|
|
29
|
+
pyeuvac is a Python3 implementation of the extra ultraviolet (EUV) flux model EUVAC described by P. G. Richards,
|
|
30
|
+
J. A. Fennelly, D. G. Torr. This EUV model provides fluxes in the range 5-105 nm, divided into 20 intervals
|
|
31
|
+
of 5 nm width and into 17 separate lines.
|
|
32
|
+
|
|
33
|
+
If you use pyeuvac or Euvac model directly or indirectly, please, cite in your research the following paper:
|
|
34
|
+
|
|
35
|
+
1. Richards, P. G., J. A. Fennelly, and D. G. Torr (1994), Euvac: A solar EUV Flux Model for aeronomic calculations,
|
|
36
|
+
J. Geophys. Res., 99(A5), 8981-8992. https://doi.org/10.1029/94JA00518
|
|
37
|
+
|
|
38
|
+
# User's guide
|
|
39
|
+
|
|
40
|
+
<!--Users guide-->
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
The following command is used to install the package:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
python -m pip install pyeuvac
|
|
48
|
+
```
|
|
49
|
+
pyeuvac is the name of the package.
|
|
50
|
+
|
|
51
|
+
## Euvac
|
|
52
|
+
|
|
53
|
+
The pyeuvac package contains one class Euvac which has 3 methods:
|
|
54
|
+
- get_spectral_bands() for calculating the spectrum over intervals;
|
|
55
|
+
- get_spectral_lines() for calculating the spectrum along individual lines;
|
|
56
|
+
- get_spectra() for calculating the spectrum in a wavelength interval and in an individual wavelength.
|
|
57
|
+
|
|
58
|
+
All methods of the class have two input parameters:
|
|
59
|
+
- F<sub>10.7</sub> - daily value of the F<sub>10.7</sub> solar activity index (in s.f.u.);
|
|
60
|
+
- F<sub>10.7A</sub> - the average value of the F<sub>10.7</sub> solar activity index for 81 days.
|
|
61
|
+
|
|
62
|
+
Parameters can only be of types float, int, list and numpy.array. If there are several parameters, they are passed as
|
|
63
|
+
lists with an equal number of elements.
|
|
64
|
+
|
|
65
|
+
## Usage example
|
|
66
|
+
|
|
67
|
+
1. get_spectral_bands()
|
|
68
|
+
|
|
69
|
+
Method for calculating spectrum in 5 nm wide intervals from 5-105 nm range. Method returns xarray Dataset class object.
|
|
70
|
+
|
|
71
|
+
Input parameters:
|
|
72
|
+
- f107 - single value of the daily index F<sub>10.7</sub> (in s.f.u.);
|
|
73
|
+
- f107avg - 81-day average F<sub>10.7</sub> value (in s.f.u.).
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
<xarray.Dataset> Size: 736B
|
|
77
|
+
Dimensions: (F10.7: 1, F10.7AVG: 1, band_center: 20, band_number: 20)
|
|
78
|
+
Coordinates:
|
|
79
|
+
* F10.7 (F10.7) float64 8B <input F10.7 values>
|
|
80
|
+
* F10.7AVG (F10.7AVG) float64 8B <input F10.7A values>
|
|
81
|
+
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 97.5 102.5
|
|
82
|
+
* band_number (band_number) int32 80B 0 1 2 3 4 5 ... 14 15 16 17 18 19
|
|
83
|
+
Data variables:
|
|
84
|
+
euv_flux_spectra (F10.7, F10.7AVG, band_center) float64 160B <output spectrum>
|
|
85
|
+
lband (band_number) float64 160B 5.0 10.0 15.0 ... 95.0 100.0
|
|
86
|
+
uband (band_number) float64 160B 10.0 15.0 20.0 ... 100.0 105.0
|
|
87
|
+
```
|
|
88
|
+
The resulting spectrum is contained in a three-dimensional array with dimensions (F<sub>10.7</sub>, F<sub>10.7A</sub>, euv_spectrum)
|
|
89
|
+
|
|
90
|
+
Below is an example of calculating the spectrum with input parameters F<sub>10.7</sub> = F<sub>10.7A</sub> = 200 s.f.u.
|
|
91
|
+
```
|
|
92
|
+
# importing a package with the alias pe
|
|
93
|
+
import pyeuvac as pe
|
|
94
|
+
# creating an instance of the Euvac class
|
|
95
|
+
example = pe.Euvac()
|
|
96
|
+
# calculate the spectrum values at F10.7 = 200 and F10.7A = 200 (P = 200 as an example of the Richards et al.) using get_spectral_bands()
|
|
97
|
+
spectrum = example.get_spectral_bands(f107=200., f107avg=200.)
|
|
98
|
+
# output the resulting EUV-spectra
|
|
99
|
+
print(spectrum['euv_flux_spectra'])
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
<xarray.DataArray 'euv_flux_spectra' (F10.7: 1, F10.7AVG: 1, band_center: 20)> Size: 160B
|
|
103
|
+
array([[[ 2.642448 , 0.83475 , 12.504 , 10.3367336 ,
|
|
104
|
+
7.01157116, 3.56471 , 1.69090256, 0.72348547,
|
|
105
|
+
0.976695 , 0.92705019, 0.51372157, 0.826272 ,
|
|
106
|
+
0.34776092, 0.22137 , 1.19157903, 2.5642565 ,
|
|
107
|
+
5.945697 , 4.793988 , 2.2567559 , 3.762175 ]]])
|
|
108
|
+
Coordinates:
|
|
109
|
+
* F10.7 (F10.7) float64 8B 200.0
|
|
110
|
+
* F10.7AVG (F10.7AVG) float64 8B 200.0
|
|
111
|
+
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
If you need to calculate the spectrum for several F<sub>10.7</sub> and F<sub>10.7A</sub> values, pass them using a list.
|
|
115
|
+
The number of values in the lists must be equal.
|
|
116
|
+
```
|
|
117
|
+
# calculate the spectrum values at F10.7 = [200., 210., 220.] and F10.7A = [200., 210., 220.]
|
|
118
|
+
spectrum = example.get_spectral_bands(f107=[200., 210., 220.], f107avg=[200., 210., 220.])
|
|
119
|
+
# output the resulting EUV-spectra for the first pair of F10.7 and F10.7A
|
|
120
|
+
print(spectrum['euv_flux_spectra'][0,0,:])
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
<xarray.DataArray 'euv_flux_spectra' (band_center: 20)> Size: 160B
|
|
124
|
+
array([ 2.642448 , 0.83475 , 12.504 , 10.3367336 , 7.01157116,
|
|
125
|
+
3.56471 , 1.69090256, 0.72348547, 0.976695 , 0.92705019,
|
|
126
|
+
0.51372157, 0.826272 , 0.34776092, 0.22137 , 1.19157903,
|
|
127
|
+
2.5642565 , 5.945697 , 4.793988 , 2.2567559 , 3.762175 ])
|
|
128
|
+
Coordinates:
|
|
129
|
+
F10.7 float64 8B 200.0
|
|
130
|
+
F10.7AVG float64 8B 200.0
|
|
131
|
+
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
2. get_spectral_lines()
|
|
135
|
+
|
|
136
|
+
Method for calculating spectrum in 17 separate lines from the range 5-105 nm. Method returns xarray Dataset class object.
|
|
137
|
+
|
|
138
|
+
Input parameters:
|
|
139
|
+
- f107 - single value of the daily index F10.7 (in s.f.u.);
|
|
140
|
+
- f107avg - 81-day average F10.7 value (in s.f.u.).
|
|
141
|
+
|
|
142
|
+
f107 and f107avg can be represented by lists for calculating spectra for several values of F<sub>10.7</sub> and F<sub>10.7A</sub>.
|
|
143
|
+
In this case, the lengths of these lists should be the same.
|
|
144
|
+
|
|
145
|
+
Output parameters:
|
|
146
|
+
- xarray dataset
|
|
147
|
+
```
|
|
148
|
+
<xarray.Dataset> Size: 492B
|
|
149
|
+
Dimensions: (F10.7: 1, F10.7AVG: 1, line_wavelength: 17,
|
|
150
|
+
line_number: 17)
|
|
151
|
+
Coordinates:
|
|
152
|
+
* F10.7 (F10.7) float64 8B <input F10.7 values>
|
|
153
|
+
* F10.7AVG (F10.7AVG) float64 8B <input F10.7A values>
|
|
154
|
+
* line_wavelength (line_wavelength) float64 136B 25.63 28.41 ... 102.6 103.2
|
|
155
|
+
* line_number (line_number) int32 68B 0 1 2 3 4 5 ... 11 12 13 14 15 16
|
|
156
|
+
Data variables:
|
|
157
|
+
euv_flux_spectra (F10.7, F10.7AVG, line_wavelength) float64 136B <output spectrum>
|
|
158
|
+
wavelength (line_number) float64 136B 25.63 28.41 ... 102.6 103.2
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Below is an example of spectrum calculation using get_spectra_lines() method
|
|
162
|
+
```
|
|
163
|
+
# importing a package with the alias pe
|
|
164
|
+
import pyeuvac as pe
|
|
165
|
+
# creating an instance of the Euvac class
|
|
166
|
+
example = pe.Euvac()
|
|
167
|
+
# calculate the spectrum values at F10.7 = 200 and F10.7A = 200 (P = 200 as an example of the Richards et al.) using get_spectral_bands()
|
|
168
|
+
spectrum = example.get_spectral_lines(f107=200., f107avg=200.)
|
|
169
|
+
# output the resulting EUV-spectra
|
|
170
|
+
print(spectrum['euv_flux_spectra'])
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
<xarray.DataArray 'euv_flux_spectra' (F10.7: 1, F10.7AVG: 1, line_wavelength: 17)> Size: 136B
|
|
174
|
+
array([[[0.61318 , 3.679536 , 3.2 , 9.6599724 , 1.1641526 ,
|
|
175
|
+
0.55071116, 1.00224288, 2.05612492, 1.55873 , 2.22441 ,
|
|
176
|
+
0.49140144, 0.24854 , 0.6596096 , 0.977886 , 6.4812176 ,
|
|
177
|
+
5.676986 , 3.4313916 ]]])
|
|
178
|
+
Coordinates:
|
|
179
|
+
* F10.7 (F10.7) float64 8B 200.0
|
|
180
|
+
* F10.7AVG (F10.7AVG) float64 8B 200.0
|
|
181
|
+
* line_wavelength (line_wavelength) float64 136B 25.63 28.41 ... 102.6 103.2
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
If you need to calculate the spectrum for several P values, pass them using a list:
|
|
185
|
+
```
|
|
186
|
+
# calculate the spectrum values at F10.7 = [200., 210., 220.] and F10.7A = [200., 210., 220.]
|
|
187
|
+
spectrum = example.get_spectral_lines(f107=[200., 210., 220.], f107avg=[200., 210., 220.])
|
|
188
|
+
# output the resulting EUV-spectra for the first pair of F10.7 and F10.7A
|
|
189
|
+
print(spectrum['euv_flux_spectra'][0,0,:])
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
<xarray.DataArray 'euv_flux_spectra' (line_wavelength: 17)> Size: 136B
|
|
193
|
+
array([0.61318 , 3.679536 , 3.2 , 9.6599724 , 1.1641526 ,
|
|
194
|
+
0.55071116, 1.00224288, 2.05612492, 1.55873 , 2.22441 ,
|
|
195
|
+
0.49140144, 0.24854 , 0.6596096 , 0.977886 , 6.4812176 ,
|
|
196
|
+
5.676986 , 3.4313916 ])
|
|
197
|
+
Coordinates:
|
|
198
|
+
F10.7 float64 8B 200.0
|
|
199
|
+
F10.7AVG float64 8B 200.0
|
|
200
|
+
* line_wavelength (line_wavelength) float64 136B 25.63 28.41 ... 102.6 103.2
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
3. get_spectra()
|
|
204
|
+
|
|
205
|
+
This method combines the get_spectral_bands() and get_spectral_lines() methods. The method returns a tuple of
|
|
206
|
+
xarray Dataset (lines, bands), the first element is the flux in intervals, the second is the flux in individual lines.
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# pyeuvac
|
|
2
|
+
<!--Basic information-->
|
|
3
|
+
pyeuvac is a Python3 implementation of the extra ultraviolet (EUV) flux model EUVAC described by P. G. Richards,
|
|
4
|
+
J. A. Fennelly, D. G. Torr. This EUV model provides fluxes in the range 5-105 nm, divided into 20 intervals
|
|
5
|
+
of 5 nm width and into 17 separate lines.
|
|
6
|
+
|
|
7
|
+
If you use pyeuvac or Euvac model directly or indirectly, please, cite in your research the following paper:
|
|
8
|
+
|
|
9
|
+
1. Richards, P. G., J. A. Fennelly, and D. G. Torr (1994), Euvac: A solar EUV Flux Model for aeronomic calculations,
|
|
10
|
+
J. Geophys. Res., 99(A5), 8981-8992. https://doi.org/10.1029/94JA00518
|
|
11
|
+
|
|
12
|
+
# User's guide
|
|
13
|
+
|
|
14
|
+
<!--Users guide-->
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
The following command is used to install the package:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
python -m pip install pyeuvac
|
|
22
|
+
```
|
|
23
|
+
pyeuvac is the name of the package.
|
|
24
|
+
|
|
25
|
+
## Euvac
|
|
26
|
+
|
|
27
|
+
The pyeuvac package contains one class Euvac which has 3 methods:
|
|
28
|
+
- get_spectral_bands() for calculating the spectrum over intervals;
|
|
29
|
+
- get_spectral_lines() for calculating the spectrum along individual lines;
|
|
30
|
+
- get_spectra() for calculating the spectrum in a wavelength interval and in an individual wavelength.
|
|
31
|
+
|
|
32
|
+
All methods of the class have two input parameters:
|
|
33
|
+
- F<sub>10.7</sub> - daily value of the F<sub>10.7</sub> solar activity index (in s.f.u.);
|
|
34
|
+
- F<sub>10.7A</sub> - the average value of the F<sub>10.7</sub> solar activity index for 81 days.
|
|
35
|
+
|
|
36
|
+
Parameters can only be of types float, int, list and numpy.array. If there are several parameters, they are passed as
|
|
37
|
+
lists with an equal number of elements.
|
|
38
|
+
|
|
39
|
+
## Usage example
|
|
40
|
+
|
|
41
|
+
1. get_spectral_bands()
|
|
42
|
+
|
|
43
|
+
Method for calculating spectrum in 5 nm wide intervals from 5-105 nm range. Method returns xarray Dataset class object.
|
|
44
|
+
|
|
45
|
+
Input parameters:
|
|
46
|
+
- f107 - single value of the daily index F<sub>10.7</sub> (in s.f.u.);
|
|
47
|
+
- f107avg - 81-day average F<sub>10.7</sub> value (in s.f.u.).
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
<xarray.Dataset> Size: 736B
|
|
51
|
+
Dimensions: (F10.7: 1, F10.7AVG: 1, band_center: 20, band_number: 20)
|
|
52
|
+
Coordinates:
|
|
53
|
+
* F10.7 (F10.7) float64 8B <input F10.7 values>
|
|
54
|
+
* F10.7AVG (F10.7AVG) float64 8B <input F10.7A values>
|
|
55
|
+
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 97.5 102.5
|
|
56
|
+
* band_number (band_number) int32 80B 0 1 2 3 4 5 ... 14 15 16 17 18 19
|
|
57
|
+
Data variables:
|
|
58
|
+
euv_flux_spectra (F10.7, F10.7AVG, band_center) float64 160B <output spectrum>
|
|
59
|
+
lband (band_number) float64 160B 5.0 10.0 15.0 ... 95.0 100.0
|
|
60
|
+
uband (band_number) float64 160B 10.0 15.0 20.0 ... 100.0 105.0
|
|
61
|
+
```
|
|
62
|
+
The resulting spectrum is contained in a three-dimensional array with dimensions (F<sub>10.7</sub>, F<sub>10.7A</sub>, euv_spectrum)
|
|
63
|
+
|
|
64
|
+
Below is an example of calculating the spectrum with input parameters F<sub>10.7</sub> = F<sub>10.7A</sub> = 200 s.f.u.
|
|
65
|
+
```
|
|
66
|
+
# importing a package with the alias pe
|
|
67
|
+
import pyeuvac as pe
|
|
68
|
+
# creating an instance of the Euvac class
|
|
69
|
+
example = pe.Euvac()
|
|
70
|
+
# calculate the spectrum values at F10.7 = 200 and F10.7A = 200 (P = 200 as an example of the Richards et al.) using get_spectral_bands()
|
|
71
|
+
spectrum = example.get_spectral_bands(f107=200., f107avg=200.)
|
|
72
|
+
# output the resulting EUV-spectra
|
|
73
|
+
print(spectrum['euv_flux_spectra'])
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
<xarray.DataArray 'euv_flux_spectra' (F10.7: 1, F10.7AVG: 1, band_center: 20)> Size: 160B
|
|
77
|
+
array([[[ 2.642448 , 0.83475 , 12.504 , 10.3367336 ,
|
|
78
|
+
7.01157116, 3.56471 , 1.69090256, 0.72348547,
|
|
79
|
+
0.976695 , 0.92705019, 0.51372157, 0.826272 ,
|
|
80
|
+
0.34776092, 0.22137 , 1.19157903, 2.5642565 ,
|
|
81
|
+
5.945697 , 4.793988 , 2.2567559 , 3.762175 ]]])
|
|
82
|
+
Coordinates:
|
|
83
|
+
* F10.7 (F10.7) float64 8B 200.0
|
|
84
|
+
* F10.7AVG (F10.7AVG) float64 8B 200.0
|
|
85
|
+
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
If you need to calculate the spectrum for several F<sub>10.7</sub> and F<sub>10.7A</sub> values, pass them using a list.
|
|
89
|
+
The number of values in the lists must be equal.
|
|
90
|
+
```
|
|
91
|
+
# calculate the spectrum values at F10.7 = [200., 210., 220.] and F10.7A = [200., 210., 220.]
|
|
92
|
+
spectrum = example.get_spectral_bands(f107=[200., 210., 220.], f107avg=[200., 210., 220.])
|
|
93
|
+
# output the resulting EUV-spectra for the first pair of F10.7 and F10.7A
|
|
94
|
+
print(spectrum['euv_flux_spectra'][0,0,:])
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
<xarray.DataArray 'euv_flux_spectra' (band_center: 20)> Size: 160B
|
|
98
|
+
array([ 2.642448 , 0.83475 , 12.504 , 10.3367336 , 7.01157116,
|
|
99
|
+
3.56471 , 1.69090256, 0.72348547, 0.976695 , 0.92705019,
|
|
100
|
+
0.51372157, 0.826272 , 0.34776092, 0.22137 , 1.19157903,
|
|
101
|
+
2.5642565 , 5.945697 , 4.793988 , 2.2567559 , 3.762175 ])
|
|
102
|
+
Coordinates:
|
|
103
|
+
F10.7 float64 8B 200.0
|
|
104
|
+
F10.7AVG float64 8B 200.0
|
|
105
|
+
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
2. get_spectral_lines()
|
|
109
|
+
|
|
110
|
+
Method for calculating spectrum in 17 separate lines from the range 5-105 nm. Method returns xarray Dataset class object.
|
|
111
|
+
|
|
112
|
+
Input parameters:
|
|
113
|
+
- f107 - single value of the daily index F10.7 (in s.f.u.);
|
|
114
|
+
- f107avg - 81-day average F10.7 value (in s.f.u.).
|
|
115
|
+
|
|
116
|
+
f107 and f107avg can be represented by lists for calculating spectra for several values of F<sub>10.7</sub> and F<sub>10.7A</sub>.
|
|
117
|
+
In this case, the lengths of these lists should be the same.
|
|
118
|
+
|
|
119
|
+
Output parameters:
|
|
120
|
+
- xarray dataset
|
|
121
|
+
```
|
|
122
|
+
<xarray.Dataset> Size: 492B
|
|
123
|
+
Dimensions: (F10.7: 1, F10.7AVG: 1, line_wavelength: 17,
|
|
124
|
+
line_number: 17)
|
|
125
|
+
Coordinates:
|
|
126
|
+
* F10.7 (F10.7) float64 8B <input F10.7 values>
|
|
127
|
+
* F10.7AVG (F10.7AVG) float64 8B <input F10.7A values>
|
|
128
|
+
* line_wavelength (line_wavelength) float64 136B 25.63 28.41 ... 102.6 103.2
|
|
129
|
+
* line_number (line_number) int32 68B 0 1 2 3 4 5 ... 11 12 13 14 15 16
|
|
130
|
+
Data variables:
|
|
131
|
+
euv_flux_spectra (F10.7, F10.7AVG, line_wavelength) float64 136B <output spectrum>
|
|
132
|
+
wavelength (line_number) float64 136B 25.63 28.41 ... 102.6 103.2
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Below is an example of spectrum calculation using get_spectra_lines() method
|
|
136
|
+
```
|
|
137
|
+
# importing a package with the alias pe
|
|
138
|
+
import pyeuvac as pe
|
|
139
|
+
# creating an instance of the Euvac class
|
|
140
|
+
example = pe.Euvac()
|
|
141
|
+
# calculate the spectrum values at F10.7 = 200 and F10.7A = 200 (P = 200 as an example of the Richards et al.) using get_spectral_bands()
|
|
142
|
+
spectrum = example.get_spectral_lines(f107=200., f107avg=200.)
|
|
143
|
+
# output the resulting EUV-spectra
|
|
144
|
+
print(spectrum['euv_flux_spectra'])
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
<xarray.DataArray 'euv_flux_spectra' (F10.7: 1, F10.7AVG: 1, line_wavelength: 17)> Size: 136B
|
|
148
|
+
array([[[0.61318 , 3.679536 , 3.2 , 9.6599724 , 1.1641526 ,
|
|
149
|
+
0.55071116, 1.00224288, 2.05612492, 1.55873 , 2.22441 ,
|
|
150
|
+
0.49140144, 0.24854 , 0.6596096 , 0.977886 , 6.4812176 ,
|
|
151
|
+
5.676986 , 3.4313916 ]]])
|
|
152
|
+
Coordinates:
|
|
153
|
+
* F10.7 (F10.7) float64 8B 200.0
|
|
154
|
+
* F10.7AVG (F10.7AVG) float64 8B 200.0
|
|
155
|
+
* line_wavelength (line_wavelength) float64 136B 25.63 28.41 ... 102.6 103.2
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
If you need to calculate the spectrum for several P values, pass them using a list:
|
|
159
|
+
```
|
|
160
|
+
# calculate the spectrum values at F10.7 = [200., 210., 220.] and F10.7A = [200., 210., 220.]
|
|
161
|
+
spectrum = example.get_spectral_lines(f107=[200., 210., 220.], f107avg=[200., 210., 220.])
|
|
162
|
+
# output the resulting EUV-spectra for the first pair of F10.7 and F10.7A
|
|
163
|
+
print(spectrum['euv_flux_spectra'][0,0,:])
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
<xarray.DataArray 'euv_flux_spectra' (line_wavelength: 17)> Size: 136B
|
|
167
|
+
array([0.61318 , 3.679536 , 3.2 , 9.6599724 , 1.1641526 ,
|
|
168
|
+
0.55071116, 1.00224288, 2.05612492, 1.55873 , 2.22441 ,
|
|
169
|
+
0.49140144, 0.24854 , 0.6596096 , 0.977886 , 6.4812176 ,
|
|
170
|
+
5.676986 , 3.4313916 ])
|
|
171
|
+
Coordinates:
|
|
172
|
+
F10.7 float64 8B 200.0
|
|
173
|
+
F10.7AVG float64 8B 200.0
|
|
174
|
+
* line_wavelength (line_wavelength) float64 136B 25.63 28.41 ... 102.6 103.2
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
3. get_spectra()
|
|
178
|
+
|
|
179
|
+
This method combines the get_spectral_bands() and get_spectral_lines() methods. The method returns a tuple of
|
|
180
|
+
xarray Dataset (lines, bands), the first element is the flux in intervals, the second is the flux in individual lines.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pyeuvac"
|
|
7
|
+
version = "0.0.6b"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Anton Tatarnikov", email="tatarnikoffanton@yandex.ru" },
|
|
10
|
+
{ name="Oleg Zolotov", email="ovz.office@gmail.com" },
|
|
11
|
+
]
|
|
12
|
+
description = "Python3 implementation of EUVAC - extreme ultraviolet (EUV) flux model for aeronomic calculations."
|
|
13
|
+
|
|
14
|
+
readme = "README.md"
|
|
15
|
+
license = {file = "LICENSE"}
|
|
16
|
+
|
|
17
|
+
keywords = ["Solar radiation model", "EUV"]
|
|
18
|
+
|
|
19
|
+
requires-python = ">=3.7"
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Development Status :: 4 - Beta",
|
|
22
|
+
"Intended Audience :: Science/Research",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3.7",
|
|
25
|
+
"Programming Language :: Python :: 3.8",
|
|
26
|
+
"Programming Language :: Python :: 3.9",
|
|
27
|
+
"Programming Language :: Python :: 3.10",
|
|
28
|
+
"Programming Language :: Python :: 3.11",
|
|
29
|
+
"License :: OSI Approved :: Apache Software License",
|
|
30
|
+
"Topic :: Scientific/Engineering :: Physics"
|
|
31
|
+
]
|
|
32
|
+
dependencies=[
|
|
33
|
+
"importlib-resources",
|
|
34
|
+
"netcdf4",
|
|
35
|
+
"numpy",
|
|
36
|
+
"pandas",
|
|
37
|
+
"xarray"
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[project.urls]
|
|
41
|
+
Homepage = "https://github.com/klklklo/pyeuvac"
|
|
42
|
+
|
|
43
|
+
[tool.setuptools]
|
|
44
|
+
include-package-data=true
|
|
45
|
+
|
|
46
|
+
[tool.setuptools.package-data]
|
|
47
|
+
"pyeuvac._coeffs" = [ "*.nc"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from pyeuvac._euvac import Euvac
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import xarray as xr
|
|
3
|
+
import pyeuvac._misc as _m
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Euvac:
|
|
7
|
+
'''
|
|
8
|
+
EUVAC model class.
|
|
9
|
+
'''
|
|
10
|
+
def __init__(self):
|
|
11
|
+
|
|
12
|
+
self._bands_dataset, self._lines_dataset = _m.get_euvac()
|
|
13
|
+
|
|
14
|
+
self._bands_f74113 = np.array(self._bands_dataset['F74113'], dtype=np.float64).reshape(20,1)
|
|
15
|
+
self._bands_ai = np.array(self._bands_dataset['Ai'], dtype=np.float64).reshape(20,1)
|
|
16
|
+
|
|
17
|
+
self._lines_f74113 = np.array(self._lines_dataset['F74113'], dtype=np.float64).reshape(17,1)
|
|
18
|
+
self._lines_ai = np.array(self._lines_dataset['Ai'], dtype=np.float64).reshape(17,1)
|
|
19
|
+
|
|
20
|
+
def _get_p(self, i, f107, f107avg):
|
|
21
|
+
'''
|
|
22
|
+
Method for getting the P parameter. For each pair of values f107 and f107a, the value
|
|
23
|
+
P = (f107 + f107 avg) / 2. - 80. is calculated, and then a matrix is constructed,
|
|
24
|
+
each column of which is the value P.
|
|
25
|
+
:param i: number of rows.
|
|
26
|
+
:param f107: single value of the daily index F10.7 or an array of such values.
|
|
27
|
+
:param f107avg: a single value of the F10.7 index averaged over 81 days or an array of such values.
|
|
28
|
+
:return: numpy array.
|
|
29
|
+
'''
|
|
30
|
+
|
|
31
|
+
if f107.size != f107avg.size:
|
|
32
|
+
raise Exception(f'The number of F10.7 and F10.7_avg values does not match. f107 contained {f107.size} '
|
|
33
|
+
f'elements, f107avg contained {f107avg.size} elements.')
|
|
34
|
+
|
|
35
|
+
p = (f107 + f107avg) / 2. - 80.
|
|
36
|
+
p_0 = p[:]
|
|
37
|
+
for j in range(i-1):
|
|
38
|
+
p_0 = np.vstack((p_0, p))
|
|
39
|
+
|
|
40
|
+
return p_0
|
|
41
|
+
|
|
42
|
+
def _check_types(self, *proxies):
|
|
43
|
+
if not all([isinstance(x, (float, int, list, np.ndarray)) for x in proxies]):
|
|
44
|
+
raise TypeError(f'Only float, int, list and np.ndarray types are allowed. f107 was {type(proxies[0])}, '
|
|
45
|
+
f'f107avg was {type(proxies[1])}')
|
|
46
|
+
return True
|
|
47
|
+
|
|
48
|
+
def get_spectral_bands(self, *, f107, f107avg, correction=False):
|
|
49
|
+
'''
|
|
50
|
+
Model calculation method. Returns the values of radiation fluxes in all 20 intervals
|
|
51
|
+
of the spectrum of the interval 10-105 nm.
|
|
52
|
+
:param f107: single value of the daily index F10.7 or an array of such values.
|
|
53
|
+
:param f107avg: a single value of the F10.7 index averaged over 81 days or an array of such values.
|
|
54
|
+
:param correction: parameter for applying flux factor correction
|
|
55
|
+
:return: xarray Dataset [euv_flux_spectra, lband, uband].
|
|
56
|
+
'''
|
|
57
|
+
|
|
58
|
+
bands = 20
|
|
59
|
+
|
|
60
|
+
if self._check_types(f107, f107avg):
|
|
61
|
+
|
|
62
|
+
f107 = np.array([f107], dtype=np.float64) if isinstance(f107, (type(None), int, float)) \
|
|
63
|
+
else np.array(f107, dtype=np.float64)
|
|
64
|
+
f107avg = np.array([f107avg], dtype=np.float64) if isinstance(f107avg, (type(None), int, float)) \
|
|
65
|
+
else np.array(f107avg, dtype=np.float64)
|
|
66
|
+
|
|
67
|
+
p = self._get_p(bands,f107, f107avg)
|
|
68
|
+
pai = self._bands_ai * p + 1.0
|
|
69
|
+
|
|
70
|
+
if correction:
|
|
71
|
+
pai[pai < 0.8] = 0.8
|
|
72
|
+
|
|
73
|
+
spectra = self._bands_f74113 * pai
|
|
74
|
+
|
|
75
|
+
res = np.zeros((spectra.shape[1], spectra.shape[1], spectra.shape[0]))
|
|
76
|
+
for i in range(spectra.shape[1]):
|
|
77
|
+
res[i, i, :] = spectra[:, i]
|
|
78
|
+
|
|
79
|
+
return xr.Dataset(data_vars={'euv_flux_spectra': (('F10.7', 'F10.7AVG', 'band_center'), res),
|
|
80
|
+
'lband': ('band_number', self._bands_dataset['lband'].values),
|
|
81
|
+
'uband': ('band_number', self._bands_dataset['uband'].values)},
|
|
82
|
+
coords={'F10.7': f107,
|
|
83
|
+
'F10.7AVG': f107avg,
|
|
84
|
+
'band_center': self._bands_dataset['center'].values,
|
|
85
|
+
'band_number': np.arange(bands)})
|
|
86
|
+
|
|
87
|
+
def get_spectral_lines(self, *, f107, f107avg, correction=False):
|
|
88
|
+
'''
|
|
89
|
+
Model calculation method. Returns the values of radiation fluxes in all 17 lines
|
|
90
|
+
of the spectrum of the interval 10-105 nm.
|
|
91
|
+
:param f107: single value of the daily index F10.7 or an array of such values.
|
|
92
|
+
:param f107avg: a single value of the F10.7 index averaged over 81 days or an array of such values.
|
|
93
|
+
:param correction: parameter for applying flux factor correction
|
|
94
|
+
:return: xarray Dataset [euv_flux_spectra, wavelength].
|
|
95
|
+
'''
|
|
96
|
+
|
|
97
|
+
lines = 17
|
|
98
|
+
|
|
99
|
+
if self._check_types(f107, f107avg):
|
|
100
|
+
|
|
101
|
+
f107 = np.array([f107], dtype=np.float64) if isinstance(f107, (type(None), int, float)) \
|
|
102
|
+
else np.array(f107, dtype=np.float64)
|
|
103
|
+
f107avg = np.array([f107avg], dtype=np.float64) if isinstance(f107avg, (type(None), int, float)) \
|
|
104
|
+
else np.array(f107avg, dtype=np.float64)
|
|
105
|
+
|
|
106
|
+
p = self._get_p(lines, f107, f107avg)
|
|
107
|
+
pai = self._lines_ai * p + 1.0
|
|
108
|
+
|
|
109
|
+
if correction:
|
|
110
|
+
pai[pai < 0.8] = 0.8
|
|
111
|
+
|
|
112
|
+
spectra = self._lines_f74113 * pai
|
|
113
|
+
|
|
114
|
+
res = np.zeros((spectra.shape[1], spectra.shape[1], spectra.shape[0]))
|
|
115
|
+
for i in range(spectra.shape[1]):
|
|
116
|
+
res[i, i, :] = spectra[:, i]
|
|
117
|
+
|
|
118
|
+
return xr.Dataset(data_vars={'euv_flux_spectra': (('F10.7', 'F10.7AVG', 'line_wavelength'), res),
|
|
119
|
+
'wavelength': ('line_number', self._lines_dataset['lambda'].values)},
|
|
120
|
+
coords={'F10.7': f107,
|
|
121
|
+
'F10.7AVG': f107avg,
|
|
122
|
+
'line_wavelength': self._lines_dataset['lambda'].values,
|
|
123
|
+
'line_number': np.arange(lines)})
|
|
124
|
+
|
|
125
|
+
def get_spectra(self, *, f107, f107avg, correction=False):
|
|
126
|
+
'''
|
|
127
|
+
Model calculation method. Combines the get_spectra_bands() and get_spectral_lines() methods.
|
|
128
|
+
:param f107: single value of the daily index F10.7 or an array of such values.
|
|
129
|
+
:param f107avg: a single value of the F10.7 index averaged over 81 days or an array of such values.
|
|
130
|
+
:param correction: parameter for applying flux factor correction
|
|
131
|
+
:return: xarray Dataset [euv_flux_spectra, lband, uband], xarray Dataset [euv_flux_spectra, wavelength].
|
|
132
|
+
'''
|
|
133
|
+
|
|
134
|
+
return (self.get_spectral_bands(f107=f107, f107avg=f107avg, correction=correction),
|
|
135
|
+
self.get_spectral_lines(f107=f107, f107avg=f107avg, correction=correction))
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
import xarray as xr
|
|
3
|
+
from importlib_resources import files
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@functools.cache
|
|
7
|
+
def _read_coeffs(file):
|
|
8
|
+
return xr.open_dataset(files('pyeuvac._coeffs').joinpath(file))
|
|
9
|
+
|
|
10
|
+
def get_euvac():
|
|
11
|
+
return _read_coeffs('euvac_bands_coeffs.nc').copy(), _read_coeffs('euvac_lines_coeffs.nc').copy(),
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: pyeuvac
|
|
3
|
+
Version: 0.0.6b0
|
|
4
|
+
Summary: Python3 implementation of EUVAC - extreme ultraviolet (EUV) flux model for aeronomic calculations.
|
|
5
|
+
Author-email: Anton Tatarnikov <tatarnikoffanton@yandex.ru>, Oleg Zolotov <ovz.office@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/klklklo/pyeuvac
|
|
7
|
+
Keywords: Solar radiation model,EUV
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
18
|
+
Requires-Python: >=3.7
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE.txt
|
|
21
|
+
Requires-Dist: importlib-resources
|
|
22
|
+
Requires-Dist: netcdf4
|
|
23
|
+
Requires-Dist: numpy
|
|
24
|
+
Requires-Dist: pandas
|
|
25
|
+
Requires-Dist: xarray
|
|
26
|
+
|
|
27
|
+
# pyeuvac
|
|
28
|
+
<!--Basic information-->
|
|
29
|
+
pyeuvac is a Python3 implementation of the extra ultraviolet (EUV) flux model EUVAC described by P. G. Richards,
|
|
30
|
+
J. A. Fennelly, D. G. Torr. This EUV model provides fluxes in the range 5-105 nm, divided into 20 intervals
|
|
31
|
+
of 5 nm width and into 17 separate lines.
|
|
32
|
+
|
|
33
|
+
If you use pyeuvac or Euvac model directly or indirectly, please, cite in your research the following paper:
|
|
34
|
+
|
|
35
|
+
1. Richards, P. G., J. A. Fennelly, and D. G. Torr (1994), Euvac: A solar EUV Flux Model for aeronomic calculations,
|
|
36
|
+
J. Geophys. Res., 99(A5), 8981-8992. https://doi.org/10.1029/94JA00518
|
|
37
|
+
|
|
38
|
+
# User's guide
|
|
39
|
+
|
|
40
|
+
<!--Users guide-->
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
The following command is used to install the package:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
python -m pip install pyeuvac
|
|
48
|
+
```
|
|
49
|
+
pyeuvac is the name of the package.
|
|
50
|
+
|
|
51
|
+
## Euvac
|
|
52
|
+
|
|
53
|
+
The pyeuvac package contains one class Euvac which has 3 methods:
|
|
54
|
+
- get_spectral_bands() for calculating the spectrum over intervals;
|
|
55
|
+
- get_spectral_lines() for calculating the spectrum along individual lines;
|
|
56
|
+
- get_spectra() for calculating the spectrum in a wavelength interval and in an individual wavelength.
|
|
57
|
+
|
|
58
|
+
All methods of the class have two input parameters:
|
|
59
|
+
- F<sub>10.7</sub> - daily value of the F<sub>10.7</sub> solar activity index (in s.f.u.);
|
|
60
|
+
- F<sub>10.7A</sub> - the average value of the F<sub>10.7</sub> solar activity index for 81 days.
|
|
61
|
+
|
|
62
|
+
Parameters can only be of types float, int, list and numpy.array. If there are several parameters, they are passed as
|
|
63
|
+
lists with an equal number of elements.
|
|
64
|
+
|
|
65
|
+
## Usage example
|
|
66
|
+
|
|
67
|
+
1. get_spectral_bands()
|
|
68
|
+
|
|
69
|
+
Method for calculating spectrum in 5 nm wide intervals from 5-105 nm range. Method returns xarray Dataset class object.
|
|
70
|
+
|
|
71
|
+
Input parameters:
|
|
72
|
+
- f107 - single value of the daily index F<sub>10.7</sub> (in s.f.u.);
|
|
73
|
+
- f107avg - 81-day average F<sub>10.7</sub> value (in s.f.u.).
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
<xarray.Dataset> Size: 736B
|
|
77
|
+
Dimensions: (F10.7: 1, F10.7AVG: 1, band_center: 20, band_number: 20)
|
|
78
|
+
Coordinates:
|
|
79
|
+
* F10.7 (F10.7) float64 8B <input F10.7 values>
|
|
80
|
+
* F10.7AVG (F10.7AVG) float64 8B <input F10.7A values>
|
|
81
|
+
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 97.5 102.5
|
|
82
|
+
* band_number (band_number) int32 80B 0 1 2 3 4 5 ... 14 15 16 17 18 19
|
|
83
|
+
Data variables:
|
|
84
|
+
euv_flux_spectra (F10.7, F10.7AVG, band_center) float64 160B <output spectrum>
|
|
85
|
+
lband (band_number) float64 160B 5.0 10.0 15.0 ... 95.0 100.0
|
|
86
|
+
uband (band_number) float64 160B 10.0 15.0 20.0 ... 100.0 105.0
|
|
87
|
+
```
|
|
88
|
+
The resulting spectrum is contained in a three-dimensional array with dimensions (F<sub>10.7</sub>, F<sub>10.7A</sub>, euv_spectrum)
|
|
89
|
+
|
|
90
|
+
Below is an example of calculating the spectrum with input parameters F<sub>10.7</sub> = F<sub>10.7A</sub> = 200 s.f.u.
|
|
91
|
+
```
|
|
92
|
+
# importing a package with the alias pe
|
|
93
|
+
import pyeuvac as pe
|
|
94
|
+
# creating an instance of the Euvac class
|
|
95
|
+
example = pe.Euvac()
|
|
96
|
+
# calculate the spectrum values at F10.7 = 200 and F10.7A = 200 (P = 200 as an example of the Richards et al.) using get_spectral_bands()
|
|
97
|
+
spectrum = example.get_spectral_bands(f107=200., f107avg=200.)
|
|
98
|
+
# output the resulting EUV-spectra
|
|
99
|
+
print(spectrum['euv_flux_spectra'])
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
<xarray.DataArray 'euv_flux_spectra' (F10.7: 1, F10.7AVG: 1, band_center: 20)> Size: 160B
|
|
103
|
+
array([[[ 2.642448 , 0.83475 , 12.504 , 10.3367336 ,
|
|
104
|
+
7.01157116, 3.56471 , 1.69090256, 0.72348547,
|
|
105
|
+
0.976695 , 0.92705019, 0.51372157, 0.826272 ,
|
|
106
|
+
0.34776092, 0.22137 , 1.19157903, 2.5642565 ,
|
|
107
|
+
5.945697 , 4.793988 , 2.2567559 , 3.762175 ]]])
|
|
108
|
+
Coordinates:
|
|
109
|
+
* F10.7 (F10.7) float64 8B 200.0
|
|
110
|
+
* F10.7AVG (F10.7AVG) float64 8B 200.0
|
|
111
|
+
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
If you need to calculate the spectrum for several F<sub>10.7</sub> and F<sub>10.7A</sub> values, pass them using a list.
|
|
115
|
+
The number of values in the lists must be equal.
|
|
116
|
+
```
|
|
117
|
+
# calculate the spectrum values at F10.7 = [200., 210., 220.] and F10.7A = [200., 210., 220.]
|
|
118
|
+
spectrum = example.get_spectral_bands(f107=[200., 210., 220.], f107avg=[200., 210., 220.])
|
|
119
|
+
# output the resulting EUV-spectra for the first pair of F10.7 and F10.7A
|
|
120
|
+
print(spectrum['euv_flux_spectra'][0,0,:])
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
<xarray.DataArray 'euv_flux_spectra' (band_center: 20)> Size: 160B
|
|
124
|
+
array([ 2.642448 , 0.83475 , 12.504 , 10.3367336 , 7.01157116,
|
|
125
|
+
3.56471 , 1.69090256, 0.72348547, 0.976695 , 0.92705019,
|
|
126
|
+
0.51372157, 0.826272 , 0.34776092, 0.22137 , 1.19157903,
|
|
127
|
+
2.5642565 , 5.945697 , 4.793988 , 2.2567559 , 3.762175 ])
|
|
128
|
+
Coordinates:
|
|
129
|
+
F10.7 float64 8B 200.0
|
|
130
|
+
F10.7AVG float64 8B 200.0
|
|
131
|
+
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
2. get_spectral_lines()
|
|
135
|
+
|
|
136
|
+
Method for calculating spectrum in 17 separate lines from the range 5-105 nm. Method returns xarray Dataset class object.
|
|
137
|
+
|
|
138
|
+
Input parameters:
|
|
139
|
+
- f107 - single value of the daily index F10.7 (in s.f.u.);
|
|
140
|
+
- f107avg - 81-day average F10.7 value (in s.f.u.).
|
|
141
|
+
|
|
142
|
+
f107 and f107avg can be represented by lists for calculating spectra for several values of F<sub>10.7</sub> and F<sub>10.7A</sub>.
|
|
143
|
+
In this case, the lengths of these lists should be the same.
|
|
144
|
+
|
|
145
|
+
Output parameters:
|
|
146
|
+
- xarray dataset
|
|
147
|
+
```
|
|
148
|
+
<xarray.Dataset> Size: 492B
|
|
149
|
+
Dimensions: (F10.7: 1, F10.7AVG: 1, line_wavelength: 17,
|
|
150
|
+
line_number: 17)
|
|
151
|
+
Coordinates:
|
|
152
|
+
* F10.7 (F10.7) float64 8B <input F10.7 values>
|
|
153
|
+
* F10.7AVG (F10.7AVG) float64 8B <input F10.7A values>
|
|
154
|
+
* line_wavelength (line_wavelength) float64 136B 25.63 28.41 ... 102.6 103.2
|
|
155
|
+
* line_number (line_number) int32 68B 0 1 2 3 4 5 ... 11 12 13 14 15 16
|
|
156
|
+
Data variables:
|
|
157
|
+
euv_flux_spectra (F10.7, F10.7AVG, line_wavelength) float64 136B <output spectrum>
|
|
158
|
+
wavelength (line_number) float64 136B 25.63 28.41 ... 102.6 103.2
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Below is an example of spectrum calculation using get_spectra_lines() method
|
|
162
|
+
```
|
|
163
|
+
# importing a package with the alias pe
|
|
164
|
+
import pyeuvac as pe
|
|
165
|
+
# creating an instance of the Euvac class
|
|
166
|
+
example = pe.Euvac()
|
|
167
|
+
# calculate the spectrum values at F10.7 = 200 and F10.7A = 200 (P = 200 as an example of the Richards et al.) using get_spectral_bands()
|
|
168
|
+
spectrum = example.get_spectral_lines(f107=200., f107avg=200.)
|
|
169
|
+
# output the resulting EUV-spectra
|
|
170
|
+
print(spectrum['euv_flux_spectra'])
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
<xarray.DataArray 'euv_flux_spectra' (F10.7: 1, F10.7AVG: 1, line_wavelength: 17)> Size: 136B
|
|
174
|
+
array([[[0.61318 , 3.679536 , 3.2 , 9.6599724 , 1.1641526 ,
|
|
175
|
+
0.55071116, 1.00224288, 2.05612492, 1.55873 , 2.22441 ,
|
|
176
|
+
0.49140144, 0.24854 , 0.6596096 , 0.977886 , 6.4812176 ,
|
|
177
|
+
5.676986 , 3.4313916 ]]])
|
|
178
|
+
Coordinates:
|
|
179
|
+
* F10.7 (F10.7) float64 8B 200.0
|
|
180
|
+
* F10.7AVG (F10.7AVG) float64 8B 200.0
|
|
181
|
+
* line_wavelength (line_wavelength) float64 136B 25.63 28.41 ... 102.6 103.2
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
If you need to calculate the spectrum for several P values, pass them using a list:
|
|
185
|
+
```
|
|
186
|
+
# calculate the spectrum values at F10.7 = [200., 210., 220.] and F10.7A = [200., 210., 220.]
|
|
187
|
+
spectrum = example.get_spectral_lines(f107=[200., 210., 220.], f107avg=[200., 210., 220.])
|
|
188
|
+
# output the resulting EUV-spectra for the first pair of F10.7 and F10.7A
|
|
189
|
+
print(spectrum['euv_flux_spectra'][0,0,:])
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
<xarray.DataArray 'euv_flux_spectra' (line_wavelength: 17)> Size: 136B
|
|
193
|
+
array([0.61318 , 3.679536 , 3.2 , 9.6599724 , 1.1641526 ,
|
|
194
|
+
0.55071116, 1.00224288, 2.05612492, 1.55873 , 2.22441 ,
|
|
195
|
+
0.49140144, 0.24854 , 0.6596096 , 0.977886 , 6.4812176 ,
|
|
196
|
+
5.676986 , 3.4313916 ])
|
|
197
|
+
Coordinates:
|
|
198
|
+
F10.7 float64 8B 200.0
|
|
199
|
+
F10.7AVG float64 8B 200.0
|
|
200
|
+
* line_wavelength (line_wavelength) float64 136B 25.63 28.41 ... 102.6 103.2
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
3. get_spectra()
|
|
204
|
+
|
|
205
|
+
This method combines the get_spectral_bands() and get_spectral_lines() methods. The method returns a tuple of
|
|
206
|
+
xarray Dataset (lines, bands), the first element is the flux in intervals, the second is the flux in individual lines.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
LICENSE.txt
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/pyeuvac/__init__.py
|
|
5
|
+
src/pyeuvac/_euvac.py
|
|
6
|
+
src/pyeuvac/_misc.py
|
|
7
|
+
src/pyeuvac.egg-info/PKG-INFO
|
|
8
|
+
src/pyeuvac.egg-info/SOURCES.txt
|
|
9
|
+
src/pyeuvac.egg-info/dependency_links.txt
|
|
10
|
+
src/pyeuvac.egg-info/requires.txt
|
|
11
|
+
src/pyeuvac.egg-info/top_level.txt
|
|
12
|
+
src/pyeuvac/_coeffs/euvac_bands_coeffs.nc
|
|
13
|
+
src/pyeuvac/_coeffs/euvac_lines_coeffs.nc
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyeuvac
|