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

Create an automatic sherpa model generator #61

Open
zblz opened this issue Feb 2, 2015 · 3 comments
Open

Create an automatic sherpa model generator #61

zblz opened this issue Feb 2, 2015 · 3 comments
Milestone

Comments

@zblz
Copy link
Owner

zblz commented Feb 2, 2015

From the radiative and functional models, create a sherpa model automagically, e.g.:

>>> from naima.models import create_sherpa_model, Synchrotron, PowerLaw
>>> SynPL = create_sherpa_model(model=Synchrotron, particle_distribution=PowerLaw)

All parameter fields, etc, should be populated programatically from the given models.

@zblz zblz added this to the future milestone Feb 5, 2015
@cdeil
Copy link
Contributor

cdeil commented Apr 28, 2015

@zblz – now that Sherpa is open, we'll start using it heavily in Gammapy.

@kingj90 will work on gammapy.spectrum ... we should try to find a way to avoid duplicating spectral model classes and functionality in gammapy and naima.

@zblz
Copy link
Owner Author

zblz commented Apr 29, 2015

@cdeil - definitely, we should not duplicate this. I did a few enhancements on the sherpa models in naima so that they are easier to code (base classes for each particle distribution and then a subclass for emission process) but this is not meant to be exposed to the user. I was not planning on developing this further than the thin wrappers in place in the near future, so if you have a plan for a better sherpa model framework we could use that with the naima models as well.

@cdeil
Copy link
Contributor

cdeil commented Dec 1, 2016

@joleroi, @adonath and I were discussing this briefly today.
I think a factory function or some other Sherpa model generator would be nice.
If it's more that 20 lines of code / significant effort, one should first look at https://saba.readthedocs.io/
That was a GSoC project and had input from both Astropy and Sherpa devs.
I haven't looked in detail what they do or if it's suitable for our needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants