Python3 implementation of EUVAC - extreme ultraviolet (EUV) flux model for aeronomic calculations.
Project description
pyeuvac
pyeuvac is a Python3 implementation of the extra ultraviolet (EUV) flux model EUVAC described by P. G. Richards, J. A. Fennelly, D. G. Torr. This EUV model provides fluxes in the range 5-105 nm, divided into 20 intervals of 5 nm width and into 17 separate lines.
If you use pyeuvac or Euvac model directly or indirectly, please, cite in your research the following paper:
- Richards, P. G., J. A. Fennelly, and D. G. Torr (1994), Euvac: A solar EUV Flux Model for aeronomic calculations, J. Geophys. Res., 99(A5), 8981-8992. https://doi.org/10.1029/94JA00518
User's guide
Installation
The following command is used to install the package:
python -m pip install pyeuvac
pyeuvac is the name of the package.
Euvac
The pyeuvac package contains one class Euvac which has 3 methods:
- get_spectral_bands() for calculating the spectrum over intervals;
- get_spectral_lines() for calculating the spectrum along individual lines;
- get_spectra() for calculating the spectrum in a wavelength interval and in an individual wavelength.
All methods of the class have two input parameters:
- F10.7 - daily value of the F10.7 solar activity index (in s.f.u.);
- F10.7A - the average value of the F10.7 solar activity index for 81 days.
Parameters can only be of types float, int, list and numpy.array. If there are several parameters, they are passed as lists with an equal number of elements.
Usage example
- get_spectral_bands()
Method for calculating spectrum in 5 nm wide intervals from 5-105 nm range. Method returns xarray Dataset class object.
Input parameters:
- f107 - single value of the daily index F10.7 (in s.f.u.);
- f107avg - 81-day average F10.7 value (in s.f.u.).
<xarray.Dataset> Size: 736B
Dimensions: (F10.7: 1, F10.7AVG: 1, band_center: 20, band_number: 20)
Coordinates:
* F10.7 (F10.7) float64 8B <input F10.7 values>
* F10.7AVG (F10.7AVG) float64 8B <input F10.7A values>
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 97.5 102.5
* band_number (band_number) int32 80B 0 1 2 3 4 5 ... 14 15 16 17 18 19
Data variables:
euv_flux_spectra (F10.7, F10.7AVG, band_center) float64 160B <output spectrum>
lband (band_number) float64 160B 5.0 10.0 15.0 ... 95.0 100.0
uband (band_number) float64 160B 10.0 15.0 20.0 ... 100.0 105.0
The resulting spectrum is contained in a three-dimensional array with dimensions (F10.7, F10.7A, euv_spectrum)
Below is an example of calculating the spectrum with input parameters F10.7 = F10.7A = 200 s.f.u.
# importing a package with the alias pe
import pyeuvac as pe
# creating an instance of the Euvac class
example = pe.Euvac()
# 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()
spectrum = example.get_spectral_bands(f107=200., f107avg=200.)
# output the resulting EUV-spectra
print(spectrum['euv_flux_spectra'])
<xarray.DataArray 'euv_flux_spectra' (F10.7: 1, F10.7AVG: 1, band_center: 20)> Size: 160B
array([[[ 2.642448 , 0.83475 , 12.504 , 10.3367336 ,
7.01157116, 3.56471 , 1.69090256, 0.72348547,
0.976695 , 0.92705019, 0.51372157, 0.826272 ,
0.34776092, 0.22137 , 1.19157903, 2.5642565 ,
5.945697 , 4.793988 , 2.2567559 , 3.762175 ]]])
Coordinates:
* F10.7 (F10.7) float64 8B 200.0
* F10.7AVG (F10.7AVG) float64 8B 200.0
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5
If you need to calculate the spectrum for several F10.7 and F10.7A values, pass them using a list. The number of values in the lists must be equal.
# calculate the spectrum values at F10.7 = [200., 210., 220.] and F10.7A = [200., 210., 220.]
spectrum = example.get_spectral_bands(f107=[200., 210., 220.], f107avg=[200., 210., 220.])
# output the resulting EUV-spectra for the first pair of F10.7 and F10.7A
print(spectrum['euv_flux_spectra'][0,0,:])
<xarray.DataArray 'euv_flux_spectra' (band_center: 20)> Size: 160B
array([ 2.642448 , 0.83475 , 12.504 , 10.3367336 , 7.01157116,
3.56471 , 1.69090256, 0.72348547, 0.976695 , 0.92705019,
0.51372157, 0.826272 , 0.34776092, 0.22137 , 1.19157903,
2.5642565 , 5.945697 , 4.793988 , 2.2567559 , 3.762175 ])
Coordinates:
F10.7 float64 8B 200.0
F10.7AVG float64 8B 200.0
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5
- get_spectral_lines()
Method for calculating spectrum in 17 separate lines from the range 5-105 nm. Method returns xarray Dataset class object.
Input parameters:
- f107 - single value of the daily index F10.7 (in s.f.u.);
- f107avg - 81-day average F10.7 value (in s.f.u.).
f107 and f107avg can be represented by lists for calculating spectra for several values of F10.7 and F10.7A. In this case, the lengths of these lists should be the same.
Output parameters:
- xarray dataset
<xarray.Dataset> Size: 492B
Dimensions: (F10.7: 1, F10.7AVG: 1, line_wavelength: 17,
line_number: 17)
Coordinates:
* F10.7 (F10.7) float64 8B <input F10.7 values>
* F10.7AVG (F10.7AVG) float64 8B <input F10.7A values>
* line_wavelength (line_wavelength) float64 136B 25.63 28.41 ... 102.6 103.2
* line_number (line_number) int32 68B 0 1 2 3 4 5 ... 11 12 13 14 15 16
Data variables:
euv_flux_spectra (F10.7, F10.7AVG, line_wavelength) float64 136B <output spectrum>
wavelength (line_number) float64 136B 25.63 28.41 ... 102.6 103.2
Below is an example of spectrum calculation using get_spectra_lines() method
# importing a package with the alias pe
import pyeuvac as pe
# creating an instance of the Euvac class
example = pe.Euvac()
# 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()
spectrum = example.get_spectral_lines(f107=200., f107avg=200.)
# output the resulting EUV-spectra
print(spectrum['euv_flux_spectra'])
<xarray.DataArray 'euv_flux_spectra' (F10.7: 1, F10.7AVG: 1, line_wavelength: 17)> Size: 136B
array([[[0.61318 , 3.679536 , 3.2 , 9.6599724 , 1.1641526 ,
0.55071116, 1.00224288, 2.05612492, 1.55873 , 2.22441 ,
0.49140144, 0.24854 , 0.6596096 , 0.977886 , 6.4812176 ,
5.676986 , 3.4313916 ]]])
Coordinates:
* F10.7 (F10.7) float64 8B 200.0
* F10.7AVG (F10.7AVG) float64 8B 200.0
* line_wavelength (line_wavelength) float64 136B 25.63 28.41 ... 102.6 103.2
If you need to calculate the spectrum for several P values, pass them using a list:
# calculate the spectrum values at F10.7 = [200., 210., 220.] and F10.7A = [200., 210., 220.]
spectrum = example.get_spectral_lines(f107=[200., 210., 220.], f107avg=[200., 210., 220.])
# output the resulting EUV-spectra for the first pair of F10.7 and F10.7A
print(spectrum['euv_flux_spectra'][0,0,:])
<xarray.DataArray 'euv_flux_spectra' (line_wavelength: 17)> Size: 136B
array([0.61318 , 3.679536 , 3.2 , 9.6599724 , 1.1641526 ,
0.55071116, 1.00224288, 2.05612492, 1.55873 , 2.22441 ,
0.49140144, 0.24854 , 0.6596096 , 0.977886 , 6.4812176 ,
5.676986 , 3.4313916 ])
Coordinates:
F10.7 float64 8B 200.0
F10.7AVG float64 8B 200.0
* line_wavelength (line_wavelength) float64 136B 25.63 28.41 ... 102.6 103.2
- get_spectra()
This method combines the get_spectral_bands() and get_spectral_lines() methods. The method returns a tuple of xarray Dataset (lines, bands), the first element is the flux in intervals, the second is the flux in individual lines.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyeuvac-0.0.6b0.tar.gz.
File metadata
- Download URL: pyeuvac-0.0.6b0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a5ba714268c387f627c8db8532883b8b689e61394e24ee9a279b484638799d8
|
|
| MD5 |
27e67a027229bed02b9bed6d9ee5c3fe
|
|
| BLAKE2b-256 |
13fb4c88a3cdad8629d0388358c8b569c3e7e8e4f87d153d4f11a5b4bb5cee7c
|
File details
Details for the file pyeuvac-0.0.6b0-py3-none-any.whl.
File metadata
- Download URL: pyeuvac-0.0.6b0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77986424c55fd0260ecd0930f8b7769775c228cd05403f488b141bccc3ecac3a
|
|
| MD5 |
49aedccbc5fb9d32f9e8852ed1dcc432
|
|
| BLAKE2b-256 |
1dc6f57d79074fd502161d7e830824f19076702506c98872f886963dc406c7f0
|