pyspammodel


Namepyspammodel JSON
Version 0.0.2b1 PyPI version JSON
download
home_pageNone
SummaryPython3 implementation of model SPAM - model of solar X-ray, extreme ultraviolet and far ultraviolet radiation flux at the top of the Earth’s atmosphere of the ultraviolet radiation spectrum of the Sun
upload_time2024-11-13 10:49:27
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords solar radiation model euv fuv xuv
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyspammodel
<!--Basic information-->
pyspammodel is a Python3 implementation of models of the X-ray, extreme and far ultraviolet radiation spectra of the Sun described by A.A. Nusinov. 
The EUV model describes variations in the 5–105 nm spectral region, which are responsible for the ionization of the main components of the earth’s atmosphere.
The FUV model describes the flux changes in the 115–242 nm region, which determines heating of the upper atmosphere and the dissociation of molecular oxygen.
The input parameter for both models is the intensity of the photon flux in the Lyman-alpha line, which has been measured for decades. 
Using this parameter allows you to calculate solar radiation fluxes for any period of time.

If you use pyspammodel or SPAM model directly or indirectly, please, cite in your research the following paper:

1.  Nikolaeva, V.; Gordeev, E.  SPAM: Solar Spectrum Prediction for Applications and Modeling. Atmosphere 2023, 14, 226.
https://doi.org/10.3390/atmos14020226

## User's guide

<!--Users guide-->

### Installation

The following command is used to install the package:

```
python -m pip install pyspammodel
```

pyspammodel is the name of the package.

The package contains two classes: SolarSpam and AeroSpam.

### SolarSpam

This class is a implementation of the Solar-SPAM model of the photon energy flux spectrum for the wavelength range of 
0-190 nm in spectral bands of 1 nm each.

Input parameters:
- single value of the daily index F10.7 (in s.f.u.). You can set one or more F10.7 values.
Use a list to pass multiple values.

Output parameters:
- xarray dataset

```
<xarray.Dataset> Size: 8kB
Dimensions:           (band_center: 190, F107: 3, band_number: 190)
Coordinates:
  * band_center       (band_center) float64 2kB 0.5 1.5 2.5 ... 188.5 189.5
  * F107              (F107) float64 24B <F10.7 input values>
  * band_number       (band_number) int32 760B 0 1 2 3 4 ... 185 186 187 188 189
Data variables:
    euv_flux_spectra  (band_center, F107) float64 5kB <output spectrum values>
    line_lambda       (band_number) float64 2kB 0.5 1.5 2.5 ... 188.5 189.5
```

### SolarSpam usage example

- import the pyspammodel package;
- create an instance of the SolarSpam class;
- perform calculations with the created instance.

This class contains two methods for calculating the spectrum:
- get_spectral_bands() for calculating the spectrum in a wavelength interval;
- get_spectra() a method for unifying the use of a class with the AeroSpam class.


1. get_spectral_bands()
```
# importing a package with the alias spam
import pyspammodel as spam
# creating an instance of the SolarSpam class
example = spam.SolarSpam()
# calculate the spectrum values at F10.7 = 155 s.f.u. using get_spectral_bands()
spectrum = example.get_spectral_bands(155.)
# output the resulting spectrum
print(spectrum['euv_flux_spectra'])


<xarray.DataArray 'euv_flux_spectra' (band_center: 190, F107: 1)> Size: 2kB
array([[1.38379787e-05],
       [2.00129689e-04],
...
       [3.34889779e-03],
       [2.53368184e-03]])
Coordinates:
  * band_center  (band_center) float64 2kB 0.5 1.5 2.5 3.5 ... 187.5 188.5 189.5
  * F107         (F107) float64 8B 155.0
```

If you need to calculate the spectrum for several F10.7 values, pass them using a list:

```
# calculate the spectrum values at F10.7 = 155 s.f.u. and F10.7 = 200 s.f.u. using get_spectral_bands()
spectra = example.get_spectral_bands([155., 200.])
# output the resulting spectra
print(spectra['euv_flux_spectra'])


<xarray.DataArray 'euv_flux_spectra' (band_center: 190, F107: 2)> Size: 3kB
array([[1.38379787e-05, 1.91147693e-05],
       [2.00129689e-04, 2.66188391e-04],
...
       [3.34889779e-03, 3.41110956e-03],
       [2.53368184e-03, 2.63010161e-03]])
Coordinates:
  * band_center  (band_center) float64 2kB 0.5 1.5 2.5 3.5 ... 187.5 188.5 189.5
  * F107         (F107) float64 16B 155.0 200.0
```

2. get_spectra()
This method is used to unify the use of the pyspammodel package classes. get_spectra() internally calls the 
get_spectral_bands() method with the parameters passed to get_spectra().


### AeroSpam

This class is a implementation of the Aero-SPAM model which is designed specifically for aeronomic research 
and provides a photon flux for 37 specific wavelength intervals (20 wave bands and 16 separate spectral lines 
within the range of 5–105 nm, and an additional 121.5 nm Lyman-alpha line).

Input parameters:
- single value of the daily index F10.7 (in s.f.u.). You can set one or more F10.7 values.
Use a list to pass multiple values.

Output parameters:
- xarray dataset

For calculations of the model by interval wavelength and by wavelength interval xarray is different:

```
# wavelength interval
<xarray.Dataset> Size: 888B
Dimensions:           (band_center: 20, F107: 1, band_number: 20)
Coordinates:
  * band_center       (band_center) float64 160B 7.5 12.5 17.5 ... 97.5 102.5
  * F107              (F107) float64 8B <F10.7 input values>
  * band_number       (band_number) int32 80B 0 1 2 3 4 5 ... 14 15 16 17 18 19
Data variables:
    euv_flux_spectra  (band_center, F107) float64 160B <output spectrum values>
    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


# wavelength line
<xarray.Dataset> Size: 484B
Dimensions:           (lambda: 17, F107: 1, line_number: 17)
Coordinates:
  * line_number       (line_number) int32 68B 0 1 2 3 4 5 ... 11 12 13 14 15 16
  * lambda            (lambda) float64 136B 25.6 28.4 30.3 ... 102.6 103.2 121.6
  * F107              (F107) float64 8B <F10.7 input values>
Data variables:
    euv_flux_spectra  (lambda, F107) float64 136B <output spectrum values>
    line_lambda       (line_number) float64 136B 25.6 28.4 30.3 ... 103.2 121.6
```

### AeroSpam usage example

This class contains three methods for calculating the spectrum:
- get_spectral_bands() for calculating the spectrum in a wavelength interval;
- get_spectral_lines() for calculating the spectrum for an individual wavelength;
- get_spectra() for calculating the spectrum in a wavelength interval and in an individual wavelength.

The steps of work are similar to the steps described for the SolarSpam class. 

Below is an example of working with the AeroSpam class:

1. get_spectral_bands()
```
# importing a package with the alias spam
import pyspammodel as spam
# creating an instance of the AeroSpam class
example = spam.AeroSpam()
# calculate the spectrum values at F10.7 = 155 s.f.u. using get_spectral_bands()
spectrum = example.get_spectral_bands(155.)
# output the resulting spectrum
print(spectrum['euv_flux_spectra'])


<xarray.DataArray 'euv_flux_spectra' (band_center: 20, F107: 1)> Size: 160B
array([[3.37198588e+11],
       [9.52514320e+12],
...
       [3.39380556e+13],
       [2.75864363e+13]])
Coordinates:
  * band_center  (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5
  * F107         (F107) float64 8B 155.0
```

If you need to calculate the spectrum for several F10.7 values, pass them using a list:

```
# calculate the spectrum values at F10.7 = 155 s.f.u. and F10.7 = 200 s.f.u. using get_spectral_bands()
spectra = example.get_spectral_bands([155., 200.])
# output the resulting spectra
print(spectra['euv_flux_spectra'])


<xarray.DataArray 'euv_flux_spectra' (band_center: 20, F107: 2)> Size: 320B
array([[3.37198588e+11, 4.17408996e+11],
       [9.52514320e+12, 1.15589974e+13],
...
       [3.39380556e+13, 3.66626002e+13],
       [2.75864363e+13, 3.01543655e+13]])
Coordinates:
  * band_center  (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5
  * F107         (F107) float64 16B 155.0 200.0
```

2. get_spectral_lines()
```
# importing a package with the alias p
import pyspammodel as p
# creating an instance of the AeroSpam class
example = spam.AeroSpam()
# calculate the spectrum values at F10.7 = 155 s.f.u. using get_spectral_lines()
spectrum = example.get_spectral_lines(155.)
# output the resulting spectrum
print(spectrum['euv_flux_spectra'])


<xarray.DataArray 'euv_flux_spectra' (lambda: 17, F107: 1)> Size: 136B
array([[2.34873663e+15],
       [2.72154623e+15],
...
       [1.24545242e+16],
       [9.48119446e+17]])
Coordinates:
  * lambda   (lambda) float64 136B 25.6 28.4 30.3 36.8 ... 102.6 103.2 121.6
  * F107     (F107) float64 8B 155.0
```

If you need to calculate the spectrum for several Na values, pass them using a list:

```
# calculate the spectrum values at F10.7 = 155 s.f.u. and F10.7 = 200 s.f.u. using get_spectral_lines()
spectra = example.get_spectral_lines([155., 200.])
# output the resulting spectra
print(spectra['euv_flux_spectra'])


<xarray.DataArray 'euv_flux_spectra' (lambda: 17, F107: 2)> Size: 272B
array([[2.34873663e+15, 4.33271389e+15],
       [2.72154623e+15, 4.83634865e+15],
...
       [1.24545242e+16, 1.94326255e+16],
       [9.48119446e+17, 1.42630744e+18]])
Coordinates:
  * lambda   (lambda) float64 136B 25.6 28.4 30.3 36.8 ... 102.6 103.2 121.6
  * F107     (F107) float64 16B 155.0 200.0
```

3. get_spectra()

This method is used to unify the use of the pyspammodel package classes. get_spectra() internally calls the 
get_spectral_bands() and get_spectral_lines() method with the parameters passed to get_spectra(). The method returns 
a tuple of two datasets, the first element is a dataset from the get_spectral_bands() method, 
the second is a dataset from the get_spectral_lines() method. get_spectra() can accept either one or 
several values of F10.7.

```
# importing a package with the alias p
import pyspammodel as p
# creating an instance of the AeroSpam class
example = spam.AeroSpam()
# calculate the spectrum values at F10.7 = 155 s.f.u. using get_spectra()
spectrum = example.get_spectra(155.)
# output the resulting spectrum
print(spectrum)


(<xarray.Dataset> Size: 888B
Dimensions:           (band_center: 20, F107: 1, band_number: 20)
Coordinates:
  * band_center       (band_center) float64 160B 7.5 12.5 17.5 ... 97.5 102.5
  * F107              (F107) float64 8B 155.0
  * band_number       (band_number) int32 80B 0 1 2 3 4 5 ... 14 15 16 17 18 19
Data variables:
    euv_flux_spectra  (band_center, F107) float64 160B 3.372e+11 ... 2.759e+13
    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: 484B
Dimensions:           (lambda: 17, F107: 1, line_number: 17)
Coordinates:
  * line_number       (line_number) int32 68B 0 1 2 3 4 5 ... 11 12 13 14 15 16
  * lambda            (lambda) float64 136B 25.6 28.4 30.3 ... 102.6 103.2 121.6
  * F107              (F107) float64 8B 155.0
Data variables:
    euv_flux_spectra  (lambda, F107) float64 136B 2.349e+15 ... 9.481e+17
    line_lambda       (line_number) float64 136B 25.6 28.4 30.3 ... 103.2 121.6)
```

Use tuple indexing using square brackets [] to get a specific dataset:

```
# calculate the spectrum values at F10.7 = 155 s.f.u. using get_spectra()
spectrum = example.get_spectra(155.)
# getting a dataset for the spectrum in the wavelength intervals
print(spectrum[0])


<xarray.Dataset> Size: 888B
Dimensions:           (band_center: 20, F107: 1, band_number: 20)
Coordinates:
  * band_center       (band_center) float64 160B 7.5 12.5 17.5 ... 97.5 102.5
  * F107              (F107) float64 8B 155.0
  * band_number       (band_number) int32 80B 0 1 2 3 4 5 ... 14 15 16 17 18 19
Data variables:
    euv_flux_spectra  (band_center, F107) float64 160B 3.372e+11 ... 2.759e+13
    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
```





            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyspammodel",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "Solar radiation model, EUV, FUV, XUV",
    "author": null,
    "author_email": "Anton Tatarnikov <tatarnikoffanton@yandex.ru>, Oleg Zolotov <ovz.office@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/01/b5/af492a5223cd580a23a2f55f70882458007a9e43fd5436387e5b2e5e0606/pyspammodel-0.0.2b1.tar.gz",
    "platform": null,
    "description": "# pyspammodel\r\n<!--Basic information-->\r\npyspammodel is a Python3 implementation of models of the X-ray, extreme and far ultraviolet radiation spectra of the Sun described by A.A. Nusinov. \r\nThe EUV model describes variations in the 5\u2013105 nm spectral region, which are responsible for the ionization of the main components of the earth\u2019s atmosphere.\r\nThe FUV model describes the flux changes in the 115\u2013242 nm region, which determines heating of the upper atmosphere and the dissociation of molecular oxygen.\r\nThe input parameter for both models is the intensity of the photon flux in the Lyman-alpha line, which has been measured for decades. \r\nUsing this parameter allows you to calculate solar radiation fluxes for any period of time.\r\n\r\nIf you use pyspammodel or SPAM model directly or indirectly, please, cite in your research the following paper:\r\n\r\n1.  Nikolaeva, V.; Gordeev, E.  SPAM: Solar Spectrum Prediction for Applications and Modeling. Atmosphere 2023, 14, 226.\r\nhttps://doi.org/10.3390/atmos14020226\r\n\r\n## User's guide\r\n\r\n<!--Users guide-->\r\n\r\n### Installation\r\n\r\nThe following command is used to install the package:\r\n\r\n```\r\npython -m pip install pyspammodel\r\n```\r\n\r\npyspammodel is the name of the package.\r\n\r\nThe package contains two classes: SolarSpam and AeroSpam.\r\n\r\n### SolarSpam\r\n\r\nThis class is a implementation of the Solar-SPAM model of the photon energy flux spectrum for the wavelength range of \r\n0-190 nm in spectral bands of 1 nm each.\r\n\r\nInput parameters:\r\n- single value of the daily index F10.7 (in s.f.u.). You can set one or more F10.7 values.\r\nUse a list to pass multiple values.\r\n\r\nOutput parameters:\r\n- xarray dataset\r\n\r\n```\r\n<xarray.Dataset> Size: 8kB\r\nDimensions:           (band_center: 190, F107: 3, band_number: 190)\r\nCoordinates:\r\n  * band_center       (band_center) float64 2kB 0.5 1.5 2.5 ... 188.5 189.5\r\n  * F107              (F107) float64 24B <F10.7 input values>\r\n  * band_number       (band_number) int32 760B 0 1 2 3 4 ... 185 186 187 188 189\r\nData variables:\r\n    euv_flux_spectra  (band_center, F107) float64 5kB <output spectrum values>\r\n    line_lambda       (band_number) float64 2kB 0.5 1.5 2.5 ... 188.5 189.5\r\n```\r\n\r\n### SolarSpam usage example\r\n\r\n- import the pyspammodel package;\r\n- create an instance of the SolarSpam class;\r\n- perform calculations with the created instance.\r\n\r\nThis class contains two methods for calculating the spectrum:\r\n- get_spectral_bands() for calculating the spectrum in a wavelength interval;\r\n- get_spectra() a method for unifying the use of a class with the AeroSpam class.\r\n\r\n\r\n1. get_spectral_bands()\r\n```\r\n# importing a package with the alias spam\r\nimport pyspammodel as spam\r\n# creating an instance of the SolarSpam class\r\nexample = spam.SolarSpam()\r\n# calculate the spectrum values at F10.7 = 155 s.f.u. using get_spectral_bands()\r\nspectrum = example.get_spectral_bands(155.)\r\n# output the resulting spectrum\r\nprint(spectrum['euv_flux_spectra'])\r\n\r\n\r\n<xarray.DataArray 'euv_flux_spectra' (band_center: 190, F107: 1)> Size: 2kB\r\narray([[1.38379787e-05],\r\n       [2.00129689e-04],\r\n...\r\n       [3.34889779e-03],\r\n       [2.53368184e-03]])\r\nCoordinates:\r\n  * band_center  (band_center) float64 2kB 0.5 1.5 2.5 3.5 ... 187.5 188.5 189.5\r\n  * F107         (F107) float64 8B 155.0\r\n```\r\n\r\nIf you need to calculate the spectrum for several F10.7 values, pass them using a list:\r\n\r\n```\r\n# calculate the spectrum values at F10.7 = 155 s.f.u. and F10.7 = 200 s.f.u. using get_spectral_bands()\r\nspectra = example.get_spectral_bands([155., 200.])\r\n# output the resulting spectra\r\nprint(spectra['euv_flux_spectra'])\r\n\r\n\r\n<xarray.DataArray 'euv_flux_spectra' (band_center: 190, F107: 2)> Size: 3kB\r\narray([[1.38379787e-05, 1.91147693e-05],\r\n       [2.00129689e-04, 2.66188391e-04],\r\n...\r\n       [3.34889779e-03, 3.41110956e-03],\r\n       [2.53368184e-03, 2.63010161e-03]])\r\nCoordinates:\r\n  * band_center  (band_center) float64 2kB 0.5 1.5 2.5 3.5 ... 187.5 188.5 189.5\r\n  * F107         (F107) float64 16B 155.0 200.0\r\n```\r\n\r\n2. get_spectra()\r\nThis method is used to unify the use of the pyspammodel package classes. get_spectra() internally calls the \r\nget_spectral_bands() method with the parameters passed to get_spectra().\r\n\r\n\r\n### AeroSpam\r\n\r\nThis class is a implementation of the Aero-SPAM model which is designed specifically for aeronomic research \r\nand provides a photon flux for 37 specific wavelength intervals (20 wave bands and 16 separate spectral lines \r\nwithin the range of 5\u2013105 nm, and an additional 121.5 nm Lyman-alpha line).\r\n\r\nInput parameters:\r\n- single value of the daily index F10.7 (in s.f.u.). You can set one or more F10.7 values.\r\nUse a list to pass multiple values.\r\n\r\nOutput parameters:\r\n- xarray dataset\r\n\r\nFor calculations of the model by interval wavelength and by wavelength interval xarray is different:\r\n\r\n```\r\n# wavelength interval\r\n<xarray.Dataset> Size: 888B\r\nDimensions:           (band_center: 20, F107: 1, band_number: 20)\r\nCoordinates:\r\n  * band_center       (band_center) float64 160B 7.5 12.5 17.5 ... 97.5 102.5\r\n  * F107              (F107) float64 8B <F10.7 input values>\r\n  * band_number       (band_number) int32 80B 0 1 2 3 4 5 ... 14 15 16 17 18 19\r\nData variables:\r\n    euv_flux_spectra  (band_center, F107) float64 160B <output spectrum values>\r\n    lband             (band_number) float64 160B 5.0 10.0 15.0 ... 95.0 100.0\r\n    uband             (band_number) float64 160B 10.0 15.0 20.0 ... 100.0 105.0\r\n    center            (band_number) float64 160B 7.5 12.5 17.5 ... 97.5 102.5\r\n\r\n\r\n# wavelength line\r\n<xarray.Dataset> Size: 484B\r\nDimensions:           (lambda: 17, F107: 1, line_number: 17)\r\nCoordinates:\r\n  * line_number       (line_number) int32 68B 0 1 2 3 4 5 ... 11 12 13 14 15 16\r\n  * lambda            (lambda) float64 136B 25.6 28.4 30.3 ... 102.6 103.2 121.6\r\n  * F107              (F107) float64 8B <F10.7 input values>\r\nData variables:\r\n    euv_flux_spectra  (lambda, F107) float64 136B <output spectrum values>\r\n    line_lambda       (line_number) float64 136B 25.6 28.4 30.3 ... 103.2 121.6\r\n```\r\n\r\n### AeroSpam usage example\r\n\r\nThis class contains three methods for calculating the spectrum:\r\n- get_spectral_bands() for calculating the spectrum in a wavelength interval;\r\n- get_spectral_lines() for calculating the spectrum for an individual wavelength;\r\n- get_spectra() for calculating the spectrum in a wavelength interval and in an individual wavelength.\r\n\r\nThe steps of work are similar to the steps described for the SolarSpam class. \r\n\r\nBelow is an example of working with the AeroSpam class:\r\n\r\n1. get_spectral_bands()\r\n```\r\n# importing a package with the alias spam\r\nimport pyspammodel as spam\r\n# creating an instance of the AeroSpam class\r\nexample = spam.AeroSpam()\r\n# calculate the spectrum values at F10.7 = 155 s.f.u. using get_spectral_bands()\r\nspectrum = example.get_spectral_bands(155.)\r\n# output the resulting spectrum\r\nprint(spectrum['euv_flux_spectra'])\r\n\r\n\r\n<xarray.DataArray 'euv_flux_spectra' (band_center: 20, F107: 1)> Size: 160B\r\narray([[3.37198588e+11],\r\n       [9.52514320e+12],\r\n...\r\n       [3.39380556e+13],\r\n       [2.75864363e+13]])\r\nCoordinates:\r\n  * band_center  (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5\r\n  * F107         (F107) float64 8B 155.0\r\n```\r\n\r\nIf you need to calculate the spectrum for several F10.7 values, pass them using a list:\r\n\r\n```\r\n# calculate the spectrum values at F10.7 = 155 s.f.u. and F10.7 = 200 s.f.u. using get_spectral_bands()\r\nspectra = example.get_spectral_bands([155., 200.])\r\n# output the resulting spectra\r\nprint(spectra['euv_flux_spectra'])\r\n\r\n\r\n<xarray.DataArray 'euv_flux_spectra' (band_center: 20, F107: 2)> Size: 320B\r\narray([[3.37198588e+11, 4.17408996e+11],\r\n       [9.52514320e+12, 1.15589974e+13],\r\n...\r\n       [3.39380556e+13, 3.66626002e+13],\r\n       [2.75864363e+13, 3.01543655e+13]])\r\nCoordinates:\r\n  * band_center  (band_center) float64 160B 7.5 12.5 17.5 ... 92.5 97.5 102.5\r\n  * F107         (F107) float64 16B 155.0 200.0\r\n```\r\n\r\n2. get_spectral_lines()\r\n```\r\n# importing a package with the alias p\r\nimport pyspammodel as p\r\n# creating an instance of the AeroSpam class\r\nexample = spam.AeroSpam()\r\n# calculate the spectrum values at F10.7 = 155 s.f.u. using get_spectral_lines()\r\nspectrum = example.get_spectral_lines(155.)\r\n# output the resulting spectrum\r\nprint(spectrum['euv_flux_spectra'])\r\n\r\n\r\n<xarray.DataArray 'euv_flux_spectra' (lambda: 17, F107: 1)> Size: 136B\r\narray([[2.34873663e+15],\r\n       [2.72154623e+15],\r\n...\r\n       [1.24545242e+16],\r\n       [9.48119446e+17]])\r\nCoordinates:\r\n  * lambda   (lambda) float64 136B 25.6 28.4 30.3 36.8 ... 102.6 103.2 121.6\r\n  * F107     (F107) float64 8B 155.0\r\n```\r\n\r\nIf you need to calculate the spectrum for several Na values, pass them using a list:\r\n\r\n```\r\n# calculate the spectrum values at F10.7 = 155 s.f.u. and F10.7 = 200 s.f.u. using get_spectral_lines()\r\nspectra = example.get_spectral_lines([155., 200.])\r\n# output the resulting spectra\r\nprint(spectra['euv_flux_spectra'])\r\n\r\n\r\n<xarray.DataArray 'euv_flux_spectra' (lambda: 17, F107: 2)> Size: 272B\r\narray([[2.34873663e+15, 4.33271389e+15],\r\n       [2.72154623e+15, 4.83634865e+15],\r\n...\r\n       [1.24545242e+16, 1.94326255e+16],\r\n       [9.48119446e+17, 1.42630744e+18]])\r\nCoordinates:\r\n  * lambda   (lambda) float64 136B 25.6 28.4 30.3 36.8 ... 102.6 103.2 121.6\r\n  * F107     (F107) float64 16B 155.0 200.0\r\n```\r\n\r\n3. get_spectra()\r\n\r\nThis method is used to unify the use of the pyspammodel package classes. get_spectra() internally calls the \r\nget_spectral_bands() and get_spectral_lines() method with the parameters passed to get_spectra(). The method returns \r\na tuple of two datasets, the first element is a dataset from the get_spectral_bands() method, \r\nthe second is a dataset from the get_spectral_lines() method. get_spectra() can accept either one or \r\nseveral values of F10.7.\r\n\r\n```\r\n# importing a package with the alias p\r\nimport pyspammodel as p\r\n# creating an instance of the AeroSpam class\r\nexample = spam.AeroSpam()\r\n# calculate the spectrum values at F10.7 = 155 s.f.u. using get_spectra()\r\nspectrum = example.get_spectra(155.)\r\n# output the resulting spectrum\r\nprint(spectrum)\r\n\r\n\r\n(<xarray.Dataset> Size: 888B\r\nDimensions:           (band_center: 20, F107: 1, band_number: 20)\r\nCoordinates:\r\n  * band_center       (band_center) float64 160B 7.5 12.5 17.5 ... 97.5 102.5\r\n  * F107              (F107) float64 8B 155.0\r\n  * band_number       (band_number) int32 80B 0 1 2 3 4 5 ... 14 15 16 17 18 19\r\nData variables:\r\n    euv_flux_spectra  (band_center, F107) float64 160B 3.372e+11 ... 2.759e+13\r\n    lband             (band_number) float64 160B 5.0 10.0 15.0 ... 95.0 100.0\r\n    uband             (band_number) float64 160B 10.0 15.0 20.0 ... 100.0 105.0\r\n    center            (band_number) float64 160B 7.5 12.5 17.5 ... 97.5 102.5\r\n    \r\n<xarray.Dataset> Size: 484B\r\nDimensions:           (lambda: 17, F107: 1, line_number: 17)\r\nCoordinates:\r\n  * line_number       (line_number) int32 68B 0 1 2 3 4 5 ... 11 12 13 14 15 16\r\n  * lambda            (lambda) float64 136B 25.6 28.4 30.3 ... 102.6 103.2 121.6\r\n  * F107              (F107) float64 8B 155.0\r\nData variables:\r\n    euv_flux_spectra  (lambda, F107) float64 136B 2.349e+15 ... 9.481e+17\r\n    line_lambda       (line_number) float64 136B 25.6 28.4 30.3 ... 103.2 121.6)\r\n```\r\n\r\nUse tuple indexing using square brackets [] to get a specific dataset:\r\n\r\n```\r\n# calculate the spectrum values at F10.7 = 155 s.f.u. using get_spectra()\r\nspectrum = example.get_spectra(155.)\r\n# getting a dataset for the spectrum in the wavelength intervals\r\nprint(spectrum[0])\r\n\r\n\r\n<xarray.Dataset> Size: 888B\r\nDimensions:           (band_center: 20, F107: 1, band_number: 20)\r\nCoordinates:\r\n  * band_center       (band_center) float64 160B 7.5 12.5 17.5 ... 97.5 102.5\r\n  * F107              (F107) float64 8B 155.0\r\n  * band_number       (band_number) int32 80B 0 1 2 3 4 5 ... 14 15 16 17 18 19\r\nData variables:\r\n    euv_flux_spectra  (band_center, F107) float64 160B 3.372e+11 ... 2.759e+13\r\n    lband             (band_number) float64 160B 5.0 10.0 15.0 ... 95.0 100.0\r\n    uband             (band_number) float64 160B 10.0 15.0 20.0 ... 100.0 105.0\r\n    center            (band_number) float64 160B 7.5 12.5 17.5 ... 97.5 102.5\r\n```\r\n\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python3 implementation of model SPAM - model of solar X-ray, extreme ultraviolet and far ultraviolet radiation flux at the top of the Earth\u2019s atmosphere of the ultraviolet radiation spectrum of the Sun",
    "version": "0.0.2b1",
    "project_urls": {
        "Homepage": "https://github.com/klklklo/pyspammodel"
    },
    "split_keywords": [
        "solar radiation model",
        " euv",
        " fuv",
        " xuv"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1d53cfe42efd4e0429c3bb083f0b614a3ba466d7d729aa8d2652c7f067101e1f",
                "md5": "c5c2c895420c18dbca605eaf8808bff0",
                "sha256": "64eba84c5915921620b90d722ed0acaa920f2ed13c97842dce047c840b456070"
            },
            "downloads": -1,
            "filename": "pyspammodel-0.0.2b1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c5c2c895420c18dbca605eaf8808bff0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 19793,
            "upload_time": "2024-11-13T10:49:25",
            "upload_time_iso_8601": "2024-11-13T10:49:25.531467Z",
            "url": "https://files.pythonhosted.org/packages/1d/53/cfe42efd4e0429c3bb083f0b614a3ba466d7d729aa8d2652c7f067101e1f/pyspammodel-0.0.2b1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "01b5af492a5223cd580a23a2f55f70882458007a9e43fd5436387e5b2e5e0606",
                "md5": "79b8c957ae69569ad7fa63c957c19599",
                "sha256": "ff76b32f3bb0d1703a0b9c019b08b4d21a70c3939474ec3e177c6dc3f5e80cf6"
            },
            "downloads": -1,
            "filename": "pyspammodel-0.0.2b1.tar.gz",
            "has_sig": false,
            "md5_digest": "79b8c957ae69569ad7fa63c957c19599",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 21401,
            "upload_time": "2024-11-13T10:49:27",
            "upload_time_iso_8601": "2024-11-13T10:49:27.265879Z",
            "url": "https://files.pythonhosted.org/packages/01/b5/af492a5223cd580a23a2f55f70882458007a9e43fd5436387e5b2e5e0606/pyspammodel-0.0.2b1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-13 10:49:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "klklklo",
    "github_project": "pyspammodel",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyspammodel"
}
        
Elapsed time: 0.53564s