Changeset 5245


Ignore:
Timestamp:
Apr 28, 2008, 8:00:14 AM (17 years ago)
Author:
sexton
Message:

(1) update of production processes document (2) test for generating points for URS output (3) update of graduate proposal

Files:
12 edited

Legend:

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

    r5222 r5245  
    910910            raise ValueError, msg
    911911        lats_longs = ensure_numeric(data_points)
     912        print 'hello', lats_longs
    912913        latitudes = ravel(lats_longs[:,0:1])
    913914        longitudes = ravel(lats_longs[:,1:])
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r5226 r5245  
    61176117                          lat_amount, long_amount,
    61186118                          verbose=self.verbose)
     6119
     6120    def test_URS_points_needed_poly1(self):
     6121        # domain in southern hemisphere zone 51
     6122        grid_spacing = 2./60.
     6123        poly1 = [[296361.89, 8091928.62],[429495.07,8028278.82], [447230.56,8000674.05],
     6124                     [429661.2,7982177.6],[236945.9,7897453.16],[183493.44,7942782.27],
     6125                     [226583.04,8008058.96]]
     6126        URS_points_needed_to_file('test_example_poly1',poly1,51,
     6127                                  grid_spacing,verbose=self.verbose)
     6128
     6129    def test_URS_points_needed_poly2(self):
     6130        # domain in northern hemisphere zone 47
     6131        grid_spacing = 2./60.
     6132        poly2 = [[419336.424,810100.845],[342405.0281,711455.8026],[274649.9152,723352.9603],
     6133                  [272089.092,972393.0131],[347633.3754,968551.7784],
     6134                        [427979.2022,885965.2313],[427659.0993,875721.9386],
     6135                        [429259.6138,861317.3083],[436301.8775,840830.723]]
     6136        URS_points_needed_to_file('test_example_poly2',poly2,47,
     6137                                  grid_spacing,verbose=self.verbose)
    61196138       
    61206139    #### END TESTS URS UNGRIDDED 2 SWW ###
  • anuga_work/development/MISG_2008/sensitivity_study.py

    r5066 r5245  
    136136    tri_id2 = domain.get_triangle_containing_point([-c/m-20,y_extent*0.5])
    137137    tri_id3 = domain.get_triangle_containing_point([-c/m+50,y_extent*0.5])
    138      
     138
     139    print 'hello', -c/m, -c/m-10, -c/m-20, -c/m+50
     140   
    139141    stage_centroid     = domain.quantities['stage'].centroid_values
    140142    xmom_centroid      = domain.quantities['xmomentum'].centroid_values
     
    146148    elev3 = elevation_centroid[tri_id3]
    147149
     150    print 'hello again', elev0, elev1, elev2, elev3
    148151    import time
    149152    t0 = time.time()
  • anuga_work/production/broome/run_boundary_points.py

    r5001 r5245  
    2121from anuga.shallow_water.data_manager import URS_points_needed_to_file, \
    2222     urs_ungridded2sww
    23 import project                 # Definition of file names and polygons
     23import project_urs                 # Definition of file names and polygons
    2424
    2525#------------------------------------------------------------------------------
     
    2727# output to file
    2828#------------------------------------------------------------------------------
    29 poly = project.poly_all
     29poly = project_urs.poly_all
    3030print "poly", poly
    31 print "project.boundaries_in_dir_name",project.boundaries_in_dir_name
    32 URS_points_needed_to_file(project.boundaries_in_dir_name,poly, export_csv=True, zone=51)
     31print "project_urs.boundaries_in_dir_name",project_urs.boundaries_in_dir_name
     32URS_points_needed_to_file(project_urs.boundaries_in_dir_name,poly, export_csv=True, zone=51)
    3333#URS_points_needed_to_file(project.boundaries_dir_name5,poly, export_csv=True, zone=50)
    3434#URS_points_needed_to_file(project.boundaries_dir_name5,poly, export_csv=True)
  • anuga_work/production/exmouth_2006/plot_contour_data.py

    r4949 r5245  
    33
    44import project
    5 from pylab import plot, xlabel, ylabel, savefig, ion, close, axis, title, legend, grid
     5from pylab import plot, xlabel, ylabel, savefig, ion, close, axis, title, legend, grid, figure
    66from os import sep
    77 
     
    5656#Magnitude 9.0 event (Sumba) at Exmouth')
    5757legend(['ANUGA','Green\'s law'])
    58 axis([-5,85,min(stage_max)*0.9,max(stage_max)*1.1])
     58#axis([-5,85,min(stage_max)*0.9,max(stage_max)*1.1])
     59axis([-5,85,3.5,max(stage_max)*1.1])
    5960grid(True)
    6061#savefig('stratification_onslow_gun')
     
    6263#savefig('stratification_dampier_gun')
    6364
     65depthv2 = [0,5,20,80]
     66datav2 = [8.2,6,4,h1]
     67figure(2)
     68plot(d2,green,'g-',depthv2,datav2,'bo-')
     69xlabel('depth (m)')
     70ylabel('stage (m)')
     71title('ANUGA modelled maximum stage versus Green\'s approximation \n \
     72Magnitude 9.3 event (Java) at Exmouth')
     73legend(['ANUGA','Green\'s law'])
     74axis([-5,85,3.5,max(stage_max)*1.1])
     75grid(True)
     76savefig('strat_exmouth_gun_v2')
    6477close('all')
    6578
  • anuga_work/production/onslow_2006/convert_db_points.py

    r4580 r5245  
    1313   
    1414    fid_out = open(filenameout, 'w')
    15     s = '%s,%s\n' %('easting','northing')
     15    s = '%s,%s,%s\n' %('easting','northing','zone')
    1616    fid_out.write(s)
    1717    for line in lines[1:]:
    1818       fields = line.split(',')
    19        x = float(fields[1])
    20        y = float(fields[0])
     19       #x = float(fields[1])
     20       #y = float(fields[0])
     21       x = float(fields[0])
     22       y = float(fields[1])
    2123       zone, easting, northing = redfearn(x,y)
    22        s = '%f,%f\n' %(easting,northing)
     24       s = '%f,%f,%f\n' %(easting,northing,zone)
    2325       fid_out.write(s)
    2426
     
    2931import project
    3032
    31 filename = project.gaugedir + 'db_points.txt'
    32 filename_out = project.gaugedir + 'db_points_convert.txt'
     33#filename = project.gaugedir + 'db_points.txt'
     34#filename_out = project.gaugedir + 'db_points_convert.txt'
     35filename = project.gaugedir + 'aus_hazard_pts.txt'
     36filename_out = project.gaugedir + 'aus_hazard_pts_en.txt'
    3337alter_file(filename,filename_out)
     38
  • anuga_work/production/shark_bay_2007/export_results.py

    r4856 r5245  
    7171                    reduction = max,
    7272                    verbose = True,
    73                     format = 'asc')
     73                    format = 'txt')
  • anuga_work/production/west_tas_2008/convert2eastnorth.py

    r4968 r5245  
    3131#filename = project_smf.polygondir + 'domain.txt'
    3232#filename = project_smf.polygondir + 'local.txt'
    33 filename = project_smf.polygondir + 'region.txt'
     33#filename = project_smf.polygondir + 'region.txt'
     34#filename = project_smf.datadir + 'Sorell_Basin_150m_DD_Interp.txt'
     35#filename = project_smf.datadir + 'S_Tasman_Rise_150m_DD_Interp.txt'
     36filename = project_smf.polygondir + 'origin.txt'
    3437#filename_out = project_smf.polygondir + 'domain.csv'
    3538#filename_out = project_smf.polygondir + 'local.csv'
    36 filename_out = project_smf.polygondir + 'region.csv'
     39#filename_out = project_smf.polygondir + 'region.csv'
     40#filename_out = project_smf.datadir + 'Sorell_Basin_150m_EN_Interp.txt'
     41#filename_out = project_smf.datadir + 'S_Tasman_Rise_150m_EN_Interp.txt'
     42filename_out = project_smf.polygondir + 'origin_EN.csv'
    3743alter_file(filename,filename_out)
  • anuga_work/production/west_tas_2008/project_smf.py

    r4968 r5245  
    2424state = 'tasmania'
    2525scenario_dir_name = 'smf_scenario_2008'
    26 '''
    27 # onshore data provided by NSW LPI, Krishna merged with existing
    28 # PMD data to make 100m DEM
    29 on_offshore_name100 = 'bathyland100'
     26
     27# onshore data sourced from 250m grid
     28onshore_name250 = 'bathyland250'
     29
     30# coastline from GA
     31coast_line_name = 'aus_cst'
    3032
    3133# survey data
    32 offshore_name1 = 'surveyAreaA'
    33 offshore_name2 = 'surveyAreaB'
    34 offshore_name3 = 'surveyAreaC'
     34offshore_name1 = 'S_Tasman_Rise_150m_EN_Interp'
     35offshore_name2 = 'Sorell_Basin_150m_EN_Interp'
     36offshore_name3 = 'West_Tas_EastNorth_z'
    3537
    36 # AHO data
    37 offshore_name4 = '1000003611export'
    38 offshore_name5 = '1000003613export'
    39 offshore_name6 = '1000003614export'
    40 offshore_name7 = '1000003627export'
    41 offshore_name8 = '1000003628export'
    42 offshore_name9 = 'AHDexport'
    43 '''
    4438#swollen/ all data output
    4539basename = 'source'
     
    6155codedirname = codedir + 'project_smf.py'
    6256meshname = outputtimedir + 'mesh_' + basename
    63 '''
     57
    6458# Necessary if using point datasets, rather than grid
    65 on_offshore100_dem_name = datadir + on_offshore_name100
     59onshore_250_dem_name = datadir + onshore_name250
    6660offshore_dem_name1 = datadir + offshore_name1
    6761offshore_dem_name2 = datadir + offshore_name2
    6862offshore_dem_name3 = datadir + offshore_name3
     63coast_line = datadir + coast_line_name
    6964
    7065combined_dem_name   = datadir + 'west_tas_combined_elevation'
    71 '''
     66
    7267###############################
    7368# Domain definitions
     
    9489###################################################################
    9590
    96 
    9791# exporting asc grid
    9892eastingmin = 333000
     
    107101
    108102# historical slides
    109 #slide_origin = [,]
     103slide_origin = [338270.5407, 5217273.89]
    110104
    111105depth = 1750.0
  • anuga_work/production/west_tas_2008/run_west_tas_smf.py

    r4968 r5245  
    5454
    5555# filenames
    56 on_offshore25_dem_name = project_smf.on_offshore25_dem_name
     56onshore_250_dem_name = project_smf.onshore_250_dem_name
    5757meshname = project_smf.meshname+'.msh'
    5858
    5959# creates DEM from asc data
    60 convert_dem_from_ascii2netcdf(on_offshore25_dem_name, use_cache=True, verbose=True)
     60convert_dem_from_ascii2netcdf(onshore_250_dem_name, use_cache=True, verbose=True)
    6161
    6262#creates pts file for onshore DEM
    63 dem2pts(on_offshore25_dem_name,
    64         easting_min=project_smf.eastingmin25,
    65         easting_max=project_smf.eastingmax25,
    66         northing_min=project_smf.northingmin25,
    67         northing_max= project_smf.northingmax25,
    68         use_cache=True, verbose=True)
     63dem2pts(onshore_250_dem_name, use_cache=True, verbose=True)
    6964
    7065print 'create offshore'
    71 G1 = Geospatial_data(file_name = project_smf.offshore_dem_name1 + '.xya')+\
    72      Geospatial_data(file_name = project_smf.offshore_dem_name2 + '.xya')+\
    73      Geospatial_data(file_name = project_smf.offshore_dem_name3 + '.xya')
     66G1 = Geospatial_data(file_name = project_smf.offshore_dem_name1 + '.txt')+\
     67     Geospatial_data(file_name = project_smf.offshore_dem_name2 + '.txt')+\
     68     Geospatial_data(file_name = project_smf.offshore_dem_name3 + '.txt')
    7469
    7570print 'create onshore'
    76 G2 = Geospatial_data(file_name = project_smf.on_offshore25_dem_name + '.pts')
     71G2 = Geospatial_data(file_name = project_smf.onshore_250_dem_name + '.pts')
     72
     73print 'create coastline'
     74G3 = Geospatial_data(file_name = project_smf.coast_line + '.txt')
    7775
    7876print 'add'
    79 G = G1 + G2
     77G = G1.clip(Geospatial_data(project_smf.polyAll)) + G2 + G3
    8078
    8179print 'export points'
Note: See TracChangeset for help on using the changeset viewer.