Commit 7dcab00e authored by Zhang Xin's avatar Zhang Xin
Browse files

fig bug: large mermory in the model FlatLED

parent a4587b61
Pipeline #7816 failed with stage
in 0 seconds
......@@ -75,7 +75,7 @@ class FlatLED(MockObject):
ledflats = bandtoLed[self.chip.filter_type]
iFlat = np.zeros([self.chip.npix_y, self.chip.npix_x])
for nled in ledflats:
iFlat = iFlat + self.getLEDImage(led_type=nled, LED_Img_flag=False)
iFlat = iFlat + self.getLEDImage1(led_type=nled, LED_Img_flag=False)
iFlat = iFlat/len(ledflats)
return iFlat
......@@ -123,7 +123,7 @@ class FlatLED(MockObject):
# return LED flat, e/s
###
def getLEDImage1(self, led_type='LED1'):
def getLEDImage1(self, led_type='LED1', LED_Img_flag =True):
# cwave = cwaves[led_type]
flat = fits.open(os.path.join(self.flatDir, 'model_' +
cwaves_name[led_type] + 'nm.fits'))
......@@ -155,6 +155,8 @@ class FlatLED(MockObject):
N[0:self.chip.npix_y, 0:self.chip.npix_x]),
method='linear')
U = U/np.mean(U)
flatImage = U
if LED_Img_flag:
flatImage = U*fluxLED[led_type]*1000
gc.collect()
return flatImage
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment