Commit c2287032 authored by GZhao's avatar GZhao
Browse files

update flat refdata

parent bff1392e
Pipeline #8527 passed with stage
in 0 seconds
...@@ -325,7 +325,7 @@ class CpicVisEmccd(object): ...@@ -325,7 +325,7 @@ class CpicVisEmccd(object):
self.switch = { self.switch = {
'bias_vp': True, 'bias_vp': True,
'bias_hp': True, 'bias_hp': True,
'bias_ci': True, 'bias_ci': False,
'bias_shift': True, 'bias_shift': True,
'cic': True, 'cic': True,
'dark': True, 'dark': True,
...@@ -337,7 +337,8 @@ class CpicVisEmccd(object): ...@@ -337,7 +337,8 @@ class CpicVisEmccd(object):
'cosmicray': True, 'cosmicray': True,
'blooming': True, 'blooming': True,
'em_blooming': True, 'em_blooming': True,
} 'poisson': True,
}
self.dark_file = cpism_refdata + '/camera/emccd_dark_current.fits' self.dark_file = cpism_refdata + '/camera/emccd_dark_current.fits'
self.flat_file = cpism_refdata + '/camera/emccd_flat_field.fits' self.flat_file = cpism_refdata + '/camera/emccd_flat_field.fits'
...@@ -613,7 +614,6 @@ class CpicVisEmccd(object): ...@@ -613,7 +614,6 @@ class CpicVisEmccd(object):
log.debug( log.debug(
f"nonlinear effect added with coefficient {nonlinear_coefficient}") f"nonlinear effect added with coefficient {nonlinear_coefficient}")
image += (image / fullwell)**2 * nonlinear_coefficient * fullwell image += (image / fullwell)**2 * nonlinear_coefficient * fullwell
return image return image
def time_syn(self, t, readout=True, initial=False): def time_syn(self, t, readout=True, initial=False):
...@@ -836,10 +836,15 @@ class CpicVisEmccd(object): ...@@ -836,10 +836,15 @@ class CpicVisEmccd(object):
img_bias = np.zeros(self.bias_shape, dtype=int) img_bias = np.zeros(self.bias_shape, dtype=int)
if self.switch['poisson']:
image = np.random.poisson(image)
else:
image = np.round(image).astype(int)
img_bias[ img_bias[
self.pscan2: -self.oscan2, self.pscan2: -self.oscan2,
self.pscan1: -self.oscan1 self.pscan1: -self.oscan1
] = np.random.poisson(image) ] = image
image = img_bias image = img_bias
if self.switch['shutter']: if self.switch['shutter']:
...@@ -862,6 +867,8 @@ class CpicVisEmccd(object): ...@@ -862,6 +867,8 @@ class CpicVisEmccd(object):
em_fix = self.em_fix_fuc_fit(emgain) * emgain em_fix = self.em_fix_fuc_fit(emgain) * emgain
image = np.random.gamma(image, em_fix) + image * (emgain - em_fix) image = np.random.gamma(image, em_fix) + image * (emgain - em_fix)
fits.writeto("image.fits", image, overwrite=True)
if self.switch['em_blooming']: if self.switch['em_blooming']:
image = self.emregester_blooming(image) image = self.emregester_blooming(image)
......
band: f662 band: f662
emgain: 200 emset: 180
emset: -1 expt: 10
expt: 100
nframe: 2 nframe: 2
obsid: '42100000002' obsid: '42100000002'
rotation: 0 rotation: 0
...@@ -17,7 +16,7 @@ gnc_info: ...@@ -17,7 +16,7 @@ gnc_info:
POS_ANG0: 0.0 POS_ANG0: 0.0
POSI0_X: 35 POSI0_X: 35
POSI0_Y: 49 POSI0_Y: 49
POSI0_Z: 18 POSI0_Z: 18cd
VELO0_X: 36 VELO0_X: 36
VELO0_Y: 24 VELO0_Y: 24
VELO0_Z: 18 VELO0_Z: 18
......
band: f661 band: f661
emgain: 200 # emgain: 100
emset: -1 emset: 180
expt: 100 expt: 30
nframe: 2 nframe: 2
obsid: '40100000005' obsid: '40100000005'
rotation: 30 rotation: 30
......
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