NCAR / ldcpy

Statistical and visual tools for gathering metrics and comparing Earth System Model data files. A common use case is comparing data that has been lossily compressed with the original data.
https://ldcpy.readthedocs.io/
Apache License 2.0
19 stars 2 forks source link

use imshow instead of pcolormesh for spatial plots #213

Closed pinarda closed 3 years ago

pinarda commented 3 years ago

axs[i].imshow(img=no_inf_data_set, transform=ccrs.PlateCarree(), cmap=mymap) will plot things flipped and upside down, and without the colorbar, but it is a start. Results indicated time for the entire plot call could be reduced to ~2.7 seconds from ~5.2 seconds. Imshow takes half the time that pcolormesh does to plot (4.8 -> 2.4 seconds).

pinarda commented 3 years ago

See https://xray.readthedocs.io/en/latest/plotting.html#two-dimensions

pinarda commented 3 years ago

Timing the entire plot call on Jupyterhub takes 7.2 seconds, so if we switch to using imshow we should see it take about 4.8 seconds (2.4 for calculating the mean, 2.4 for plotting).