|
fosanalysis
A framework to evaluate distributed fiber optic sensor data
|
Utility functions for Luna ODiSI 6100 TSV files. More...
Functions | |
| None | tsv_extract_time_intervals (str input_file, str output_file, list list_of_time_intervals) |
Extracts the parts of the measurement data into smaller .tsv files. | |
| tsv_print_metadata_table (str root_dir, str pattern="*", list keys=["Channel", "Sensor Name", "Sensor Serial Number", "Length (m)", "Date"], str table_style="Markdown") | |
Read the metadata from all files matching the pattern in a given directory root_dir, extract selected metadata entries (keys) and display them in a nicely formatted table. | |
Utility functions for Luna ODiSI 6100 TSV files.
| None fosanalysis.datahandling.tsvutils.tsv_extract_time_intervals | ( | str | input_file, |
| str | output_file, | ||
| list | list_of_time_intervals ) |
Extracts the parts of the measurement data into smaller .tsv files.
The parts are given by time intervals. The file header is copied as is. A measurement line is copied to the output_file if its timestamp \(t\) falls within at least one of the given time intervals: \(t_{\mathrm{s}} \leq t \leq t_{\mathrm{e}}\). Overlapping intervals are supported.
output_file is overwritten without asking for confirmation!| input_file | String with the path of the input file (.tsv) |
| output_file | String with the path of the output file (.tsv) |
| list_of_time_intervals | List of time intervals. Each interval is given as tuple of its the limits (start time \(t_{\mathrm{s}}\), end time \(t_{\mathrm{e}}\)). Both limits can be either datetime.datetime or None. Setting one or both of the limits to None results in an (half) unlimited open interval. It is not necessary that the exact interval boundaries appear in the data. |
Definition at line 17 of file tsvutils.py.
| fosanalysis.datahandling.tsvutils.tsv_print_metadata_table | ( | str | root_dir, |
| str | pattern = "*", | ||
| list | keys = ["Channel", "Sensor Name", "Sensor Serial Number", "Length (m)", "Date"], | ||
| str | table_style = "Markdown" ) |
Read the metadata from all files matching the pattern in a given directory root_dir, extract selected metadata entries (keys) and display them in a nicely formatted table.
Use this function to quickly gain an overview over the content of a directory with measurement files exported to TSV format by Luna ODiSI. The file filtering is done with Python built-in module glob. The table formatting is done with brplotviz.
| root_dir | Directory to scan for TSV files matching the pattern. |
| pattern | File name pattern to select TSV files, according to the specification of the Python glob module. |
| keys | List of dictionary keys to extract. These are the description texts in the file header. |
| table_style | Table output style supported by brplotviz. Please consider the brplotviz documentation for available options. |
Definition at line 54 of file tsvutils.py.