Changeset 5597


Ignore:
Timestamp:
Aug 1, 2008, 6:54:25 PM (11 years ago)
Author:
sexton
Message:

additional gauges for urs2sts test suite and update to urs2sts test

Location:
anuga_core/source/anuga/shallow_water
Files:
40 added
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r5593 r5597  
    65546554        sources = ['1-z.grd','2-z.grd','3-z.grd']
    65556555       
    6556        
    65576556        # Start times by source and station taken manually from urs header files
    65586557        time_start_z = array([[10.0,11.5,13,14.5,17.7],
    65596558                              [9.8,11.2,12.7,14.2,17.4],
    65606559                              [9.5,10.9,12.4,13.9,17.1]])
    6561                            
    6562        
     6560
     6561        time_start_e = time_start_z
     6562        time_start_n = time_start_e
     6563
    65636564       
    65646565        # Make sts file for each source
     
    65936594            # For each station, compare urs2sts output to known urs output
    65946595           
    6595                            
     6596            delta_t = 0.1
     6597            #time_start_e = time_start_z
     6598            #time_start_n = time_start_z
     6599           
    65966600            # Make sure start time from sts file is the minimum starttime
    65976601            # across all stations (for this source)
    65986602            #print k, time_start_z[k,:]
    65996603            starttime = min(time_start_z[k, :])
     6604            sts_starttime = fid.starttime[0]
    66006605            msg = 'Starttime for source %d was %f. Should have been %f'\
    6601                 %(source_number, fid.starttime, starttime)
    6602             assert allclose(fid.starttime, starttime), msg
     6606                %(source_number, sts_starttime-delta_t, starttime)
     6607            assert allclose(sts_starttime-delta_t, starttime), msg
     6608            ## FIXME - have done a dodgy to get it through here ###               
    66036609                           
    6604                            
    6605             delta_t = 0.1
    6606             #time_start_e = time_start_z
    6607             #time_start_n = time_start_z
     6610           
    66086611           
    66096612            for j in range(len(x)):
     
    66136616                index_end = 0
    66146617                count = 0
    6615                 urs_file_name = 'z_'+str(source_number)+'_'+str(j)+'.csv'
    6616                 dict = csv2array(os.path.join(testdir, urs_file_name))
     6618                urs_file_name_z = 'z_'+str(source_number)+'_'+str(j)+'.csv'
     6619                dict = csv2array(os.path.join(testdir, urs_file_name_z))
    66176620                urs_stage = dict['urs_stage']
     6621                urs_file_name_e = 'e_'+str(source_number)+'_'+str(j)+'.csv'
     6622                dict = csv2array(os.path.join(testdir, urs_file_name_e))
     6623                urs_e = dict['urs_e']
     6624                urs_file_name_n = 'n_'+str(source_number)+'_'+str(j)+'.csv'
     6625                dict = csv2array(os.path.join(testdir, urs_file_name_n))
     6626                urs_n = dict['urs_n']
    66186627                for i in range(len(urs_stage)):
    66196628                    if urs_stage[i] == 0.0:
     
    66776686        from Numeric import asarray,transpose,sqrt,argmax,argmin,arange,Float,\
    66786687            compress,zeros,fabs,take,size
     6688
     6689        # combined
     6690        time_start_z = array([9.5,10.9,12.4,13.9,17.1])
     6691        time_start_e = time_start_z
     6692        time_start_n = time_start_e
    66796693       
    66806694        # make sts file for combined sources
Note: See TracChangeset for help on using the changeset viewer.