Commit 058383b4 authored by Fang Yuedong's avatar Fang Yuedong
Browse files

extended the magnitude cut on brighter end to mag_sat-2.5, updated random seeds in dark and flat

parent 3aa0572f
......@@ -509,6 +509,7 @@ class Chip(FocalPlane):
ncombine=1, read_noise=self.read_noise, gain=1,
seed=SeedBiasNonuni+self.chipID,
logger=self.logger)
# Readout noise for Biases is not generated with random seeds. So readout noise for bias images can't be reproduced.
if config["ins_effects"]["cosmic_ray"] == True:
if config["ins_effects"]["cray_differ"] == True:
cr_map, cr_event_num = effects.produceCR_Map(
......@@ -636,7 +637,7 @@ class Chip(FocalPlane):
# Add Read-out Noise
if config["ins_effects"]["add_readout"] == True:
seed = int(config["random_seeds"]["seed_readout"]) + pointing_ID*30 + self.chipID
seed = int(config["random_seeds"]["seed_readout"]) + pointing_ID*30 + self.chipID + 3
rng_readout = galsim.BaseDeviate(seed)
readout_noise = galsim.GaussianNoise(rng=rng_readout, sigma=self.read_noise)
FlatCombImg.addNoise(readout_noise)
......@@ -758,7 +759,7 @@ class Chip(FocalPlane):
# Add Read-out Noise
if config["ins_effects"]["add_readout"] == True:
seed = int(config["random_seeds"]["seed_readout"]) + pointing_ID*30 + self.chipID
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)
......
......@@ -197,7 +197,7 @@ def MakeFlatSmooth(GSBounds, seed):
Flty, Fltx = np.mgrid[ymin:(ymax+1), xmin:(xmax+1)]
rg = Generator(PCG64(int(seed)))
p1,p2,bg=rg.poisson(1000, 3)
Fltz = 1e-6*(a1 * (Fltx-p1) ** 2 + a2 * (Flty-p2) ** 2 - a3*Fltx - a4*Flty) + bg*20
Fltz = 0.6*1e-7*(a1 * (Fltx-p1) ** 2 + a2 * (Flty-p2) ** 2 - a3*Fltx - a4*Flty) + bg*20
FlatImg = galsim.ImageF(Fltz)
return FlatImg
......
......@@ -40,7 +40,7 @@ class Filter(object):
# self.filter_dir = filter_param.filter_dir
def is_too_bright(self, mag):
return mag <= self.mag_saturation - 1.0
return mag <= self.mag_saturation - 2.5
# return mag <= 14.0
def is_too_dim(self, mag):
......
......@@ -26,7 +26,7 @@ extensions = [
setup(name='CSSTSim',
version='0.3',
version='0.5',
packages=find_packages(),
# install_requires=[
# 'numpy>=1.18.5',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment