f_vtk = vtkWritePointDataStructured2D( f_vtk, Ftmp , Xt, 'fp90' ) # ======= Write 100% F_km ================ f_vtk = vtkWritePointDataStructured2D( f_vtk, F_km, Xt, 'fp_km' ) # ======= Write 00% F_km ================ Ftmp[:,:] = 0.; Ftmp += F_km*id90_km f_vtk = vtkWritePointDataStructured2D( f_vtk, Ftmp , Xt, 'fp90_km' ) # Close the file at the end. f_vtk.close(); Ftmp = None if( printOn ): CfD = dict() CfD['title']='F(x,y)'; CfD['label']=fileout; CfD['N']=16 Cfp = addContourf( Xt, Yt, Ft , CfD ) CfD['title']='F_km(x,y), Ana'; CfD['label']=fileout+'_km' Cfa = addContourf( Xt, Yt, F_km, CfD ) Fym = writeCrossWindSum( Ft, Xt, None, None ) pfig = plt.figure(num=3, figsize=(12.,9.)) varLabel = '$fp_y(x) = \sum_y fp(x,y)$' axLabels = ['Cross Wind Integrated Footprint', 'x', 'sum_y fp(x,y) '] pfig = addToPlot(pfig, Xt[0,:], Fym, varLabel, axLabels, False ) Ft = Zt = Xt = Yt = None F_km = None plt.show()
Q, X, Y, resDict = quadrantAnalysis(v1, v2, qaDict) # Extract the results nQ = resDict['nQ'] # Number of quadrant hits (nQ[0] := Ntotal) SQ = resDict['SQ'] # Quadrant contributions (e.g. Reynolds stress) #klims = resDict['klims'] # === Plot quadrant analysis output === # cDict = dict() cDict['cmap'] = plt.cm.gist_yarg # Include the colormap info within a dict cDict['N'] = 12 # Number of levels in contour plot cDict['title'] = "Quadrant Analysis\n{}: z={}-{} m".format( filename, z[ijk1[2]], z[ijk2[2]]) cDict['label'] = "JPDF" CO = addContourf(X, Y, Q, cDict) CO.ax.spines['left'].set_position('zero') CO.ax.spines['bottom'].set_position('zero') #CO.ax.set_ylabel(r"$w'/\sigma_w$") #CO.ax.set_xlabel(r"$u'/sigma_u$") #plt.clabel(CO, CO.levels[:-2:3], inline=False, fontsize=10) cn = 100. / nQ[0] print(' Ejections (%) = {}, Sweeps (%) = {} '.format(cn * nQ[2], cn * nQ[4])) print(' Outward Interactions (%) = {}, Inward Interactions (%) = {} '.format( cn * nQ[1], cn * nQ[3])) #plt.legend(loc=0) if (saveFig): plt.savefig(saveFig, format='jpg', dpi=300)
# Retain unused keys from original raster PRdict = Rdict.copy() Rdict = None PRdict['R'] = PR PRdict['GlobOrig'] = PROrig PRdict['gridRot'] = rotation PRdict['dPx'] = np.array([dxG[0], dxG[1]]) if (not args.printOnly): saveTileAsNumpyZ(fileout, PRdict) # Print the raster map, first, in a coordinate system where x-axis is aligned with the windDir # and, second, in its original orientation. if (printOn or printOnly): figDims = 13. * (Xdims[::-1].astype(float) / np.max(Xdims)) fig = plt.figure(num=1, figsize=figDims) fig = addImagePlot(fig, PR, args.fileout) CfD = dict() CfD['title'] = ' Z(x,y) ' CfD['label'] = "PALM DOMAIN ON MAP" CfD['N'] = 16 CO = addContourf(XTRM, YTRM, PR[::-1, :], CfD) plt.show() XTRM = None YTRM = None PR = None PRDict = None
Rdims = np.array(np.shape(R)) ROrig = Rdict['GlobOrig'] dPx = entry2Int(Rdict['dPx']) Rdict = None if (Ry[-1] < Ry[0]): Ry *= -1. # Make values run into positive direction. R = R[::-1, :] dPx = entry2Int(dPx) print ' Rdims = {} '.format(Rdims) print ' ROrig = {} '.format(ROrig) X, Y = np.meshgrid(Rx, Ry) if (ROrig[0] == 0): print ' Resetting y-origin. ' ROrig[0] = Rdims[0] * dPx if (not printOnly): vtkWriteDataStructured2d(None, X, Y, R, fileout, 'Z') if (printOnly or printOn): CfD = dict() CfD['title'] = 'R(X,Y)' CfD['label'] = fileout + ' raster data.' CfD['N'] = 16 C = addContourf(X, Y, R, CfD) plt.show()