Changeset 466 in lmdz_wrf


Ignore:
Timestamp:
Jun 9, 2015, 5:16:33 PM (9 years ago)
Author:
lfita
Message:

Keep transmitting the `None' value of vardim in the simulation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/validation_sim.py

    r465 r466  
    12201220          [valdimobs['X'][it],valdimobss['Y'][it]])
    12211221elif obskind == 'single-station':
    1222     stsimpos = index_2mat(valdimsim['Y'],valdimsim['X'],[valdimobs['Y'],             \
    1223       valdimobs['X']])
    12241222    stationpos = np.zeros((2), dtype=int)
    1225     iid = 0
    1226     for idn in osim.variables[vardims['X'][0]].dimensions:
    1227         if idn == dims['X'][0]:
    1228             stationpos[1] = stsimpos[iid]
    1229         elif idn == dims['Y'][0]:
    1230             stationpos[0] = stsimpos[iid]
    1231 
    1232         iid = iid + 1
    1233     print main + ': station point in simulation:', stationpos
    1234     print '    station position:',valdimobs['X'],',',valdimobs['Y']
    1235     print '    simulation coord.:',valdimsim['X'][tuple(stsimpos)],',',              \
    1236       valdimsim['Y'][tuple(stsimpos)]
     1223    if valdimsim.has_key('X') and valdimsim.has_key('Y'):
     1224        stsimpos = index_2mat(valdimsim['Y'],valdimsim['X'],[valdimobs['Y'],         \
     1225          valdimobs['X']])
     1226        iid = 0
     1227        for idn in osim.variables[vardims['X'][0]].dimensions:
     1228            if idn == dims['X'][0]:
     1229                stationpos[1] = stsimpos[iid]
     1230            elif idn == dims['Y'][0]:
     1231                stationpos[0] = stsimpos[iid]
     1232
     1233            iid = iid + 1
     1234        print main + ': station point in simulation:', stationpos
     1235        print '    station position:',valdimobs['X'],',',valdimobs['Y']
     1236        print '    simulation coord.:',valdimsim['X'][tuple(stsimpos)],',',          \
     1237          valdimsim['Y'][tuple(stsimpos)]
     1238    else:
     1239        print main + ': validation with two time-series !!'
    12371240
    12381241elif obskind == 'trajectory':
Note: See TracChangeset for help on using the changeset viewer.