Changeset 4910


Ignore:
Timestamp:
Jan 7, 2008, 3:46:29 PM (16 years ago)
Author:
nick
Message:

changed name of ploting function from gauges_sww2csv to sww2csv_gauges
and added some print statments to sww2timeseries to point users to the newer code.

Location:
anuga_core/source/anuga/abstract_2d_finite_volumes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py

    r4889 r4910  
    13991399       
    14001400
    1401     def test_gauges_sww2csv(self):
     1401    def test_sww2csv_gauges(self):
    14021402
    14031403        def elevation_function(x, y):
     
    14671467
    14681468       
    1469         gauges_sww2csv(sww.filename,
     1469        sww2csv_gauges(sww.filename,
    14701470                            points_file,
    14711471                            verbose=False,
     
    15091509
    15101510
    1511     def test_gauges_sww2csv1(self):
     1511    def test_sww2csv_gauges1(self):
    15121512        from anuga.pmesh.mesh import Mesh
    15131513        from anuga.shallow_water import Domain, Transmissive_boundary
     
    15851585        file_id.close()
    15861586
    1587         gauges_sww2csv(sww.filename,
     1587        sww2csv_gauges(sww.filename,
    15881588                            points_file,
    15891589                            quantities=['Stage', 'elevation'],
  • anuga_core/source/anuga/abstract_2d_finite_volumes/util.py

    r4889 r4910  
    685685    """
    686686
     687    msg = 'NOTE: A new function is available to create csv files from sww files called'
     688    msg += 'sww2csv_gauges in anuga.abstract_2d_finite_volumes.util'
     689    msg += 'PLUS another new function to create graphs from csv files called'   
     690    msg += 'csv2timeseries_graphs in anuga.abstract_2d_finite_volumes.util'
     691    print msg
    687692   
    688693    k = _sww2timeseries(swwfiles,
     
    14941499    return xc
    14951500
     1501def make_plots_from_csv_file(directories_dic={dir:['gauge', 0, 0]},
     1502                                output_dir='',
     1503                                base_name='',
     1504                                plot_numbers=['3-5'],
     1505                                quantities=['Speed','Stage','Momentum'],
     1506                                assess_all_csv_files=True,
     1507                                extra_plot_name='test' ):
     1508   
     1509    print 'make_plots_from_csv_file has been replaced by csv2timeseries_graphs ',
     1510    print 'Please use "from anuga.shallow_water.util import csv2timeseries_graphs"'
     1511   
     1512    return csv2timeseries_graphs(directories_dic,
     1513                                 output_dir,
     1514                                 base_name,
     1515                                 plot_numbers,
     1516                                 quantities,
     1517                                 extra_plot_name,
     1518                                 assess_all_csv_files
     1519                                 )
     1520   
     1521
    14961522def csv2timeseries_graphs(directories_dic={},
    14971523                            output_dir='',
     
    15041530                            verbose=False):
    15051531                               
    1506     """    WARNING!! NO UNIT TESTS... could make some as to test filename..but have
     1532    """   
     1533    WARNING!! NO UNIT TESTS... could make some as to test filename..but have
    15071534    spend ages on this already...
     1535    AND NOTE Create_latex is NOT implemented yet.
    15081536   
    15091537   
     
    15711599   
    15721600    """
    1573     import pylab#
     1601    import pylab
     1602    try:
     1603        import pylab
     1604    except ImportError:
     1605        msg='csv2timeseries_graphs needs pylab to be installed correctly'
     1606        raise msg
     1607            #ANUGA don't need pylab to work so the system doesn't
     1608            #rely on pylab being installed
     1609        return
    15741610    from os import sep
    15751611    from anuga.shallow_water.data_manager import \
     
    19271963                               
    19281964    """     
    1929     NOTE! DOES not work 100% yet. eg don't use assess_all_csv_files=True
    1930     everything else is ok?                 
    1931     Use sww2timeseries....           
     1965    NOTE! This code has NOT been removed as it is very close to working
     1966    the same as the current code for sww2timeseries_graphs HOWEVER IT WOULD
     1967    BE MUCH NICER!! instead of explicit if statments it uses loops and halves
     1968    the number of lines of code.... but it doesn't work yet           
    19321969   
    19331970    Read in csv files that have the right header information and
     
    22712308        file.close()
    22722309
    2273 def gauges_sww2csv(sww_file,
     2310def sww2csv_gauges(sww_file,
    22742311                   gauge_file,
    22752312                   quantities = ['stage', 'elevation', 'xmomentum', 'ymomentum'],
Note: See TracChangeset for help on using the changeset viewer.