ktindiana / sphinxval

SPHINX validation code for solar energetic particle models
MIT License
3 stars 3 forks source link

Forecasts without triggers/inputs are always assigned "Trigger/Input after Observed Phenomenon" all clear match status #89

Open lukestegeman opened 7 months ago

lukestegeman commented 7 months ago

In match.py, within the match_all_clear() function, see lines 1577-1587:

    #If there is a threshold crossing in the prediction window
    if contains_thresh_cross:
        #The triggers and inputs must all be before threshold crossing
        if trigger_input_start:
            #Observed all clear is False
            sphinx.all_clear_match_status = "SEP Event"
            all_clear_status = False
        else:
            all_clear_status = None
            sphinx.all_clear_match_status = "Trigger/Input after Observed Phenomenon"
            return all_clear_status

This chunk of code checks 1) if a threshold crossing has occurred within the prediction window (contains_thresh_cross), and 2) if all triggers and inputs for the forecast are dated prior to the threshold crossing time (trigger_input_start). trigger_input_start can take on values

Since if None: yields the same result as if False:, SPHINX objects associated with forecasts in which there are no triggers/inputs are incorrectly assigned sphinx.all_clear_match_status = 'Trigger/Input after Observed Phenomenon'.

To fix this issue, we could simply include an or (trigger_input_start is None), e.g.,

    #If there is a threshold crossing in the prediction window
    if contains_thresh_cross:
        #The triggers and inputs must all be before threshold crossing
        if trigger_input_start or (trigger_input_start is None):
            #Observed all clear is False
            sphinx.all_clear_match_status = "SEP Event"
            all_clear_status = False
        else:
            all_clear_status = None
            sphinx.all_clear_match_status = "Trigger/Input after Observed Phenomenon"
            return all_clear_status
rickyegeland commented 3 months ago

In meeting discussions we decided we want to require that a trigger always be present. For SWPC this means we will create a new trigger type, "human_evaluation".

For sphinx, this means that we ought to give a warning and mark invalid/skip any forecast that doesn't have a trigger.

ktindiana commented 3 months ago

"give a warning and mark invalid/skip any forecast that doesn't have a trigger" - this is the current behavior of SPHINX. Do we want to close this out or keep until we get a "human_evaluation" field?