Ignore:
Timestamp:
Jun 21, 2006, 9:31:57 AM (18 years ago)
Author:
sexton
Message:

MOST and ANUGA comparisons and updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • production/sydney_2006/get_timeseries.py

    r2885 r3190  
    55import project
    66from pyvolution.util import file_function
    7 from coordinate_transforms.redfearn import degminsec2decimal_degrees, redfearn
     7#from coordinate_transforms.redfearn import degminsec2decimal_degrees, redfearn
    88from pylab import *
    99from matplotlib.ticker import MultipleLocator, FormatStrFormatter
    1010
    11 swwfile = project.outputname + '.sww'
    12 
    13 
     11swwfile = project.outputname + '.sww'
     12#swwfile = project.outputdir + timestampdir + sep + project.outputname + '.sww'
     13# place to store figures
     14#graphloc = project.outputdir + timestampdir + sep
     15graphloc = project.outputdir
    1416
    1517#Time interval to plot
    16 tmin = 13000
    17 tmax = 21000
     18tmin = 2*60
     19tmax = 10*60
    1820
    1921def get_gauges_from_file(filename):
     
    3436        gaugelocation.append(location)
    3537       
    36     #Return gauges and raw data for subsequent storage
    3738    return gauges, lines, gaugelocation
    3839
     
    4041gauges, lines, locations = get_gauges_from_file(project.gauge_filename)
    4142
    42 print 'number of gauges for Benfield:   ', len(gauges)
     43print 'number of gauges:   ', len(gauges)
    4344
    4445#Read model output
     
    5051                  use_cache = True)
    5152
    52 
    53                
     53print 'size f', size(f.quantities['stage'],axis=0), size(f.quantities['stage'],axis=1)
     54
    5455from math import sqrt, atan, degrees
    5556from Numeric import ones
     
    8586        uh = f(t, point_id = k)[2]
    8687        vh = f(t, point_id = k)[3]
    87         myloc = locations[k]
     88        gaugeloc = locations[k]
    8889        depth = w-z
    89 
     90       
    9091        m = sqrt(uh*uh + vh*vh)   #Absolute momentum
    9192        vel = sqrt(uh*uh + vh*vh) / (w-z + 1.e-30) #Absolute velocity
     
    135136             model_time, elevations, '-k')
    136137    #name = 'Gauge_%d: (%.1f, %.1f)' %(k, g[0], g[1])
    137     name = 'Gauge_%d: (%.1f, %.1f) Location: %s' %(k, g[0], g[1], myloc)
     138    name = 'Gauge_%d: (%.1f, %.1f) Location: %s' %(k, g[0], g[1], gaugeloc)
    138139    title(name)
    139140
     
    144145           shadow=True,
    145146           loc='upper right')
    146     #savefig('Gauge_%d_stage' %k)
    147     savefig('Gauge_%s_stage' %myloc)
    148 
    149     # raw_input('Next')
     147    #('Gauge_%d_stage' %k)
     148    savefig('%sGauge_%s_stage' %(graphloc, gaugeloc))
     149    #savefig('Gauge_%s_stage.eps' %gaugeloc)
    150150   
    151151    #Momentum plot
     
    159159    ylabel('sqrt( uh^2 + vh^2 ) [m^2/s]')   
    160160    #savefig('Gauge_%d_momentum' %k)
    161     savefig('Gauge_%s_momentum' %myloc)
     161    savefig('%sGauge_%s_momentum' %(graphloc, gaugeloc))
    162162   
    163     # raw_input('Next')
    164 
    165163    #Bearing plot
    166164    ion()
     
    181179    ylabel(' atan(vh/uh) [degrees from North]')   
    182180    #savefig('Gauge_%d_bearing' %k)
    183     savefig('Gauge_%s_bearing' %myloc)
    184    
    185     # raw_input('Next')
     181    savefig('%sGauge_%s_bearing' %(graphloc, gaugeloc))
    186182
    187183    #Speed plot
     
    195191    ylabel('sqrt( uh^2 + vh^2 ) / depth [m/s]')   
    196192    #savefig('Gauge_%d_speed' %k)
    197     savefig('Gauge_%s_speed' %myloc)
    198    
    199     # raw_input('Next')
    200 
    201     whichone = '_%s' %myloc
     193    savefig('%sGauge_%s_speed' %(graphloc, gaugeloc))
     194
     195    whichone = '_%s' %gaugeloc
    202196    thisfile = project.gaugetimeseries+whichone+'.csv'
    203197    fid = open(thisfile, 'w')
Note: See TracChangeset for help on using the changeset viewer.