Changeset 4537 for anuga_work


Ignore:
Timestamp:
Jun 7, 2007, 8:56:23 AM (17 years ago)
Author:
nick
Message:
 
Location:
anuga_work/development/alpha_validation
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/alpha_validation/find_alpha.py

    r4457 r4537  
    77from anuga.shallow_water import Reflective_boundary
    88from anuga.utilities.numerical_tools import cov
    9 from Numeric import array, resize,shape,Float,zeros
     9from Numeric import array, resize,shape,Float,zeros,take,argsort
     10from pylab import plot, ion, hold,savefig,semilogx,plotting
    1011
    1112
     
    1718                         boundary_tags={'back': [2], 'side': [1,3],
    1819                                        'ocean': [0]},
    19                          maximum_triangle_area=100000,
     20                         maximum_triangle_area=100,
    2021                         filename=mesh_dir_name,
    2122                         use_cache=True,
     
    2930G = Geospatial_data(file_name = topo_dir_name)
    3031print 'start split'
    31 G_small, G_other = G.split(0.1,True)
     32
     33G_sample,G_loss= G.split(0.1, True)
     34
     35G_small, G_other = G_sample.split(0.1,True)
    3236
    3337
    3438
    35 #alphas = [0.0001, 0.001, 0.01, 0.1, 1.0, 10.0, 100.0,1000.0,10000.0]
    36 alphas = [0.001,1,100]
     39alphas = [0.000001, 0.00001, 0.0001, 0.001, 0.01, 0.1, 1.0, 10.0, 100.0,1000.0,10000.0]
     40#alphas = [0.001,1,100]
    3741domains = {}
    3842#domains = []
     
    6670normal_cov=array(zeros([len(alphas),2]),typecode=Float)
    6771i=0
    68 #print 'domains',domains.keys()
    69 #keys_list=domains.keys()
    70 #print 'domains',keys_list.sort()
     72
    7173for domain in domains:
    7274#    print'domain',domain
     
    8284    sample_cov= cov(elevation_sample)
    8385
    84     ele_cov= cov(elevation_sample,elevation_predicted)
     86    ele_cov= cov(elevation_sample-elevation_predicted)
    8587    normal_cov[i,:]= [domain,ele_cov/sample_cov]
    8688
     
    9193print'data',data[100:200]
    9294print'normal cov',normal_cov
     95normal_cov0=normal_cov[:,0]
     96normal_cov_new=take(normal_cov,argsort(normal_cov0))
     97semilogx(normal_cov_new[:,0],normal_cov_new[:,1])
     98savefig("alphas",dpi=300)
    9399   
    94 
    95 # from file load x,y,z data
    96 # use file xy data to find predicted z data from domain
    97 # determine error and repeat
Note: See TracChangeset for help on using the changeset viewer.