Changeset 2045


Ignore:
Timestamp:
Nov 21, 2005, 1:49:50 PM (19 years ago)
Author:
ole
Message:

Changed expand_search back to True.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/data_manager.py

    r2038 r2045  
    14271427            easting_max = None,
    14281428            northing_min = None,
    1429             northing_max = None,         
     1429            northing_max = None,
     1430            expand_search = False, #To avoid intractable situations (This will be fixed when least_squares gets redesigned)           
    14301431            verbose = False,
    14311432            origin = None,
     
    15291530
    15301531
     1532    #FIXME: Refactor using code from file_function.statistics
     1533    #Something like print swwstats(swwname)
     1534    if verbose:
     1535        x = fid.variables['x'][:]
     1536        y = fid.variables['y'][:]
     1537        times = fid.variables['time'][:]
     1538        print '------------------------------------------------'
     1539        print 'Statistics of SWW file:'
     1540        print '  Name: %s' %swwfile
     1541        print '  Reference:'
     1542        print '    Lower left corner: [%f, %f]'\
     1543              %(xllcorner, yllcorner)
     1544        print '    Start time: %f' %fid.starttime[0]
     1545        print '  Extent:'
     1546        print '    x [m] in [%f, %f], len(x) == %d'\
     1547              %(min(x.flat), max(x.flat), len(x.flat))
     1548        print '    y [m] in [%f, %f], len(y) == %d'\
     1549              %(min(y.flat), max(y.flat), len(y.flat))
     1550        print '    t [s] in [%f, %f], len(t) == %d'\
     1551              %(min(times), max(times), len(times))
     1552        print '  Quantities [SI units]:'
     1553        for name in ['stage', 'xmomentum', 'ymomentum', 'elevation']:
     1554            q = fid.variables[name][:].flat
     1555            print '    %s in [%f, %f]' %(name, min(q), max(q))
     1556
     1557
     1558
     1559
     1560
    15311561    #Get quantity and reduce if applicable
    15321562    if verbose: print 'Processing quantity %s' %quantity
     
    15391569
    15401570    q = apply_expression_to_dictionary(quantity, quantity_dict)
     1571
    15411572
    15421573
     
    15551586    assert len(q.shape) == 1
    15561587    assert q.shape[0] == number_of_points   
     1588   
     1589
     1590    if verbose:
     1591        print 'Processed values for %s are in [%f, %f]' %(quantity, min(q), max(q))
    15571592   
    15581593
     
    16251660
    16261661    interp = Interpolation(vertex_points, volumes, grid_points, alpha=0.0,
    1627                            precrop = False, expand_search = True,
     1662                           precrop = False,
     1663                           expand_search = expand_search,
    16281664                           verbose = verbose)
     1665
     1666   
    16291667
    16301668    #Interpolate using quantity values
    16311669    if verbose: print 'Interpolating'
    16321670    grid_values = interp.interpolate(q).flat
     1671
     1672    if verbose:
     1673        print 'Interpolated values are in [%f, %f]' %(min(grid_values),
     1674                                                      max(grid_values))
    16331675
    16341676    if format.lower() == 'ers':
     
    22972339    outfile.variables['x'][:] = x - xllcorner
    22982340    outfile.variables['y'][:] = y - yllcorner
    2299     outfile.variables['z'][:] = z
    2300     outfile.variables['elevation'][:] = z  #FIXME HACK
     2341    outfile.variables['z'][:] = z             #FIXME HACK
     2342    outfile.variables['elevation'][:] = z 
    23012343    outfile.variables['time'][:] = times   #Store time relative
    23022344    outfile.variables['volumes'][:] = volumes.astype(Int32) #On Opteron 64
     
    23232365                i += 1
    23242366
    2325 
     2367    #outfile.close()               
     2368
     2369    #FIXME: Refactor using code from file_function.statistics
     2370    #Something like print swwstats(swwname)
    23262371    if verbose:
    23272372        x = outfile.variables['x'][:]
    23282373        y = outfile.variables['y'][:]
     2374        times = outfile.variables['time'][:]
    23292375        print '------------------------------------------------'
    23302376        print 'Statistics of output file:'
     
    23482394
    23492395
    2350 
    2351     outfile.close()
     2396    outfile.close()               
     2397
    23522398
    23532399
Note: See TracChangeset for help on using the changeset viewer.