- Timestamp:
- Aug 2, 2018, 2:41:43 PM (7 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r1998 r2007 6469 6469 return 6470 6470 6471 def DataSetSection_multidims(values , filen, varn):6471 def DataSetSection_multidims(values0, filen, varn): 6472 6472 """ Function to get a section (values along multiple dimensions) of a given data-set 6473 values = [dimn1],[beg1],[end1],[int1]@[...[[dimnM],[begM],[endM],[intM]]]6473 values0= [dimn1],[beg1],[end1],[int1]@[...[[dimnM],[begM],[endM],[intM]]]:[oldname] 6474 6474 [dimni]: name of the dimension 6475 6475 [begi],[endi],[inti]: beginning, end and interval along the dimension-axis 6476 6476 [endi] = -1, last value 6477 6477 NOTE: dimensions without values are taken allover their size 6478 [oldname]= whether should be used the 'old' name version (using slice values) or not ('False') 6479 * NOTE: this value is optional if it is not present oldname = True 6478 6480 filen= netCDF with the data-set 6479 6481 varn= ',' list of variables, 'all' for all variables in data-set … … 6486 6488 print DataSetSection_multidims.__doc__ 6487 6489 quit() 6490 6491 if len(values0.split(':')) == 1: 6492 values = values0 + [] 6493 oldn = True 6494 else: 6495 values = values0.split(':')[0] 6496 oldn = gen.Str_Bool(values0.split(':')[1]) 6488 6497 6489 6498 Ndims = len(values.split('@')) … … 6504 6513 str(endvs[idim]) + '-I' + str(intvs[idim]) 6505 6514 6506 ofile = ofile=filen.split('.')[0] + ofiletile + '.nc' 6515 # Old name 6516 if oldn: 6517 ofile = ofile=filen.split('.')[0] + ofiletile + '.nc' 6518 else: 6519 ofile = 'newfile_multidims.nc' 6507 6520 6508 6521 nciobj = NetCDFFile(filen,'r') -
trunk/tools/obs-sim_Comparison.bash
r2006 r2007 189 189 values='Time,0,-1,1@bottom_top,0,-1,1@south_north,'${ysnd}','${ysnd}',1@' 190 190 values=${values}'west_east,'${xsnd}','${xsnd}',1@south_north_stag,'${ysnd}',' 191 values=${values}${ysnd1}',1@west_east_stag,'${xsnd}','${xsnd1}',1 '191 values=${values}${ysnd1}',1@west_east_stag,'${xsnd}','${xsnd1}',1:False' 192 192 python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen} \ 193 193 -S ${values} -v all … … 213 213 Hhfilen=`echo ${Hfilen} | tr '.' ' ' | awk '{print $1}'` 214 214 215 ofilen=${Dfilen}/${Hhfilen}'_Time_B0-E-1-I1_bottom_top_B0-E-1-I1_'${yslc}'_'${xslc}'_' 216 ofilen=${ofilen}${ystslc}'_'${xstslc}'.nc' 215 ofilen='newfile_multidims.nc' 217 216 mv ${ofilen} ${simsndptf} 218 217 fi … … 304 303 values='Time,0,-1,1@south_north,'${ysnd}','${ysnd}',1@' 305 304 values=${values}'west_east,'${xsnd}','${xsnd}',1@south_north_stag,'${ysnd}',' 306 values=${values}${ysnd1}',1@west_east_stag,'${xsnd}','${xsnd1}',1 '305 values=${values}${ysnd1}',1@west_east_stag,'${xsnd}','${xsnd1}',1:False' 307 306 python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen} \ 308 307 -S ${values} -v all … … 323 322 xstslc='west_east_stag_B'${xsnd}'-E'${xsnd1}'-I1' 324 323 325 ofilen= ${filen}'_Time_B0-E-1-I1_'${yslc}'_'${xslc}'_'${ystslc}'_'${xstslc}'.nc'324 ofilen='newfile_multidims.nc' 326 325 mv ${ofilen} ${simsfcptf} 327 326 fi … … 836 835 if test ${Nconfc} -gt 1; then 837 836 values=${odir}',Time,time' 838 HMT='simout_snddiags_,'${stid} ,'nc'837 HMT='simout_snddiags_,'${stid}'_'${expn},'nc' 839 838 python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values} \ 840 839 -f ${HMT} -v all … … 857 856 fi 858 857 859 iexp=`e cpr ${iexp} + 1`858 iexp=`expr ${iexp} + 1` 860 859 # end of experiments 861 860 done
Note: See TracChangeset
for help on using the changeset viewer.