forked from cyangiraffe/nudetect
-
Notifications
You must be signed in to change notification settings - Fork 1
/
noise_advanced_example.py
43 lines (30 loc) · 988 Bytes
/
noise_advanced_example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import numpy as np
import matplotlib.pyplot as plt
from nudetect import Noise
noise = Noise('/disk/lif2/spike/detectorData/'
'H117/20180803_H117_noise_-10C_-500V/20180803_H117_noise_-10C_-500V.fits',
data_dir='/users/jmsander/outputs/{}/noise/data',
plot_dir='/users/jmsander/outputs/{}/noise/plots',
detector='H117',
voltage=-500,
temp=5)
noise.select_detector_region(5, 5, 10, 10)
noise.load_raw_data()
#
# Processing data
#
# Generating both count and FWHM data for each pixel.
noise.gen_quick_noise(plot_subdir='pixels')
noise.gen_full_noise(save_plot=True, plot_subdir='pixels')
#
# Plotting
#
# Plotting a pixel heatmap and histogram of count data wrt pixels.
noise.plot_pixel_map('Count')
noise.plot_pixel_hist('Count')
# Plotting a pixel heatmap and histogram using the FWHM of the
# Gaussian fitted to the noise spectrum.
noise.plot_pixel_map('FWHM')
noise.plot_pixel_hist('FWHM')
noise.plot_pixel_map('Mean')
noise.plot_pixel_hist('Mean')