Changeset 2556


Ignore:
Timestamp:
Mar 17, 2006, 3:38:41 PM (18 years ago)
Author:
nick
Message:

new onslow with metadata control

Location:
production/onslow_2006
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • production/onslow_2006/project.py

    r2543 r2556  
    1111
    1212from coordinate_transforms.redfearn import degminsec2decimal_degrees
     13
     14from time import localtime, strftime
     15
     16from os import getcwd
     17
    1318               
    1419#Making assumptions about the location of scenario data
    1520scenario_dir_name = 'onslow_tsunami_scenario_2006'
    16 
    1721
    1822# 250m data to be provided
     
    2428
    2529boundary_basename = 'SU-AU'
     30
     31#swollen/ all data output
     32basename = 'source'
     33
     34codename = 'project.py'
     35
     36if sys.platform == 'win32':
     37    home = environ['INUNDATIONHOME']     #Sandpit's parent dir
     38else:   
     39    home = expanduser('~')
     40
     41#Derive subdirectories and filenames
     42
     43
     44meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep
     45datadir = home+sep+scenario_dir_name+sep+'topographies'+sep
     46
     47timedir = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
     48outputdir = home+sep+scenario_dir_name+sep+'output'+sep+timedir+sep
     49polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep
     50boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep
     51
     52codedir = getcwd()+sep
     53codedirname = codedir + 'project.py'
     54
     55meshname = meshdir + basename
     56
     57coarsedemname = datadir + coarsename
     58
     59onshore_dem_name = datadir + onshore_name
     60
     61combineddemname = datadir + 'onslow_combined_elevation'
     62
     63outputname = outputdir + basename  #Used by post processing
     64
     65#!gauge_filename = outputdir + 'onslow_gauges.xya'
     66#!gauge_outname = outputdir + 'gauges_max_output.xya'
    2667
    2768# clipping region for fine elevation data
     
    3778
    3879# region for visualisation
    39 eminviz =
    40 emaxviz =
    41 nminviz =
    42 nmaxviz =
    43 
    44 #swollen/ all data output
    45 basename = 'source_fine_clipped'
    46 
    47 if sys.platform == 'win32':
    48     home = environ['INUNDATIONHOME']     #Sandpit's parent dir
    49 else:   
    50     home = expanduser('~')
    51 
    52 #Derive subdirectories and filenames
    53 meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep
    54 datadir = home+sep+scenario_dir_name+sep+'topographies'+sep
    55 outputdir = home+sep+scenario_dir_name+sep+'output'+sep
    56 polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep
    57 boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep
    58 
    59 meshname = meshdir + basename
    60 
    61 coarsedemname = datadir + coarsename
    62 
    63 onshore_dem_name = datadir + onshore_name
    64 
    65 combineddemname = datadir + 'onslow_combined_elevation'
    66 
    67 outputname = outputdir + basename  #Used by post processing
    68 
    69 #!gauge_filename = outputdir + 'onslow_gauges.xya'
    70 #!gauge_outname = outputdir + 'gauges_max_output.xya'
     80eminviz = 260000
     81emaxviz = 320000
     82nminviz = 7590000
     83nmaxviz = 7630000
    7184
    7285#Georeferencing
     
    112125poly_direction = [k0, k1, k2, k3]
    113126
    114 testpoly = [p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30]
    115 #!slump_origin = [385000.0, 6255000.0] #Absolute UTM
  • production/onslow_2006/run_onslow.py

    r2554 r2556  
    3131from smf import slump_tsunami  # Function for submarine mudslide
    3232
     33from shutil import copy
     34from os import mkdir, access, F_OK
    3335
    3436#------------------------------------------------------------------------------
     
    4850
    4951source_dir = project.boundarydir
     52
     53#if dir doesn't exists then makes dir
     54if access(project.outputdir,F_OK) == 0 :
     55    mkdir (project.outputdir)
     56# creates copy of code in output dir
     57copy (project.codedirname, project.outputdir + project.codename)
     58copy (project.codedir + 'run_onslow.py', project.outputdir + 'run_onlsow.py')
     59print "copied to"+ project.outputdir + project.codename + 'and run_onlsow.py'
    5060
    5161# coarse data
     
    6575
    6676# combining the coarse and fine data
    67 combine_rectangular_points_files(project.coarsedemname + '.pts',
     77# NOTE MUST HAVE FINE FIRST!
     78combine_rectangular_points_files(
    6879                                 project.onshore_dem_name + '.pts',
     80                                 project.coarsedemname + '.pts',
    6981                                 project.combineddemname + '.pts')
    7082
    7183
    72 #------------------------------------------------------------------------------
     84
     85#-------------------------------------------------------------------------------                                 
    7386# Create the triangular mesh based on overall clipping polygon with a tagged
    7487# boundary and interior regions defined in project.py along with
     
    164177       source_dir + project.boundary_basename),
    165178      {'verbose': True,
     179# note didn't work with the below
    166180#       'minlat': south - 1,
    167181#       'maxlat': north + 1,
Note: See TracChangeset for help on using the changeset viewer.