Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Implement NaimaModel wrapper class #2124
This PR introduces a preliminary implementation for a interface with Naima models.
A few things are still not in place (see the TODO list), but I would like to receive some feedback before carrying on!
I have added a new
In this implementation, the user is supposed to have his own Naima installation. He needs to define a particle distribution and a radiative model, and pass the latter as an argument to a new NaimaModel instance:
The model parameters and are left free by default. They can be freezed/unfreezed through the
The distance to the source is 1 kpc by default, but can be changed. In the case of an inverse Compton radiative model, instantiated with a list of
As a test, I have reproduced the joint-crab paper fit (see the notebook).
Any idea or comment is welcome! Cheers
adonath left a comment
Thanks @luca-giunti! I've left a few comments to address...
I noticed that the parameter values for the
This might lead to confusion, but I'm not sure if there is an easy way around this...
Hi! @adonath, I did my best to apply all requested changes.
Indeed, I did not find an easy way to fix this. However, I guess that now that parameters are exposed as attributes the temptation of doing
Here is a link to the notebook where I use the NaimaModel to reproduce the joint-crab paper fit (Note that I stil used the
If you add a tutorial notebook or example, please make it fast. 10 seconds is good, 1 min is max.
Tutorials that run for many minutes are bad: users have to sit and wait for the example to run, but to learn you need to play with parameters. And if the tutorial takes long to execute, then it's difficult to test in our continuous integration setup.
So far there's always been a way to make a fast example: use small dataset, simple model, use optimisation parameters so that it runs fast - one doesn't learn so much more by running 100s of iterations and have super-precise results.
@cdeil I agree, especially because this is a rather minimal interface with Naima and it probably doesn't deserve a huge tutorial. I wonder if a tutorial is needed at all, to be honest. Maybe the current example plus a reference to the joint-crab paper notebook (with a brief explanation on how this class may ease the fit) could be enough?