Giter Club home page Giter Club logo

Comments (6)

andreatramacere avatar andreatramacere commented on July 20, 2024

Dear Mireia, thanks a lot for using jeteset. Before going into the details may I ask you which version you are using?
I suggest you to install the release candidate of the new version: https://github.com/andreatramacere/jetset/releases/tag/1.2.0rc10
You can directly use the installer https://github.com/andreatramacere/jetset-installer, passing to the command line the argument 1.2.0rc10.
The documentation for the pre-release is here: https://andreatramacere.github.io/jetsetdoc/html/index.html
Now, coming to your issue. I should have a look at the code that you use to plot in matplotlib to understand what is going on. The other problem might be solved with the version that I am suggesting you to install.
Please, let me know how things evolve and how I can help you.
Cheers
Andrea

from jetset.

mireianievas avatar mireianievas commented on July 20, 2024

I am using 1.1.2, the last stable I guess. I will try the pre-release you mention. Any big compatibility issue I need to know in advance?

One, maybe relevant bit, is that I have my own electron distribution defined. It is basically a broken power law, but defined in a way that it is always concave (i.e. redefining p_1 so that p_1' = abs(p_1 - p). Maybe (I'm not saying it is the reason) jetset 'forgets' at some point it is a custom distribution and uses a standard broken power law?

from jetset.jet_emitters import EmittersDistribution
def distr_func_bkn(gamma_break,gamma,p,p_1):
    return np.power(gamma,-np.abs(p))*(1.+(gamma/gamma_break))**(-np.abs(p_1))

bkn2=EmittersDistribution('bkn')
bkn2.add_par('gamma_break',par_type='turn-over-energy',val=1E3,vmin=1., vmax=None, unit='lorentz-factor')
bkn2.add_par('p',par_type='LE_spectral_slope',val=2.5,vmin=0., vmax=10, unit='')
bkn2.add_par('p_1',par_type='HE_spectral_slope',val=3.2,vmin=0., vmax=10, unit='')
bkn2.set_distr_func(distr_func_bkn)
bkn2.parameters.show_pars()
bkn2.parameters.p.val=2
bkn2.parameters.p_1.val=0.5

p=bkn2.plot3p()
p.fig

At least that would perhaps explain this non-sense SED

image

from jetset.

andreatramacere avatar andreatramacere commented on July 20, 2024

So I found what happens, you called the distribution with the same name of the custom model, 'bkn'. Once you save the model, and you load it, the constructor is getting the custom one. In version 1.1.2 I have not implemented the serialization of the custom electron distribution. This is done with the version that I have suggested before, anyhow I found the solution for your problem, still using version 1.1.2. Use the code attached, and remember, once you load the model and then you update it with the saved custom distribution, run .eval() to update
custom_emitters_ditribution_serialization.ipynb.gz

from jetset.

andreatramacere avatar andreatramacere commented on July 20, 2024

I have also pushed the notebook with the solution to the git repo that you share before.
Please, let me know if this solved your problem

from jetset.

mireianievas avatar mireianievas commented on July 20, 2024

from jetset.

andreatramacere avatar andreatramacere commented on July 20, 2024

Regarding compatibility, there might be minor changes. Just in case, share with me a piece of code with all the jetset steps that you are using, I will check if it is OK

from jetset.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.