improver.wxcode.wxcode_decision_tree module

Module containing weather symbol decision tree

improver.wxcode.wxcode_decision_tree.wxcode_decision_tree()[source]

Define queries that comprise the weather symbol decision tree. Each queries contains the following elements:

  • succeed: The next query to call if the diagnostic being queried
    satisfies the current query.
  • fail: The next query to call if the diagnostic being queried
    does not satisfy the current query.
  • probability_thresholds: A list of probability thresholds that the
    query requires. One entry is provided for each diagnostic field being tested.
  • threshold_condition: The condition the diagnostic must satisfy
    relative to the probability threshold (e.g. greater than (>) the probability threshold).
  • condition_combination: The way (AND, OR) in which multiple
    conditions should be combined; e.g. rainfall > 0.5 AND snowfall > 0.5
  • diagnostics_fields: The diagnostics which are being used in the
    query. If this is a list of lists, the two fields in a given list are subtracted (1st - (2nd * gamma)) and then compared with the probability threshold.
  • diagnostic_gamma (NOT UNIVERSAL): This is the gamma factor that
    is used when comparing two fields directly, rather than comparing a single field to a probability threshold. e.g. gamma * P(SnowfallRate) < P(RainfallRate).
  • diagnostic_thresholds: The thresholding that is expected to have
    been applied to the input data; this is used to extract the approproate data from the input cubes.
  • diagnostic_conditions: The condition that is expected to have
    been applied to the input data; this can be used to ensure the thresholding is as expected.
Returns:A dictionary containing the queries that comprise the decision tree.
Return type:queries (dict)