Closed tomvothecoder closed 6 months ago
Thanks for the PR. I just have some minor comments and clarification questions. Other then that, maybe to have another regression test for zonal_mean_2d_stratosphere() just in case..
I performed a regression test using zonal_mean_2d_stratosphere()
. All variables except two are within the accepted relative tolerance: MERRA2-U-SON and MERRA-U-JJA. Only 16/3610 and 15/3610 elements are mismatched.
Comparing:
/global/cfs/projectdirs/e3sm/e3sm_diags_cdat_test/655-zonal-mean-2d-stratosphere/zonal_mean_2d_stratosphere/MERRA2/MERRA2-U-SON-global_ref.nc
/global/cfs/projectdirs/e3sm/e3sm_diags_cdat_test/main/zonal_mean_2d_stratosphere/MERRA2/MERRA2-U-SON-global_ref.nc
Not equal to tolerance rtol=1e-05, atol=0
Mismatched elements: 16 / 3610 (0.443%)
Max absolute difference: 1.12679693e-07
Max relative difference: 0.06101062
x: array([[ 6.962348e-07, 8.762654e-01, 1.605988e+00, ..., 2.470426e+00,
1.311890e+00, 1.454603e-06],
[ 1.235800e-06, 1.004880e+00, 1.845646e+00, ..., 2.164340e+00,...
y: array([[ 6.962348e-07, 8.762654e-01, 1.605988e+00, ..., 2.470426e+00,
1.311890e+00, 1.454603e-06],
[ 1.227703e-06, 1.004880e+00, 1.845646e+00, ..., 2.164340e+00,...
Comparing:
/global/cfs/projectdirs/e3sm/e3sm_diags_cdat_test/655-zonal-mean-2d-stratosphere/zonal_mean_2d_stratosphere/MERRA2/MERRA2-U-JJA-global_ref.nc
/global/cfs/projectdirs/e3sm/e3sm_diags_cdat_test/main/zonal_mean_2d_stratosphere/MERRA2/MERRA2-U-JJA-global_ref.nc
Not equal to tolerance rtol=1e-05, atol=0
Mismatched elements: 15 / 3610 (0.416%)
Max absolute difference: 2.09578261e-07
Max relative difference: 0.00898989
x: array([[-9.994902e-07, 1.855954e+00, 3.415055e+00, ..., -1.025078e+00,
-5.548744e-01, -9.440600e-07],
[-9.595097e-07, 1.685548e+00, 3.103145e+00, ..., -8.308557e-01,...
y: array([[-9.994902e-07, 1.855954e+00, 3.415055e+00, ..., -1.025078e+00,
-5.548744e-01, -9.440600e-07],
[-9.595177e-07, 1.685548e+00, 3.103145e+00, ..., -8.308557e-01,...
I opened a GitHub issue to debug these variables later. I will merge this PR once the build passes.
Description
Summary of Changes
Drivers and Parameters
zonal_mean_2d_driver.py
lat_lon_driver.py
)ZonalMeanParameter.DEFAULT_PLEVS
as default value fordefault_plevs
zonal_mean_2d_stratosphere_driver.py
create_metrics()
functionZonalMeanParameter.DEFAULT_PLEVS
as default value fordefault_plevs
metrics.py
axis
argument to specify axes based on requirements of setaxis
is["X", "Y"]
_get_weights()
to handle Z axis with new_get_z_weights()
functioncore_parameter.py
_is_plevs_set()
function to check ifplevs
attr is set. This method is used to determine whetherDEFAULT_PLEVS
should be used or not in therun_diags()
functions found in the driver moduleszonal_mean_2d_parameter.py
andzonal_mean_2d_stratosphere_parameter.py
plevs
attr to use deep copy ofDEFAULT_PLEVS
defined in each filePlotting
plot/utils.py
PLOT_TITLE
andPLOT_SIDE_TITLE
dictionaries toMAIN_TITLE_FONTSIZE
andSECONDARY_TITLE_FONTSIZE
floats_save_plot()
to acceptpanel_configs
andborder_padding
args (can vary per set)_add_color_map()
that can be reused when refactoring plot modules for other sets_get_c_levels_and_norm()
,_add_contour_plot()
,_configure_titles()
,_configure_x_and_y_axes()
,_add_cbar()
,_add_min_mean_max_text()
,_add_rmse_corr_text()
_get_contour_label_format_and_pad()
to handle float values <0.01 and <0.2zonal_mean_2d_plot.py
plot()
and_add_colormap()
functions based on how other sets are refactored (e.g.,lat_lon_plot.py
)_add_colormap()
has some subtle differences compared toplot.utils._add_colormap()
, which is why I implemented a unique version here (e.g., operates on plevs Z axis)_zonal_mean_2d_stratosphere_plot.py
Misc.
Checklist
If applicable: