aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-01-11 19:55:54 +0800
committerAaron LI <aly@aaronly.me>2018-01-11 19:55:54 +0800
commit8dcf5caa1e6b37d7717ea04167e96ebee3e9516a (patch)
tree59034279180583ab0e31a7c44c12a9a541a3e3be /fg21sim
parent34d7800441d6cd3ac0b5818d87425349676e6cfe (diff)
downloadfg21sim-8dcf5caa1e6b37d7717ea04167e96ebee3e9516a.tar.bz2
clusters/main: minor cleanups
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/extragalactic/clusters/main.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py
index 68291eb..2c8ac54 100644
--- a/fg21sim/extragalactic/clusters/main.py
+++ b/fg21sim/extragalactic/clusters/main.py
@@ -297,11 +297,10 @@ class GalaxyClusters:
"""
logger.info("Calculating the radio halo emissions ...")
num = len(self.halos)
- i = 0
- for hdict in self.halos:
- i += 1
- if i % 100 == 0:
- logger.info("[%d/%d] %.1f%% ..." % (i, num, 100*i/num))
+ for i, hdict in enumerate(self.halos):
+ ii = i + 1
+ if ii % 100 == 0:
+ logger.info("[%d/%d] %.1f%% ..." % (ii, num, 100*ii/num))
haloem = HaloEmission(gamma=hdict["gamma"], n_e=hdict["n_e"],
B=hdict["B0"], radius=hdict["Rhalo"],
redshift=hdict["z0"])
@@ -357,11 +356,10 @@ class GalaxyClusters:
"""
num = len(self.halos)
logger.info("Draw template images for %d halos ..." % num)
- i = 0
- for hdict in self.halos:
- i += 1
- if i % 100 == 0:
- logger.info("[%d/%d] %.1f%% ..." % (i, num, 100*i/num))
+ for i, hdict in enumerate(self.halos):
+ ii = i + 1
+ if ii % 100 == 0:
+ logger.info("[%d/%d] %.1f%% ..." % (ii, num, 100*ii/num))
theta_e = hdict["Rhalo_angular"] / self.sky.pixelsize
template = helper.draw_halo(radius=theta_e,
felong=hdict["felong"],