Changeset 5627


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

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

Location:
anuga_core/source/anuga/shallow_water
Files:
2 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,
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r5622 r5627  
    12811281                quantity = 'elevation',
    12821282                cellsize = cellsize,
     1283                number_of_decimal_places = 9,
    12831284                verbose = self.verbose,
    12841285                format = 'asc')
     
    13691370                quantity = 'depth',
    13701371                cellsize = cellsize,
     1372                number_of_decimal_places = 9,
    13711373                verbose = self.verbose,
    13721374                format = 'asc')
     
    20032005                quantity = 'elevation',
    20042006                cellsize = cellsize,
     2007                number_of_decimal_places = 9,
    20052008                verbose = self.verbose,
    20062009                format = 'asc')
     
    21892192                quantity = 'elevation',
    21902193                cellsize = cellsize,
     2194                number_of_decimal_places = 9,
    21912195                easting_min = 308530,
    21922196                easting_max = 308570,
     
    23362340                quantity = 'stage',
    23372341                cellsize = cellsize,
     2342                number_of_decimal_places = 9,
    23382343                reduction = min,
    23392344                format = 'asc',
     
    24492454                quantity = 'stage - elevation',
    24502455                cellsize = cellsize,
     2456                number_of_decimal_places = 9,
    24512457                reduction = min,
    24522458                format = 'asc',
     
    26002606                quantity = 'elevation',
    26012607                cellsize = cellsize,
     2608                number_of_decimal_places = 9,
    26022609                verbose = self.verbose,
    26032610                format = 'asc')
     
    27072714                quantity = 'elevation',
    27082715                cellsize = cellsize,
     2716                number_of_decimal_places = 9,
    27092717                NODATA_value = NODATA_value,
    27102718                verbose = self.verbose,
     
    41484156                quantity = 'depth',
    41494157                cellsize = 200000,
     4158                number_of_decimal_places = 9,
    41504159                verbose = True)
    41514160
Note: See TracChangeset for help on using the changeset viewer.