add_LED_flat.py 742 Bytes
Newer Older
1
2
import numpy as np
from ObservationSim.MockObject import FlatLED
Zhang Xin's avatar
Zhang Xin committed
3
import galsim
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

def add_LED_Flat(self, chip, filt, tel, pointing, catalog, obs_param):
        
    if not hasattr(self, 'h_ext'):
        _, _ = self.prepare_headers(chip=chip, pointing=pointing)
    chip_wcs = galsim.FitsWCS(header = self.h_ext)
    pf_map = np.zeros_like(chip.img.array)
    if obs_param["LED_TYPE"] is not None:
        if len(obs_param["LED_TYPE"]) != 0:
            print("LED OPEN--------")

            led_obj = FlatLED(chip, filt)

            led_flat = led_obj.drawObj_LEDFlat(led_type_list=obs_param["LED_TYPE"], exp_t_list=obs_param["LED_TIME"])
            pf_map = led_flat
    chip.img = chip.img + led_flat
    return chip, filt, tel, pointing