<jupyter_start><jupyter_text>Load and process some slow signal data<jupyter_code>pwd
from ssm.core import pchain
from ssm.core.util_pmodules import Aggregate
from ssm.pmodules import *

# initializing our process chain
data_proc = pchain.ProcessingChain()

reader = Reader('/data/CHECS-data/nsbcal/40steps_NSB-Cal40_2019-04-26_11.08.hdf5')
data_proc.add(reader)
#This module removes incomplete frames and marks bad and unstable pixels
frame_cleaner = PFCleaner()
data_proc.add(frame_cleaner)
# A simple flat field computation based on the first 7000 frames
sff = SimpleFF(0,7000)
data_proc.add(sff)

#The Aggregate module collects the computed object from the frame
aggr = Aggregate(["raw_resp","simple_ff"])
data_proc.add(aggr)

# Simple visualization of the chain
print(data_proc)

#Execute the chain
data_proc.run()<jupyter_output><empty_output><jupyter_text>Plot the processed data<jupyter_code>from CHECLabPy.plotting.camera import CameraImage

data = aggr.aggr["raw_resp"][0]
ff = aggr.aggr['simple_ff'][0]

time_averaged = np.mean(data.data,axis=0)
camera_averaged = np.nanmean(data.data-ff,axis=1)
#A time series plot
plt.figure()
plt.plot(data.time-data.time[0],camera_averaged)

plt.xlabel('Time since run start (s)')
plt.ylabel("Average amplitude (mV)")

#Different average camera images
camera = CameraImage(data.xpix, data.ypix, data.size)
camera.image = time_averaged
camera.add_colorbar('Amplitdue (mV)')
camera.ax.set_title('Raw Data')

camera = CameraImage(data.xpix, data.ypix, data.size)
camera.image = time_averaged -ff
camera.add_colorbar('Amplitdue (mV)')
camera.ax.set_title('Flat fielded')

camera = CameraImage(data.xpix, data.ypix, data.size)
camera.image = ff
camera.add_colorbar('Amplitdue (mV)')
camera.ax.set_title('Flat field coefficents')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11833333333333333, 'fraction_numerical': 0.017222222222222222, 'mean_word_length': 6.8304347826086955, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '342852', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 678, 'n_tokens_neox': 645, 'n_words': 142, 'path': 'Simple processing and plotting.ipynb', 'repo_name': 'wolke26/SSM-analysis', 'size': '1800'}