add_cosmic_rays.py 698 Bytes
Newer Older
1
2
3
4
from ObservationSim.Instrument.Chip import ChipUtils as chip_utils

def add_cosmic_rays(self, chip, filt, tel, pointing, catalog, obs_param):
    self.chip_output.Log_info("  Adding Cosmic-Ray")
5
6
7
8
9
10
11
    
    # Get exposure time
    if (obs_param) and ("exptime" in obs_param) and (obs_param["exptime"] is not None):
        exptime = obs_param["exptime"]
    else:
        exptime = pointing.exp_time

12
13
14
    chip.img, crmap_gsimg, cr_event_num = chip_utils.add_cosmic_rays(
        img=chip.img, 
        chip=chip, 
15
        exptime=exptime, 
16
17
18
        seed=self.overall_config["random_seeds"]["seed_CR"]+pointing.id*30+chip.chipID)
    # [TODO] output cosmic ray image
    return chip, filt, tel, pointing