Changeset 4847


Ignore:
Timestamp:
Nov 22, 2007, 2:40:14 PM (17 years ago)
Author:
nick
Message:

fixed some print statement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/geospatial_data/geospatial_data.py

    r4816 r4847  
    13801380                                     alpha_list=None,
    13811381                                     mesh_file=None,
     1382                                     boundary_poly=None,
    13821383                                     mesh_resolution=100000,
    13831384                                     north_boundary=None,
     
    14241425    OUTPUT: returns the minumum normalised covalance calculate AND the
    14251426           alpha that created it. PLUS writes a plot of the results
     1427           
     1428    NOTE: code will not work if the data_file extend is greater than the
     1429    boundary_polygon or the north_boundary...west_boundary
    14261430       
    14271431    """
     
    14331437    from anuga.utilities.numerical_tools import cov
    14341438    from Numeric import array, resize,shape,Float,zeros,take,argsort,argmin
     1439    from anuga.utilities.polygon import is_inside_polygon
    14351440
    14361441    attribute_smoothed='elevation'
     
    14751480    if verbose: print 'finish split'
    14761481    points=G_small.get_data_points()
     1482
     1483    #FIXME: Remove points outside boundary polygon
     1484#    print 'new point',len(points)
     1485#   
     1486#    new_points=[]
     1487#    new_points=array([],typecode=Float)
     1488#    new_points=resize(new_points,(len(points),2))
     1489#    print "BOUNDARY", boundary_poly
     1490#    for i,point in enumerate(points):
     1491#        if is_inside_polygon(point,boundary_poly, verbose=True):
     1492#            new_points[i] = point
     1493#            print"WOW",i,new_points[i]
     1494#    points = new_points
     1495
     1496   
    14771497    if verbose: print "Number of points in sample to compare: ", len(points)
    14781498   
     
    14891509    for alpha in alphas:
    14901510        #add G_other data to domains with different alphas
    1491         domain = Domain(mesh_file, use_cache=False, verbose=verbose)
     1511        if verbose:print '\n Calculating domain and mesh for Alpha = ',alpha,'\n'
     1512        domain = Domain(mesh_file, use_cache=cache, verbose=verbose)
    14921513        if verbose:print domain.statistics()
    14931514        domain.set_quantity(attribute_smoothed,
    14941515                    geospatial_data = G_other,
    1495                     use_cache = True,
     1516                    use_cache = cache,
    14961517                    verbose = verbose,
    14971518                    alpha = alpha)
     
    15131534    normal_cov=array(zeros([len(alphas),2]),typecode=Float)
    15141535
     1536    if verbose: print 'Determine difference between predicted results and actual data'
    15151537    for i,alpha in enumerate(domains):
    1516         #print'alpha',alpha
     1538        if verbose: print'Alpha =',alpha
     1539       
    15171540        points_geo=domains[alpha].geo_reference.change_points_geo_ref(points)
    15181541        #returns the predicted elevation of the points that were "split" out
    15191542        #of the original data set for one particular alpha
    1520         elevation_predicted=domains[alpha].quantities[attribute_smoothed] \
    1521                                   .get_values(interpolation_points=points_geo)
    1522    
     1543        elevation_predicted=domains[alpha].quantities[attribute_smoothed].\
     1544                            get_values(interpolation_points=points_geo)
     1545 
     1546        #add predicted elevation to array that starts with x, y, z...
    15231547        data[:,i+3]=elevation_predicted
    15241548
Note: See TracChangeset for help on using the changeset viewer.