Changeset 4910
- Timestamp:
- Jan 7, 2008, 3:46:29 PM (16 years ago)
- 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 1399 1399 1400 1400 1401 def test_ gauges_sww2csv(self):1401 def test_sww2csv_gauges(self): 1402 1402 1403 1403 def elevation_function(x, y): … … 1467 1467 1468 1468 1469 gauges_sww2csv(sww.filename,1469 sww2csv_gauges(sww.filename, 1470 1470 points_file, 1471 1471 verbose=False, … … 1509 1509 1510 1510 1511 def test_ gauges_sww2csv1(self):1511 def test_sww2csv_gauges1(self): 1512 1512 from anuga.pmesh.mesh import Mesh 1513 1513 from anuga.shallow_water import Domain, Transmissive_boundary … … 1585 1585 file_id.close() 1586 1586 1587 gauges_sww2csv(sww.filename,1587 sww2csv_gauges(sww.filename, 1588 1588 points_file, 1589 1589 quantities=['Stage', 'elevation'], -
anuga_core/source/anuga/abstract_2d_finite_volumes/util.py
r4889 r4910 685 685 """ 686 686 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 687 692 688 693 k = _sww2timeseries(swwfiles, … … 1494 1499 return xc 1495 1500 1501 def 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 1496 1522 def csv2timeseries_graphs(directories_dic={}, 1497 1523 output_dir='', … … 1504 1530 verbose=False): 1505 1531 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 1507 1534 spend ages on this already... 1535 AND NOTE Create_latex is NOT implemented yet. 1508 1536 1509 1537 … … 1571 1599 1572 1600 """ 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 1574 1610 from os import sep 1575 1611 from anuga.shallow_water.data_manager import \ … … 1927 1963 1928 1964 """ 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 1932 1969 1933 1970 Read in csv files that have the right header information and … … 2271 2308 file.close() 2272 2309 2273 def gauges_sww2csv(sww_file,2310 def sww2csv_gauges(sww_file, 2274 2311 gauge_file, 2275 2312 quantities = ['stage', 'elevation', 'xmomentum', 'ymomentum'],
Note: See TracChangeset
for help on using the changeset viewer.