HOME ESR EXPERIMENTS LABS etc
E121 E127 E132 E125 E143 laser_cooling_2021 E142 Ê128 E146 E0052 E0018 E0028 E0038 E0075 E0203_E0018
  masses & isomeres 2025  Not logged in ELOG logo
Message ID: 137     Entry time: Fri Apr 4 01:12:03 2025
Author: Shahab 
Category: Analysis 
Subject: NPZ add up script 
Since there are many NPZ summer scripts around, I thought I would also share mine. This one takes advantage of the power of filelists and has a progress bar. Creating file lists gives you more control over the range of analyzed data, for example, the command:

find /data.local/G22-00018_00203/results/analyzers/RSA02 -name "RSA02-2025.04.04.01.??.??.???.tiq_spectrogram.npz" > filelist.txt

makes a file list of everything file that was produced during the second hour of the morning of the April 4th. You can fine tune the wildcards according to the time range you are interested in.


then just call the script by:

python npz_addup.py filelist.txt

you can also provide time cuts, like this:

python npz_addup.py --time-cut 0.14 filelist.txt

which will cut away first 0.14 seconds of the spectrogram. Without time cuts, it will do over the whole range.


It creates 4 type of files:

summed_spectrum.npz --> for use with RionID for PID
summed_spectrogram.npz --> for general use / analysis
summed_spectrum.png --> for general view
summed_spectrogram.png --> for detailed view

if time-cut is provided, the filenames will have a "_time_cut" suffix at the end.


Here is the link to the script:

https://github.com/xaratustrah/e0018_e0203_scripts/blob/main/npz_addup.py

examples are in attachment:
Attachment 1: summed_spectrogram_time_cut.png  170 kB  Uploaded Fri Apr 4 15:44:34 2025  | Hide | Hide all
summed_spectrogram_time_cut.png
Attachment 2: summed_spectrogram.png  255 kB  Uploaded Fri Apr 4 15:44:38 2025  | Hide | Hide all
summed_spectrogram.png
ELOG V3.1.5-fc6679b