Converting units in Spectral-Energy-Distributions.
Project description
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
Example
See unit-tests ./spectral_energy_distribution_units/tests/test_convert.py to reproduce the upper figures A , B , C , and D.
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
Hashes for spectral_energy_distribution_units_sebastian-achim-mueller-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 558f4942e61ca90f40f34338167d570f3365b8c47578c591e428e0b9212407bb |
|
MD5 | e0a69e25d122f896df15d110aaa24e03 |
|
BLAKE2b-256 | 5c99082be4cfcd15f8bfaf6f4d868d3ae5456f7abcd3ab60b2dc36b1ec353e9f |
Hashes for spectral_energy_distribution_units_sebastian_achim_mueller-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f8d9ffa68db40fce17d770f93e675c6bef3a00bb95026602e123a1375490d57 |
|
MD5 | 2d97f9ae6dcc4593cf7b3e10212ae009 |
|
BLAKE2b-256 | a9765e41e81d33346e48738ad303994d9c4290da418339eff3389dcd5f0a207c |