Code related to readout and analysis of data taken with a Bartington Magnetometer
Required submodule daqhats need to be installed in the virtual environment. See DAQHATS.
Other required libraries for spectral analysis include:
dashfor web-ui.jupyterfor notebooks.polarsfor large csv reading.h5pyfor hdf5 file handling.scipyfor spectrograms.argparsefor python argument parsing.
- Start Screen session:
screen -S <session_name>
- Environment activation:
cd gdzhao
source .env/bin/activate
- Start Acquisition (each in individual screen sessions):
Monitor raspberry-pi health using python monitorpi.py -s <scan_rate> <save_dir>. A recommendation is -s 0.5 use default. Saves in save_dir/logs/ directory.
Scan magnetometer using python scan_save_rawh5_fault_tolerant.py -s <scan_rate> -t <t_measure> <save_dir>.
- QuickStart for watchdog session.
python watchacq.py -s <scan_rate> -t <t_measure> <save_drdirectly starts an acquisition in scriptscan_save_rawh5_fault_tolerant.pyin a separate screen session. This script will watch the running status of the acquisition script and attempt to restart the screen session and the script once error occurs.
scan_save_rawh5.pysaves one hdf5 file with continuous writing. Data is raw adc code without calibration in uint 16 format.scan_save_rawh5_fault_tolerant.pyscan at given scanrate, by default dumps hdf5 file parts every 1 hour. Data is raw adc code in uint16 format.
continuous_scan_save.pysaves with either hdf5 or csv. The acquisition length should not exceed the memory limit of the raspberry-pi.continuous_scan_saveh5.pysaves with hdf5 only. The acquisition length should not exceed the memory limit of the raspberry-pi.continuous_scan_savecsv.pysaves line by line the readout. Has low memory usage and can handle longer durations.
monitorpi.pysaves a csv of cpu temperature, external voltage, inbox temperature, inbox humidity, inbox pressure.
magnetofft.pyuses fft to compute fft amplitude. New version ofmagnetofft.pycontain Power Spectrum (PS) and Power Spectral Density (PSD) calculation from FFT_report. Also contains plotting routines for PS and PSD.
pspsdbatch.pycomputes and stores 1-hour ps-psd results, have options to save either each segment or the mean of each hour.