Changeset 943 for trunk/UTIL/PYTHON/powerlaw
- Timestamp:
- Apr 27, 2013, 2:49:02 PM (12 years ago)
- Location:
- trunk/UTIL/PYTHON/powerlaw
- Files:
-
- 6 added
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/powerlaw/find_devils.py
r942 r943 27 27 28 28 ### LOAD NETCDF DATA 29 #filename = "/home/aymeric/Big_Data/psfc.nc"30 29 nc = Dataset(filename) 31 30 psfc = nc.variables["PSFC"] … … 38 37 depression = [] 39 38 stride = 1 #5 40 for i in range(0,shape[0],stride): 39 stride = 20 40 #stride = 50 41 #stride = 100 42 start = 0 43 start = stride 44 for i in range(start,shape[0],stride): 41 45 42 46 psfc2d = np.array ( psfc [ i, : , : ] ) … … 52 56 ## 2.5 clearly too low, 3.5 not too bad, 4 probably good 53 57 fac = 3.5 58 fac = 3.2 59 ##fac = 2.5 60 #fac = 3. ## final choice 54 61 #fac = 2.5 55 fac = 3.56 62 lim = ave - fac*std 57 63 where = np.where(psfc2d < lim) … … 64 70 65 71 draw = False 72 #draw = True 66 73 if draw: 67 74 ################################################################################## … … 74 81 what_I_plot = myp.bounds(what_I_plot,zevmin,zevmax) 75 82 zelevels = np.linspace(zevmin,zevmax) 76 fig = plt.figure( )77 sub = myp.definesubplot(2,fig)78 plt.subplot(sub )83 fig = plt.figure(figsize=(16,8)) 84 subv,subh = myp.definesubplot(2,fig) 85 plt.subplot(subv,subh,1) 79 86 plt.contourf(what_I_plot,zelevels,cmap=palette) 80 87 plt.colorbar(fraction=0.05,pad=0.03,format="%.1f",\ 81 88 ticks=np.linspace(zevmin,zevmax,ndiv+1),\ 82 89 extend='both',spacing='proportional') 83 plt.subplot(sub+1) 84 palette = plt.get_cmap(name="binary") 90 plt.subplot(subv,subh,2) 91 palette = plt.get_cmap(name="hot") #"binary") 92 #lab[np.where(lab > 0.99)] = np.NaN 93 #plt.pcolor(lab,cmap=palette) 85 94 plt.contourf(lab,2,cmap=palette) 86 95 plt.show() … … 104 113 #sizex = detsize( xx, res = 10, loga=False, thres=3 ) 105 114 #sizey = detsize( yy, res = 10, loga=False, thres=3 ) 115 sizex = detsize( xx, res = 15, loga=False, thres=2 ) 116 sizey = detsize( yy, res = 15, loga=False, thres=2 ) 106 117 ### 118 print sizex, sizey 107 119 #if ( mym.max(sizex) > mym.max(sizey) ): sizey = sizex ### un peu limite dans certains cas 108 120 if (len(sizex) > len(sizey)) : sizey = sizex ### plus fidele mais petit souci lorsque PBC … … 137 149 138 150 save = True 139 save = False151 #save = False 140 152 pression = False 141 pression = True 153 #pression = True 154 155 filename = "/home/aymeric/Big_Data/psfc_f18.nc" 142 156 143 157 if save: 144 allsizesx, allsizesy, depression = getsize( "/home/aymeric/Big_Data/psfc.nc")158 allsizesx, allsizesy, depression = getsize(filename) 145 159 ### sauvegarde texte pour inspection 146 160 mym.writeascii(allsizesx,'allsizex.txt') … … 198 212 if not pression: 199 213 zebins = zebins [ zebins > 15. ] 214 #zebins = zebins [ zebins > 20. ] 215 zebins = zebins [ zebins > 25. ] 200 216 zebins = zebins [ zebins < 1000. ] 201 217 else: … … 288 304 #plothist = np.append(plothist,400.*np.ones(2) ) 289 305 306 exit() 307 290 308 plt.figure(3) 291 309 [alpha, xmin, L] = plfit.plfit(plothist,'xmin',30)#50.)
Note: See TracChangeset
for help on using the changeset viewer.