Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projection mismatch after library upgrade #98

Open
valenal opened this issue Apr 16, 2021 · 1 comment
Open

Projection mismatch after library upgrade #98

valenal opened this issue Apr 16, 2021 · 1 comment

Comments

@valenal
Copy link

valenal commented Apr 16, 2021

when upgrading matplotlib-base from 3.2.1 --> 3.4.1
and using ds.monet.quick_map(robust=True)

This is what my code looks like (the only difference between the attached figures is the library)

import monet as m
import monetio as mio
ds = mio.cmaq.open_dataset('CCTM_ASENS_v52_DDM_gcc_DDM_P2_test_TRECH2_20160624.nc')
print(repr(ds[poll][15,0,160:163,178:181]))
ds[poll][15,0,160:163,178:181].monet.quick_map(robust=True)

<xarray.DataArray 'O3_PNX' (y: 3, x: 3)>
array([[-1.413654 , -1.2353712 , -0.93085957],
[-1.1120044 , -1.2926427 , -1.1387304 ],
[-0.70462906, -0.980141 , -1.0245911 ]], dtype=float32)
Coordinates:
time datetime64[ns] 2016-06-24T15:00:00
longitude (y, x) float64 -74.17 -74.03 -73.89 ... -74.09 -73.96 -73.82
latitude (y, x) float64 40.66 40.63 40.6 40.76 ... 40.71 40.87 40.84 40.81
Dimensions without coordinates: y, x
Attributes:
long_name: O3_PNX
units: ppbV
var_desc: Sens of O3 to PNX
proj4_srs: +proj=lcc +lat_1=33.0 +lat_2=45.0 +lat_0=40.0 +lon_0=-97.0 +x...

matplotlib-base 3.2.1
matplotlib-base_3 2 1

matplotlib-base 3.4.1
matplotlib-base_3 4 1

@zmoon
Copy link
Member

zmoon commented Jan 20, 2022

In v3.3 Matplotlib changed the default for grid layout assumptions for pcolors: https://matplotlib.org/stable/users/prev_whats_new/whats_new_3.3.0.html#pcolor-and-pcolormesh-now-accept-shading-nearest-and-auto, that's what causes this change. But monet should probably address this explicitly (by setting Matplotlib version and/or providing shading when plotting).

@zmoon zmoon transferred this issue from noaa-oar-arl/monetio Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants