Changeset 4699


Ignore:
Timestamp:
Sep 4, 2007, 1:48:06 PM (17 years ago)
Author:
ole
Message:

Cosmetics while pondering over storage of extrema

Location:
anuga_core/source/anuga
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/config.py

    r4685 r4699  
    149149umask = 002  # used to set file and directory permission created by anuga
    150150
     151max_float = 1.0e36 # Largest number. Used to initialise (max, min) ranges.
     152   
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r4688 r4699  
    8787     ensure_absolute
    8888from anuga.config import minimum_storable_height as default_minimum_storable_height
     89from anuga.config import max_float
    8990from anuga.utilities.numerical_tools import ensure_numeric,  mean
    9091from anuga.caching.caching import myhash
     
    47804781    sww_quantities = Domain.conserved_quantities
    47814782    RANGE = '_range'
     4783
    47824784    def __init__(self):
    47834785        pass
     
    47984800        outfile.description = description
    47994801
    4800         #For sww compatibility
     4802        # For sww compatibility
    48014803        if smoothing is True:
    48024804            # Smoothing to be depreciated
     
    48134815        except:
    48144816            revision_number = None
    4815         # writing a string so None can be written   
    4816         outfile.revision_number = str(revision_number)
    4817         #times - A list or array of the time slice times OR a start time
    4818         #times = ensure_numeric(times)
    4819         #Start time in seconds since the epoch (midnight 1/1/1970)
    4820 
    4821         # this is being used to seperate one number from a list.
     4817        # Allow None to be stored as a string               
     4818        outfile.revision_number = str(revision_number)
     4819
     4820
     4821       
     4822        # times - A list or array of the time slice times OR a start time
     4823        # times = ensure_numeric(times)
     4824        # Start time in seconds since the epoch (midnight 1/1/1970)
     4825
     4826        # This is being used to seperate one number from a list.
    48224827        # what it is actually doing is sorting lists from numeric arrays.
    48234828        if type(times) is list or type(times) is ArrayType: 
     
    48574862        outfile.createVariable(q+Write_sww.RANGE, precision,
    48584863                               ('numbers_in_range',))
    4859         # The values are initally filled with large (10e+36) numbers.
    4860         # I'm relying on this feature.  Maybe I shouldn't?
    4861         outfile.variables[q+Write_sww.RANGE][1] = \
    4862                           -1*outfile.variables[q+Write_sww.RANGE][1]
     4864
     4865        # Initialise ranges with small and large sentinels.
     4866        # If this was in pure Python we could have used None sensibly
     4867        outfile.variables[q+Write_sww.RANGE][0] = max_float  # Min               
     4868        outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max
    48634869
    48644870        #FIXME: Backwards compatibility
     
    48784884            outfile.createVariable(q+Write_sww.RANGE, precision,
    48794885                                   ('numbers_in_range',))
    4880             # Initialising the max value to a very small number.
    4881             # It assumes that netcdf initialises it to a very large number
    4882             outfile.variables[q+Write_sww.RANGE][1] = \
    4883                 -outfile.variables[q+Write_sww.RANGE][1]
     4886
     4887            # Initialise ranges with small and large sentinels.
     4888            # If this was in pure Python we could have used None sensibly
     4889            outfile.variables[q+Write_sww.RANGE][0] = max_float  # Min               
     4890            outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max
    48844891           
    48854892        if type(times) is list or type(times) is ArrayType: 
     
    50385045        print 'More Statistics:'
    50395046        for q in Write_sww.sww_quantities:
    5040             print '  %s in [%f, %f]' %(q
    5041                                        ,outfile.variables[q+Write_sww.RANGE][0]
    5042                                        ,outfile.variables[q+Write_sww.RANGE][1]
    5043                                        )
     5047            print '  %s in [%f, %f]' %(q,
     5048                                       outfile.variables[q+Write_sww.RANGE][0],
     5049                                       outfile.variables[q+Write_sww.RANGE][1])
    50445050        print '------------------------------------------------'
     5051
    50455052       
    50465053def obsolete_write_sww_time_slices(outfile, has, uas, vas, elevation,
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r4686 r4699  
    262262        #print "sww.filename", sww.filename
    263263        os.remove(sww.filename)
     264
     265       
    264266       
    265267    def test_sww_constant_smooth(self):
Note: See TracChangeset for help on using the changeset viewer.