Changeset 3833 for trunk/LMDZ.PLUTO/util/script_figures/temp_time_zoom.py
- Timestamp:
- Jul 7, 2025, 1:39:13 PM (24 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.PLUTO/util/script_figures/temp_time_zoom.py
r3823 r3833 1 1 #! /usr/bin/env python 2 from ppclass import pp3 2 from netCDF4 import Dataset 4 3 from numpy import * … … 11 10 import datetime 12 11 from mpl_toolkits.basemap import Basemap, shiftgrid 12 from FV3_utils import * 13 13 14 14 ############################ 15 filename1= "diagfi2015_S.nc"15 filename1=name+"_S.nc" 16 16 var="temperature" #variable 17 xarea="-169,-165" 18 yarea="-19,-15" 17 longitude=[-169,-165] 18 # longitude=-165 19 latitude=[-19,-15] 20 # latitude=-19 19 21 20 22 # local time de la longitude consideree a t=0 21 23 loct=12 22 sol0= 3024 sol0=12 23 25 t0=1./24*loct 24 t1=t0+1 25 tint=[s tr(sol0+t0)+','+str(sol0+t1)] #Time must be as written in the input file26 t1=t0+12 27 tint=[sol0+t0,sol0+t1] #Time must be as written in the input file 26 28 print(tint) 27 29 nc1=Dataset(filename1) 28 30 29 lat=nc1.variables["lat"][:] 30 lon=nc1.variables["lon"][:] 31 alt=nc1.variables["altitude"][:] 31 lat=getvar(nc1,"latitude") 32 lon=getvar(nc1,"longitude") 33 alt=getvar(nc1,"altitude") 34 tim=getvar(nc1,"Time",times=tint) 32 35 ############################ 33 34 def getvar(filename,var,tint,xarea,yarea):35 myvar = pp(file=filename,var=var,t=tint,x=xarea,y=yarea,compute="nothing").getf()36 print(('shape myvar = ',shape(myvar)))37 return myvar38 39 36 40 37 mpl.figure(figsize=(18, 10)) 41 38 42 43 myvar=getvar(filename1,var,tint,xarea,yarea)[:,:,0,0] 39 myvar=getvar(nc1,var,times=tint,longitudes=longitude,latitudes=latitude)[:,:,0,0] 44 40 font=23 45 tim=np.linspace(0,24,9)41 # tim=np.linspace(0,24,9) 46 42 print(("tim=",tim)) 47 43 print(('on prend les premiers indice, shape (tmps, alt, var) =',shape(tim), shape(alt), shape(myvar))) … … 49 45 pal=get_cmap(name="Spectral_r") 50 46 lev=np.linspace(40,50,10) 51 xticks=[0,2,4,6,8,10,12,14,16,18,20,22,24]47 # xticks=[0,2,4,6,8,10,12,14,16,18,20,22,24] 52 48 print(('hello:',np.linspace(0,24,13))) 53 49 #yticks=np.linspace(0,240,9) 54 alt=alt/1000.55 50 56 51 … … 72 67 mpl.xlabel('Local Time (h)',labelpad=10,fontsize=font) 73 68 mpl.ylabel('Altitude (km)',labelpad=10, fontsize=font) 74 mpl.xticks(xticks,fontsize=font)75 #mpl.xticks(fontsize=font)69 # mpl.xticks(xticks,fontsize=font) 70 mpl.xticks(fontsize=font) 76 71 #mpl.yticks(yticks,fontsize=font) 77 72 mpl.yticks(fontsize=font)
Note: See TracChangeset
for help on using the changeset viewer.