Skip to content
Chip.py 53.5 KiB
Newer Older
    #             # Add Read-out Noise
    #             if config["ins_effects"]["add_readout"] == True:
    #                 seed = int(config["random_seeds"]["seed_readout"]
    #                            ) + pointing_ID*30 + self.chipID + 2
    #                 rng_readout = galsim.BaseDeviate(seed)
    #                 readout_noise = galsim.GaussianNoise(
    #                     rng=rng_readout, sigma=self.read_noise)
    #                 DarkCombImg.addNoise(readout_noise)

    #             DarkCombImg, self.gain_channel = effects.ApplyGainNonUniform16(
    #                 DarkCombImg, gain=self.gain,
    #                 nsecy=self.nsecy, nsecx=self.nsecx,
    #                 seed=SeedGainNonuni+self.chipID,
    #                 logger=self.logger)
    #             # DarkCombImg = effects.AddOverscan(
    #             #     DarkCombImg,
    #             #     overscan=overscan, gain=self.gain,
    #             #     widthl=27, widthr=27, widtht=8, widthb=8)
    #             DarkCombImg.replaceNegative(replace_value=0)
    #             DarkCombImg.quantize()
    #             DarkCombImg = galsim.ImageUS(DarkCombImg)
    #             timestamp_obs += 10 * 60
    #             chip_utils.outputCal(
    #                 chip=self,
    #                 img=DarkCombImg,
    #                 ra_cen=ra_cen,
    #                 dec_cen=dec_cen,
    #                 img_rot=img_rot,
    #                 im_type='DARK',
    #                 pointing_ID=pointing_ID,
    #                 output_dir=chip_output.subdir,
    #                 exptime=self.dark_exptime,
    #                 project_cycle=config["project_cycle"],
    #                 run_counter=config["run_counter"],
    #                 timestamp=timestamp_obs)
    #         del DarkCombImg
    #     # img = galsim.ImageUS(img)

    #     # # 16 output channel, with each a single image file
    #     # if config["ins_effects"]["readout16"] == True:
    #     #     print("  16 Output Channel simulation")
    #     #     for coli in [0, 1]:
    #     #         for rowi in range(8):
    #     #             sub_img = effects.readout16(
    #     #                 GSImage=img,
    #     #                 rowi=rowi,
    #     #                 coli=coli,
    #     #                 overscan_value=self.overscan)
    #     #             rowcoltag = str(rowi) + str(coli)
    #     #             img_name_root = chip_output.img_name.split(".")[0]
    #     #             sub_img.write("%s/%s_%s.fits" % (chip_output.subdir, img_name_root, rowcoltag))
    #     #     del sub_img
    #     return img