Changeset 6290


Ignore:
Timestamp:
Feb 6, 2009, 9:41:31 AM (16 years ago)
Author:
jgriffin
Message:

New format and naming conventions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/australia_ph2/sydney/build_boundary_7875.py

    r6288 r6290  
    33WA, Australia.  The boundary is based on the National Hazard Map.
    44
    5 Input: order_filename from project_250m.py
    6        event_number needs to be reflected in the project_250m file
    7 Output: creates a sts file and csv files stored in project_250m.boundaries_dir_event.
     5Input: order_filename from project.py
     6       event_number needs to be reflected in the project file
     7Output: creates a sts file and csv files stored in project.boundaries_dir_event.
    88The run_sydney.py is reliant on the output of this script.
    99"""
    1010import os
    1111from os import sep
    12 import project_250m
     12from os.path import join
     13import project
    1314
    1415from anuga.utilities.numerical_tools import ensure_numeric
     
    2930#--------------------------------------------------------------------------
    3031
    31 dir=os.path.join(project_250m.muxhome,'mux')
     32dir=os.path.join(project.muxhome,'mux')
    3233
    3334# Refer to event_07875.list in home+state+sep+event08 for event details
     
    6364    weights=weight_factor*ones(len(urs_filenames),Float)
    6465
    65     scenario_name=project_250m.scenario_name
    66     order_filename=os.path.join(project_250m.urs_boundary_name)
     66    scenario_name=project.scenario_name
     67    urs_order = join(project.urs_order)
    6768
    68     print 'reading', order_filename
    69     # Create ordered sts file
    70     print 'creating sts file'
     69    print 'reading', urs_order
    7170
    7271    urs2sts(urs_filenames,
    73             basename_out=os.path.join(project_250m.boundaries_dir_event,scenario_name),
    74             ordering_filename=order_filename,
    75             weights=weights,
    76             mean_stage=project_250m.tide,
    77             verbose=True)
     72            basename_out = join(project.event_sts),
     73            ordering_filename = urs_order,
     74            weights = weights,
     75            mean_stage = project.tide,
     76            verbose = True)
    7877else:
    7978    print 'number of sources do not match event.list'
     
    9998        quantities[name] = fid.variables[name][:]
    10099
    101 #------------------------------------------------------------------------------
    102 # Get Maxium wave height throughout timeseries at each index point
    103 #------------------------------------------------------------------------------
     100    #------------------------------------------------------------------------------
     101    # Get Maxium wave height throughout timeseries at each index point
     102    #------------------------------------------------------------------------------
    104103
    105104    maxname = 'max_sts_stage.csv'
    106     fid_max = open(project_250m.boundaries_dir_event+sep+maxname,'w')
     105    fid_max = open(project.boundaries_dir_event+sep+maxname,'w')
    107106    s = 'index, x, y, max_stage \n'
    108107    fid_max.write(s)   
     
    116115        fid_max.write(s)
    117116     
    118 #------------------------------------------------------------------------------
    119 # Get Minium wave height throughout timeseries at each index point
    120 #------------------------------------------------------------------------------
     117    #------------------------------------------------------------------------------
     118    # Get Minium wave height throughout timeseries at each index point
     119    #------------------------------------------------------------------------------
    121120
    122121    minname = 'min_sts_stage.csv'
    123     fid_min = open(project_250m.boundaries_dir_event+sep+minname,'w')
     122    fid_min = open(project.boundaries_dir_event+sep+minname,'w')
    124123    s = 'index, x, y, max_stage \n'
    125124    fid_min.write(s)   
     
    135134
    136135
    137         fid_sts = open(project_250m.boundaries_dir_event+sep+basename+'_'+ str(index)+'.csv', 'w')
     136        fid_sts = open(project.boundaries_dir_event+sep+basename+'_'+ str(index)+'.csv', 'w')
    138137        s = 'time, stage, xmomentum, ymomentum \n'
    139138        fid_sts.write(s)
    140139
    141 #------------------------------------------------------------------------------
    142 # End of the get gauges
    143 #------------------------------------------------------------------------------
     140    #------------------------------------------------------------------------------
     141    # End of the get gauges
     142    #------------------------------------------------------------------------------
    144143        for k in range(len(time)-1):
    145144            s = '%.6f, %.6f, %.6f, %.6f\n' %(time[k], stage[k], xmomentum[k], ymomentum[k])
     
    153152    return quantities,elevation,time
    154153
    155 quantities,elevation,time=get_sts_gauge_data(os.path.join(project_250m.boundaries_dir_event,project_250m.scenario_name),verbose=False)
     154quantities,elevation,time=get_sts_gauge_data(os.path.join(project.boundaries_dir_event,project.scenario_name),verbose=False)
    156155
    157156print len(elevation), len(quantities['stage'][0,:])
Note: See TracChangeset for help on using the changeset viewer.