Closed cosimoNigro closed 4 years ago
u_B is used also in P_jet_B (sorry it is my fault, you were using before just B^2 / 8 pi, but since I also needed it for another function when I introduced the function I changed yours as well to simplify it and forgot to tell you.) return (prefactor * self.u_B).to("erg s-1") https://github.com/cosimoNigro/agnpy/blob/738a445b53f1daebbeaf598d32de389249e077e8/agnpy/emission_regions.py#L282
Fixed in master, thank you.
I just realized that u_ph_synch is somewhat misleading name. You use u_ph in other places of the code, but it is for the photon density, and this function is energy density
No, it is also density of radiation https://github.com/cosimoNigro/agnpy/blob/master/agnpy/targets.py#L192 see corresponding formulas in Finke's 2016 paper.
Also check the classical Tavecchio's plot for the densities (Fig 14. of https://www.aanda.org/articles/aa/pdf/2014/09/aa23484-14.pdf) it's always energy density, not simple volumetric density. Right?
right, sorry, my mistake, should have seen that the returned units are erg cm-3, but then the naming is not very fortunate, since 'ph' normally stands for photons, so photon density is number density of photons, not eneryg density. Actually Finke uses also nph but in sense of number density, not energy density (see beginning of section 2.1): "${n}{{ph}}(\epsilon ,{\rm{\Omega }})$ is the number density of incident ("seed") photons with energies between $\epsilon $ and epsilon + depsilon and solid angles between Ω and ${\rm{\Omega }}+d{\rm{\Omega }}$,"
EDIT: ok, this one is n_ph and not u_ph, now I understand the notation
This small pull request adds functions to compute the peak flux and frequencies of the SEDs.
@jsitarek watchout I changed the names of two functions you introduced:
u_B
->U_B
(in Finke and Dermer is always capitalised though other energy densities are not)u_dens_synchr
->u_ph_synch
(I have named the other functions computing the densities of photons asu_ph
, also in the whole code we use _synch rather than _synchr).Sorry for not asking to change that in the PR, I did not check carefully. I modified test_gmax.py to work with the new functions, but as I said I'll make proper test scripts soon.