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: |