Changeset 13899 for NEMO/branches/2020/tickets_icb_1900/tests/STATION_ASF/EXPREF/plot_station_asf.py
- Timestamp:
- 2020-11-27T17:26:33+01:00 (4 years ago)
- Location:
- NEMO/branches/2020/tickets_icb_1900
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/tickets_icb_1900
- Property svn:externals
-
NEMO/branches/2020/tickets_icb_1900/tests/STATION_ASF/EXPREF/plot_station_asf.py
r12629 r13899 1 #!/usr/bin/env python 1 #!/usr/bin/env python3 2 2 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- 3 3 4 # Post-diagnostic of STATION_ASF / L. Brodeau, 20 194 # Post-diagnostic of STATION_ASF / L. Brodeau, 2020 5 5 6 6 import sys 7 7 from os import path as path 8 #from string import replace9 8 import math 10 9 import numpy as nmp 11 #import scipy.signal as signal12 10 from netCDF4 import Dataset 13 11 import matplotlib as mpl … … 15 13 import matplotlib.pyplot as plt 16 14 import matplotlib.dates as mdates 17 #from string import find 18 #import warnings 19 #warnings.filterwarnings("ignore") 20 #import time 21 22 #import barakuda_plot as bp 23 #import barakuda_tool as bt 24 25 reload(sys) 26 sys.setdefaultencoding('utf8') 27 28 cy1 = '2016' ; # First year 15 16 cy1 = '2018' ; # First year 29 17 cy2 = '2018' ; # Last year 30 31 jt0 = 032 jt0 = 1751933 34 18 35 19 dir_figs='.' … … 72 56 narg = len(sys.argv) 73 57 if narg != 2: 74 print 'Usage: '+sys.argv[0]+' <DIR_OUT_SASF>'; sys.exit(0)58 print('Usage: '+sys.argv[0]+' <DIR_OUT_SASF>'); sys.exit(0) 75 59 cdir_data = sys.argv[1] 76 60 … … 82 66 def chck4f(cf): 83 67 cmesg = 'ERROR: File '+cf+' does not exist !!!' 84 if not path.exists(cf): print cmesg; sys.exit(0)68 if not path.exists(cf): print(cmesg); sys.exit(0) 85 69 86 70 ###cf_in = nmp.empty((), dtype="S10") … … 104 88 # Getting time array from the first file: 105 89 id_in = Dataset(cf_in[0]) 106 vt = id_in.variables['time_counter'][ jt0:]90 vt = id_in.variables['time_counter'][:] 107 91 cunit_t = id_in.variables['time_counter'].units ; print(' "time_counter" is in "'+cunit_t+'"') 108 92 id_in.close() … … 138 122 if ctest == 'skin': id_in = Dataset(cf_in[ja]) 139 123 if ctest == 'noskin': id_in = Dataset(cf_in_ns[ja]) 140 xF[:,ja] = id_in.variables[L_VNEM[jv]][ jt0:,1,1] # only the center point of the 3x3 spatial domain!124 xF[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain! 141 125 if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name 142 126 id_in.close() … … 180 164 rmlt = 10.**(int(romagn)) / 2. 181 165 yrng = math.copysign( math.ceil(abs(rmax)/rmlt)*rmlt , rmax) 182 #print 'yrng = ', yrng ; #sys.exit(0)183 166 184 167 fig = plt.figure(num = 10+jv, figsize=size_fig, facecolor='w', edgecolor='k') … … 211 194 for ja in range(nb_algos-1): 212 195 id_in = Dataset(cf_in[ja]) 213 xF[:,ja] = id_in.variables[L_VNEM[jv]][ jt0:,1,1] # only the center point of the 3x3 spatial domain!196 xF[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain! 214 197 if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name 215 198 id_in.close() 216 199 # 217 200 id_in = Dataset(cf_in_ns[ja]) 218 xFns[:,ja] = id_in.variables[L_VNEM[jv]][ jt0:,1,1] # only the center point of the 3x3 spatial domain!201 xFns[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain! 219 202 if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name 220 203 id_in.close() … … 229 212 rmlt = 10.**(int(romagn)) / 2. 230 213 yrng = math.copysign( math.ceil(abs(rmax)/rmlt)*rmlt , rmax) 231 print 'yrng = ', yrng ; #sys.exit(0) 232 233 234 235 214 215 236 216 for ja in range(nb_algos-1): 237 217
Note: See TracChangeset
for help on using the changeset viewer.