diff options
author | Aaron LI <aly@aaronly.me> | 2017-10-19 09:05:35 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-10-19 09:05:35 +0800 |
commit | 73e6f8a436e7b805144c48c757a7bab0ab94b01b (patch) | |
tree | a940970f84c0adec2e77be142e443c9e3e7e37a6 /fg21sim/extragalactic/clusters/halo.py | |
parent | 13861dc37376e04ea64bbf61a49c0f183d84a558 (diff) | |
download | fg21sim-73e6f8a436e7b805144c48c757a7bab0ab94b01b.tar.bz2 |
clusters/halo: Improve time step determination a bit
Diffstat (limited to 'fg21sim/extragalactic/clusters/halo.py')
-rw-r--r-- | fg21sim/extragalactic/clusters/halo.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index a481ce5..3ce3ed7 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -294,8 +294,11 @@ class RadioHalo: # to improve the results. # XXX: is this necessary??? nstep_min = 20 - if (tstop - tstart) / self.fpsolver.tstep < nstep_min: - self.fpsolver.tstep = (tstop - tstart) / nstep_min + if (tstop - tstart) / self.time_step < nstep_min: + tstep = (tstop - tstart) / nstep_min + logger.debug("Decreased time step: %g -> %g [Gyr]" % + (self.time_step, self.fpsolver.tstep)) + self.fpsolver.tstep = tstep self.electron_spec = self.fpsolver.solve(u0=n0_e, tstart=tstart, tstop=tstop) |