4.11.1. thuner.analyze.mcs

Functions for analyzing MCSs. In particular, for implementing the methodologies presented in the following papers:

Short et al. (2023), Objectively diagnosing characteristics of mesoscale organization from radar reflectivity and ambient winds. https://dx.doi.org/10.1175/MWR-D-22-0146.1

Functions

process_velocities(output_directory[, ...])

Process winds and velocities for analysis.

quality_control(output_directory, ...[, ...])

Perform quality control on MCSs based on the provided options.

classify_all(output_directory, analysis_options)

Classify MCSs based on quadrants, as described in Short et al. (2023).

classify_angles(name, angles, category_labels)

Classify the quadrants based on the angles between the vectors.

classify_small_offsets(classified, x_offset, ...)

Classify small offsets as 'centered' if the offset is less than the minimum offset.

classify_ambiguous(classified, unambiguous)

Classify ambiguous classifications as 'ambiguous'.

pydantic model thuner.analyze.mcs.AnalysisOptions[source]

Bases: BaseOptions

Options for convective system analysis.

Fields:
Validators:

field max_area: float = inf

Maximum area of MCS in km^2.

Constraints:
  • gt = 0

field max_boundary_overlap: float = 0.001

Maximum fraction of system member object pixels touching boundary.

Constraints:
  • gt = 0

field min_area: float = 100.0

Minimum area of MCS in km^2.

Constraints:
  • ge = 0

field min_axis_ratio: float = 2

Minimum axis ratio of MCS.

Constraints:
  • ge = 0

field min_duration: float = 30

Minimum duration of MCS in minutes.

Constraints:
  • ge = 0

field min_major_axis_length: float = 25

Minimum major axis length of MCS in km.

Constraints:
  • ge = 0

field min_offset: float = 10

Minimum stratiform offset in km.

Constraints:
  • ge = 0

field min_relative_velocity: float = 2

Minimum relative velocity in m/s.

Constraints:
  • ge = 0

field min_shear: float = 2

Minimum shear in m/s.

Constraints:
  • ge = 0

field min_velocity: float = 5

Minimum velocity in m/s.

Constraints:
  • ge = 0

field quadrant_buffer_angle: float = 10

Buffer angle in degrees for quadrant based classification.

Constraints:
  • ge = 0

field type: Literal['AnalysisOptions'] = 'AnalysisOptions'
field window_size: int = 6

Window size for temporal smoothing of velocities.

Constraints:
  • ge = 1

thuner.analyze.mcs.classify_all(output_directory, analysis_options: AnalysisOptions, analysis_directory=None, offset_filepath=None, velocities_filepath=None, quality_filepath=None, classify_small_offsets=False, classify_ambiguous=False)[source]

Classify MCSs based on quadrants, as described in Short et al. (2023).

Parameters:
  • output_directory (str) – Path to the thuner run output directory.

  • analysis_options (dict) – Dictionary of quality control options.

Returns:

DataFrame describing MCS classifications.

Return type:

pd.DataFrame

thuner.analyze.mcs.classify_ambiguous(classified, unambiguous)[source]

Classify ambiguous classifications as ‘ambiguous’.

thuner.analyze.mcs.classify_angles(name, angles, category_labels)[source]

Classify the quadrants based on the angles between the vectors.

Parameters:
  • name (str) – Name of the classification

  • angles (pd.DataFrame) – DataFrame of angles between vectors.

  • category_labels (list) – List of category labels, [front_label, right_label, rear_label, left_label].

Returns:

Series of classifications.

Return type:

pd.Series

thuner.analyze.mcs.classify_small_offsets(classified, x_offset, y_offset, min_offset)[source]

Classify small offsets as ‘centered’ if the offset is less than the minimum offset.

thuner.analyze.mcs.process_velocities(output_directory, window_size=6, analysis_directory=None, profile_dataset='era5_pl')[source]

Process winds and velocities for analysis.

Parameters:

output_directory (str) – Path to the thuner run output directory.

thuner.analyze.mcs.quality_control(output_directory, analysis_options: AnalysisOptions, analysis_directory=None)[source]

Perform quality control on MCSs based on the provided options.

Parameters:
  • output_directory (str) – Path to the thuner run output directory.

  • analysis_options (AnalysisOptions) – Options for analysis and quality control checks.

Returns:

DataFrame describing quality control checks.

Return type:

pd.DataFrame