Newer
Older
# Add Read-out Noise
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)
Zhang Xin
committed
DarkCombImg, self.gain_channel = effects.ApplyGainNonUniform16(
DarkCombImg, gain=self.gain,
nsecy=self.nsecy, nsecx=self.nsecx,
Fang Yuedong
committed
seed=SeedGainNonuni+self.chipID,
logger=self.logger)
# 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,
pointing_ID=pointing_ID,
output_dir=chip_output.subdir,
Zhang Xin
committed
exptime=self.dark_exptime,
Fang Yuedong
committed
project_cycle=config["project_cycle"],
run_counter=config["run_counter"],
del DarkCombImg
# img = galsim.ImageUS(img)
# # 16 output channel, with each a single image file
# 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