Beispiel #1
0
    topoDict = None

    if (all(topoDims != Rxdims)):
        msg = ''' Error: mismatch in raster data and topography data shapes
    Topo_dims={} vs. Data_dims={}'''.format(topoDims, Rxdims)
        sys.exit(msg)

    # Fill in the coordinate grid
    xa = np.arange(Rdims[1]).astype(float) * dPx[1]
    ya = np.arange(Rdims[0]).astype(float) * dPx[0]
    X, Y = np.meshgrid(xa, ya)

    # Write the data into a VTK file
    # N axis of (N,E) coordinates has to be reversed
    fname = fileout.split('.')[0] + '.vtk'
    t_vtk = vtkWriteHeaderAndGridStructured2d(X, Y, topo[::-1, :], fname,
                                              'VTK map')
    t_vtk = vtkWritePointDataHeader(t_vtk, Rx[::-1, :], 1)
    t_vtk = vtkWritePointDataStructured2D(t_vtk, Rx[::-1, :], X, varname)

    t_vtk.close()

# - - - - - - - - - - - - - - - - - - - - - - - - - - #

# Save as npz
if (not printOnly):
    Rdict['R'] = Rx
    Rdict['dPx'] = dPx
    Rdict['GlobOrig'] = ROrig
    Rdict['Nshapes'] = Nshapes
    saveTileAsNumpyZ(fileout, Rdict)
    Rdict = None
Beispiel #2
0
  
  if( vtkOn ):
    
    # Footprint to VTK-format together with the complete topography. 
    Ftmp = np.zeros( np.shape(Ft), float )
    Rdict = readNumpyZTile( filetopo )
    R = Rdict['R']
    Rdims = np.array(np.shape(R))
    ROrig = Rdict['GlobOrig']
    dPx = Rdict['dPx']
    Rdict = None
    if( all(Rdims != np.shape(Xt)) ):
      sys.exit(' Error! Mismatch Topo_dims={} vs. Fp_dims={}'.format(Rdims,np.shape(Xt)))
  

    f_vtk = vtkWriteHeaderAndGridStructured2d( Xt, Yt, R[::-1,:], fileout, 'Footprint'); R=None 
    f_vtk = vtkWritePointDataHeader( f_vtk, Ft, 5 )
  
    # ======= Write 100% Ft ================
    f_vtk = vtkWritePointDataStructured2D( f_vtk, Ft , Xt, 'fp' )
  
    # ======= Write 75% Ft ================
    Ftmp[:,:] = 0.; Ftmp += Ft*id75
    f_vtk = vtkWritePointDataStructured2D( f_vtk, Ftmp , Xt, 'fp75' )
  
    # ======= Write 90% Ft ================
    Ftmp[:,:] = 0.; Ftmp += Ft*id90
    f_vtk = vtkWritePointDataStructured2D( f_vtk, Ftmp , Xt, 'fp90' )
  
    # ======= Write 100% F_km ================
    f_vtk = vtkWritePointDataStructured2D( f_vtk, F_km, Xt, 'fp_km' )
Beispiel #3
0
  fileId, varId = idAppendices(fileList[fn], ijkOn )
  writeNumpyZFootprint(fileout+fileId, FM, XM, YM, ZM, Cnorm )

  if( vtkOn ):
    if( writeHeader ):
      Rdict = readNumpyZTile( filetopo )
      R = Rdict['R']
      Rdims = np.array(np.shape(R))
      ROrig = Rdict['GlobOrig']
      dPx = Rdict['dPx']
      Rdict = None
      if( all(Rdims != np.shape(XM)) ):
        print(' Error! Mismatch Topo_dims={} vs. fp_dims={}'.format(Rdims,np.shape(XM)))
        sys.exit(1)

      f_vtk = vtkWriteHeaderAndGridStructured2d( XM, YM, R[::-1,:], fileout, 'Footprints')
      f_vtk = vtkWritePointDataHeader( f_vtk, FM, len(fileNos) )
      writeHeader = False; R=None

    f_vtk = vtkWritePointDataStructured2D( f_vtk, FM   , XM, 'fp_'+varId )

    '''
    if( printOn or printOnly ):
      CfD = dict()
      CfD['title']='F(x,y)'; CfD['label']=fileout; CfD['N']=16
      Cfp = addContourf( XM, YM, FM   , CfD )
      
      CfD['title']='F_neg(x,y)'; CfD['label']=fileout+'_neg'; CfD['N']=16
      Cfm = addContourf( XM, YM, FMneg, CfD )
      
      CfD['title']='Z(x,y)'; CfD['label']=' Topography Height (m) '; CfD['N']=16