Python implementation of EUVAC model of the ultraviolet radiation spectrum of the Sun
Project description
pyeuvac
pyeuvac is a Python3 implementation of models of the extra ultraviolet (EUV) flux of the Sun 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.
Usage example
The pyeuvac package has 3 methods: get_spectra_lines() for calculating the spectrum along individual lines, get_spectra_bands() for calculating the spectrum over intervals, and get_spectra(), combining both methods.
- get_spectra_lines()
# importing a package with the alias p
import pyeuvac as pe
# creating an instance of the EUVAC class
ex = 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_lines()
spectra = ex.get_spectra_lines((200,200))
# output the resulting EUV-spectra
print(spectra['euv_flux_spectra'])
<xarray.DataArray 'euv_flux_spectra' (lambda: 17, P: 1)> Size: 136B
array([[0.61318 ],
[3.679536 ],
...
[5.676986 ],
[3.4313916 ]])
Coordinates:
* lambda (lambda) float64 136B 25.63 28.41 30.33 30.38 ... 97.7 102.6 103.2
* P (P) float64 8B 200.0
If you need to calculate the spectrum for several P values, pass them using a list:
# calculate the spectrum values at F10.7 = 200 and F10.7A = 200, F10.7 = 190 and F10.7A = 210, F10.7 = 200 and F10.7A = 220
spectra = ex.get_spectra_lines([(200,200), (190,210), (200,220)])
# output the resulting EUV-spectra
print(spectra['euv_flux_spectra'])
<xarray.DataArray 'euv_flux_spectra' (lambda: 17, P: 3)> Size: 408B
array([[0.61318 , 0.61318 , 0.625945 ],
[3.679536 , 3.679536 , 3.968664 ],
... ... ...
[5.676986 , 5.676986 , 5.8584015 ],
[3.4313916 , 3.4313916 , 3.5423409 ]])
Coordinates:
* lambda (lambda) float64 136B 25.63 28.41 30.33 30.38 ... 97.7 102.6 103.2
* P (P) float64 24B 200.0 200.0 210.0
- get_spectra_bands()
# importing a package with the alias p
import pyeuvac as pe
# creating an instance of the Euvt2021 class
ex = 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_spectra_bands()
spectra = ex.get_spectra_bands((200,200))
# output the resulting EUV-spectra
print(spectra['euv_flux_spectra'])
<xarray.DataArray 'euv_flux_spectra' (band_center: 20, P: 1)> Size: 160B
array([[ 2.642448 ],
[ 0.83475 ],
...
[ 2.2567559 ],
[ 3.762175 ]])
Coordinates:
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5
* P (P) float64 8B 200.0
If you need to calculate the spectrum for several P values, pass them using a list:
# calculate the spectrum values at F10.7 = 200 and F10.7A = 200, F10.7 = 190 and F10.7A = 210, F10.7 = 200 and F10.7A = 220
spectra = ex.get_spectra_bands([(200,200), (190,210), (200,220)])
# output the resulting EUV-spectra
print(spectra['euv_flux_spectra'])
<xarray.DataArray 'euv_flux_spectra' (band_center: 20, P: 3)> Size: 480B
array([[ 2.642448 , 2.642448 , 2.762652 ],
[ 0.83475 , 0.83475 , 0.8668125 ],
... ... ...
[ 2.2567559 , 2.2567559 , 2.32190223],
[ 3.762175 , 3.762175 , 3.87010625]])
Coordinates:
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5
* P (P) float64 24B 200.0 200.0 210.0
- get_spectra()
This method combines the get_spectra_bands() and get_spectra_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.
# importing a package with the alias p
import pyeuvac as pe
# creating an instance of the Euvt2021 class
ex = 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_spectra()
spectra = ex.get_spectra((200,200))
# output the resulting EUV-spectra
print(spectra)
(<xarray.Dataset> Size: 968B
Dimensions: (band_center: 20, P: 1, band_number: 20)
Coordinates:
* band_center (band_center) float64 160B 7.5 12.5 17.5 ... 97.5 102.5
* P (P) float64 8B 200.0
* band_number (band_number) int64 160B 0 1 2 3 4 5 ... 14 15 16 17 18 19
Data variables:
euv_flux_spectra (band_center, P) float64 160B 2.642 0.8348 ... 2.257 3.762
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
center (band_number) float64 160B 7.5 12.5 17.5 ... 97.5 102.5, <xarray.Dataset> Size: 280B
Dimensions: (lambda: 17, P: 1)
Coordinates:
* lambda (lambda) float64 136B 25.63 28.41 30.33 ... 102.6 103.2
* P (P) float64 8B 200.0
Data variables:
euv_flux_spectra (lambda, P) float64 136B 0.6132 3.68 3.2 ... 5.677 3.431)
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.2b0.tar.gz.
File metadata
- Download URL: pyeuvac-0.0.2b0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14f59c595affd073883f69dd5ef2e794233d030d0d2445011b711eadf98e95d3
|
|
| MD5 |
9748ad6775a1b93f46557a8cabb67a78
|
|
| BLAKE2b-256 |
d09c262d5747cbab61a17a03fd311d64a0b3bd6efc6fa80e15245b6cebb01f94
|
File details
Details for the file pyeuvac-0.0.2b0-py3-none-any.whl.
File metadata
- Download URL: pyeuvac-0.0.2b0-py3-none-any.whl
- Upload date:
- Size: 8.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 |
b279b61b50cd7b800092fbac09f702f06ff5b3caeabb4f4222b72195dc1cb2cc
|
|
| MD5 |
1698fc3dd626fbf2726a4d652dee89fa
|
|
| BLAKE2b-256 |
a0f7f53a22340b215f263ef29f5be83929b7686c85a284cc42785029d4ba6210
|