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") # 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 chip.img, crmap_gsimg, cr_event_num = chip_utils.add_cosmic_rays( img=chip.img, chip=chip, exptime=exptime, seed=self.overall_config["random_seeds"]["seed_CR"]+pointing.id*30+chip.chipID) # [TODO] output cosmic ray image return chip, filt, tel, pointing