Ignore:
Timestamp:
Sep 25, 2008, 2:24:38 PM (16 years ago)
Author:
kristy
Message:

Updated all scripts to reflect Perth format. Also added 250m scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/busselton/get_gauges.py

    r5608 r5786  
    1414        compress,zeros,fabs,take
    1515    fid = NetCDFFile(filename+'.sts', 'r')    #Open existing file for read
     16    permutation = fid.variables['permutation'][:]
    1617    x = fid.variables['x'][:]+fid.xllcorner   #x-coordinates of vertices
    1718    y = fid.variables['y'][:]+fid.yllcorner   #y-coordinates of vertices
     
    2728
    2829    maxname = 'max_sts_stage.csv'
    29     fid_max = open(project.boundaries_dir+sep+maxname,'w')
    30     s = 'x, y, max_stage \n'
     30    fid_max = open(project.boundaries_dir_event+sep+maxname,'w')
     31    s = 'index, x, y, max_stage \n'
    3132    fid_max.write(s)   
    3233    for j in range(len(x)):
    33         locx=int(x[j])
    34         locy=int(y[j])
     34        index= permutation[j]
    3535        stage = quantities['stage'][:,j]
    3636        xmomentum = quantities['xmomentum'][:,j]
    3737        ymomentum = quantities['ymomentum'][:,j]
    3838
    39         s = '%.6f, %.6f, %.6f\n' %(x[j], y[j], max(stage))
     39        s = '%d, %.6f, %.6f, %.6f\n' %(index, x[j], y[j], max(stage))
    4040        fid_max.write(s)
    4141       
    42         fid_sts = open(project.boundaries_dir+sep+basename+'_'+str(locx)+'_'+str(locy)+'.csv', 'w')
     42        fid_sts = open(project.boundaries_dir_event+sep+basename+'_'+ str(index)+'.csv', 'w')
    4343        s = 'time, stage, xmomentum, ymomentum \n'
    4444        fid_sts.write(s)
     
    5454    return quantities,elevation,time
    5555
    56 quantities,elevation,time=get_sts_gauge_data(os.path.join(project.boundaries_dir,project.scenario_name),verbose=False)
     56quantities,elevation,time=get_sts_gauge_data(os.path.join(project.boundaries_dir_event,project.scenario_name),verbose=False)
    5757
    5858print len(elevation), len(quantities['stage'][0,:])
Note: See TracChangeset for help on using the changeset viewer.