Changeset 2438 in lmdz_wrf for trunk/tools/geometry_tools.py
- Timestamp:
- Apr 14, 2019, 10:51:53 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/geometry_tools.py
r2437 r2438 14 14 from mpl_toolkits.mplot3d import Axes3D 15 15 import matplotlib.pyplot as plt 16 import os 16 17 17 18 errormsg = 'ERROR -- error -- ERROR -- error' 19 infmsg = 'INFORMATION -- information -- INFORMATION -- information' 18 20 19 21 ####### Contents: … … 416 418 boat[4*dpts:5*dpts,:] = fstarboardsaid 417 419 420 fname = 'boat_L' + str(int(length*100.)) + '_B' + str(int(beam*100.)) + '_lb' + \ 421 str(int(lbeam*100.)) + '_sb' + str(int(sternbp*100.)) + '.dat' 422 if not os.path.isfile(fname): 423 print infmsg 424 print ' ' + fname + ": writting boat coordinates file '" + fname + "' !!" 425 of = open(fname, 'w') 426 of.write('# boat file with Length: ' + str(length) +' max_beam: '+str(beam)+ \ 427 'length_at_max_beam:' + str(lbeam) + '% beam at stern: ' + str(sternbp)+ \ 428 ' %\n') 429 for ip in range(dpts*5): 430 of.write(str(boat[ip,0]) + ' ' + str(boat[ip,1]) + '\n') 431 432 of.close() 433 print fname + ": Successfull written '" + fname + "' !!" 434 418 435 return boat 419 436
Note: See TracChangeset
for help on using the changeset viewer.