print('Missed {:d} out of {:d} trains'.format(n_empty_trains,n_tr))
print('Lost {:d} images out of {:d}'.format(n_empty_sc,this_run_mcells*(n_tr-n_empty_trains)))
else:
print('missing G{:01d}'.format(i))
```
%% Cell type:markdown id: tags:
## Offset and Noise Maps ##
Below offset and noise maps for the high ($g_0$) gain stage are shown, alongside the distribution of these values. One expects block-like structures mapping to the ASICs of the detector
"db_output = False # Output constants to the calibration database\n",
"local_output = False # output constants locally"
"local_output = True # output constants locally"
]
},
{
...
...
%% Cell type:markdown id: tags:
# pnCCD Dark Characterization
Author: DET Group, Version 1.0
The following notebook provides dark image analysis of the pnCCD detector.
Dark characterization evaluates offset and noise of the detector and gives information about bad pixels. Resulting maps are saved as .h5 files for a latter use.
Characterization of dark images with purpose to create dark maps (offset, noise and bad pixel maps) is an iterative process. Firstly, initial offset and noise maps are produced from raw dark data.
%% Cell type:code id: tags:
``` python
fordatainreader.readChunks():
data=data.astype(np.float32)
dx=np.count_nonzero(data,axis=(0,1))
data=data[:,:,dx!=0]
histCalRaw.fill(data)
#Filling calculators with data
noiseCal.fill(data)
offsetMap=noiseCal.getOffset()#Produce offset map
noiseMap=noiseCal.get()#Produce noise map
noiseCal.reset()#Reset noise calculator
print("Initial maps were created")
```
%% Cell type:code id: tags:
``` python
#**************OFFSET MAP HISTOGRAM***********#
ho,co=np.histogram(offsetMap.flatten(),bins=700)
do={'x':co[:-1],
'y':ho,
'y_err':np.sqrt(ho[:]),
'drawstyle':'bars',
'color':'cornflowerblue',
}
fig=xana.simplePlot(do,figsize='1col',aspect=2,
x_label='Offset (ADU)',
y_label="Counts",y_log=True,
)
#*****NOISE MAP HISTOGRAM FROM THE OFFSET CORRECTED DATA*******#