Changeset 9199


Ignore:
Timestamp:
Jun 18, 2014, 11:42:23 PM (10 years ago)
Author:
steve
Message:

Small changes to plot_utils

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/utilities/plot_utils.py

    r9195 r9199  
    789789        raise Exception, 'No spatial reference information given'
    790790
     791
    791792    ds.SetProjection(srs.ExportToWkt())
    792793
     
    797798    #import pdb
    798799    #pdb.set_trace()
     800    import scipy
    799801
    800802    outband = ds.GetRasterBand(1)
     803    outband.SetNoDataValue(numpy.nan)
    801804    outband.WriteArray(data)
    802805
     
    942945    #index_qFun=scipy.interpolate.LinearNDInterpolator(swwXY,scipy.arange(len(swwX),dtype='int64').transpose())
    943946
    944     gridXY_array=scipy.ascontiguousarray([scipy.concatenate(gridX),scipy.concatenate(gridY)]).transpose()
     947    #print 'index_qFun', index_qFun
     948   
     949    gridXY_array=scipy.array([scipy.concatenate(gridX),scipy.concatenate(gridY)]).transpose()
     950    #gridXY_array=scipy.concatenate((gridX,gridY)).transpose()
     951   
     952    gridXY_array=scipy.ascontiguousarray(gridXY_array)
     953    #print gridXY_array.flags['C_CONTIGUOUS']
     954    #print 'GRIDXY_ARRAY', gridXY_array.shape
     955
    945956    gridqInd=index_qFun(gridXY_array)
    946957
     
    949960        from anuga.geometry.polygon import outside_polygon
    950961        cut_points = outside_polygon(gridXY_array, bounding_polygon)
     962       
     963        #print cut_points.shape
    951964        #cut_points=(nxutils.points_inside_poly(gridXY_array, bounding_polygon)==False).nonzero()[0]
    952965       
     
    9911004            if(bounding_polygon is not None):
    9921005                # Cut the points outside the bounding polygon
    993                 gridq[cut_points]=scipy.nan
     1006                gridq[cut_points]= numpy.nan
    9941007
    9951008            # Make name for output file
Note: See TracChangeset for help on using the changeset viewer.