API
Main module
In scintillometry.main.py
Analyse data & 2D flux footprints from Scintec’s BLS scintillometers.
Usage: src/main.py [-h] [-i <input_data>] [-d] [...] [-v]
Options and arguments (and corresponding environment variables):
- Required arguments:
- -i, --input <path>
Path to raw BLS450 data.
- -t, --transect <path>
Path to topographical path transect.
- Optional switches:
- -h, --help
Show this help message and exit.
- -z, --dry-run
Dry run of model.
- -v, --verbose
Verbose mode.
- Optional arguments:
- -e, --eddy <str>
Path to eddy covariance data (innFLUX).
- -p, --profile <str>
Path prefix to vertical temperature and humidity measurements (HATPRO).
- -l, --local-timezone <str>
Convert to local timezone. Default “CET”.
- -c, --calibrate <float float>
Recalibrate path lengths.
- -r, --regime <str>
Set default stability condition.
- -m, --most-name <str>
ID of MOST coefficients. Default “an1988”.
- -s, --switch-time <str>
Override local time of switch between stability regimes.
- -a, --algorithm <str>
Algorithm used to calculate switch time. Default “sun”.
- -k, --station-id <str>
ZAMG station ID (Klima-ID). Default 11803.
- --location <str>
Location of experiment. Overrides any other location metadata.
- --beam-wavelength <int>
Transmitter beam wavelength, nm. Default 850 nm.
- --beam-error <int>
Transmitter beam wavelength error, nm. Default 20 nm.
- scintillometry.main.main()[source]
Parses command line arguments and executes analysis.
Converts command line arguments into kwargs. Imports and parses scintillometer, weather, and transect data. If the appropriate arguments are specified:
Parses vertical measurements
Calculates sensible heat fluxes
Compares calculated fluxes to external data.
The majority of kwarg expansions should occur in this module. Do not rely on kwargs for passing arguments between backend modules.
- scintillometry.main.perform_analysis(datasets, **kwargs)[source]
Analyses flux data.
Calculates and plots parsed data, and optionally compares it to third-party data.
Defaults for keyword arguments only apply if the kwargs are passed via command line arguments.
- Parameters:
datasets (dict) – Parsed and labelled datasets for scintillometry measurements, weather observations, topography, and optionally vertical measurements.
- Keyword Arguments:
eddy_path (str) – Path to eddy covariance measurements. Default None.
regime (str) – Target stability condition. Default None.
timezone (str) – Local timezone of the measurement period. Default “CET”.
most_name (str) – MOST coefficients for unstable and stable conditions. Default “an1988”.
method (str) – Method to calculate switch time. Default “sun”.
switch_time (Union[str, pd.Timestamp]) – Local time of switch between stability conditions. Overrides <method>. Default None.
location (str) – Location of data collection. Default empty string.
beam_wavelength (int) – Transmitter beam wavelength, nm. Default 880 nm.
beam_error (int) – Transmitter beam error, nm. Default 20 nm.
- Returns:
Passes input datasets. If a path to eddy covariance data is provided, adds the key “eddy” containing the parsed eddy covariance data.
- Return type:
dict
- scintillometry.main.perform_data_parsing(**kwargs)[source]
Parses data from command line arguments.
- Keyword Arguments:
bls_path (str) – Path to a raw .mnd data file using FORMAT-1.
transect_path (str) – Path to processed transect. The data must be formatted as <path_height>, <normalised_path_position>. The normalised path position maps to: [0: receiver location, 1: transmitter location].
calibration (list) – Contains the incorrect and correct path lengths. Format as [incorrect, correct].
station_id (str) – ZAMG weather station ID (Klima-ID). Default 11803.
timezone (str) – Local timezone during the scintillometer’s operation. Default “CET”.
profile_prefix (str) –
Path to vertical measurements. For HATPRO Retrieval data there should be two HATPRO files ending with “humidity” and “temp”. The path should be identical for both files, e.g.:
./path/to/file_humidity.csv ./path/to/file_temp.csv
would require file_path = “./path/to/file_”. Default None.
- Returns:
Parsed and labelled datasets for scintillometry measurements, weather observations, and topography.
- Return type:
dict
- scintillometry.main.user_argumentation()[source]
Parses user arguments when run as main.
- Required arguments:
- -i, --input <path>
Path to raw BLS450 data.
- -t, --transect <path>
Path to topographical path transect.
- Optional switches:
- -h, --help
Show this help message and exit.
- -z, --dry-run
Dry run of model.
- -v, --verbose
Verbose mode.
- Optional arguments:
- -e, --eddy <str>
Path to eddy covariance data (InnFLUX).
- -p, --profile <str>
Path prefix to vertical temperature and humidity measurements (HATPRO).
- -l, --local-timezone <str>
Convert to local timezone. Default “CET”.
- -c, --calibrate <float float>
Recalibrate path lengths.
- -r, --regime <str>
Set default stability condition.
- -m, --most-name <str>
ID of MOST coefficients. Default “an1988”.
- -s, --switch-time <str>
Override local time of switch between stability regimes.
- -a, --algorithm <str>
Algorithm used to calculate switch time. Default “sun”.
- -k, --station-id <str>
ZAMG station ID (Klima-ID). Default 11803.
- --location <str>
Location of experiment. Overrides any other location metadata.
- --beam-wavelength <int>
Transmitter beam wavelength, nm. Default 850 nm.
- --beam-error <int>
Transmitter beam wavelength error, nm. Default 20 nm.
- Returns:
Namespace of user arguments.
- Return type:
argparse.Namespace
Subpackages
- Wrangler
- Metrics
- Submodules
- Calculations module
MetricsFlux
MetricsFlux.constants
MetricsFlux.plotting
MetricsFlux.derivation
MetricsFlux.construction
MetricsFlux.iteration
MetricsFlux.append_vertical_variables()
MetricsFlux.calculate_switch_time()
MetricsFlux.compare_lapse_rates()
MetricsFlux.construct_flux_dataframe()
MetricsFlux.get_boundary_height()
MetricsFlux.get_elbow_point()
MetricsFlux.get_nearest_time_index()
MetricsFlux.get_regression()
MetricsFlux.get_switch_time()
MetricsFlux.get_switch_time_vertical()
MetricsFlux.iterate_fluxes()
MetricsFlux.match_time_at_threshold()
MetricsFlux.plot_derived_metrics()
MetricsFlux.plot_iterated_metrics()
MetricsFlux.plot_lapse_rates()
MetricsFlux.plot_switch_time_stability()
MetricsTopography
MetricsWorkflow
- References
- Module contents
- Visuals
- Submodules
- Plotting module
FigureFormat
FigureFormat.get_date_and_timezone()
FigureFormat.get_site_name()
FigureFormat.initialise_formatting()
FigureFormat.label_selector()
FigureFormat.merge_label_with_unit()
FigureFormat.merge_multiple_labels()
FigureFormat.parse_formatting_kwargs()
FigureFormat.plot_constant_lines()
FigureFormat.set_xy_labels()
FigureFormat.title_plot()
FigurePlotter
FigurePlotter.plot_comparison()
FigurePlotter.plot_convection()
FigurePlotter.plot_generic()
FigurePlotter.plot_innflux()
FigurePlotter.plot_iterated_fluxes()
FigurePlotter.plot_merged_profiles()
FigurePlotter.plot_scatter()
FigurePlotter.plot_time_series()
FigurePlotter.plot_vertical_comparison()
FigurePlotter.plot_vertical_profile()
FigurePlotter.save_figure()
FigurePlotter.setup_plot_data()
- Module contents
- Backend
- Submodules
- Constants module
AtmosConstants
AtmosConstants.alpha11
AtmosConstants.alpha12
AtmosConstants.lamda
AtmosConstants.lamda_error
AtmosConstants.at_opt
AtmosConstants.aq_opt
AtmosConstants.most_coeffs_ft
AtmosConstants.cp
AtmosConstants.dalr
AtmosConstants.g
AtmosConstants.k
AtmosConstants.kelvin
AtmosConstants.latent_vapour
AtmosConstants.r_dry
AtmosConstants.r_vapour
AtmosConstants.ratio_rmm
AtmosConstants.ref_pressure
AtmosConstants.rho
AtmosConstants.convert_pressure()
AtmosConstants.convert_temperature()
AtmosConstants.get()
AtmosConstants.overwrite()
- Transects module
- Derivations module
- Constructions module
ProfileConstructor
ProfileConstructor.constants
ProfileConstructor.extrapolate_air_pressure()
ProfileConstructor.extrapolate_column()
ProfileConstructor.get_air_pressure()
ProfileConstructor.get_bulk_richardson()
ProfileConstructor.get_environmental_lapse_rate()
ProfileConstructor.get_gradient()
ProfileConstructor.get_lapse_rates()
ProfileConstructor.get_mixing_ratio()
ProfileConstructor.get_moist_adiabatic_lapse_rate()
ProfileConstructor.get_n_squared()
ProfileConstructor.get_potential_temperature()
ProfileConstructor.get_reduced_pressure()
ProfileConstructor.get_static_stability()
ProfileConstructor.get_vertical_variables()
ProfileConstructor.get_virtual_temperature()
ProfileConstructor.get_water_vapour_pressure()
ProfileConstructor.non_uniform_differencing()
- Iterations module
IterationMost
IterationMost.constants
IterationMost.calc_obukhov_length()
IterationMost.calc_theta_star()
IterationMost.calc_u_star()
IterationMost.check_signs()
IterationMost.get_most_coefficients()
IterationMost.momentum_stability()
IterationMost.momentum_stability_stable()
IterationMost.momentum_stability_unstable()
IterationMost.most_iteration()
IterationMost.most_method()
IterationMost.similarity_function()
- Deprecations module
- References
- Module contents