Changeset 2636 in lmdz_wrf for trunk


Ignore:
Timestamp:
Jun 25, 2019, 5:01:01 AM (5 years ago)
Author:
lfita
Message:

Adding:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nautical.py

    r2633 r2636  
    1919# buoy1: Function to draw a buoy as superposition of prism and section of ball
    2020# band_lighthouse: Function to plot a lighthouse with spiral bands
     21# EstuarioRioPlata: Function to plot an eschematic representation of the Estuario of Rio de la Plata
    2122# green_buoy1: Function to draw a green mark buoy using buoy1
    2223# isolateddanger_buoy1: Function to draw an isolated danger buoy using buoy1
     
    3334#   circular segments
    3435# [north/east/south/west_buoy1: Function to draw a [North/East/South/West] danger buoy using buoy1
     36
     37# Definitions [Name, lat, lon]
     38NotablePostitions = {                                                                \
     39  'PuntaMedanos': ['Punta Medanos', np.array([-36.8494, -56.6395])],                 \
     40  'PuntaRaza': ['Punta Raza', np.array([-36.2929, -56.7474])],                       \
     41  'RioSalado': ['Rio Salado', np.array([-35.7423, -57.3635])],                       \
     42  'PuntaIndio': ['Punt Indio', np.array([-35.4179, -57.0959])],                      \
     43  'PuntaAtalaya': ['Punta Atalaya', np.array([-35.01868, -57.5181])],                \
     44  'Tigre': ['Tigre', np.array([-34.4486, -58.4989])],                                \
     45  'MartinChico': ['Martin Chico', np.array([-34.1681, -58.2118])],                   \
     46  'Colonia': ['Colonia del Sacramento', np.array([-34.4724, -57.8556])],             \
     47  'ArroyoRosario': ['Arroyo Rosario', np.array([-34.4331, -57.3504])],               \
     48  'Montevideo': ['Montevideo', np.array([-34.9216, -56.1574])],                      \
     49  'PuntaEste': ['Punta del Este', np.array([-34.9830, -54.9533])],                   \
     50  'CaboPolonio': ['Cabo Polonio', np.array([-34.4083, -53.7782])]}
    3551
    3652# FROM: http://www.photographers1.com/Sailing/NauticalTerms&Nomenclature.html
     
    11741190    return buoy, buoysecs, buoydic
    11751191
     1192def EstuarioRioPlata(N=300):
     1193    """ Function to plot an eschematic representation of the Estuario of Rio de la Plata
     1194      N: total number of vertices to use
     1195    """
     1196    fname = 'EstuarioRioPlata'
     1197
     1198    secs0 = ['PuntaMedanos', 'PuntaRaza', 'RioSalado', 'PuntaIndio', 'PuntaAtalaya', \
     1199      'Tigre', 'MartinChico', 'Colonia', 'ArroyoRosario', 'Montevideo', 'PuntaEste', \
     1200      'CaboPolonio']
     1201    secs = []
     1202    dic = {}
     1203    rads = [5., 1.0, 5., 5., 5., 5., 5., 5., 5., 5., 5.]
     1204    lengths = ['short', 'short', 'short', 'short', 'short', 'short', 'short',        \
     1205      'short', 'short', 'short', 'short']
     1206    sides = ['right', 'left', 'left', 'right', 'left', 'left', 'left', 'left',       \
     1207      'right', 'left', 'right']
     1208    Nsecs = len(secs0)
     1209    Nn = N/Nsecs
     1210    estuario = np.zeros((N,2), dtype=np.float)
     1211
     1212    iip = 0
     1213    # Atlantic_PuntaRaza
     1214    prevn = 'PuntaMedanos'
     1215    pv = NotablePostitions[prevn]
     1216    ip = pv[1]
     1217    for isec in range(1,Nsecs-1):
     1218        iisec = isec - 1
     1219        aname = secs0[isec]
     1220        pv = NotablePostitions[aname]
     1221        ep = pv[1]
     1222        dps = geo.dist_points(ip,ep)
     1223        estuario[iip:iip+Nn,:] = geo.circ_sec(ip,ep, dps*rads[iisec], lengths[iisec],\
     1224          sides[iisec], Nn)
     1225        secs.append(prevn+'_'+aname)
     1226        dic[prevn+'_'+aname] = [estuario[iip:iip+Nn,:], ['-', 'k', 1.]]
     1227        ip = ep + 0.
     1228        prevn = aname + ''
     1229        iip = iip + Nn
     1230
     1231    Nn2 =  N - (Nsecs-2)*Nn
     1232    isec = Nsecs-1
     1233    iisec = isec - 1
     1234    aname = secs0[isec]
     1235    pv = NotablePostitions[aname]
     1236    ep = pv[1]
     1237    dps = geo.dist_points(ip,ep)
     1238    isec = Nsecs - 1
     1239    estuario[iip:N,:] = geo.circ_sec(ip, ep, dps*rads[iisec], lengths[iisec],        \
     1240      sides[iisec], Nn2)
     1241    secs.append(prevn+'_'+aname)
     1242    dic[prevn+'_'+aname] = [estuario[iip:N,:], ['-', 'k', 1.]]
     1243
     1244    return estuario, secs, dic
     1245
Note: See TracChangeset for help on using the changeset viewer.