Changeset 501 in lmdz_wrf for trunk/tools/validation_sim.py


Ignore:
Timestamp:
Jun 15, 2015, 5:38:25 PM (9 years ago)
Author:
lfita
Message:

Using mask pearson correlation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/validation_sim.py

    r500 r501  
    16721672
    16731673# Observed values temporally around coincident times
     1674#    simobsvalues, simobsSvalues, simobsTvalues, simobsTtvalues, trjsim =             \
     1675#        getting_ValidationValues(obskind, Nexactt, dims, trajpos, ovsim, ovobs,      \
     1676#        exacttvalues, oFillValue, Ngrid)
     1677
     1678# Observed values temporally around coincident times
    16741679    simobsvalues, simobsSvalues, simobsTvalues, simobsTtvalues, trjsim =             \
    16751680        getting_ValidationValues(obskind, Ncoindt, dims, trajpos, ovsim, ovobs,      \
     
    17061711
    17071712# statisics obs
    1708     obsmask = ma.masked_equal(arrayvals[:,1], fillValueF)
     1713# Masking 'nan'
     1714    obsmask0 = np.where(arrayvals[:,1] != arrayvals[:,1], fillValueF, arrayvals[:,1])
     1715    obsmask = ma.masked_equal(obsmask0, fillValueF)
    17091716    obsmask2 = obsmask*obsmask
    17101717
     
    17151722    obsstats[3] = obsmask2.mean()
    17161723    obsstats[4] = np.sqrt(obsstats[3] - obsstats[2]*obsstats[2])
    1717 
     1724 
    17181725# Statistics sim-obs
    17191726    simobsstats = np.zeros((9), dtype=np.float)
     
    17291736    simobsstats[5] = np.mean(np.abs(diffvals))
    17301737    simobsstats[6] = np.sqrt(np.mean(diffvals*diffvals))
    1731     simobsstats[7], simobsstats[8] = sts.pearsonr(arrayvals[:,0], arrayvals[:,1])
     1738    simobsstats[7], simobsstats[8] = sts.mstats.pearsonr(arrayvals[:,0], arrayvals[:,1])
    17321739
    17331740# Statistics around sim values
Note: See TracChangeset for help on using the changeset viewer.