test_zoom_basin.py 516 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env python
  2. # B a r a K u d a
  3. #
  4. # L. Brodeau, 2017]
  5. import sys
  6. import numpy as nmp
  7. from netCDF4 import Dataset
  8. import barakuda_orca as bo
  9. narg = len(sys.argv)
  10. if narg != 3:
  11. print 'Usage: '+sys.argv[0]+' <basin_mask> <basin_name>'; sys.exit(0)
  12. cf_bm = sys.argv[1]
  13. cname = sys.argv[2]
  14. # Opening basin_mask:
  15. f_bm = Dataset(cf_bm)
  16. mask = f_bm.variables['tmask'+cname][:,:]
  17. f_bm.close()
  18. (i1,j1,i2,j2) = bo.shrink_domain(mask)
  19. print ' i1, i2 =>', i1, i2
  20. print ' j1, j2 =>', j1, j2