Converting Spectral-Energy-Distributions (SEDs)
In Astronomy, SEDs can have different styles. The style effects the units and sometimes multiplies the y -axis with a power-law depending on the x -axis. But to compare findings we have to transform to a single style. This function helps you to transform between sed-styles. Here are example sed-styles A , B , C , and D showing the differential flux of Crab, and the integral sensitivity of Fermi-LAT.
A |
B |
|---|---|
A = {
"x_energy_in_eV": 1e6,
"y_inverse_energy_in_eV": 624150907446.0763, # one erg
"y_inverse_area_in_m2": 1e-4,
"y_inverse_time_in_s": 1.0,
"y_scale_energy_in_eV": 624150907446.0763, # one erg
"y_scale_energy_power": 2.0,
}
B = {
"x_energy_in_eV": 1e9,
"y_inverse_energy_in_eV": 1e9,
"y_inverse_area_in_m2": 1.0,
"y_inverse_time_in_s": 1.0,
"y_scale_energy_in_eV": 1e9,
"y_scale_energy_power": 0.0,
}
C |
D |
|---|---|
C = {
"x_energy_in_eV": 1,
"y_inverse_energy_in_eV": 1,
"y_inverse_area_in_m2": 1,
"y_inverse_time_in_s": 1.0,
"y_scale_energy_in_eV": 1,
"y_scale_energy_power": 2.7,
}
D = {
"x_energy_in_eV": 1e9,
"y_inverse_energy_in_eV": 1e12,
"y_inverse_area_in_m2": 1e-4,
"y_inverse_time_in_s": 1.0,
"y_scale_energy_in_eV": 1e12,
"y_scale_energy_power": 2.0,
}
Function
Transform the numeric values in the arrays x -axis, and y -axis from style A to B.
import spectral_energy_distribution_units as sed
x_B, y_B = sed.convert_units_with_style(x=x_A, y=y_A, input_style=A, target_style=B)
Find also a function for the style-dictionaries A and B being unpacked:
x_B, y_B = sed.convert_units(x=x_A, y=y_A, x_energy_in_eV=... )
Install
pip install spectral-energy-distribution-units-sebastian-achim-mueller
Example
See unit-tests ./spectral_energy_distribution_units/tests/test_convert.py to reproduce the upper figures A , B , C , and D.
Metadata
Release files for spectral-energy-distribution-units-sebastian-achim-mueller 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| spectral_energy_distribution_units_sebastian_achim_mueller-0.0.7.tar.gz | 7.8 kB | Without provenance | Details for spectral_energy_distribution_units_sebastian_achim_mueller-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spectral_energy_distribution_units_sebastian_achim_mueller-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for spectral_energy_distribution_units_sebastian_achim_mueller-0.0.7-py3-none-any.whl |
Total release size: 15.7 kB
Release files / spectral_energy_distribution_units_sebastian_achim_mueller-0.0.7.tar.gz
| Download URL | spectral_energy_distribution_units_sebastian_achim_mueller-0.0.7.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33d5c57424fbd620658e1b6e9e6eeef17530eb08be9d232acbf46573b8b6640a
|
|
BLAKE2b-256 checksum How to use checksums |
cae08476e7fc1abf661c1a4d3b84ab1eacf05230c08f4e9ef25b56296baee3bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.4
|
Release files / spectral_energy_distribution_units_sebastian_achim_mueller-0.0.7-py3-none-any.whl
| Download URL | spectral_energy_distribution_units_sebastian_achim_mueller-0.0.7-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
01447d76df4bf092c8a8a44c2b135c86ae4b067c200cf601a198be258d90e974
|
|
BLAKE2b-256 checksum How to use checksums |
0e4e2ae0f356874ea3595baa07ac2377720d941bc563844a44815174f8aea44c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.4
|
Security for spectral-energy-distribution-units-sebastian-achim-mueller 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.