From 78be1f0735829491c7fb322c02feab46ce917d32 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 21 Feb 2019 20:37:33 +0800 Subject: clusters/halo: Reorder '_is_turb_active()' a bit --- fg21sim/extragalactic/clusters/halo.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index e24a0c3..bcda7bb 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -684,6 +684,17 @@ class RadioHalo1M: return raise ValueError("Not a merger begin/end time: %f" % t) + def _is_turb_active(self, t): + """ + Is the turbulence acceleration is active at the given time? + """ + if self._acceleration_disabled: + return False + + t_merger = self._merger_time(t) + tau_turb = self.duration_turb(t_merger) + return (t >= t_merger) and (t <= t_merger + tau_turb) + def mass_merged(self, t=None): """ The mass of the merged cluster. @@ -733,17 +744,6 @@ class RadioHalo1M: return helper.magnetic_field(mass=mass, z=z, eta_b=self.eta_b, kT_out=self.kT_out) - def _is_turb_active(self, t): - """ - Is the turbulence acceleration is active at the given time? - """ - if self._acceleration_disabled: - return False - - t_merger = self._merger_time(t) - tau_turb = self.duration_turb(t_merger) - return (t >= t_merger) and (t <= t_merger + tau_turb) - class RadioHaloAM(RadioHalo1M): """ -- cgit v1.2.2