Skip to content

Commit

Permalink
Move suppression to import section
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Nov 2, 2022
1 parent 001579f commit 86e9659
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions utils/SnapPy/snapscripts/snapEnsPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
import numpy as np
import logging

# suppress some warnings
warnings.filterwarnings("ignore", category=UserWarning,
message="Warning: 'partition' will ignore the 'mask' of the MaskedArray.")
# shapefile.py uses root logger :-( and warns a lot about GSHHS
logging.root.setLevel(logging.ERROR)



def plotMap(data, x, y, ax, title="", title_loc="center", clevs=[10,100,300,1000,3000,10000,30000,100000, 300000, 10000000], colors=None, extend='max'):
ax.add_feature(cartopy.feature.GSHHSFeature(scale='low', facecolor='none', edgecolor='whitesmoke', linewidth=.2), zorder=100)
Expand Down Expand Up @@ -263,12 +270,6 @@ def snapens(ncfiles, hour, outfile):


def main():
# suppress some warnings
warnings.filterwarnings("ignore", category=UserWarning,
message="Warning: 'partition' will ignore the 'mask' of the MaskedArray.")
# shapefile.py uses root logger :-( and warns a lot about GSHHS
logging.root.setLevel(logging.ERROR)

os.umask(0o002)

parser = argparse.ArgumentParser(
Expand Down

0 comments on commit 86e9659

Please sign in to comment.