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

Module contents