gcpy icon indicating copy to clipboard operation
gcpy copied to clipboard

Bugs about automatic regridding for cube-sphere when plotting

Open yuanjianz opened this issue 10 months ago • 4 comments

Name and Institution (Required)

Name: Yuanjian Zhang Institution: WashU

Confirm you have reviewed the following documentation

Description of your issue or question

Current main branch of GcPy seems to have trouble reformatting during the process of cube-sphere regridding.

  1. Cube-sphere emissions and column AOD will trigger an error in the auto reformatting in compare_single_level functions due to lack of the dimension lev.
  2. Auto regridding in compare_single_level for standard cube-sphere grids will only pick ref instead of finer resolution as documented.
  3. Current regridding methods for cube-sphere grids will flipped Xdim, Ydim and lon, lat, which is causing horizontal flip when plotting single level in single_panel and absdiff, fracdiff in compare_single_level.

Issue 1

When doing benchmark_emis_plot and benchmark_aod_plot between two cube-sphere files with different resolution, the program will trigger an error that says "cannot find lev" in xarray.rename.

Issue 2 and 3

compare_single_level(refds,'ref',devds,'dev',['SpeciesConcVV_DST1'])

image The function automatically chooses c24 as comparing resolutiuon(issue 2), and we can also find the weird strips and incorrect negative bias in the figure(dev's values should be larger than ref). The latter issue is caused by horizontal flip after regridding(issue 3), which can be confirmed by the figure following:

single_panel(devds_regridded_from_c30_to_c24['SpeciesConcVV_DST1'].isel(lev=0,time=0))
  • devds_regridded_from_c30_to_c24 is regridded from devds using file_regrid function following documentation image

yuanjianz avatar Apr 09 '24 19:04 yuanjianz

Thank you @yuanjianz! I think this addresses an old issue that was closed due to becoming stale: https://github.com/geoschem/gcpy/issues/167

lizziel avatar Apr 09 '24 20:04 lizziel

And this issue too: https://github.com/geoschem/gcpy/issues/147

lizziel avatar Apr 09 '24 20:04 lizziel

Hi @lizziel, I am convinced that these strips are caused by horizontal flip when plotting the regridded data. The reformatting process in regridding functions does not correctly reshape regridded files follwing the sequence of either lat,lon or Ydim, Xdim. This could be handled by reshape_MAPL_cs but I would rather the output from regridding process to be already in good shape. Please see the pull request #311.

yuanjianz avatar Apr 09 '24 21:04 yuanjianz

Also note that each cube-sphere face is flipped separately, thus typical horizontal flip features cannot be told from a global plot.

yuanjianz avatar Apr 09 '24 23:04 yuanjianz

We can close this issue as PR #311 has been merged into GCPy 1.5.0.

yantosca avatar May 29 '24 17:05 yantosca