NOAA-EMC / RDASApp

Regional DAS
GNU Lesser General Public License v2.1
2 stars 13 forks source link

Error - python mpasjedi_increment_singleob.py #190

Closed guoqing-noaa closed 1 month ago

guoqing-noaa commented 1 month ago

Following the quick start guide, the python plotting step returned the errors attached at the end of this post.

@SamuelDegelia-NOAA @delippi Could you help check this? Thanks! Thanks Keenan for reporting this.

python mpasjedi_increment_singleob.py
adpupa_hofx.nc4
JEDI:
  oberr_input: 1.2
  oberr_final: 1.2
ob:   -5.0
omf:  5.92
hofx: -10.92
oberr_final: 1.2
Using:
  singleob_lat: 35.5
  singleob_lon: -97.5

Creating Increment Plot...

Traceback (most recent call last):
  File "/mnt/lfs5/BMC/wrfruc/gge/tmp/rdas_build_test/RDASApp/expr/mpas_2024052700/mpasjedi_increment_singleob.py", line 190, in <module>
    plt.tight_layout()
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/matplotlib/pyplot.py", line 2302, in tight_layout
    return gcf().tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/matplotlib/figure.py", line 3197, in tight_layout
    kwargs = get_tight_layout_figure(
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/matplotlib/tight_layout.py", line 320, in get_tight_layout_figure
    kwargs = _auto_adjust_subplotpars(fig, renderer,
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/matplotlib/tight_layout.py", line 82, in _auto_adjust_subplotpars
    bb += [ax.get_tightbbox(renderer, for_layout_only=True)]
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/cartopy/mpl/geoaxes.py", line 530, in get_tightbbox
    return matplotlib.axes.Axes.get_tightbbox(
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/matplotlib/axes/_base.py", line 4666, in get_tightbbox
    bbox = a.get_tightbbox(renderer)
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/matplotlib/artist.py", line 355, in get_tightbbox
    bbox = self.get_window_extent(renderer)
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/matplotlib/collections.py", line 321, in get_window_extent
    return self.get_datalim(transforms.IdentityTransform())
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/matplotlib/collections.py", line 281, in get_datalim
    paths = [transform.transform_path_non_affine(p) for p in paths]
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/matplotlib/collections.py", line 281, in <listcomp>
    paths = [transform.transform_path_non_affine(p) for p in paths]
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/matplotlib/transforms.py", line 2436, in transform_path_non_affine
    return self._a.transform_path_non_affine(path)
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/cartopy/mpl/geoaxes.py", line 170, in transform_path_non_affine
    new_vertices = self.target_projection.quick_vertices_transform(
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/cartopy/crs.py", line 1362, in quick_vertices_transform
    return_value = super().quick_vertices_transform(vertices, src_crs)
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/cartopy/crs.py", line 1247, in quick_vertices_transform
    if (x.min() >= x_limits[0] and x.max() <= x_limits[1] and
  File "/lfs5/BMC/wrfruc/gge/miniconda3/4.6.14/envs/eva/lib/python3.9/site-packages/numpy/core/_methods.py", line 44, in _amin
    return umr_minimum(a, axis, None, out, keepdims, initial, where)
ValueError: zero-size array to reduction operation minimum which has no identity
guoqing-noaa commented 1 month ago

To update, I tested on Jet. Keenan tested on Hera. The same error message.

delippi commented 1 month ago

@guoqing-noaa please try removing transform=ccrs.PlateCarree() from the following line: c1 = m1.tricontourf(triang, jedi_inc, clevs, cmap=cm, extend='both', transform=ccrs.PlateCarree())

keenaneure commented 1 month ago

That fixed the bug on my end. Thank you!

delippi commented 1 month ago

Great! feel free to make a little PR for that.

guoqing-noaa commented 1 month ago

@guoqing-noaa please try removing transform=ccrs.PlateCarree() from the following line: c1 = m1.tricontourf(triang, jedi_inc, clevs, cmap=cm, extend='both', transform=ccrs.PlateCarree())

@delippi Thanks! This worked. I will create a PR for this.

delippi commented 1 month ago

@guoqing-noaa please try removing transform=ccrs.PlateCarree() from the following line: c1 = m1.tricontourf(triang, jedi_inc, clevs, cmap=cm, extend='both', transform=ccrs.PlateCarree())

@delippi Thanks! This worked. I will create a PR for this.

Thank you!