"# Validate the constants availability and raise/warn correspondingly. \n",
"missing_dark_constants = set(\n",
" c for c in [\"OffsetCCD\", \"NoiseCCD\", \"BadPixelsDarkCCD\"] if c not in metadata.keys())\n",
" c for c in pnccd_cal.dark_calibrations if c not in metadata.keys())\n",
"\n",
"if missing_dark_constants:\n",
" raise KeyError(\n",
...
...
%% Cell type:markdown id: tags:
# pnCCD Data Correction #
Authors: DET Group, Modified by Kiana Setoodehnia - Version 5.0
The following notebook provides offset, common mode, relative gain, split events and pattern classification corrections of images acquired with the pnCCD. This notebook *does not* yet correct for charge transfer inefficiency.
panel_x_label='Row Stat (ADU)',panel_y_label='Column Stat (ADU)',
title='Image of Single Events (First Frame of the First Sequence)')
step_timer.done_step("Plotting")
```
%% Cell type:code id: tags:
``` python
# Resetting the histogram calculators:
histCalRaw.reset()
histCalOffsetCor.reset()
ifcorr_bools.get('common_mode'):
histCalCommonModeCor.reset()
ifcorr_bools.get('relgain'):
histCalGainCor.reset()
ifcorr_bools.get('pattern_class'):
histCalPcorr.reset()
histCalPcorrS.reset()
```
%% Cell type:markdown id: tags:
Next, the corrected event patterns are read from the patterns/dataset created previously and are separated into 4 different categories (singles, doubles, triples and quadruples) using the pattern indices. However, this is done only for one sequence, corresponding to the seq_num variable, as an example.
Note that the number of bins and the bin range for the following histograms may be different from those presented above (depending on gain) to make the counts more noticible and the peaks more defined.
If you are interested in plotting the events from all sequences or the spectra of half of the sensor, execute the spectra_pnCCD_NBC.ipynb notebook.