Converts SMP measurement files (*.pnt
) into CSV containing all data points (Depth and Penetration Force) plus a multi-line header containing time, latitude, longitude and other site-specific information. A depth/force profile quicklook is also generated as a PNG file.
The SMP class methods retrieve_header
, extract_data
and general function xcorr
are from the excellent SnowMicroPyn tool by Sascha Grimm. SnowMicroPyn is licensed under the GNU General Public License version 3.0 (GPLv3).
The detect_peaks
and associated _plot
helper functions are from the Biomechanics and Motor Control repo by Marcos Duarte. BMC is licensed under the MIT Licence
The following assumes you have a working Python 2.7 or 3.6/3.7/3.8 environment including pip
Use the install-from-github functionality from pip
to install from the master
branch:
pip install https://github.com/m9brady/SMP_to_CSV/archive/master.zip
Make a local clone of this repo, navigate to where it is located and run the following command to install to your currently-active python environment:
pip install .
When snowmicrotoolset
is installed, a new utility is added to your Python scripts path: smp_to_csv
. Simply run this tool with no arguments to get some help documentation on what it needs to function:
$ smp_to_csv
***************************
** No input folder given **
***************************
Usage: smp_to_csv [OPTIONS]
Convert SLF .PNT files to CSV/PNG formats
Options:
-i, --input_folder TEXT Location of input .smp files
-o, --output_folder TEXT Location of output csv/png files [default: ./outdata]
--version Show the version and exit.
-h, --help Show this message and exit.
After installing snowmicrotoolset
you should now be able to import the SMP class in a python interpreter or script using the following:
>>> from snowmicrotoolset import SMP
>>> p = SMP('path/to/pnt_file.pnt')
This dataset is licensed under the Open Government License of Canada and is subject to the Copyright Act of Canada. Additional information can be found at the Government of Canada's Open Government portal