Package: pyfocs
pyfocsversion==0.5.1.Overviewpyfocs is the University of Bayreuth Micrometeorology python library for processing Fiber Optic Distributed Sensing (FODS) data. It is intended to streamline the handling of large and long-term DTS setups.It automates the calibration and mapping of FODS data allowing the user to focus on the science. Calibration is robustly handled using thedtscalibration package(des Tombe, Schilperoort, and Bakker, 2020). pyfocs can robustly handle an arbitrary fiber geometry, number of reference sections, and fiber calibration setup (through the dtscalibration package).The library consists of the automation script (PyFOX.py) used to herd the data from raw format to physically labeled and calibrated data in the netcdf format (see figure). Unfortunately pyfocs only supports Silixa Distribute Temperature Sensing (DTS) devices, such as an Ultima or XT, at the moment. This library is built around thexarraypackage for handling n-dimensional data, especially in a netcdf format.Also included are a family of functions for calculating wind speed from FODS data as well as other common statistical techniques, data manipulation, and diagnostics plots for FODS. See the example notebooks for more details.Check out ourEGU2020 talkfor an overview of both libraries.PyFOX StepsData and the surrounding directory structure is assumed to follow this outline..Each Subdirectory corresponds to a particular step in the processing.Archives original.xmlfiles into specified time interval.Creates netcdfs of the raw data, including the instrument reported temperature, stokes intensity, and anti-stokes intensity. Dimensions of Length Along the Fiber,LAF, and time.Integrates external data streams and other reference data, performs step-loss corrections, performs the user-defined calibration based on des Tombe et al, (2020). Returns instrument reported temperature, calibrated temperature, log-power ratio of stoke and anti-stokes intensities, stokes intensity, anti-stokes intensities, and all data labels. Dimensions areLAFandtime. New coordinates specified by location type in the location library can be used to label the data along with anumber of labelsbynumber of LAFcoordinate.Converts data labels with physical coordinates. Drops the LAF label and only includes the physical location (xyz) andtime. Facilitates matching coordinates between sections for performing wind speed calculations along a commonx,y, andzcoordinate.InstallationThis installation assumes you have the anaconda distribution of python. If you do not have anaconda see the basictroubleshooting section.pyfocs can be installed by using:pip install pyfocswhich installs pyfocs plus all dependencies.If you encounter errors when running pyfocs using this method, we instead recommend installing from source. Download the source code from this repository (green button with "Clone or Download"), extract the package, navigate to the directory containing thesetup.pyfile, and install usingpip install ..Both methods should result in thePyFOX.pyscript being callable from the command line.Example notebooksWe detail most steps in the processing of DTS data and provide some pointers on best practices in our example notebooks. The notebooks refer to the example data stored in this repository.Example 1: raw data checkslooks at how to assess data quality as it comes out of the instrument.Example 2: calibrated data checkslooks at how to assess the calibration and what decisions are available. In also details how to refine mapping of physical labels for the last step.Example 3: final data checkslooks at how DTS data are labeled with physical coordinates, how to calculate wind speed, and shows one way of quickly viewing the data.Referencesdes Tombe, B.; Schilperoort, B.; Bakker, M. Estimation of Temperature and Associated Uncertainty from Fiber-Optic Raman-Spectrum Distributed Temperature Sensing. Sensors 2020, 20, 2235.Muppet ArchiverBatch script for scheduled archiving of.xmlfiles on the Silixa DTS devices. Why muppet? Unviersity of Bayreuth Micrometeorology names their Silixa devices after muppet characters. Requires an anaconda 3.* distribution of python. Task scheduler must point to the.batscript and not the python script.Troubleshooting/First time with pythonInstall the anaconda version of pythonhttps://www.anaconda.com/distribution/#download-sectionYou should be prompted to install python for your particular OS. Install a version >=3.6.PyYAML updatingAn error in an old version of pip stops the updating of PyYAML. If you get an error related to this library you can solve it with:pip install --ignore-installed PyYAMLWindows specific stuffYou will always need to use the anaconda power prompt or a similar environment. You will find it difficult/impossible to run python outside of the anaconda environment.Fromhttps://www.correlatedsolutions.com/support/index.php?/Knowledgebase/Article/View/85/1/running-python-scripts-from-anywhere-under-windowsFor the first time, windows asks what application to use to run *.py files.
Select python in Anaconda directory: make sure check box "Always use this app to open .py files" is checked
Click "More Apps"
Click "Look for another app on this PC"
Find path to anaconda python, e.g. "C:\Users\Your Name\Anaconda3\python"
Click "Open"
Click "OK"Other issues may be related to running the anaconda prompt without administrator issues.