Closed telegraphic closed 5 years ago
@telegraphic The error when using units on obs_bandwidth
is because it add units to bandwidth by default similar to DM and fluence. So when specifying units when instantiating the class Frb
will lead to a value of 31.25 MHz**2 when doing internal calculations. Hence the units are non-convertible. I think adding a check to the setters in the class Frb
to see if the correct units are already assigned would resolve this issue. I'll open this as an issue for enhancement.
As for the average luminosity, I have a beta version of a calc_luminosity()
function already developed but not released yet, however I found various differing definitions in the literature so I wasn't sure exactly which one to implement. Do know the preferred reference for calculating luminosity, if so I can add it relatively quickly.
I've just been dividing energy by width ;)
Wael just reminded me that in the Zhang (2018) paper they picked up that central observing frequency nu should be used instead of obs_bandwidth to estimate isotropic energy (I'm checking some of his calculations against fruitbat!):
The (1+z) factor was misused in the expression of E in some previous papers. The central frequency νc, rather than the bandwidth B, should be used in these calculations.
It's this equation:
So are you suggesting that both calc_energy()
and calc_luminosity()
should use a new parameter obs_freq_central
instead of obs_bandwidth
? This should be a pretty quick change.
Yes, that's my understanding, they suggest that obs_freq_central
is more appropriate. (I wouldn't be suprised if the argument continued though, as some pulses may be inherently band-limited, and others may be much wider band than the bandwidth of the receiver).
What I am going to do is use obs_freq_central
by default and have a keyword use_bandwidth
in the function call for calc_luminosity()
and calc_energy()
that will allow for the option of using obs_bandwidth
.
The pull request #16 updating to version 0.2.1 has the luminosity function and passing units updates.
You can use the calc_luminosity()
function with either obs_freq_central
or obs_bandwidth
. The same goes for calc_energy()
however it now uses obs_freq_central
by default.
I also made it possible to pass values with astropy units when calling Frb()
and it will use those units instead of the predefined units I gave them unless the units aren't convertible.
If this works as you expect let me know and I can close this issue.
I'm closing this issue based on talking to you in person, the issue seems resolved.
Hey, was playing with luminosity conversion and I'm getting a unit error:
But with units on obs_bandwidth:
Also - smallish feature request: compute average luminosity in ergs/s