Changeset 3833 for trunk/LMDZ.PLUTO/util/script_figures/proftempNH.py
- Timestamp:
- Jul 7, 2025, 1:39:13 PM (36 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.PLUTO/util/script_figures/proftempNH.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 zefile="diagfi2015_A.nc"16 d1="restart_ref/"17 18 f1=d1+zefile19 20 21 15 var="temperature" #variable 22 16 23 nc1=Dataset( f1)24 lat= nc1.variables["lat"][:]25 lon= nc1.variables["lon"][:]26 alt= nc1.variables["altitude"][:]27 tim= nc1.variables["time_counter"][:]17 nc1=Dataset(name+"_A.nc") 18 lat=getvar(nc1,"latitude") 19 lon=getvar(nc1,"longitude") 20 alt=getvar(nc1,"altitude") 21 tim=getvar(nc1,"Time") 28 22 29 23 print(('Time = ',tim)) … … 43 37 print(('Point =',p,' Time=',tim[indt1])) 44 38 return indt1 45 46 def getvar(filename,var):47 myvar = pp(file=filename,var=var,compute="nothing").getf()48 return myvar49 39 50 40 def getindex(lat,lon,mylat,mylon): … … 57 47 indt=findindextime(tini,lt0,ltchoice,p) 58 48 indlat,indlon=getindex(lat,lon,p[1],p[0]) 59 myvar=getvar( f1,var)[indt,:,indlat,indlon]49 myvar=getvar(nc1,var)[indt,:,indlat,indlon] 60 50 return myvar 61 51 ############################ … … 92 82 font=23 93 83 94 alt=alt/1000.95 96 84 mpl.plot(myvar1,alt,'r',label='Entry') 97 85 mpl.plot(myvar2,alt,'g',label='Entry-like on edge')
Note: See TracChangeset
for help on using the changeset viewer.