From 4fe83ef4a9b3541281e4bdc00372ca26fe475ec4 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 27 Sep 2023 15:11:21 -0400 Subject: [PATCH 1/2] use poly1d from numpy directly --- poppy/optics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poppy/optics.py b/poppy/optics.py index 66ffd009..06771549 100644 --- a/poppy/optics.py +++ b/poppy/optics.py @@ -566,7 +566,7 @@ def get_transmission(self, wave): else: raise NotImplemented("No defined NIRCam wedge BLC mask for that wavelength? ") - sigmas = scipy.poly1d(polyfitcoeffs)(scalefact) + sigmas = numpy.poly1d(polyfitcoeffs)(scalefact) sigmar = sigmas * np.abs(y) sigmar.clip(np.finfo(sigmar.dtype).tiny, out=sigmar) # avoid divide by zero -> NaNs From b2f1c3f0ab966872dbbb4e70c2f2463d5c60fbfd Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 27 Sep 2023 16:47:11 -0400 Subject: [PATCH 2/2] switch NaN to nan --- poppy/accel_math.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/poppy/accel_math.py b/poppy/accel_math.py index 5e9fadee..4e1a4f58 100644 --- a/poppy/accel_math.py +++ b/poppy/accel_math.py @@ -387,7 +387,7 @@ def benchmark_fft(npix=2048, iterations=20, double_precision=True): time_fftw = timer.timeit(number=iterations) / iterations print(" {:.3f} s".format(time_fftw)) else: - time_fftw = np.NaN + time_fftw = np.nan if poppy.accel_math._NUMEXPR_AVAILABLE: print("Timing performance with Numexpr + FFTW:") @@ -396,7 +396,7 @@ def benchmark_fft(npix=2048, iterations=20, double_precision=True): time_numexpr = timer.timeit(number=iterations) / iterations print(" {:.3f} s".format(time_numexpr)) else: - time_numexpr = np.NaN + time_numexpr = np.nan if poppy.accel_math._MKLFFT_AVAILABLE: print("Timing performance with Numexpr + MKL:") @@ -407,7 +407,7 @@ def benchmark_fft(npix=2048, iterations=20, double_precision=True): time_mkl = timer.timeit(number=iterations) / iterations print(" {:.3f} s".format(time_mkl)) else: - time_mkl = np.NaN + time_mkl = np.nan if poppy.accel_math._OPENCL_AVAILABLE: print("Timing performance with OpenCL:") @@ -416,7 +416,7 @@ def benchmark_fft(npix=2048, iterations=20, double_precision=True): time_opencl = timer.timeit(number=iterations) / iterations print(" {:.3f} s".format(time_opencl)) else: - time_opencl = np.NaN + time_opencl = np.nan poppy.conf.use_mkl, poppy.conf.use_fftw, poppy.conf.use_numexpr, poppy.conf.use_cupy,\