Changeset 4847
- Timestamp:
- Nov 22, 2007, 2:40:14 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/geospatial_data/geospatial_data.py
r4816 r4847 1380 1380 alpha_list=None, 1381 1381 mesh_file=None, 1382 boundary_poly=None, 1382 1383 mesh_resolution=100000, 1383 1384 north_boundary=None, … … 1424 1425 OUTPUT: returns the minumum normalised covalance calculate AND the 1425 1426 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 1426 1430 1427 1431 """ … … 1433 1437 from anuga.utilities.numerical_tools import cov 1434 1438 from Numeric import array, resize,shape,Float,zeros,take,argsort,argmin 1439 from anuga.utilities.polygon import is_inside_polygon 1435 1440 1436 1441 attribute_smoothed='elevation' … … 1475 1480 if verbose: print 'finish split' 1476 1481 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 1477 1497 if verbose: print "Number of points in sample to compare: ", len(points) 1478 1498 … … 1489 1509 for alpha in alphas: 1490 1510 #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) 1492 1513 if verbose:print domain.statistics() 1493 1514 domain.set_quantity(attribute_smoothed, 1494 1515 geospatial_data = G_other, 1495 use_cache = True,1516 use_cache = cache, 1496 1517 verbose = verbose, 1497 1518 alpha = alpha) … … 1513 1534 normal_cov=array(zeros([len(alphas),2]),typecode=Float) 1514 1535 1536 if verbose: print 'Determine difference between predicted results and actual data' 1515 1537 for i,alpha in enumerate(domains): 1516 #print'alpha',alpha 1538 if verbose: print'Alpha =',alpha 1539 1517 1540 points_geo=domains[alpha].geo_reference.change_points_geo_ref(points) 1518 1541 #returns the predicted elevation of the points that were "split" out 1519 1542 #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... 1523 1547 data[:,i+3]=elevation_predicted 1524 1548
Note: See TracChangeset
for help on using the changeset viewer.