Documentation of dark processing script¶
Script’s name: glint_dark.py
This script generates the average dark used in the signal processing of datacube.
dark
means background noise in the detector.
It is measured when no light is collected by the pixels.
It relies on the library GLINT Pipeline’s classes to work.
- The products are:
- average dark frame
- average dark per channel
- Some monitoring data can be created:
- histogram of dark on the whole frame on the whole datacube (hdf5 file)
- optimal parameters from a Gaussian fitting of this histogram (hdf5 file)
- histogram of the dark per channel on the whole datacube (hdf5 file)
- Evolution of the dark in different areas of the frame along the frame-axis of the datacube (non-saved plot)
This script is used in 3 steps.
- First step: simply change the value of the variables in the Settings section:
- save: boolean,
True
for saving products and monitoring data,False
otherwise - monitor: boolean,
True
for creating histogram of the background noise and plotting them - nbfiles: 2-tuple of int, set the bounds between which the dark files are selected.
None
is equivalent to 0 if it is the lower bound or -1 included or it is the upper one. - edge_min, edge_max: minimal left-edge and maximal right-edge of the histograms.
- save: boolean,
- Second step: change the value of the variables in the Inputs and Outputs sections:
- datafolder: folder containing the datacube to use.
- dark_list: list of files in datafolder to open.
- date: str, date of the acquisition of the data in format YYY-MM-DD.
Third step: start the script and let it run.
-
glint_dark.
gaus
(x, a, x0, sig)¶ Computes a Gaussian curve
Parameters: x: values where the curve is estimated.
a: amplitude of the Gaussian.
x0: location of the Gaussian.
sig: scale of the Gaussian.
Returns: Gaussian curve.
-
glint_dark.
getHistogram
(data, bins)¶ Returns the histogram of
data
according to thebins
.Parameters: data: array of N element, data used to create the histogram, if dim>1, it is flattened
bins: array of N+1 elements, left bin edges of the histogram. The last element is the right edge of the last bin.
Returns: Non-normalized histogram.
-
glint_dark.
saveFile
(path, data, mode='channel')¶ Save the histogram of the dark into a HDF5 file.
Parameters: path: string, path of the file to save. Must contain the name of the file+extension.
dic_data : dictionary of data to save
date : string, date of the acquisition of the data (YYYY-MM-DD)
mode: str, if
channel
, the information per channel is saved instead of the information got from the whole frameReturns: a HDF5 file in the specified path with the following tree.