cemac / SWIFT-Testbed3

ARCHIVED. Repository for Testbed 3 Work Flow
GNU General Public License v3.0
2 stars 0 forks source link

Review NWCSAF plotting routines for efficiency #43

Open tdjames1 opened 3 years ago

tdjames1 commented 3 years ago

Review NWCSAF plotting routines for improvements to efficiency, fixing errors/warnings etc.

tdjames1 commented 3 years ago

Plotting scripts output the following warning:

nwcpy_3.py:252: MatplotlibDeprecationWarning: 
The dedent function was deprecated in Matplotlib 3.1 and will be removed in 3.3. Use inspect.cleandoc instead.
  m = Basemap(lon_0=lon_0, llcrnrx=lowleftx, llcrnry=lowleftty, urcrnrx=uprightx, urcrnry=uprighty, projection=proj, resolution='l', area_thresh=250, satellite_height=h, rsphere=(a,b))

There is a patch to basemap v1.2.1/v1.2.2 (available via conda-forge) that should fix this warning: https://github.com/matplotlib/basemap/pull/466/commits/ac2957d4ffb78307ecef8a7e6c1bab7f9fea0ea7

The nwcsaf conda env uses basemap v1.2.0.

lecjlg commented 3 years ago

Having a go at updating the basemap module on the swift-plot machine

conda update -c conda-forge basemap Looks like it takes it to version basemap-1.2.2

lecjlg commented 3 years ago

There is also a warning that is displayed during the plotting nwcpy_3.py:308: MatplotlibDeprecationWarning: The 's' parameter of annotate() has been renamed 'text' since Matplotlib 3.3; support for the old name will be dropped two minor releases later. verticalalignment='top')

This is a simple fix of change

plt.annotate(s=word[i]) to plt.annotate(text=word[i]) in the nwcpy_3.py

lecjlg commented 3 years ago

Updating the basemap module and changing s to word seems to get rid of any warnings in the plotting script.

lecjlg commented 3 years ago

Not sure if this will make plotting scripts go any faster, I suspect not, but log outputs are much better to look at now.