Changes between Initial Version and Version 1 of Ticket #341


Ignore:
Timestamp:
Sep 16, 2009, 2:14:39 PM (15 years ago)
Author:
rwilson
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #341 – Description

    initial v1  
    11We need to think about refactoring the code users change to run ANUGA.  This is files like project.py, setup_model.py, etc.
    22
    3 Currently the code to put ASCelevations into ANUGA looks like:
    4 convert_dem_from_ascii2netcdf(project.demname, ...)
    5 dem2pts(project.demname, ...)
    6 domain = create_domain_...(...)
     3Currently the code to put ASCelevations into ANUGA looks like:[[BR]]
     4convert_dem_from_ascii2netcdf(project.demname, ...)[[BR]]
     5dem2pts(project.demname, ...)[[BR]]
     6domain = create_domain_...(...)[[BR]]
    77domain.set_quantity('elevation', project.demname+'.pts', ...)
    88
    9 Hidden away under all that is the assumption that the filename passed to dem2pts() is just a root and '.dem' is *assumed* as the extension.  This leads to confusion as:
    10 1. project.demname is used all over as a root filename, no real names used,
     9Hidden away under all that is the assumption that the filename passed to dem2pts() is just a root and '.dem' is *assumed* as the extension.  This leads to confusion as:[[BR]]
     101. project.demname is used all over as a root filename, no real names used,[[BR]]
    11112. sometimes extensions are supplied to a function with the filename, sometimes not.
    1212
     
    1515Additionally, it may now be possible to get ANUGA code to *automatically* convert files.  If we say that a file is an "input elevation" file, then ANUGA can convert an ASC file to a DEM file just by looking at the extension (not a real good idea, but simple) or by some 'file'-like magic (do 'man file').
    1616
    17 Similarly, a consistent function naming convention would be nice.  In runcairns.py we see this to convert an ASC file to a DEM file:
    18 convert_dem_from_ascii2netcdf(project.demname, ...)
     17Similarly, a consistent function naming convention would be nice.  In runcairns.py we see this to convert an ASC file to a DEM file:[[BR]]
     18convert_dem_from_ascii2netcdf(project.demname, ...)[[BR]]
    1919dem2pts(project.demname, ...)
    2020
    21 This could look like:
    22 asc2dem(project.demname, ...)
     21This could look like:[[BR]]
     22asc2dem(project.demname, ...)[[BR]]
    2323dem2pts(project.demname, ...)
    2424
    2525or
    26 convert_asc_to_dem(project.demname, ...)
     26convert_asc_to_dem(project.demname, ...)[[BR]]
    2727convert_dem_to_pts(project.demname, ...)
    2828