zblz / naima

Derivation of non-thermal particle distributions through MCMC spectral fitting
http://naima.readthedocs.io
BSD 3-Clause "New" or "Revised" License
45 stars 54 forks source link

Add proton synchrotron computation #134

Open zblz opened 7 years ago

zblz commented 7 years ago

This is a relatively simple modification that would require an additional argument to the Synchrotron class and setting the particle mass to either m_e or m_p in the gyroradius calculation.

XiaonaS commented 7 years ago

Thank you very much for your reply, Zabalza. I modified it, and now I can use the proton synchrotron. Now I can enter the code "radiative.py" from my local path, but I don't know how to put it in the installed Naima path, and enter it from naima. Sorry for your time because of my limit knowledge of python.

wrijupan commented 7 years ago

Hello,

Thanks for the suggestion. I was looking into the Synchrotron class to modify it for proton synchrotron. Apart from modifying the gyroradius calculation, the Synchrotron class also uses _elec and _gam functions from the base class BaseElectron for _spectrum calculation. In this base class also the electron mass appears. So we have to modify the base electron class as well right ? Or just define mec2 = (m_p * c**2).cgs globally in the proton synchrotron code? Please forgive me if I am wrong.

Regards

wrijupan commented 7 years ago

@XiaonaS did proton synchrotron work for you by only modifying the Synchrotron class or did you touch the BaseElectron class as well? Your suggestions are much appreciated.

Thank you in advance.

XiaonaS commented 7 years ago

Yes, I have changed all the m_e to m_p in "radiative.py " when I calculate the proton synchrotron.

Best

wrijupan commented 7 years ago

Thank you!

Regards

Uxuee commented 4 years ago

@XiaonaS
Hello, Apart from the change of the mass, what is the "additional argument to the Synchrotron class" that @zblz mentions in the first message? Kindly Regards