Loading observation_sim/mock_objects/FlatLED.py +39 −32 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ import numpy as np import time import math from astropy.io import fits from scipy.interpolate import griddata from scipy.interpolate import griddata,RegularGridInterpolator from astropy.table import Table from observation_sim.mock_objects.SpecDisperser import SpecDisperser from scipy import interpolate Loading Loading @@ -223,7 +223,7 @@ class FlatLED(MockObject): # return LED flat, e/s ### def getLEDImage1(self, led_type="LED1", LED_Img_flag=True): def getLEDImage1(self, led_type="LED1", LED_Img_flag=True, use_regular_grid=True): # cwave = cwaves[led_type] flat = fits.open( os.path.join(self.flatDir, "model_" + cwaves_name[led_type] + "nm.fits") Loading Loading @@ -252,13 +252,20 @@ class FlatLED(MockObject): ] # z = np.sin((xx+yy+xx**2+yy**2)) # fInterp = interp2d(xx, yy, z, kind='linear') if use_regular_grid: interp = RegularGridInterpolator((y, x), a1, method="linear", bounds_error=False, fill_value=None) n_x = np.arange(0, self.chip.npix_x, 1) n_y = np.arange(0, self.chip.npix_y, 1) M, N = np.meshgrid(n_x, n_y) U = interp((N, M)).astype(np.float32) else: X_ = np.hstack((xx.flatten()[:, None], yy.flatten()[:, None])) Z_ = a1.flatten() n_x = np.arange(0, self.chip.npix_x, 1) n_y = np.arange(0, self.chip.npix_y, 1) M, N = np.meshgrid(n_x, n_y) x_seg_len = 4 y_seg_len = 8 x_seg_len = 8 y_seg_len = 16 x_seg = int(self.chip.npix_x / x_seg_len) y_seg = int(self.chip.npix_y / y_seg_len) U = np.zeros([self.chip.npix_y, self.chip.npix_x], dtype=np.float32) Loading Loading
observation_sim/mock_objects/FlatLED.py +39 −32 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ import numpy as np import time import math from astropy.io import fits from scipy.interpolate import griddata from scipy.interpolate import griddata,RegularGridInterpolator from astropy.table import Table from observation_sim.mock_objects.SpecDisperser import SpecDisperser from scipy import interpolate Loading Loading @@ -223,7 +223,7 @@ class FlatLED(MockObject): # return LED flat, e/s ### def getLEDImage1(self, led_type="LED1", LED_Img_flag=True): def getLEDImage1(self, led_type="LED1", LED_Img_flag=True, use_regular_grid=True): # cwave = cwaves[led_type] flat = fits.open( os.path.join(self.flatDir, "model_" + cwaves_name[led_type] + "nm.fits") Loading Loading @@ -252,13 +252,20 @@ class FlatLED(MockObject): ] # z = np.sin((xx+yy+xx**2+yy**2)) # fInterp = interp2d(xx, yy, z, kind='linear') if use_regular_grid: interp = RegularGridInterpolator((y, x), a1, method="linear", bounds_error=False, fill_value=None) n_x = np.arange(0, self.chip.npix_x, 1) n_y = np.arange(0, self.chip.npix_y, 1) M, N = np.meshgrid(n_x, n_y) U = interp((N, M)).astype(np.float32) else: X_ = np.hstack((xx.flatten()[:, None], yy.flatten()[:, None])) Z_ = a1.flatten() n_x = np.arange(0, self.chip.npix_x, 1) n_y = np.arange(0, self.chip.npix_y, 1) M, N = np.meshgrid(n_x, n_y) x_seg_len = 4 y_seg_len = 8 x_seg_len = 8 y_seg_len = 16 x_seg = int(self.chip.npix_x / x_seg_len) y_seg = int(self.chip.npix_y / y_seg_len) U = np.zeros([self.chip.npix_y, self.chip.npix_x], dtype=np.float32) Loading