From 632c2857d1607150f482293df3391e874b53a823 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 29 Jul 2017 23:51:28 +0800 Subject: clusters/halo.py: Add property "volume" (unit: [cm^3]) Signed-off-by: Aaron LI --- fg21sim/extragalactic/clusters/halo.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'fg21sim/extragalactic/clusters/halo.py') diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index 44d1e1a..d7b3ec4 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -162,6 +162,15 @@ class RadioHalo: r_halo = helper.radius_halo(mass, self.z_merger) # [kpc] return r_halo + @property + def volume(self): + """ + The halo volume, calculated from the above radius. + Unit: [cm^3] + """ + r_cm = self.radius * AUC.kpc2cm + return (4*np.pi/3) * r_cm**3 + @property def magnetic_field(self): """ -- cgit v1.2.2