Skip to content

Commit

Permalink
More moving of files
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Nov 2, 2022
1 parent 58904f2 commit 4b5951a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/naccident/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ clean: clean_links
distclean: clean
rm -f bsnap_naccident create_naccident_input create_naccident_output

install: bsnap_naccident ../../utils/SnapPy/Snappy/AddToa.py
install: bsnap_naccident
install bsnap_naccident $(BINDIR)/
install ../../utils/SnapPy/Snappy/AddToa.py $(BINDIR)/snapAddToa


.PHONY: all clean distclean install
6 changes: 5 additions & 1 deletion utils/SnapPy/Snappy/AddToa.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def add_toa_to_nc(nc: netCDF4.Dataset):
totalVar[:] = total


if __name__ == "__main__":
def main():
import argparse

parser = argparse.ArgumentParser()
Expand All @@ -97,3 +97,7 @@ def add_toa_to_nc(nc: netCDF4.Dataset):

with netCDF4.Dataset(args.snapNc, "a") as nc:
add_toa_to_nc(nc)


if __name__ == "__main__":
main()
2 changes: 2 additions & 0 deletions utils/SnapPy/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ gui_scripts =
snapPy = snapscripts.snapPy:main
console_scripts =
snap4rimsterm = snapscripts.snap4rimsterm:main
snapAddToa = snappy.AddToa:main
snapCombineInverse = snapscripts.snapCombineInverse:main
snapNc2grib = snapscripts.snapNc2grib:main
snapRunnerNpps = snapscripts.snapRunnerNpps:main
snapRunnerNpp = snapscripts.snapRunnerNpp:main
eemepModelRunner = snapscripts.eemepModelRunner:main
snapRemoteRunner = snapscripts.snapRemoteRunner:main
snapEnsPlot = snapscripts.snapEnsPlot:main


[options.extras_require]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@
import sys

import numpy as np

# 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
import logging
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 @@ -266,9 +261,14 @@ def snapens(ncfiles, hour, outfile):
fig.subplots_adjust(hspace=0.12, wspace=0.01)
fig.savefig(outfile, bbox_inches='tight')



if __name__ == "__main__":
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 All @@ -281,4 +281,8 @@ def snapens(ncfiles, hour, outfile):
parser.add_argument('SNAPNC', help="snap*.nc filenames", nargs='+')
args = parser.parse_args()

snapens(args.SNAPNC, args.hour, args.out)
snapens(args.SNAPNC, args.hour, args.out)


if __name__ == "main":
main()

0 comments on commit 4b5951a

Please sign in to comment.