Agnpy

Latest version: v0.4.0

Safety actively analyzes 623518 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

0.4.0

This is the first `agnpy` version including hadronic radiative processes.
IlariaViale and dimaniad6 have implemented a `ProtonSynchrotron` class.

0.3.0

**v0.3.0 introduces proton particles distributions**.

In the previous versions of the package, only an electron distribution was available, the latter had to be defined through a dictionary
python
set the spectrum normalisation (total energy in electrons in this case)
spectrum_norm = 1e48 * u.Unit("erg")
define the spectral function parametrisation through a dictionary
spectrum_dict = {
"type": "PowerLaw",
"parameters": {"p": 2.8, "gamma_min": 1e2, "gamma_max": 1e7},
}

set the remaining quantities defining the blob
R_b = 1e16 * u.cm
B = 1 * u.G
z = Distance(1e27, unit=u.cm).z
delta_D = 10
Gamma = 10

blob = Blob(R_b, z, delta_D, Gamma, B, spectrum_norm, spectrum_dict)


This was not very handy: I have simplified - and broke - the previous blob API.
From version `0.3.0` this is how electron distribution are defined and passed to the blob

python
electron distribution
n_e = BrokenPowerLaw(
k=1e-8 * u.Unit("cm-3"),
p1=1.9,
p2=2.6,
gamma_b=1e4,
gamma_min=10,
gamma_max=1e6,
mass=m_e,
)

set the quantities defining the blob
R_b = 1e16 * u.cm
z = Distance(1e27, unit=u.cm).z
delta_D = 10
Gamma = 10
B = 1 * u.G

blob = Blob(R_b, z, delta_D, Gamma, B, n_e=n_e)


The new way of defining particle distributions also allows to define proton distributions
python
n_p = PowerLaw(k=0.1 * u.Unit("cm-3"), p=2.3, gamma_min=10, gamma_max=1e6, mass=m_p)
blob = Blob(R_b, z, delta_D, Gamma, B, n_e=n_e, n_p=n_p)

The only difference between particle distributions is the `mass` argument.
This will eventually allow to describe other particle distributions.

**To achieve this:**

* `ElectronDistribution` has been changed to `ParticleDistribution`. This is the base class from which all the different distributions (`PowerLaw`, `BrokenPowerLaw` etc..) inherit;

* dimaniad6 additionally implemented an `InterpolatedDistribution` to read an arbitrary input particle distribution (two arrays: one for of Lorentz factors and the other for densities);

* the `Blob` class has been improved:
- the different initialisation method available under the `spectrum_norm_type` argument of the `Blob` are now implemented in the base `ParticleDistribution` class. I.e. one can initialise `from_total_density`, `from_total_energy_density`, `from_density_at_gamma_1`, `from_total_energy`;
- several quantities are now provided as `properties` and are evaluated on the fly from the base parameters ( $R_b$, $z$, $\delta_D$, $\Gamma$, $B$);

* the other classes remain largely unchanged. They have just been modified internally to deal with the new definition of particle distributions;

* note that the prefactor of the particle distribution has been renamed from `k_e` to `k`, as we are not describing exclusively electrons distributions now. This means that the corresponding parameter in the fit classes is `log10_k` instead of `log10_k_e`.

0.2.0

In this release, the sherpa and Gammapy wrapper - that before were simple examples in the documentation - have been added to the source code.

A `agnpy.fit` module has been introduced with two physical scenarios:

* `SycnhrotronSelfComptonModel`, representing the sum of synchrotron and synchrotron self-Compton (SSC) radiation. This scenario is commonly considered to model BL Lac sources;

* `ExternalComptonModel`, representing the sum of synchrotron and synchrotron self-Compton radiation along with an external Compton (EC) component. EC scattering can be computed considering a list of target photon fields. This scenario is commonly considered to model flat spectrum radio quasars (FSRQs).

For each scenario, a `sherpa` or `gammapy` backend can be selected, such that the fit can be performed with both packages.
Some helper functions are added to load directly a file representing a MWL SED with a proper format into a data object of the two packages.

0.1.8

In the previous release I forgot to include the `agnpy/utils/matplotlibrc` in the `MANIFEST.in`.
To load it I am now using `improtlib.resources` rather than the deprecated `Path(__file__).parent`, see https://github.com/wimglenn/resources-example.

0.1.7

This is a minor release fixing some inconsistencies in the `agnpy.utils.plot` functions.

0.1.6

Changed few keywords in the .zenodo.json to make it findable by the ESAP platform.

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.