Add IODA and Increment comparisons - #798
Conversation
…gov:/home/manstett/swell-main into feature/mranst/hofx_comparisons
|
I had to fight cylc to get this to work as intended, I was trying to get it to operate on each observation individually, but it would choose to wait for requisite tasks that were never triggered. I switched it back operating as one task. |
|
Sorry, quick question. Is the main idea of this PR would be using |
Correct, is that sensible? |
Yeah. Maybe not necessarily for this PR but I was just wondering instead of |
Done. Now goes through a list for those variables. I have it set to |
|
Most recent commits add comparisons for increment files, as well |
|
@mranst can you please add a documentation on how to use this feature? |
Thanks for the reminder on documentation. The |
|
Each time swell/src/swell/tasks/save_obs_diags.py Line 89 in 9d6acfc So another comparison approach, or suite I should say, (not suggesting this PR) might be just comparing two stored R2D2 experiment feedbacks or Clarification; we will only store analyses and backgrounds so one would need to calculate increments. |
| script = """ | ||
| cylc set $CYLC_WORKFLOW_ID//$datetime/EvaComparisonIncrement-{{model_component}} --out skip | ||
| cylc set $CYLC_WORKFLOW_ID//$datetime/EvaComparisonJediLog-{{model_component}} --out skip | ||
| cylc set $CYLC_WORKFLOW_ID//$datetime/EvaComparisonObservations-{{model_component}} --out skip | ||
| cylc set $CYLC_WORKFLOW_ID//$datetime/PublishComparisons --out skip | ||
| cylc set $CYLC_WORKFLOW_ID//$datetime/comparison_fail --out skip | ||
| """ |
There was a problem hiding this comment.
Just one thing, what is the purpose of this here? I think I saw this on another PR as well.
There was a problem hiding this comment.
These tasks are triggered by a fail state in the comparison tasks
JediLogComparison:fail? => EvaComparisonJediLog?
For some reason, cylc decides to stall the workflow (causing a failure state) if JediLogComparison succeeds, as it thinks it is waiting for EvaComparisonJediLog to be triggered. This is sort of a hacky workaround to skip those tasks if it succeeds. If anyone has any suggestions on how to do this better, I'm all ears. It seems like something that shouldn't be an issue, or have a more simple solution, but this is the only way I've been able to get it to work
We need to keep track of all the cases where using R2D2 can help with simplifying the code. This is a great example. |
|
I was able to run Also, what does |
| observation_dict_2 = value.copy() | ||
|
|
||
| if observation_dict_1 is None or observation_dict_2 is None: | ||
| continue |
There was a problem hiding this comment.
Would changing continue for return get out of the observation loop and skip all the other obs if such condition is met?
For example if this condition is met for the first obs this will get of the loop and misses all the other obs.
| use_obs = use_obs_1 and use_obs_2 | ||
|
|
||
| if not use_obs: | ||
| continue |
There was a problem hiding this comment.
Would changing continue for return get out of the observation loop and skip all the other obs if such condition is met?
For example if this condition is met for the first obs this will get of the loop and misses all the other obs.
| 'ObsBias1/{variable}', | ||
| 'ObsValue/{variable}', | ||
| 'PreQC/{variable}', | ||
| 'hofx/{variable}' |
There was a problem hiding this comment.
There is a missing comma here
| compare, | ||
| qd.comparison_log_type('hofx'), | ||
| qd.ioda_fields_for_comparison(['hofx/{variable}']), | ||
| qd.model_components(['geos_cf']), |
There was a problem hiding this comment.
is
qd.observations([
"tempo_no2_tropo",
"tropomi_s5p_no2_tropo",
])
missing here?
| JediLogComparison-{{model_component}}[^]:fail? => EvaComparisonIncrement-{{model_component}} => PublishComparisons => comparison_fail | ||
| JediLogComparison-{{model_component}}[^]:fail? => EvaComparisonJediLog-{{model_component}} => PublishComparisons => comparison_fail | ||
| JediLogComparison-{{model_component}}[^]:fail? => EvaComparisonObservations-{{model_component}} => PublishComparisons => comparison_fail | ||
| CompareIodaObservations-{{model_component}}? & CompareIncrement-{{model_component}}? & JediLogComparison-{{model_component}}[^]? => Pass |
There was a problem hiding this comment.
There is no increments produced for hofx suites. And CompareIncrement will unconditionally run for hofx suites I think.
Description
Add comparisons to hofx observations. Used to evaluate differences for observations. Allows comparing hofx suites, and comparison plots for all suites will only be run if a difference is detected for each individual obs. This works by reading the output obs file and averaging values along a set length to check if they are equivalent between the two experiments. I implemented it this way for memory concerns, we could switch to evaluating for point-by-point differences if that makes more sense.