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): ...@@ -75,7 +75,7 @@ class FlatLED(MockObject):
ledflats = bandtoLed[self.chip.filter_type] ledflats = bandtoLed[self.chip.filter_type]
iFlat = np.zeros([self.chip.npix_y, self.chip.npix_x]) iFlat = np.zeros([self.chip.npix_y, self.chip.npix_x])
for nled in ledflats: 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) iFlat = iFlat/len(ledflats)
return iFlat return iFlat
...@@ -123,7 +123,7 @@ class FlatLED(MockObject): ...@@ -123,7 +123,7 @@ class FlatLED(MockObject):
# return LED flat, e/s # 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] # cwave = cwaves[led_type]
flat = fits.open(os.path.join(self.flatDir, 'model_' + flat = fits.open(os.path.join(self.flatDir, 'model_' +
cwaves_name[led_type] + 'nm.fits')) cwaves_name[led_type] + 'nm.fits'))
...@@ -155,7 +155,9 @@ class FlatLED(MockObject): ...@@ -155,7 +155,9 @@ class FlatLED(MockObject):
N[0:self.chip.npix_y, 0:self.chip.npix_x]), N[0:self.chip.npix_y, 0:self.chip.npix_x]),
method='linear') method='linear')
U = U/np.mean(U) U = U/np.mean(U)
flatImage = U*fluxLED[led_type]*1000 flatImage = U
if LED_Img_flag:
flatImage = U*fluxLED[led_type]*1000
gc.collect() gc.collect()
return flatImage 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