Package: scintillometry
ScintillometryDevelopment branch:Analyse data & 2D flux footprints from Scintec's BLS scintillometers.This project started life as part of a field course. If you spot any missing citations or licences pleaseopen an issue.Comprehensive documentation is availablevia ReadTheDocs.Processing Scintillometry Data in Complex TerrainScintillometryis configured for scintillometer experiments in Austria using public or local data (ZAMG, InnFLUX), but is easily modified to work with other data sources. Note that external data sources may have different licensing constraints.The package is currently in alpha and may change or break often. Support is only available for Python 3.8+ on debian-based Linux distros.InstallationScintillometrysupports package installation with pip, or from source as an editable with pip or conda.Installing as an editable is recommended, as it allows you to call command line arguments directly on the package instead of writing a frontend.Install from Source with Conda/MambaCreate or activate your preferred conda environment and run:gitclonehttps://github.com/gampnico/scintillometry.git
makeinstallThat's it!Install the package with optional dependencies:makeinstall-tests# install with dependencies for testsmakeinstall-docs# install and build local documentationmakeinstall-all# install with tests and build local documentationmakeinstall-dev# install with dependencies for developmentInstallation uses conda if mamba is unavailable. Micromamba may also work, but is not currently supported.Install with PipIf conda/mamba are not your package managers, then run:python3-mpipinstall--upgradescintillometryNote that this installation method does not provide documentation or a Makefile, and you cannot easily use the package from the command line.To install from source (recommended):gitclonehttps://github.com/gampnico/scintillometry.git
pipinstall-e.Install the package with optional dependencies:pipinstall-e.[tests]pipinstall-e.[docs]pipinstall-e.[tests,docs]# no whitespace after commapipinstall-e.[dev]FeaturesScintillometryData processing:Parse scintillometry data from Scintec's BLS series of large aperture scintillometers (.mnd files).Recalibrate data if the scintillometer was incorrectly set up (e.g. wrong dip switch settings).Parse topographical data as path transect.Parse meteorological data.Parse innFLUX and HATPRO data.Metrics:Calculate effective path heights under various stability conditions.Derive CT2values from Cn2if these were not collected.Estimate the time when stability conditions change.Estimate the boundary layer height.Compute parameters such as Obukhov length, friction velocity, etc.Compute kinematic and sensible heat fluxes. Supports free convection and iteration with MOST: several sets of coefficients are available for MOST functions, based on previous studies.Visualisation:Produces time series of scintillometry and meteorological data.Produces vertical profiles.Produces plots for derived or iterated variables.Produces comparisons between calculated parameters and external data sources.Currently implemented MOST functions:an1988: E.L. Andreas (1988),DOI: 10.1364/JOSAA.5.000481li2012: D. Li et al. (2012),DOI:10.1007/s10546-011-9660-ywy1971: Wyngaard et al. (1971),DOI: 10.1364/JOSA.61.001646wy1973: Wyngaard et al. (1973) in Kooijmans and  Hartogensis (2016),DOI: 10.1007/s10546-016-0152-yma2014: Maronga et al. (2014),DOI: 10.1007/s10546-014-9955-xbr2014: Braam et al. (2014),DOI: 10.1007/s10546-014-9938-yFootprint Climatology (Roadmap)These features are under development.Metrics:Process 2D flux footprints generated by Natascha Kljun's online model, availablehere.Adjust topography and stitch footprints together.Visualisation:Produce regression plots between calculated parameters and external data sources.Overlay stitched footprints onto map.WorkflowExample WorkflowThis package supports SRun and Austrian-sourced data (ZAMG, InnFLUX) out-of-the-box. If your scintillometry readings were taken in Austria, useDGM 5m datato generate topographical data for the scintillometer's path coordinates. Then generate the path transects necessary for calibrating the scintillometer.Scintillometer path coordinates must be accurate. Incorrectly generated topographical data leads to poor calibration and nonsense results!List all available arguments with:python3./src/scintillometry/main.py-h
makecommands# if you installed from sourceNavigate to the package root in the terminal. Calculate and plot surface
sensible heat fluxes using MOST in CET, with coefficients from Andreas (1988):python3./src/scintillometry/main.py-i"./<path_to_input>/<bls_data>.mnd"\-p"./<path_to_transect>/<transect_data>.csv"-t"CET"If you are not using the scintillometer in Austria, you will need to find and parse topographical and meteorological data yourself. Add parsing functions to classes inwrangler/data_parsing.pyto parse data from other scintillometers, organisations, or countries. A step-by-step guide on how to do this is given in the module's docstring.Make Things SimpleIf you installed from source, the provided Makefile has many uses. View all the available commands:makehelp# display help for Makefile targetsmakecommands# display help for scintillometryRun from TerminalFrom the package root, pass arguments like so:src/scintillometry/main.py[-h][-i<input_data>][-p<path_data>][-d][...][-v]Import as PackageScintillometryand its submodules can be imported as Python modules:fromscintillometry.wrangler.data_parserimportWranglerParsingparser=WranglerParsing()dataframe=parser.scintillometer.parse_scintillometer(file_path="./data.mnd")weather=parser.weather.parse_weather(file_path="./weather.csv")weather=parser.weather.transform.change_index_frequency(weather,"60S")MOST functions are stored in their respective class:fromscintillometry.backend.iterationsimportIterationMostiteration=IterationMost()iteration.most_method(dataframe,eff_h,stability,coeff_id="an1988")Many classes initialise atmospheric constants using the AtmosConstants class:fromscintillometry.metrics.calculationsimportMetricsWorkflowfromscintillometry.backend.constantsimportAtmosConstantsworkflow=MetricsWorkflow()kelvin=workflow.constants.kelvin# 273.15assertisinstance(workflow.constants,AtmosConstants)# TrueFor more information see the API section of the documentation.AcknowledgementsThis project would not be possible without the invaluable contributions from Josef Zink, Dr. Manuela Lehner, and Dr. Helen Ward.