Changeset 4699 for anuga_core/source/anuga/shallow_water/data_manager.py
- Timestamp:
- Sep 4, 2007, 1:48:06 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r4688 r4699 87 87 ensure_absolute 88 88 from anuga.config import minimum_storable_height as default_minimum_storable_height 89 from anuga.config import max_float 89 90 from anuga.utilities.numerical_tools import ensure_numeric, mean 90 91 from anuga.caching.caching import myhash … … 4780 4781 sww_quantities = Domain.conserved_quantities 4781 4782 RANGE = '_range' 4783 4782 4784 def __init__(self): 4783 4785 pass … … 4798 4800 outfile.description = description 4799 4801 4800 # For sww compatibility4802 # For sww compatibility 4801 4803 if smoothing is True: 4802 4804 # Smoothing to be depreciated … … 4813 4815 except: 4814 4816 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. 4822 4827 # what it is actually doing is sorting lists from numeric arrays. 4823 4828 if type(times) is list or type(times) is ArrayType: … … 4857 4862 outfile.createVariable(q+Write_sww.RANGE, precision, 4858 4863 ('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 4863 4869 4864 4870 #FIXME: Backwards compatibility … … 4878 4884 outfile.createVariable(q+Write_sww.RANGE, precision, 4879 4885 ('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 4884 4891 4885 4892 if type(times) is list or type(times) is ArrayType: … … 5038 5045 print 'More Statistics:' 5039 5046 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]) 5044 5050 print '------------------------------------------------' 5051 5045 5052 5046 5053 def obsolete_write_sww_time_slices(outfile, has, uas, vas, elevation,
Note: See TracChangeset
for help on using the changeset viewer.