Changeset 2700


Ignore:
Timestamp:
Apr 11, 2006, 5:05:36 PM (18 years ago)
Author:
nick
Message:

added functionality to export_results.py

Location:
production/onslow_2006
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • production/onslow_2006/export_results.py

    r2682 r2700  
    11import project, os
    2 from os import sep
     2import sys
    33
    44from pyvolution.data_manager import sww2dem
    55from pyvolution.ermapper_grids import read_ermapper_grid
     6from pyvolution.util import Screen_Catcher
     7from os import sep
    68
    7 #name = project.outputname
    8 
    9 time_dir = "20060328_094539_alpha_0.1"
     9time_dir = "20060327_095435"
    1010directory = project.outputdir
    1111name = directory + time_dir +sep + "source"
    1212
    13 print'output dir:', name
     13#normal screen output is stored in 'outname'
     14screen_output_name = directory + time_dir + sep + "export_output.txt"
     15
     16#used to catch screen output to file
     17sys.stdout = Screen_Catcher(screen_output_name)
     18sys.stderr = Screen_Catcher(screen_output_name)
     19
     20print 'output dir:', name
    1421#print 'Which variable do you want to export?'
    1522#which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3  '  ))
     
    3845    quantityname = 'elevation'  #Elevation
    3946
    40    
     47print 'start sww2dem'
    4148sww2dem(name, basename_out = outname,
    4249            quantity = quantityname,
    43             cellsize = 30,       # Trevor would like this at 25
     50            cellsize = 1000,       # Trevor would like this at 25
    4451            # define region for viz purposes
    4552            easting_min = project.e_min_area,
     
    5158            format = 'asc')
    5259
     60sys.stderr.write(sys.stdout.data)
     61
    5362#Check
    5463
  • production/onslow_2006/get_timeseries.py

    r2683 r2700  
    1111
    1212 
    13 '''
    14 time_dir = "20060331_155157"
     13
     14time_dir = "20060410_054158_elevation_6_side_15000"
    1515directory = project.outputdir
    1616swwfile = directory + time_dir +sep + "source.sww"
     
    1818directory = project.boundarydir
    1919swwfile = directory + "SU-AU_high_res.sww"
    20 
     20'''
    2121#swwfile = project.outputname + '.sww'
    2222
     
    3030    for line in lines[1:]:
    3131        fields = line.split(',')
    32         # my gauge file set up as locationname, easting, northing
     32        # my gauge file set up as  easting, northing locationname,
    3333       
    3434        easting = float(fields[0])
    3535        northing = float(fields[1])
    36         location = fields[2]
     36        location = fields[2].strip()
     37        print 'location',location
    3738        #z, easting, northing  = redfearn(lat, lon)
    3839        gauges.append([easting, northing])
     
    207208
    208209    whichone = '_%s' %myloc
    209     thisfile = project.gaugetimeseries+whichone+'.csv'
     210#    thisfile = project.gaugetimeseries+whichone+'.csv'
     211    thisfile = directory + time_dir +sep +whichone+'.csv'
    210212    fid = open(thisfile, 'w')
    211213    s = 'Time, Depth, Momentum, Velocity \n'
Note: See TracChangeset for help on using the changeset viewer.