Ignore:
Timestamp:
Apr 27, 2013, 2:49:02 PM (12 years ago)
Author:
aslmd
Message:

clean and organized UTIL/PYTHON folder

Location:
trunk/UTIL/PYTHON/powerlaw
Files:
6 added
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/powerlaw/find_devils.py

    r942 r943  
    2727   
    2828    ### LOAD NETCDF DATA
    29     #filename = "/home/aymeric/Big_Data/psfc.nc"
    3029    nc = Dataset(filename)
    3130    psfc = nc.variables["PSFC"]
     
    3837    depression = []
    3938    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):
    4145
    4246        psfc2d = np.array ( psfc [ i, : , : ] )
     
    5256                   ## 2.5 clearly too low, 3.5 not too bad, 4 probably good
    5357        fac = 3.5
     58        fac = 3.2
     59        ##fac = 2.5
     60        #fac = 3. ## final choice
    5461        #fac = 2.5
    55         fac = 3.
    5662        lim = ave - fac*std
    5763        where = np.where(psfc2d < lim)
     
    6470
    6571        draw = False
     72        #draw = True
    6673        if draw:
    6774        ##################################################################################
     
    7481            what_I_plot = myp.bounds(what_I_plot,zevmin,zevmax)
    7582            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)
    7986            plt.contourf(what_I_plot,zelevels,cmap=palette)
    8087            plt.colorbar(fraction=0.05,pad=0.03,format="%.1f",\
    8188                           ticks=np.linspace(zevmin,zevmax,ndiv+1),\
    8289                           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)
    8594            plt.contourf(lab,2,cmap=palette)
    8695            plt.show()
     
    104113        #sizex = detsize( xx, res = 10, loga=False, thres=3 )
    105114        #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 )
    106117        ###
     118        print sizex, sizey
    107119        #if ( mym.max(sizex) > mym.max(sizey) ): sizey = sizex  ### un peu limite dans certains cas
    108120        if (len(sizex) > len(sizey))     : sizey = sizex        ### plus fidele mais petit souci lorsque PBC
     
    137149
    138150save = True
    139 save = False
     151#save = False
    140152pression = False
    141 pression = True
     153#pression = True
     154
     155filename = "/home/aymeric/Big_Data/psfc_f18.nc"
    142156
    143157if save:
    144     allsizesx, allsizesy, depression = getsize("/home/aymeric/Big_Data/psfc.nc")
     158    allsizesx, allsizesy, depression = getsize(filename)
    145159    ### sauvegarde texte pour inspection
    146160    mym.writeascii(allsizesx,'allsizex.txt')
     
    198212if not pression:
    199213    zebins = zebins [ zebins > 15. ]
     214    #zebins = zebins [ zebins > 20. ]
     215    zebins = zebins [ zebins > 25. ]
    200216    zebins = zebins [ zebins < 1000. ]
    201217else:
     
    288304#plothist = np.append(plothist,400.*np.ones(2)  )
    289305
     306exit()
     307
    290308plt.figure(3)
    291309[alpha, xmin, L] = plfit.plfit(plothist,'xmin',30)#50.)
Note: See TracChangeset for help on using the changeset viewer.