- Timestamp:
- May 10, 2017, 10:18:47 PM (8 years ago)
- Location:
- trunk/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/documentation/ncmanage/compute_opersvarsfiles.html
r1538 r1561 38 38 'divc',[modval1]: [prevalues] divide by [modval1]<BR> 39 39 'forwrdderiv',[N],[ord],[dim]: un-scaled forward [N]-derivative of order [ord] along dimension [dim] of [var]<BR> 40 'ifreq_anom',[stepdimn],[stepvardimn],[istep]: computing anomalies by substracting sub-means at each<BR> 41 step by averaging from there all values taken every [istep] along dimension [stepdim]. <BR> 42 mean(j) = sum(matA[j+k*istep]_k=0,Nstep)/Nstep; Nstep = len(stepdimn)/istep; j=[0,istep]<BR> 43 [stepdimn]= name of the dimension along which to sample<BR> 44 [stepvardimn]= name of the variable-dimension with the values for [stepdimn]<BR> 45 [istep]= frequency to sample<BR> 46 'ifreq_mean',[stepdimn],[stepvardimn],[istep]: computing sub-means at each step by averaging from <BR> 47 there all values taken every [istep] along dimension [stepdim]. <BR> 48 mean(j) = sum(matA[j+k*istep]_k=0,Nstep)/Nstep; Nstep = len(stepdimn)/istep; j=[0,istep]<BR> 49 [stepdimn]= name of the dimension along which to sample<BR> 50 [stepvardimn]= name of the variable-dimension with the values for [stepdimn]<BR> 51 [istep]= frequency to sample<BR> 52 'ifreq_normmeanstd',[stepdimn],[stepvardimn],[istep]: nbormalizing anomalies by substracting mean(j)/dtsv(j) <BR> 53 sub-stats at each step by averaging from there all values taken every [istep] along dimension[stepdim]. <BR> 54 mean(j) = sum(matA[j+k*istep]_k=0,Nstep)/Nstep; std(j) = std(matA[j+k*istep]_k=0,Nstep); <BR> 55 Nstep = len(stepdimn)/istep; j=[0,istep]<BR> 56 [stepdimn]= name of the dimension along which to sample<BR> 57 [stepvardimn]= name of the variable-dimension with the values for [stepdimn]<BR> 58 [istep]= frequency to sample<BR> 40 59 'inv': inverting [prevalues] (1/[prevalues])<BR> 41 60 'lowthres',[modval1],[modval2]: if [prevalues] < [modval1]; prevalues = [modval2]<BR> … … 49 68 'norm_meanstd',[NOTnormdims]: normalization of data as: (val-<val>)/stdev(val) except along <BR> 50 69 dimensions [NOTnormdims] (':' list of dimension names, or 'any' for using all dimensions)<BR> 51 70 dimensions [NOTnormdims] (':' list of dimension names)<BR> 52 71 'pot': powering with [var] ([prevalues] ** [var])<BR> 53 72 'potc',[modval1]: [prevalues] ** [modval1]<BR> … … 72 91 <DIV CLASS="valins"> 73 92 * Transforming temperature from Kelvin to °C<BR> 74 93 $ python ${pyHOME}/nc_var.py -o compute_opersvarsfiles -S 'west_east|XLONG|-1;south_north|XLAT|-1;Time|Times|3@subc,273.15|wrfout_d01_2001-11-11_00:00:00|T2' -v 'tempC,air!temperature,C'<BR> 75 94 * Computing the x-derivative of first order<BR> 76 95 $ python ${pyHOME}/nc_var.py -o compute_opersvarsfiles -S 'lon|lon|-1;lat|lat|-1;time_counter|time_counter|-1@forwrdderiv,1,1,2|histday.nc|t2m' -v 'tasderiv,x-derivative|of|air|temperature,K' <BR> 77 96 * Normalizing a variable by substracting its mean and weighting by its standard-deviation<BR> 78 97 $ python ${pyHOME}/nc_var.py -o compute_opersvarsfiles -S 'west_east|XLONG|-1;south_north|XLAT|-1;Time|WRFtime|-1@norm_meanstd,Time|wrfout_d01_1995-01-01_00:00:00|T2' -v 'tasnorm,normalized!2m!temperature!substracting!mean!and!weighting!by!standard!deviation,K' <BR> 79 98 * Getting height of the frist level from surface from a WRF file<BR> 80 99 $ python $pyHOME/nc_var.py -o compute_opersvarsfiles -S 'west_east|XLONG|-1;south_north|XLAT|-1;bottom_top_stag|ZNW|1@addc,0|wrfout_d01_1995-01-01_00:00:00|PH%west_east|XLONG|-1;south_north|XLAT|-1;bottom_top_stag|ZNW|1@add|wrfout_d01_1995-01-01_00:00:00|PHB%contoperation@divc,9.81%west_east|XLONG|-1;south_north|XLAT|-1;Time|WRFtime|-1@sub|wrfout_d01_1995-01-01_00:00:00|HGT' -v 'height1lev,height!above!surface!of!first!level,m'<BR> 81 100 * Computing wind-direction from a WRF file<BR> 82 $ python $pyHOME/nc_var.py -o compute_opersvarsfiles -S 'west_east|XLONG|-1;south_north|XLAT|-1;Time|WRFtime|-1@addc,0|wrfout_d01_1995-01-01_00:00:00|V10%west_east|XLONG|-1;south_north|XLAT|-1;Time|WRFtime|-1@arctan|wrfout_d01_1995-01-01_00:00:00|U10%contoperation@mulc,57.2957795131' -v 'wsdir,2m!wind!direction,Degrees' 101 $ python $pyHOME/nc_var.py -o compute_opersvarsfiles -S 'west_east|XLONG|-1;south_north|XLAT|-1;Time|WRFtime|-1@addc,0|wrfout_d01_1995-01-01_00:00:00|V10%west_east|XLONG|-1;south_north|XLAT|-1;Time|WRFtime|-1@arctan|wrfout_d01_1995-01-01_00:00:00|U10%contoperation@mulc,57.2957795131' -v 'wsdir,2m!wind!direction,Degrees' 102 * Computing normalized anomalyes of WRF outputs by the mean and standard deviations of the outputs at the same hour<BR> 103 $ python nc_var.py -o compute_opersvarsfiles -S 'Time|WRFtime|-1;south_north|XLAT|-1;west_east|XLONG|-1@ifreq_normmeanstd,Time,WRFtime,8|/home/lluis/PY/wrfout_d01_1995-01-01_00:00:00|T2' -v 'tas_ifreqnormmeanstd,tas!anomaly!by!substracting!frequency!mean!at!every!8!time-steps,K' 104 83 105 </DIV> 84 106 </BODY> -
trunk/tools/generic_tools.py
r1558 r1561 10206 10206 'divc',[modval1]: divide by [modval1] 10207 10207 'forwrdderiv',[N],[ord],[dim]: un-scaled forward [N]-derivative of order [ord] along dimension [dim] of matA 10208 'ifreq_anom',[dimns],[istep],[stepdimn]: computing anomalues by substracting sub-means at each step by 10209 averaging from there all values taken every [istep] along dimension [stepdim]. 10210 mean(j) = sum(matA[j+k*istep]_k=0,Nstep)/Nstep; Nstep = len(stepdimn)/istep; j=[0,istep] 10211 [dimns]= ':' list of dimensions of the matrice 10212 [istep]= frequency to sample 10213 [stepdimn]= name of the dimension along which to sample 10214 'ifreq_mean',[dimns],[istep],[stepdimn]: computing sub-means at each step by averaging from there 10215 all values taken every [istep] along dimension [stepdim]. mean(j) = sum(matA[j+k*istep]_k=0,Nstep)/Nstep; 10216 Nstep = len(stepdimn)/istep; j=[0,istep] 10217 [dimns]= ':' list of dimensions of the matrice 10218 [istep]= frequency to sample 10219 [stepdimn]= name of the dimension along which to sample 10208 10220 'inv': inverting matA (1/matA) 10209 10221 'lowthres',[modval1],[modval2]: if [val] < [modval1]; val = [modval2] … … 10350 10362 # Dictionary with the description of the operations 10351 10363 Lopn = {'add': '+', 'addc': '+', 'arctan': 'arctangent', 'div': '/', 'divc': '/',\ 10352 'inv': '^(-1)', 'lowthres': '<', 'mul': '*', 'mulc': '*', \ 10353 'norm_meanminmax': 'Norm_mean_minmax', \ 10364 'ifreq_mean': 'ifreq_mean', 'ifreq_mean': 'ifreq_mean', 'inv': '^(-1)', \ 10365 'lowthres': '<', 'mul': '*', \ 10366 'mulc': '*', 'norm_meanminmax': 'Norm_mean_minmax', \ 10354 10367 'norm_minmax': 'Norm_minmax', 'norm_meanstd': 'Norm_mean_devstd', 'pot': '^', \ 10355 10368 'potc': '^', 'repl': 'repl_excpt', 'replbig': 'repl_excpt_bigger', \ … … 10362 10375 # Available operations 10363 10376 opavail = ['add', 'addc', 'arctan', 'centerderiv', 'div', 'divc', 'forwrdderiv', \ 10364 'i nv',\10377 'ifreq_anom', 'ifreq_mean', 'inv', \ 10365 10378 'lowthres', 'lowthres@oper', 'mul', 'mulc', 'norm_meanminmax', 'norm_minmax', \ 10366 10379 'norm_meanstd', 'pot', 'potc', 'repl', 'replbig', 'repless', 'sub', 'subc', \ … … 10431 10444 quit(-1) 10432 10445 derivcoeff = forwrdderiv[Nderiv-1,order-1,:] 10446 elif opN[0:10] == 'ifreq_anom': 10447 opn = 'ifreq_anom' 10448 dimns = opN.split(',')[1].split(':') 10449 istep = int(opN.split(',')[2]) 10450 stepdimn = opN.split(',')[3] 10451 Lopn['ifreq_anom'] = 'anomaly by substracting ifreq_mean = sum(mat[j+k*' + \ 10452 str(istep)+']_k=0,Nstep)/Nstep; ' + 'Nstep=len(' + stepdimn + ')/' + \ 10453 str(istep) + '; j=[0,' + str(istep) + ']' 10454 elif opN[0:10] == 'ifreq_mean': 10455 opn = 'ifreq_mean' 10456 dimns = opN.split(',')[1].split(':') 10457 istep = int(opN.split(',')[2]) 10458 stepdimn = opN.split(',')[3] 10459 Lopn['ifreq_mean'] = 'sum(mat[j+k*' +str(istep)+']_k=0,Nstep)/Nstep; ' + \ 10460 'Nstep=len(' + stepdimn + ')/' + str(istep) + '; j=[0,' + str(istep) + ']' 10461 elif opN[0:17] == 'ifreq_normmeanstd': 10462 opn = 'ifreq_normmeanstd' 10463 dimns = opN.split(',')[1].split(':') 10464 istep = int(opN.split(',')[2]) 10465 stepdimn = opN.split(',')[3] 10466 Lopn['ifreq_normmeanstd'] = 'normalization by substracting ' + \ 10467 'ifreq_mean/ifreq_stdv ifreq_mean= sum(mat[j+k*' + str(istep) + \ 10468 ']_k=0,Nstep)/Nstep; ifreq_stdv=stdv(mat[j+k*' + str(istep)+']_k=0,Nstep)'+\ 10469 'Nstep=len(' + stepdimn + ')/' + str(istep) + '; j=[0,' + str(istep) + ']' 10470 elif opN[0:4] == 'inv': 10471 opn = 'inv' 10472 Lopn['inv'] = 'inverse' 10433 10473 elif opN[0:8] == 'lowthres' and opN.find('@') == -1: 10434 10474 opn = 'lowthres' … … 10662 10702 matA[tuple(mat5)]*derivcoeff[5] + matA[tuple(mat6)]*derivcoeff[6] + \ 10663 10703 matA[tuple(mat7)]*derivcoeff[7] + matA[tuple(mat8)]*derivcoeff[8] 10704 elif opn == 'ifreq_anom': 10705 istepdim = dimns.index(stepdimn) 10706 lenstepdim = matA.shape[istepdim] 10707 Nsteps = lenstepdim/istep 10708 10709 meannewmatsize = list(matA.shape) 10710 meannewmatsize[istepdim] = istep 10711 meannewmat = np.zeros(tuple(meannewmatsize), dtype=valtype) 10712 matAshape = matA.shape 10713 NmatAdims = len(matAshape) 10714 10715 newmat = np.zeros(tuple(matAshape), dtype=valtype) 10716 for j in range(istep): 10717 slicemat = [] 10718 slicenewmat = [] 10719 meandims = [] 10720 for idim in range(NmatAdims): 10721 if idim == istepdim: 10722 slicemat.append(slice(j,j+Nsteps*istep,istep)) 10723 slicenewmat.append(j) 10724 meandims.append(idim) 10725 else: 10726 slicemat.append(slice(0,matAshape[idim])) 10727 slicenewmat.append(slice(0,matAshape[idim])) 10728 mdims=tuple(meandims) 10729 meannewmat[tuple(slicenewmat)]= np.mean(matA[tuple(slicemat)], axis=mdims) 10730 10731 # Computing anomaly 10732 for it in range(Nsteps): 10733 slicemat = [] 10734 for idim in range(NmatAdims): 10735 if idim == istepdim: 10736 slicemat.append(j+it*istep) 10737 else: 10738 slicemat.append(slice(0,matAshape[idim])) 10739 newmat[tuple(slicemat)] = matA[tuple(slicemat)] - \ 10740 meannewmat[tuple(slicenewmat)] 10741 additional = [meannewmat] 10742 10743 elif opn == 'ifreq_mean': 10744 istepdim = dimns.index(stepdimn) 10745 lenstepdim = matA.shape[istepdim] 10746 Nsteps = lenstepdim/istep 10747 10748 newmatsize = list(matA.shape) 10749 newmatsize[istepdim] = istep 10750 newmat = np.zeros(tuple(newmatsize), dtype=valtype) 10751 matAshape = matA.shape 10752 NmatAdims = len(matAshape) 10753 10754 for j in range(istep): 10755 slicemat = [] 10756 slicenewmat = [] 10757 meandims = [] 10758 for idim in range(NmatAdims): 10759 if idim == istepdim: 10760 slicemat.append(slice(j,j+Nsteps*istep,istep)) 10761 slicenewmat.append(j) 10762 meandims.append(idim) 10763 else: 10764 slicemat.append(slice(0,matAshape[idim])) 10765 slicenewmat.append(slice(0,matAshape[idim])) 10766 mdims=tuple(meandims) 10767 newmat[tuple(slicenewmat)] = np.mean(matA[tuple(slicemat)], axis=mdims) 10768 elif opn == 'ifreq_normmeanstd': 10769 istepdim = dimns.index(stepdimn) 10770 lenstepdim = matA.shape[istepdim] 10771 Nsteps = lenstepdim/istep 10772 10773 meannewmatsize = list(matA.shape) 10774 meannewmatsize[istepdim] = istep 10775 meannewmat = np.zeros(tuple(meannewmatsize), dtype=valtype) 10776 stdnewmat = np.zeros(tuple(meannewmatsize), dtype=valtype) 10777 matAshape = matA.shape 10778 NmatAdims = len(matAshape) 10779 10780 newmat = np.zeros(tuple(matAshape), dtype=valtype) 10781 for j in range(istep): 10782 slicemat = [] 10783 slicenewmat = [] 10784 meandims = [] 10785 for idim in range(NmatAdims): 10786 if idim == istepdim: 10787 slicemat.append(slice(j,j+Nsteps*istep,istep)) 10788 slicenewmat.append(j) 10789 meandims.append(idim) 10790 else: 10791 slicemat.append(slice(0,matAshape[idim])) 10792 slicenewmat.append(slice(0,matAshape[idim])) 10793 mdims=tuple(meandims) 10794 meannewmat[tuple(slicenewmat)]= np.mean(matA[tuple(slicemat)], axis=mdims) 10795 stdnewmat[tuple(slicenewmat)]= np.std(matA[tuple(slicemat)], axis=mdims) 10796 10797 # Computing anomaly 10798 for it in range(Nsteps): 10799 slicemat = [] 10800 for idim in range(NmatAdims): 10801 if idim == istepdim: 10802 slicemat.append(j+it*istep) 10803 else: 10804 slicemat.append(slice(0,matAshape[idim])) 10805 newmat[tuple(slicemat)] = (matA[tuple(slicemat)] - \ 10806 meannewmat[tuple(slicenewmat)])/stdnewmat[tuple(slicenewmat)] 10807 additional = [meannewmat, stdnewmat] 10808 10664 10809 elif opn == 'inv': 10665 10810 newmat = retype(1., valtype) / matA -
trunk/tools/nc_var_tools.py
r1551 r1561 813 813 Nnewdims = len(newdims) 814 814 815 if Nnewdims == 0 :815 if Nnewdims == 0 or len(newvar.shape) == 0: 816 816 print '%2s %f' % ( 'NC',newvar ) 817 817 elif Nnewdims == 1: … … 7206 7206 'divc',[modval1]: [prevalues] divide by [modval1] 7207 7207 'forwrdderiv',[N],[ord],[dim]: un-scaled forward [N]-derivative of order [ord] along dimension [dim] of [var] 7208 'ifreq_anom',[stepdimn],[stepvardimn],[istep]: computing anomalies by substracting sub-means at each 7209 step by averaging from there all values taken every [istep] along dimension [stepdim]. 7210 mean(j) = sum(matA[j+k*istep]_k=0,Nstep)/Nstep; Nstep = len(stepdimn)/istep; j=[0,istep] 7211 [stepdimn]= name of the dimension along which to sample 7212 [stepvardimn]= name of the variable-dimension with the values for [stepdimn] 7213 [istep]= frequency to sample 7214 'ifreq_mean',[stepdimn],[stepvardimn],[istep]: computing sub-means at each step by averaging from 7215 there all values taken every [istep] along dimension [stepdim]. 7216 mean(j) = sum(matA[j+k*istep]_k=0,Nstep)/Nstep; Nstep = len(stepdimn)/istep; j=[0,istep] 7217 [stepdimn]= name of the dimension along which to sample 7218 [stepvardimn]= name of the variable-dimension with the values for [stepdimn] 7219 [istep]= frequency to sample 7220 'ifreq_normmeanstd',[stepdimn],[stepvardimn],[istep]: nbormalizing anomalies by substracting mean(j)/dtsv(j) 7221 sub-stats at each step by averaging from there all values taken every [istep] along dimension[stepdim]. 7222 mean(j) = sum(matA[j+k*istep]_k=0,Nstep)/Nstep; std(j) = std(matA[j+k*istep]_k=0,Nstep); 7223 Nstep = len(stepdimn)/istep; j=[0,istep] 7224 [stepdimn]= name of the dimension along which to sample 7225 [stepvardimn]= name of the variable-dimension with the values for [stepdimn] 7226 [istep]= frequency to sample 7208 7227 'inv': inverting [prevalues] (1/[prevalues]) 7209 7228 'lowthres',[modval1],[modval2]: if [prevalues] < [modval1]; prevalues = [modval2] … … 7250 7269 opinione = ['mul', 'div', 'pot'] 7251 7270 # Operations which need to deal with dimension's names and indices 7252 opdim=['norm_meanminmax', 'norm_meanstd', 'norm_minmax'] 7271 opdim = ['ifreq_anom', 'ifreq_mean', 'ifreq_normmeanstd', 'norm_meanminmax', \ 7272 'norm_meanstd', 'norm_minmax'] 7273 # Operations which require a new dimension 7274 opnewdim = ['ifreq_mean'] 7275 # istep Operations 7276 opistep = ['ifreq_anom', 'ifreq_mean', 'ifreq_normmeanstd'] 7253 7277 7254 7278 varname = varinfo.split(',')[0] … … 7310 7334 Dadditionalunits = {} 7311 7335 # Dictionary with the Headers for the names of the additional variables 7312 DHadditionalvars = {'norm_meanminmax': ['mean','min','max'], \ 7336 DHadditionalvars = {'ifreq_anom': ['ifreq_mean'], 'ifreq_normmeanstd': \ 7337 ['ifreq_mean', 'ifreq_std'], 'norm_meanminmax': ['mean','min','max'], \ 7313 7338 'norm_meanstd': ['mean','std'], 'norm_minmax': ['min','max']} 7314 7339 7315 7340 prevalues = None 7341 slicewrft = None 7342 7316 7343 for ifv in range(Nfileopers): 7317 7344 operN = opers[ifv] … … 7429 7456 Ddv[dimn] = cftimes 7430 7457 Dtdv[dimn] = np.float 7431 Dadv[dimn] = {'sta dard_name': 'time', 'long_name': 'time',\7458 Dadv[dimn] = {'standard_name': 'time', 'long_name': 'time', \ 7432 7459 'units': tunitsval + ' since ' + refdateS} 7433 7460 … … 7484 7511 usedims = 'any' 7485 7512 for iv in range(len(normi)): normi[iv] = str(normi[iv]) 7486 opern = opernS + ',' + ':'.join(dimvarvals) + ',' + \7513 opern = opernS + ',' + ':'.join(dimvarvals) + ',' + \ 7487 7514 operN.split(',')[1] + ',' + ':'.join(normi) 7515 7516 if gen.searchInlist(opistep, opernS): 7517 opern = opernS + ',' + ':'.join(dimvarvals) + ',' + \ 7518 operN.split(',')[3] + ',' + operN.split(',')[1] 7519 usedims = list(dimvarvals) 7520 7521 if gen.searchInlist(opnewdim, opernS): 7522 # Creation of a new dimension for the operation 7523 dimv = list(dimvarvals) 7524 idim = dimv.index(operN.split(',')[1]) 7525 newdimn = opernS + dimv[idim] 7526 print infmsg 7527 print ' ' + fname + ": operation '" + opernS + "' will create " + \ 7528 " a new dimension '" + newdimn + "' !!" 7529 dimv[idim] = newdimn 7530 dimvarvals = tuple(dimv) 7531 vardimnstep = operN.split(',')[2] 7532 istep = int(operN.split(',')[3]) 7533 if vardimnstep != 'WRFtime': 7534 if not objnc.variables.has_key[vardimnstep]: 7535 print errormsg 7536 print ' ' + fname + ": file '" + filen + "' does not " + \ 7537 "have variable '" + vardimnstep + "' to be used for '" + \ 7538 "ifreq_mean' !!" 7539 print ' available ones:', objnc.variables.keys() 7540 quit(-1) 7541 odimv = objnc.variables[vardimnstep] 7542 varslice, Dddv[newdimn] = SliceVarDict(odimv, dictslice) 7543 allvalues = odimv[tuple(varslice)] 7544 Dtdv[newdimn] = odimv.dtype 7545 dicattrs = {} 7546 for attrn in odimv.ncattrs(): 7547 attrval = odimv.getncattr(attrn) 7548 dicattrs[attrn] = attrval 7549 Dadv[newdimn] = dicattrs 7550 else: 7551 if slicewrft is None: 7552 print infmsg 7553 print ' '+fname+ ": computing time-variable from 'WRF'-Time" 7554 datesv = [] 7555 wrft = objnc.variables['Times'] 7556 slicewrft, dwrfd = SliceVarDict(wrft, dictslice) 7557 fdates = wrft[tuple(slicewrft)] 7558 refdate = '19491201000000' 7559 tunitsval = 'minutes' 7560 yrref=refdate[0:4] 7561 monref=refdate[4:6] 7562 dayref=refdate[6:8] 7563 horref=refdate[8:10] 7564 minref=refdate[10:12] 7565 secref=refdate[12:14] 7566 7567 refdateS= yrref +'-'+ monref + '-' + dayref + ' ' + horref + \ 7568 ':' + minref + ':' + secref 7569 7570 dt = fdates.shape[0] 7571 allvalues = np.zeros((dt), dtype=np.float) 7572 for it in range(dt): 7573 wrfdates = gen.datetimeStr_conversion(wrft[it,:], \ 7574 'WRFdatetime', 'matYmdHMS') 7575 allvalues[it] = gen.realdatetime1_CFcompilant(wrfdates, \ 7576 refdate, tunitsval) 7577 tunits = tunitsval + ' since ' + refdateS 7578 else: 7579 # Using previous computed WRFtime 7580 allvalues = cftimes 7581 7582 Dtdv[newdimn] = np.float 7583 Dadv[newdimn] = {'standard_name': 'time', 'long_name': 'time', \ 7584 'units': tunitsval + ' since ' + refdateS, 'calendar': \ 7585 'standard'} 7586 7587 # Filling-up new dimension characteristics 7588 Dds[newdimn] = istep 7589 7590 Dddv[newdimn] = [newdimn] 7591 newdimvals = np.zeros((istep), dtype=Dtdv[newdimn]) 7592 dsize = allvalues.shape[0] 7593 Nsteps = dsize/istep 7594 for it in range(istep): 7595 newdimvals[it] = np.mean(allvalues[slice(it,istep*Nsteps,istep)]) 7596 Ddv[newdimn] = newdimvals[:] 7597 7488 7598 Dadditionaldim[opernS+'@'+varn] = usedims 7599 7489 7600 if varn != 'continuation': 7490 7601 Dadditionalunits[opernS+'@'+varn] = get_varunits(varobj) … … 7593 7704 newvn = Hvarn + '_' + operS + '_' + vnS 7594 7705 newvar = objofile.createVariable(newvn, 'f4', tuple(newvdims)) 7706 print fname + ': LLuis shapes:', newvar.shape, 'newvdims:', newvdims, 'addvs:', addvs[iHv].shape 7595 7707 newvar[:] = addvs[iHv] 7596 7708 Lattr = Hvarn + ' value for operation ' + operS + ' with variable ' + vnS
Note: See TracChangeset
for help on using the changeset viewer.