Changeset 981


Ignore:
Timestamp:
Mar 1, 2005, 1:31:28 PM (20 years ago)
Author:
ole
Message:

Work with georeferencing and documentation

Location:
inundation/ga/storm_surge/pyvolution
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/data_manager.py

    r980 r981  
    11441144    Lat and lon are assuemd to be in decimal degrees
    11451145
    1146     origin is a 5-tuple with geo referenced
    1147     UTM coordinates (zone, easting, northing, false_easting, false_northing)
     1146    origin is a 3-tuple with geo referenced
     1147    UTM coordinates (zone, easting, northing)
    11481148
    11491149    nc format has values organised as HA[TIME, LATITUDE, LONGITUDE]
  • inundation/ga/storm_surge/pyvolution/documentation/assumptions.txt

    r980 r981  
    1414one UTM zone. However, the computation will use that of the mesh.
    1515
    16 The dataflow is: (See data_manager.py)
     16The dataflow is: (See data_manager.py and from scenarios)
    1717
    1818
     19Simulation scenarios
     20--------------------
     21
     22
     23Sub directories contain scrips and derived files for each simulation.
     24The directory ../source_data contains large source files such as
     25DEMs provided externally as well as MOST tsunami simulations to be used
     26as boundary conditions.
     27
     28Manual steps are:
     29  Creation of DEMs from argcview (.asc + .prj)
     30  Creation of mesh from pmesh (.tsh)
     31  Creation of tsunami simulations from MOST (.nc)
     32
     33 
     34Typical scripted steps are
     35
     36  prepare_dem.py:  Convert asc and prj files supplied by arcview to
     37                   native dem and pts formats
     38 
     39  prepare_pts.py: Convert netcdf output from MOST to an sww file suitable
     40                  as boundary condition
     41                 
     42  prepare_mesh.py: Merge DEM (pts) and mesh (tsh) using least squares
     43                   smoothing. The outputs are tsh files with elevation data.
     44                   
     45  run_simulation.py: Use the above together with various parameters to
     46                     run inundation simluation.                         
     47                               
    1948 
    2049
  • inundation/ga/storm_surge/pyvolution/least_squares.py

    r976 r981  
    6060                     alpha=DEFAULT_ALPHA, verbose= False,
    6161                     expand_search = False,
    62                      origin = None,
    63                      mesh_origin=None):
     62                     data_origin = None,
     63                     mesh_origin = None):
    6464    """
    6565    Given a mesh file (tsh) and a point attribute file (xya), fit
     
    6767    results.
    6868   
    69     If origin is not None it is assumed to be
    70     a 5-tuple with geo referenced
    71     UTM coordinates (zone, easting, northing, false_easting, false_northing)
     69
     70    If data_origin is not None it is assumed to be
     71    a 3-tuple with geo referenced
     72    UTM coordinates (zone, easting, northing)
    7273   
    7374    mesh_origin is the same but refers to the input tsh file.
    74     FIXME: When that format contains it own origin, this parameter can go.
     75    FIXME: When the tsh format contains it own origin, these parameters can go.
     76    FIXME: And both origins should be obtained from the specified files.
    7577    """
    7678   
     
    8082   
    8183    # load in the .tsh file
     84    #FIXME (Ole): mesh_origin should be extracted here
    8285    mesh_dict = mesh_file_to_mesh_dictionary(mesh_file)
    8386    vertex_coordinates = mesh_dict['vertices']
     
    8891    if verbose:print "tsh file loaded"
    8992   
    90     # load in the .xya file
    91     #FIXME (Ole): Maybe data origin should be extracted here
     93    # load in the .pts file
     94    #FIXME (Ole): data_origin should be extracted here
    9295    try:
    9396        point_dict = load_points_file(point_file,delimiter = ',')
     
    98101    if verbose: print "points file loaded"
    99102
    100 
    101103   
    102104    if verbose:print "fitting to mesh"
     
    107109                    alpha = alpha,
    108110                    verbose = verbose,
    109                     expand_search = expand_search)
     111                    expand_search = expand_search,
     112                    data_origin = data_origin,
     113                    mesh_origin = mesh_origin)
    110114    if verbose:print "finished fitting to mesh"
    111115   
     
    124128        mesh_dict['vertex_attributes'] = new_point_attributes
    125129        mesh_dict['vertex_attribute_titles'] = title_list
    126    
     130
     131    #FIXME (Ole): Remember to output mesh_origin as well   
    127132    export_triangulation_file(mesh_output_file, mesh_dict)
    128133       
     
    134139                alpha = DEFAULT_ALPHA,
    135140                verbose = False,
    136                 expand_search = False):
     141                expand_search = False,
     142                data_origin = None,
     143                mesh_origin = None):
    137144    """
    138145    Fit a smooth surface to a triangulation,
     
    154161
    155162          point_attributes: Vector or array of data at the point_coordinates.
     163
     164          data_origin and mesh_origin are 3-tuples consisting of
     165          UTM zone, easting and northing. If specified
     166          point coordinates and vertex coordinates are assumed to be
     167          relative to their respective origins.
     168         
    156169    """
    157170    interp = Interpolation(vertex_coordinates,
     
    160173                           alpha = alpha,
    161174                           verbose = verbose,
    162                            expand_search = expand_search)
     175                           expand_search = expand_search,
     176                           data_origin = data_origin,
     177                           mesh_origin = mesh_origin)
    163178                           # expand_search = False)
    164179   
Note: See TracChangeset for help on using the changeset viewer.