Skip to content

Commit

Permalink
Merge pull request mom-ocean#112 from NOAA-GFDL/user/jpk/dora-web-upd…
Browse files Browse the repository at this point in the history
…ates

Fix for cmocean module import

After speaking with @nikizadehgfdl , we decided to take this before finishing the testing since we currently  know that analysis is broken without a fix, and we'd like to improve our chances of having some analysis on the upcoming tag...
  • Loading branch information
adcroft authored Oct 25, 2016
2 parents 2235ec7 + fddd5fb commit 361fef2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/analysis/m6plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
import numpy, numpy.matlib
import m6toolbox
import VerticalSplitScale
import cmocean

try: from mpl_toolkits.basemap import Basemap
except: print('Basemap module not found. Some regional plots may not function properly')
try: import cmocean
except: print('cmocean module not found. Some color maps may not render properly')

from sys import modules

def xyplot(field, x=None, y=None, area=None,
xlabel=None, xunits=None, ylabel=None, yunits=None,
Expand Down Expand Up @@ -1288,7 +1291,8 @@ def sectorRanges(sector=None):
c = parula_cmap()

# Register cmocean colormaps
cmoceanRegisterColormaps()
if 'cmocean' in modules.keys():
cmoceanRegisterColormaps()

# Test
if __name__ == '__main__':
Expand Down

0 comments on commit 361fef2

Please sign in to comment.