Changeset 26744 for issm/trunk/src/m/coordsystems/gmtmask.py
- Timestamp:
- 12/22/21 10:39:44 (3 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk ¶
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 25837-25866,25868-25993,25995-26330,26332-26733,26736-26739,26741
- Property svn:mergeinfo changed
-
issm/trunk/src ¶
- Property svn:mergeinfo changed
-
TabularUnified issm/trunk/src/m/coordsystems/gmtmask.py ¶
r25836 r26744 44 44 np.savetxt('./all_vertices.txt', np.transpose([long, lat, np.arange(1, nv + 1)]), delimiter='\t', fmt='%.10f') 45 45 46 #Avoid bypassing of the ld library path by Matlab (:()47 issm_dir = issmdir()48 49 try:50 ismac51 except NameError:52 ismac = False53 54 # TODO: Do we really need this (we can/already set it in etc/environment.sh)?55 if ismac:56 dyld_library_path_old = os.getenv('DYLD_LIBRARY_PATH')57 os.putenv('DYLD_LIBRARY_PATH', issm_dir + '/externalpackages/curl/install/lib:' + issm_dir + '/externalpackages/hdf5/install/lib:' + issm_dir + '/externalpackages/netcdf/install/lib')58 59 #Find path to gmt (you may need to add yours to the list).60 #61 # NOTE: Assumes gmtselect is also in this directory.62 #63 gmtpaths = [64 issm_dir + '/bin/gmt',65 issm_dir + '/externalpackages/gmt/install/bin/gmt',66 '/Applications/GMT-5.4.3.app/Contents/Resources/bin/gmt'67 ]68 gmtpath = ''69 for i in range(len(gmtpaths)):70 if os.path.isfile(gmtpaths[i]):71 gmtpath = gmtpaths[i]72 break73 74 if gmtpath == '':75 raise Exception('gmt not found! Make sure it is properly installed, or add its path to this file.')76 77 46 #figure out which vertices are on the ocean, which one on the continent: 78 subprocess.call(gmtpath + ' gmtselect ./ all_vertices.txt -h0 -Df -R0/360/-90/90 -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt', shell=True) 79 80 #reset DYLD_LIBRARY_PATH to what it was: 81 if ismac: 82 os.putenv('DYLD_LIBRARY_PATH', dyld_library_path_old) 47 subprocess.call('gmtselect ./ all_vertices.txt -h0 -Df -R0/360/-90/90 -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt', shell=True) 83 48 84 49 #read the con_vertices.txt file and flag our mesh vertices on the continent
Note:
See TracChangeset
for help on using the changeset viewer.