Ignore:
Timestamp:
Aug 7, 2008, 4:46:38 PM (14 years ago)
Author:
sexton
Message:

update to export results to allow the user to select number of decimal places

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r5612 r5627  
    16701670                reduction = None,
    16711671                cellsize = 10,
     1672                number_of_decimal_places = None,
    16721673                NODATA_value = -9999,
    16731674                easting_min = None,
     
    17271728                               reduction,
    17281729                               cellsize,
     1730                               number_of_decimal_places,
    17291731                               NODATA_value,
    17301732                               easting_min,
     
    18241826            reduction = None,
    18251827            cellsize = 10,
     1828            number_of_decimal_places = None,
    18261829            NODATA_value = -9999,
    18271830            easting_min = None,
     
    19041907    if quantity_formula.has_key(quantity):
    19051908        quantity = quantity_formula[quantity]
     1909
     1910    if number_of_decimal_places is None:
     1911        number_of_decimal_places = 9
    19061912       
    19071913    swwfile = basename_in + '.sww'
     
    21812187
    21822188            slice = grid_values[base_index:base_index+ncols]
    2183             s = array2string(slice, max_line_width=sys.maxint)
     2189            #s = array2string(slice, max_line_width=sys.maxint)
     2190            s = array2string(slice, max_line_width=sys.maxint, precision=number_of_decimal_places)
    21842191            ascid.write(s[1:-1] + '\n')
    2185 
    21862192
    21872193            #print
     
    22132219            reduction = reduction,
    22142220            cellsize = cellsize,
     2221            number_of_decimal_places = number_of_decimal_places,
    22152222            verbose = verbose,
    22162223            origin = origin,
     
    22332240            reduction = reduction,
    22342241            cellsize = cellsize,
     2242            number_of_decimal_places = number_of_decimal_places,
    22352243            verbose = verbose,
    22362244            origin = origin,
Note: See TracChangeset for help on using the changeset viewer.