Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add peak energy property to some spectral models #1087

merged 2 commits into from Jul 24, 2017


Copy link

@adonath adonath commented Jul 21, 2017

This PR adds a e_peak property to the LogParabola and ExponentialCutoffPowerLaw spectral models. It computes the peak energy of the spectral model and returns it as a quantity.

@adonath adonath requested a review from joleroi Jul 21, 2017
@adonath adonath self-assigned this Jul 21, 2017
Copy link

@cdeil cdeil left a comment

One small suggestion for the docstring. Otherwise 👍 , thanks!

@@ -733,6 +733,27 @@ def to_sherpa(self, name='default'):

return model

def e_peak(self):
"""Peak energy of the spectral model.

This comment has been minimized.


cdeil Jul 21, 2017

I would suggest:

Spectral energy distribution peak energy (`~astropy.utils.Quantity`).

Then you can delete the Returns section below to save some lines and duplicating the description what it is.

I think with "spectral energy distribution" most users will know that it's e2dnde, but just to be sure you could mention it explicitly like:

This is the peak in E^2 x dN/dE and is given by:
@adonath adonath merged commit e764d5f into gammapy:master Jul 24, 2017
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
@cdeil cdeil changed the title Add e_peak property to some spectral models Add peak energy property to some spectral models Aug 31, 2017
@cdeil cdeil added this to the 0.7 milestone Aug 31, 2017
@adonath adonath deleted the adonath:spectral_models_e_peak branch Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants