Changeset 2646 in lmdz_wrf
- Timestamp:
- Jun 29, 2019, 9:35:17 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nautical.py
r2645 r2646 17 17 18 18 ## Shapes/objects 19 # boatnames: Function to provide the names of the sections of a boat 19 20 # buoy1: Function to draw a buoy as superposition of prism and section of ball 20 21 # band_lighthouse: Function to plot a lighthouse with spiral bands … … 1377 1378 return estuario, secs, dic 1378 1379 1380 def boatnames(xn,xx,yn,yx,zn,zx,zlf): 1381 """ Function to provide the names of the sections of a boat 1382 xn: minimum length on x-axis (across beam) 1383 xx: maximum length on x-axis (across beam) 1384 yn: minimum length on y-axis (length) 1385 yx: maximum length on y-axis (length) 1386 zn: minimum length on z-axis (draught) 1387 zx: maximum length on z-axis (draught) 1388 zlf: freeboard line 1389 """ 1390 fname = 'boatnames' 1391 1392 dx = xx - xn 1393 dy = yx - yn 1394 dz = zx - zn 1395 1396 x0 = xn + dx/2. 1397 y0 = yn + dy/2. 1398 z0 = zn + dz/2. 1399 1400 # Values 1401 boatvs = { 1402 'xn': xn, 'xx': xx, 'yn': yn, 'yx': yx, 'zn': zn, 'zx': zx, \ 1403 'dx': dx, 'dy': dy, 'dz': dz, 'zlf': zlf, \ 1404 } 1405 1406 # Names 1407 boatns = { 1408 'bow': ['bow', 'proa', np.array([x0,yx,zx])], \ 1409 'stern': ['stern', 'popa', np.array([x0,yn,zx])], \ 1410 'starboard': ['starboard', 'estribor', np.array([xn,y0,zx])], \ 1411 'port': ['port', 'babor', np.array([xn,y0,zx])], \ 1412 'waterline': ['waterline', 'l'+unichr(237)+'nea de flotaci'+ unichr(243)+'n', \ 1413 np.array([xn,zlf,0.])], \ 1414 'keel': ['keel', 'quillote', np.array([xn,yn,zn])], \ 1415 } 1416 1417 # Dimensions 1418 boatls = { 1419 'length': ['length', 'eslora', np.array([x0,yn,zx], [x0,yx,zx])], \ 1420 'beam': ['beam', 'manga', np.array([xn,y0,zx], [xx,y0,zx])], \ 1421 'draught': ['draught', 'calado', np.array([xn,y0,zlf], [xn,y0,zn])], \ 1422 } 1423 1424 return boatvs, boatns, boatls
Note: See TracChangeset
for help on using the changeset viewer.