aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-10-22 15:50:58 +0800
committerAaron LI <aaronly.me@outlook.com>2016-10-22 15:50:58 +0800
commitcb839cb55a39bbd1342c5b03e85e79757ab6163b (patch)
treec60f121675f889a7a9d43a988c0ca2da152746b6 /fg21sim
parent29bd5d71bbbebaf61d912c305558e19d5be7be95 (diff)
downloadfg21sim-cb839cb55a39bbd1342c5b03e85e79757ab6163b.tar.bz2
galactic/snr.py: Fix wrong astropy quantity operation
When two quantities of same unit class divides, to get the correct numerical value, whether use `.decompose().value`, or just convert to plain Python object, e.g., `float(...)`, which will fail if the input quantity is not dimensionless.
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/galactic/snr.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/fg21sim/galactic/snr.py b/fg21sim/galactic/snr.py
index 1230f58..380f61a 100644
--- a/fg21sim/galactic/snr.py
+++ b/fg21sim/galactic/snr.py
@@ -220,7 +220,7 @@ class SuperNovaRemnants:
"""
freq = frequency * self.freq_unit
flux = flux * self.units["flux"]
- Fnu = flux * (freq / self.catalog_flux_freq).value ** (-specindex)
+ Fnu = flux * float(freq / self.catalog_flux_freq) ** (-specindex)
omega = size[0]*self.units["size"] * size[1]*self.units["size"]
Tb = Fnu_to_Tb(Fnu, omega, freq)
return Tb.value