Changeset 3664
- Timestamp:
- Feb 28, 2025, 11:16:41 AM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/z2sig/build_sig.py
r3651 r3664 9 9 import datetime 10 10 from matplotlib import pyplot 11 12 13 ###################################################################### 14 # Input Parameters 15 ###################################################################### 16 input_file = 'z2sig.def_47' 17 ps=1.1 # in Pa 18 pa=0.5 19 preff=2 20 21 # New levels 22 mynbl=201 23 n=float(mynbl) 24 25 plot = True 26 # plot = False 27 11 28 12 29 ###################################################################### … … 22 39 data=np.zeros(nbline-1,dtype='f') 23 40 i=0 41 nbl = 0 24 42 for line in mylines: 25 43 s=str.split(line) … … 28 46 else: 29 47 data[i-1]=float(s[0]) 48 nbl = nbl+1 30 49 i=i+1 31 return data,hh 50 return data,hh,nbl 32 51 33 ###################################################################### 34 # Input Parameters 35 ###################################################################### 36 nbl=47 37 data,hh=readfile('z2sig.def_47') 38 # nb of levels 39 clev=np.linspace(1,nbl,nbl) 40 ps=1.1 41 # New levels 42 mynbl=201 43 n=float(mynbl) 44 plot = True 45 plot = False 52 data,hh,nbl = readfile(input_file) 46 53 47 54 ##################### … … 107 114 # hybrid pressure: 108 115 nsig=np.zeros(nbl,dtype='f') 109 pa=0.5 #ps110 preff=2 #ps111 116 for i in range(nbl): 112 117 nsig[i]=sig_hybrid(sig[i],pa,preff) … … 161 166 162 167 if plot: 168 clev=np.linspace(1,nbl,nbl) 163 169 ### Plot pressure levels 164 170 mpl.figure(figsize=(50/2.54, 30/2.54),facecolor='w')
Note: See TracChangeset
for help on using the changeset viewer.