UMR-CNRM / EPyGrAM

Enhanced Python for Graphics and Analysis of Meteorological fields
Other
14 stars 15 forks source link

Bug when using cartoplot with gaussian field on a projection hiding a part of the globe #7

Closed SebastienRietteMTO closed 1 year ago

SebastienRietteMTO commented 2 years ago

Way to reproduce the problem: python3 -c "import os, epygram, cartopy.crs as ccrs; epygram.init_env(); r=epygram.formats.resource(os.path.dirname(epygram.file)+'/../tests/data/geometries/gaussC1.fa','r'); f=r.readfield('SURFGEOPOTENTIEL'); f.cartoplot(projection=ccrs.Orthographic())"

Output: Traceback (most recent call last): File "", line 1, in File "/home/riette/.local/lib/python3.8/site-packages/EPyGrAM/epygram/_plugins/with_cartopy/H2DField.py", line 786, in cartoplot elements = self._cartoplot_actualplot(ax, File "/home/riette/.local/lib/python3.8/site-packages/EPyGrAM/epygram/_plugins/with_cartopy/H2DField.py", line 416, in _cartoplot_actualplot pf = ax.tricontourf(triangulation, data, File "/usr/lib/python3/dist-packages/matplotlib/tri/tricontour.py", line 275, in tricontourf return TriContourSet(ax, *args, kwargs) File "/usr/lib/python3/dist-packages/matplotlib/tri/tricontour.py", line 35, in init ContourSet.init(self, ax, *args, *kwargs) File "/usr/lib/python3/dist-packages/matplotlib/contour.py", line 855, in init kwargs = self._process_args(args, kwargs) File "/usr/lib/python3/dist-packages/matplotlib/tri/tricontour.py", line 47, in _process_args tri, z = self._contour_args(args, kwargs) File "/usr/lib/python3/dist-packages/matplotlib/tri/tricontour.py", line 84, in _contour_args raise ValueError('z array must have same length as triangulation x' ValueError: z array must have same length as triangulation x and y arrays

AlexandreMary commented 1 year ago

Merged.