Changeset 4320 for BOL/Multi_atlas/atlas
- Timestamp:
- Nov 3, 2022, 12:02:26 PM (2 years ago)
- Location:
- BOL/Multi_atlas/atlas
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/Multi_atlas/atlas/atlas_none.py
r4309 r4320 47 47 (opts, args) = parser.parse_args() 48 48 49 print 'pmin = ',opts.pmin49 print('pmin = ',opts.pmin) 50 50 centerlon=float(opts.lonmax)-180 51 print 'centerlon = ',centerlon52 #quit() 51 print('centerlon = ',centerlon) 52 53 53 #--------------------------------------------------------------------------------- 54 54 import math … … 71 71 #craz() 72 72 if opts.simulation is None: 73 print "Available simulations at %s are : "%opts.input,74 for s in all_SE_simulations() : print s,73 print("Available simulations at %s are : "%opts.input,) 74 for s in all_SE_simulations() : print(s,) 75 75 exit(0) 76 76 # … … 109 109 else: 110 110 simu=svsg(opts.simulation,variable,opts.season,opts.grid) 111 print 'variable = ',variable111 print('variable = ',variable) 112 112 reff=svsg(opts.reference,variable,opts.season,opts.grid) 113 113 # … … 119 119 #cas1 sim2 != sim1 ; sim1 != OBS ; sim2 != OBS 120 120 if (opts.simulation != 'OBS' and opts.reference != 'OBS' and opts.simulation != opts.reference ) : 121 print 'simu = ',opts.simulation122 print 'reff = ',opts.reference121 print('simu = ',opts.simulation) 122 print('reff = ',opts.reference) 123 123 simu_pres = svsg(opts.simulation,'pres',opts.season,opts.grid) 124 124 simu = ml2pl(simu,simu_pres) 125 125 simu = zonmean(simu) 126 print 'simu = ',simu126 print('simu = ',simu) 127 127 reff_pres = svsg(opts.reference,'pres',opts.season,opts.grid) 128 128 reff = ml2pl(reff,reff_pres) 129 129 reff = zonmean(reff) 130 print 'reff = ',reff130 print('reff = ',reff) 131 131 ### IM250821 : projection grille horizontale 132 132 # reff=regrid(reff,simu) 133 133 simu=regrid(simu,reff) 134 ### IM250821 end135 134 diff=minus(simu,reff) 136 print 'diff_zonmean simu = ',diff137 print ' cas1 sim ref on pressure levels w/ zonmean '135 print('diff_zonmean simu = ',diff) 136 print(' cas1 sim ref on pressure levels w/ zonmean ') 138 137 #cas2 sim !=$ OBS ; ref = OBS 139 138 elif (opts.simulation != 'OBS' and opts.reference == 'OBS' ) : 140 print 'cas2'139 print('cas2') 141 140 ### interpolation sur des niveaux de pression 142 141 simu_pres = svsg(opts.simulation,'pres',opts.season,opts.grid) 143 142 simu = ml2pl(simu,simu_pres) 144 143 ### moyenne zonale 145 144 simu = zonmean(simu) 146 145 ### moyenne zonale 147 146 reff = zonmean(reff) … … 150 149 ### differences moyennes zonales 151 150 diff=minus(simu,reff) 152 print ' cas2 sim ref on pressure levels w/ zonmean '151 print(' cas2 sim ref on pressure levels w/ zonmean ') 153 152 #cas3 sim1 = sim2 154 153 elif ( opts.simulation == opts.reference and opts.simulation != 'OBS') : … … 158 157 reff = simu 159 158 diff=minus(simu,reff) 160 print ' cas3 sim ref on pressure levels w/ zonmean '159 print(' cas3 sim ref on pressure levels w/ zonmean ') 161 160 else : 162 print ' Cas non prevu !! '163 print ' Modifier l appel de atlas_none.py et relancer '161 print(' Cas non prevu !! ') 162 print(' Modifier l appel de atlas_none.py et relancer ') 164 163 exit(0) 165 164 else: 166 165 #27.11.21 if (opts.grid == '' ) : reff=regrid(reff,simu) 167 168 166 if ( opts.simulation != opts.reference ) : reff=regrid(reff,simu) 167 diff=minus(simu,reff) 169 168 170 169 pparams = plot_params(variable,'full_field') 171 #print 'minp',opts.minp172 170 vertical_interval = 'trYMaxF=1000|trYMinF=1' 173 171 #vertical_interval = 'trYMaxF=1000|trYMinF=100' … … 193 191 pdf_page=cpage([[simu_fig]],orientation='landscape', 194 192 page_trim=True, fig_trim=True, format='pdf', title=variable+" "+opts.simulation) 195 print 'PB = ',opts.dirpng,opts.season,opts.simulation,'MAP',opts.region,variable 193 print('PB = ',opts.dirpng,opts.season,opts.simulation,'MAP',opts.region,variable) 194 print('DIRpng/im.pdf=',opts.dirpng+"/"+opts.season+"/"+opts.simulation+"/MAP/"+opts.region+"/"+variable+".pdf") 196 195 pdfargs.append(cfile(pdf_page,target=opts.dirpng+"/"+opts.season+"/"+opts.simulation+"/MAP/"+opts.region+"/"+variable+".pdf")) 197 196 simu_avg=cvalue(space_average(simu)) … … 223 222 offset = tmp_aux_params['offset'] 224 223 else: 225 224 offset=0.0 226 225 if 'scale' in tmp_aux_params: 227 226 scale = tmp_aux_params['scale'] … … 273 272 if not is3d(variable): 274 273 # -- apply a mask corresponding to the reference 275 276 277 274 mask = div(reff,reff) 275 msimu = mul(wsimu,mask) 276 # -- Compute the zonal mean 278 277 zmean=ccdo(msimu, operator='zonmean') 279 278 ref_zmean=ccdo(wreff, operator='zonmean') 280 279 # 281 282 283 280 sim=opts.simulation 281 #if variable in ['zg500']: 282 # ref_zmean = ccdo(ref_zmean,operator='-b F32 mulc,1') 284 283 # zmean = ccdo(zmean,operator='-b F32 mulc,1') 285 284 zmean_fig=curves(cens([sim,ref],zmean,ref_zmean), 286 285 title="", 287 286 lgcols=3, … … 330 329 # # Composite figure 331 330 if is3d(variable): 332 333 331 page=cpage([[simu_fig,ref_fig],[diff_fig,None]],orientation='landscape', page_trim=True, fig_trim=True) 332 pdf_page=cpage([[simu_fig,ref_fig],[diff_fig,None]],orientation='landscape', 334 333 page_trim=True, fig_trim=True, format='pdf', title=variable+" "+opts.simulation) 335 334 else: … … 341 340 thumbnail_size = 200 342 341 if is3d(variable): 343 344 345 346 347 348 349 350 351 352 353 else: 354 355 356 357 358 359 360 361 362 363 342 index+=open_line(varlongname(variable)+' ('+variable+')')+\ 343 cell("%.2g"%diff_avg,cfile(diff_fig))+\ 344 cell("%.2g"%rmsd,cfile(diff_fig))+\ 345 cell(simu,cfile(simu_fig),thumbnail=thumbnail_size,hover=False)+\ 346 cell(ref,cfile(ref_fig),thumbnail=thumbnail_size,hover=False)+\ 347 cell(text_diff,cfile(diff_fig),thumbnail=thumbnail_size,hover=False)+\ 348 ' '+\ 349 cell('page',cfile(page),thumbnail=thumbnail_size,hover=False)+\ 350 cell('Pdf',cfile(pdf_page)) 351 close_line() 352 else: 353 index+=open_line(varlongname(variable)+' ('+variable+')')+\ 354 cell("%.2g"%diff_avg,cfile(diff_fig))+\ 355 cell("%.2g"%rmsd,cfile(diff_fig))+\ 356 cell(simu,cfile(simu_fig),thumbnail=thumbnail_size,hover=False)+\ 357 cell(ref,cfile(ref_fig),thumbnail=thumbnail_size,hover=False)+\ 358 cell(text_diff,cfile(diff_fig),thumbnail=thumbnail_size,hover=False)+\ 359 cell('zonal mean',cfile(zmean_fig),thumbnail=thumbnail_size,hover=False)+\ 360 cell('page',cfile(page),thumbnail=thumbnail_size,hover=False)+\ 361 cell('Pdf',cfile(pdf_page)) 362 close_line() 364 363 # 365 364 # Finalisons l'index html -
BOL/Multi_atlas/atlas/lmdz_SE.py
r3745 r4320 32 32 # Saisons gérées et leur traduction CDO 33 33 ######################################################################################### 34 seasons={ 'YEAR':"", 'DJF' : "-timavg -selmon,1,2,12", 'JJA' : "-timavg -selmon,6,7,8" , 'JJAS' : "-timavg -selmon,6,7,8,9" }35 34 #seasons={ 'YEAR':"", 'DJF' : " selmon,1,2,12", 'JJA' : " selmon,6,7,8" , 'JJAS' : "-timavg -selmon,6,7,8,9" } 36 35 #seasons={ 'YEAR':"", 'DJF' : "-timavg -selmon,1,2,12", 'JJA' : "-timavg -selmon,6,7,8" , 'JJAS' : "-timavg -selmon,6,7,8,9" } 36 seasons={ 'YEAR':"", 'DJF' : "-timavg -selmon,1,2,12", 'JJA' : "-timavg -selmon,6,7,8" , 'JJAS' : "-timavg -selmon,6,7,8,9", 'MAM' : "-timavg -selmon,3,4,5", 'SON' : "-timavg -selmon,9,10,11" } 37 37 38 38 … … 40 40 # Definitions pour l'acces aux obs gérées par Ionela 41 41 ######################################################################################### 42 cproject('OBS', ('period','fx'), ('root','/ modfs/ipslfs/dods/fabric/lmdz/SE/CMOR/OBS')) #, '/data/musat/LMDZ6/SE/CMOR/OBS'))42 cproject('OBS', ('period','fx'), ('root','/thredds/ipsl/fabric/lmdz/SE/CMOR/OBS')) #, '/data/musat/LMDZ6/SE/CMOR/OBS')) 43 43 dataloc(project='OBS',url='${root}/${variable}.nc') 44 44 # Définiton de variables dérivées pour ce projet … … 101 101 derive('OBS','dtr','minus','tasmax','tasmin') 102 102 103 calias('OBS', 'hflsevap', 'hfls', scale=1./2.5e6) 103 104 104 105 ######################################################################################### … … 117 118 ('period','fx'), 118 119 'years', 119 ('root','/ modfs/ipslfs/dods/aidelkad/lmdz/SE/ORIG'),120 ('root','/thredds/ipsl/musat/lmdz/SE/ORIG'), 120 121 separator='|') 121 122 #exemple de nom de fichier : NPv3.1ada_SE_1982_1991_1M_histmthCOSP.nc … … 164 165 calias('SE','hur','rhum', scale=100.) 165 166 calias('SE','clt','cldt', scale=100.) 166 calias('SE','cltcalipso', scale=100.)167 calias('SE','clhcalipso', scale=100.)168 calias('SE','clmcalipso', scale=100.)169 calias('SE','cllcalipso', scale=100.)167 calias('SE','cltcalipso','cltcalipso', scale=100.) 168 calias('SE','clhcalipso','clhcalipso', scale=100.) 169 calias('SE','clmcalipso','clmcalipso', scale=100.) 170 calias('SE','cllcalipso','cllcalipso', scale=100.) 170 171 171 172 # Variables dérivées … … 257 258 258 259 259 def svsg(simulation,variable,season='YEAR',grid='',root='/ modfs/ipslfs/dods/aidelkad/lmdz/SE/ORIG'):260 def svsg(simulation,variable,season='YEAR',grid='',root='/thredds/ipsl/musat/lmdz/SE/ORIG'): 260 261 """ 261 262 Rend l'objet CliMAF pour une variable d'une simulation, pour les données … … 289 290 if grid != '' : 290 291 if grid not in grid_remapfiles : 291 print "La grille %s n'est pas connue"%options.grid;292 print("La grille %s n'est pas connue"%options.grid) ; 292 293 return None 293 294 rds=regrid(seas,fds(grid_remapfiles[grid],period='fx')) 294 295 return rds 295 296 296 def bias_SE(simu,variable,season='YEAR',grid='',root='/ modfs/ipslfs/dods/aidelkad/lmdz/SE/ORIG') :297 def bias_SE(simu,variable,season='YEAR',grid='',root='/thredds/ipsl/musat/lmdz/SE/ORIG') : 297 298 """ 298 299 Calcule le biais pour une variable d'une simu, vs 'OBS' … … 320 321 shortvarname = longvarname = variable 321 322 if variable=='tas': 322 323 323 longvarname = '2M Temperature' 324 shortvarname = '2M Temp.' 324 325 if variable=='tasmax': 325 326 326 longvarname = '2M daymax Temperature' 327 shortvarname = '2M daymx Temp.' 327 328 if variable=='tasmin': 328 329 329 longvarname = '2M daymin Temperature' 330 shortvarname = '2M daymn Temp.' 330 331 if variable=='DRT': 331 332 332 longvarname = '2M diurnal amplitude temperature' 333 shortvarname = '2M dtr ' 333 334 if variable=='pr': 334 335 longvarname = 'Precipitation' … … 495 496 # 496 497 if short: 497 498 return shortvarname 498 499 else: 499 500 501 502 500 return longvarname 501 502 503
Note: See TracChangeset
for help on using the changeset viewer.