Changeset 2563 in lmdz_wrf for trunk/tools
- Timestamp:
- May 29, 2019, 9:50:46 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/geometry_tools.py
r2560 r2563 609 609 print errormsg 610 610 print ' ' + fname + ': no cutting for polygon at y=', yval, '!!' 611 612 print 'Lluis icut', icut, 'ipt:', ipt, 'ecut', ecut, 'ept:', ept, 'N', N613 print 'Lluis 00', polygon[0:7,:]614 print 'Lluis NN', polygon[ecut+1:N,:]615 611 616 612 if keep == 'left': … … 1516 1512 return island1, islandsecs, islanddic 1517 1513 1518 def buoy1(height=5., width=10., bradii=1.75, bfrac=0.8, N= 200):1514 def buoy1(height=5., width=10., bradii=1.75, bfrac=0.8, N=300): 1519 1515 """ Function to draw a buoy as superposition of prism and section of ball 1520 1516 height: height of the prism (5., default) … … 1522 1518 bradii: radii of the ball (1.75, default) 1523 1519 bfrac: fraction of the ball above the prism (0.8, default) 1524 N: total number of points of the buoy ( 200, default)1520 N: total number of points of the buoy (300, default) 1525 1521 """ 1526 1522 fname = 'buoy1' … … 1528 1524 buoy = np.zeros((N,2), dtype=np.float) 1529 1525 1526 N3 = int(N/3/5) 1530 1527 NNp = 0 1531 1528 iip = 0 1532 # Base1533 ix = width/2.1534 iy = 0.1535 Np = 41536 dx = -width/(Np-1)1537 dy = 0.1538 for ip in range(Np):1539 buoy[iip+ip,:] = [iy+dy*ip,ix+dx*ip]1540 NNp = NNp + Np1541 iip = NNp1542 1543 1529 # left lateral 1544 1530 ix = -width/2. 1531 Np = N3 1545 1532 iy = 0. 1546 Np = 21547 1533 dx = 0. 1548 1534 dy = height/(Np-1) … … 1555 1541 ix = -width/2. 1556 1542 iy = height 1557 Np = 41558 1543 dx = (width/2.-bradii*bfrac)/(Np-1) 1559 1544 dy = 0. … … 1566 1551 p1 = np.array([height, -bradii*bfrac]) 1567 1552 p2 = np.array([height, bradii*bfrac]) 1568 Np = N - 2*(NNp)1553 Np = int(2*N/3) 1569 1554 buoy[iip:iip+Np,:] = circ_sec(p1, p2, 2.*bradii, 'long', 'left', Np) 1570 1555 NNp = NNp + Np … … 1574 1559 ix = bradii*bfrac 1575 1560 iy = height 1576 Np = 41561 Np = N3 1577 1562 dx = (width/2.-bradii*bfrac)/(Np-1) 1578 1563 dy = 0. … … 1585 1570 ix = width/2. 1586 1571 iy = height 1587 Np = 21588 1572 dx = 0. 1589 1573 dy = -height/(Np-1) 1574 for ip in range(Np): 1575 buoy[iip+ip,:] = [iy+dy*ip,ix+dx*ip] 1576 NNp = NNp + Np 1577 iip = NNp 1578 1579 # Base 1580 ix = width/2. 1581 iy = 0. 1582 Np = N - int(2*N/3) - 4*N3 1583 dx = -width/(Np-1) 1584 dy = 0. 1590 1585 for ip in range(Np): 1591 1586 buoy[iip+ip,:] = [iy+dy*ip,ix+dx*ip]
Note: See TracChangeset
for help on using the changeset viewer.