Commit adb75244 authored by Xin Zhang's avatar Xin Zhang
Browse files

fix cosmic ray bug -expTime, add output cr number

parent 844aa0ba
......@@ -355,10 +355,10 @@ class Chip(FocalPlane):
# Add cosmic-rays
if config["cosmic_ray"].lower() == "y" and pointing_type=='MS':
print(" Adding Cosmic-Ray", flush=True)
cr_map = effects.produceCR_Map(
cr_map, cr_event_num = effects.produceCR_Map(
xLen=self.npix_x, yLen=self.npix_y,
exTime=self.exptime+0.5*self.readout_time,
cr_pixelRatio=0.003*(1+0.5*self.readout_time/self.exptime),
cr_pixelRatio=0.003*(self.exptime+0.5*self.readout_time)/150.,
gain=self.gain,
attachedSizes=self.attachedSizes,
seed=SeedCosmicRay+pointing_ID*30+self.chipID) # seed: obj-imaging:+0; bias:+1; dark:+2; flat:+3;
......@@ -469,7 +469,7 @@ class Chip(FocalPlane):
seed=SeedBiasNonuni+self.chipID)
if config["cosmic_ray"].lower() == "y":
if config["cray_differ"].lower() == "y":
cr_map = effects.produceCR_Map(
cr_map, cr_event_num = effects.produceCR_Map(
xLen=self.npix_x, yLen=self.npix_y,
exTime=0.01,
cr_pixelRatio=0.003*(0.01+0.5*self.readout_time)/(self.exptime+0.5*self.readout_time),
......@@ -541,7 +541,7 @@ class Chip(FocalPlane):
)
if config["cosmic_ray"].lower() == "y":
if config["cray_differ"].lower() == "y":
cr_map = effects.produceCR_Map(
cr_map, cr_event_num = effects.produceCR_Map(
xLen=self.npix_x, yLen=self.npix_y,
exTime=self.flat_exptime+0.5*self.readout_time,
cr_pixelRatio=0.003*(self.flat_exptime+0.5*self.readout_time)/(self.exptime+0.5*self.readout_time),
......@@ -632,7 +632,7 @@ class Chip(FocalPlane):
gain=1, seed_bias=SeedBiasNonuni+self.chipID)
if config["cosmic_ray"].lower() == "y":
if config["cray_differ"].lower() == "y":
cr_map = effects.produceCR_Map(
cr_map, cr_event_num = effects.produceCR_Map(
xLen=self.npix_x, yLen=self.npix_y,
exTime=self.dark_exptime+0.5*self.readout_time,
cr_pixelRatio=0.003*(self.dark_exptime+0.5*self.readout_time)/(self.exptime+0.5*self.readout_time),
......
......@@ -669,7 +669,7 @@ def produceCR_Map(xLen, yLen, exTime, cr_pixelRatio, gain, attachedSizes, seed=2
CRmap[sly, slx] += crMatrix_n[oky,:][:,okx]
return CRmap.astype(np.int32);
return CRmap.astype(np.int32), cr_event_size
def ShutterEffectArr(GSImage, t_shutter=1.3, dist_bearing=735, dt=1E-3):
......
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