From 5e4e387509f71142b3cf139dd225517c19076857 Mon Sep 17 00:00:00 2001 From: eblur Date: Fri, 10 Jul 2020 16:43:39 -0400 Subject: [PATCH 1/2] fixed bug with tnow < 0 --- newdust/halos/galhalo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newdust/halos/galhalo.py b/newdust/halos/galhalo.py index edaa186..e366585 100644 --- a/newdust/halos/galhalo.py +++ b/newdust/halos/galhalo.py @@ -220,7 +220,7 @@ def fake_variable_image(self, time, lc, arf, keyword, a FITS file will be saved. """ assert np.all(time >= 0.0) - if tnow < 0: + if tnow is None: time_now = time[-1] else: time_now = tnow From 3ca4cd0a2824572aba8a6cf8755939a9b4f1c040 Mon Sep 17 00:00:00 2001 From: eblur Date: Mon, 20 Jul 2020 22:31:45 -0400 Subject: [PATCH 2/2] Fixed bugs in variable halo --- newdust/halos/galhalo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/newdust/halos/galhalo.py b/newdust/halos/galhalo.py index e366585..daa9135 100644 --- a/newdust/halos/galhalo.py +++ b/newdust/halos/galhalo.py @@ -234,7 +234,7 @@ def fake_variable_image(self, time, lc, arf, else: imin = min(np.arange(len(self.lam))[self.lam >= lmin]) if lmax is None: - iend = -1 + iend = len(self.lam) else: iend = max(np.arange(len(self.lam))[self.lam <= lmax]) @@ -264,7 +264,8 @@ def fake_variable_image(self, time, lc, arf, result = np.zeros_like(radius) for i in np.arange(imin, iend): h_interp = InterpolatedUnivariateSpline( - self.theta, var_profile[i,:] * int_conv[i], k=1) # ct/s/arcsec^2 + self.theta, var_profile[i,:] * int_conv[i], k=1, + ext=1) # ct/s/arcsec^2 # corresponding counts at each radial value in the grid pix_flux = h_interp(r_asec) * pix_scale**2 * exposure # cts # use poisson statistics to get a random value