ua-snap / cmip6-utils

Pipelines and utilites for working with CMIP6 data
0 stars 1 forks source link

Add frequency lookup, remove "backup" routine #14

Closed Joshdpaul closed 5 months ago

Joshdpaul commented 5 months ago

This PR closes #8 by adding a new lookup table in indicators/luts.py to assert the correct nomenclature for "day" frequency using the variable id. The intention is to avoid hard-coding "day" and catch the odd frequency names like "Oday" and "SIday" while building filepaths in indicators/indicators.py.

This PR also removes the parts of the indicators/indicators.find_var_files_and_create_fp_dict() function that searched for missing files in the "backup" (ie source) directory and attempted to copy them to the input directory. Missing files will just now throw a general error.

Also fixes the conditional statements in QC 5 in indicators/qc.py as described in 3f4a524.

TO TEST:

Compute the rx1day indicators - the "day" frequency string should be pulled from the lookup table and everything should work as normal. We don't be able to test the odd frequency names until we build indicators that use those variables. Read through the code changes. If anything looks suspect, maybe pull some of it into a notebook and test that the variables like "tos" and "sithick" return their correct frequencies ("Oday" and "SIday", respectively).