Skip to content

Commit

Permalink
CDAT Migration: Test lat_lon set with run script and debug any issu…
Browse files Browse the repository at this point in the history
…es (#794)
  • Loading branch information
tomvothecoder committed Oct 25, 2024
1 parent 1a2de1c commit a9163f7
Show file tree
Hide file tree
Showing 31 changed files with 3,538 additions and 811 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[#]
sets = ["lat_lon"]
case_id = "ERA5"
variables = ["TREFHT"]
regions = ["land"]
ref_name = "ERA5"
reference_name = "ERA5 Reanalysis"
seasons = ["ANN"]
contour_levels = [-35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40]
diff_levels = [-12, -8, -4, -2, -1, -0.5, 0.5, 1, 2, 4, 8, 12]
regrid_method = "bilinear"

# [#]
# sets = ["lat_lon"]
# case_id = "MERRA2"
# variables = ["TREFHT"]
# regions = ["land"]
# ref_name = "MERRA2"
# reference_name = "MERRA2 Reanalysis"
# seasons = ["ANN"]
# contour_levels = [-35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40]
# diff_levels = [-12, -8, -4, -2, -1, -0.5, 0.5, 1, 2, 4, 8, 12]
# regrid_method = "bilinear"

# [#]
# sets = ["lat_lon"]
# case_id = "Cloud MISR"
# variables = ["CLDLOW_TAU1.3_9.4_MISR"]
# ref_name = "MISRCOSP"
# reference_name = "MISR Simulator"
# seasons = ["ANN"]
# test_colormap = "Blues"
# reference_colormap = "Blues"
# diff_colormap = "RdBu"
# contour_levels = [5, 15, 25, 35, 45, 55, 65, 75, 85, 95]
# diff_levels = [-30, -25, -20, -15, -10, -5, 5, 10, 15, 20, 25, 30]

# [#]
# sets = ["lat_lon"]
# case_id = "Cloud MISR"
# variables = ["CLDLOW_TAU1.3_MISR"]
# ref_name = "MISRCOSP"
# reference_name = "MISR Simulator"
# seasons = ["ANN"]
# test_colormap = "Blues"
# reference_colormap = "Blues"
# diff_colormap = "RdBu"
# contour_levels = [5, 15, 25, 35, 45, 55, 65, 75, 85, 95]
# diff_levels = [-30, -25, -20, -15, -10, -5, 5, 10, 15, 20, 25, 30]

# [#]
# sets = ["lat_lon"]
# case_id = "Cloud MISR"
# variables = ["CLDLOW_TAU9.4_MISR"]
# ref_name = "MISRCOSP"
# reference_name = "MISR Simulator"
# seasons = ["ANN"]
# test_colormap = "Blues"
# reference_colormap = "Blues"
# diff_colormap = "RdBu"
# contour_levels = [5, 15, 25, 35, 45, 55, 65, 75, 85, 95]
# diff_levels = [-30, -25, -20, -15, -10, -5, 5, 10, 15, 20, 25, 30]

# [#]
# sets = ["lat_lon"]
# case_id = "Cloud MISR"
# variables = ["CLDTOT_TAU1.3_MISR"]
# ref_name = "MISRCOSP"
# reference_name = "MISR Simulator"
# seasons = ["ANN"]
# test_colormap = "Blues"
# reference_colormap = "Blues"
# diff_colormap = "RdBu"
# contour_levels = [5, 15, 25, 35, 45, 55, 65, 75, 85, 95]
# diff_levels = [-30, -25, -20, -15, -10, -5, 5, 10, 15, 20, 25, 30]
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,41 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"ename": "OSError",
"evalue": "Number of files do not match at DEV_PATH and MAIN_PATH.",
"evalue": "No files found at DEV_PATH and/or MAIN_PATH.",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mOSError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[1], line 21\u001b[0m\n\u001b[1;32m 18\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mIOError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNo files found at DEV_PATH and/or MAIN_PATH.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 20\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(DEV_GLOB) \u001b[38;5;241m!=\u001b[39m \u001b[38;5;28mlen\u001b[39m(MAIN_GLOB):\n\u001b[0;32m---> 21\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mIOError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNumber of files do not match at DEV_PATH and MAIN_PATH.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
"\u001b[0;31mOSError\u001b[0m: Number of files do not match at DEV_PATH and MAIN_PATH."
"Cell \u001b[0;32mIn[2], line 28\u001b[0m\n\u001b[1;32m 25\u001b[0m MAIN_GLOB \u001b[38;5;241m=\u001b[39m \u001b[38;5;28msorted\u001b[39m(glob\u001b[38;5;241m.\u001b[39mglob(MAIN_PATH \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/*.json\u001b[39m\u001b[38;5;124m\"\u001b[39m))\n\u001b[1;32m 27\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(DEV_GLOB) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(MAIN_GLOB) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[0;32m---> 28\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mIOError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNo files found at DEV_PATH and/or MAIN_PATH.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 30\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(DEV_GLOB) \u001b[38;5;241m!=\u001b[39m \u001b[38;5;28mlen\u001b[39m(MAIN_GLOB):\n\u001b[1;32m 31\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mIOError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNumber of files do not match at DEV_PATH and MAIN_PATH.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
"\u001b[0;31mOSError\u001b[0m: No files found at DEV_PATH and/or MAIN_PATH."
]
}
],
"source": [
"from collections import defaultdict\n",
"import glob\n",
"\n",
"import pandas as pd\n",
"import numpy as np\n",
"import xarray as xr\n",
"\n",
"from auxiliary_tools.cdat_regression_testing.utils import (\n",
" get_metrics,\n",
" get_num_metrics_above_diff_thres,\n",
" get_rel_diffs,\n",
" sort_columns,\n",
" update_diffs_to_pct,\n",
" highlight_large_diffs,\n",
")\n",
"\n",
"# TODO: Update SET_NAME and SET_DIR\n",
"SET_NAME = \"lat_lon\"\n",
"SET_DIR = \"792-lat-lon\"\n",
"SET_DIR = \"792-lat_lon\"\n",
"\n",
"DEV_PATH = f\"/global/cfs/cdirs/e3sm/www/cdat-migration-fy24/{SET_DIR}/{SET_NAME}/**\"\n",
"MAIN_PATH = f\"/global/cfs/cdirs/e3sm/www/cdat-migration-fy24/main/{SET_NAME}/**\"\n",
Expand Down
Loading

0 comments on commit a9163f7

Please sign in to comment.