Changeset 7041 for misc/tools/event_selection
- Timestamp:
- May 15, 2009, 8:27:16 AM (16 years ago)
- Location:
- misc/tools/event_selection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/tools/event_selection/EventSelection.py
r6366 r7041 14 14 import tempfile 15 15 try: 16 import cpickle 16 import cpickle as pickle 17 17 except: 18 18 import pickle … … 53 53 # program name and version 54 54 APP_NAME = 'EventSelection' 55 APP_VERSION = '1. 0'55 APP_VERSION = '1.1' 56 56 57 57 # name of the configuration filename … … 536 536 size=(CTL_WIDTH, CTL_HEIGHT), style=wx.ALIGN_RIGHT) 537 537 self.txtQuakeID = wx.TextCtrl(p, -1, size=(100, 20), 538 pos=(GEN_TEXTXOFFSET, Y_OFFSET)) 538 pos=(GEN_TEXTXOFFSET, Y_OFFSET), 539 style=wx.TE_READONLY) 539 540 Y_OFFSET += GEN_DELTAY 540 541 x = FORM_WIDTH/2 - BUTTON_WIDTH - DOUBLE_BUTTON_OFFSET … … 890 891 filenames.append(filename) 891 892 892 ## No longer generate the python data file893 ## # write data to the file894 ## urs_filename = '%s/%s' % (ResultSubdir, URSDataFilename % quake_ID)895 ## try:896 ## out_fd = open(urs_filename, "w")897 ## except IOError, msg:898 ## self.error("Error opening output file %s': %s" %899 ## (urs_filename, msg))900 ## return901 ## if last_weight and filenames:902 ## out_fd.write('# Data for region %s,\n'903 ## '# hazard %d,\n'904 ## '# min height %.2f,\n'905 ## '# max height %.2f,\n'906 ## '# quake ID %d\n' %907 ## (Region, GaugeNumber, MinimumHeight,908 ## MaximumHeight, quake_ID))909 ## out_fd.write('# Generated on %s.\n' % time.asctime(time.localtime()))910 ## out_fd.write('\n')911 ## out_fd.write('import os.path\n')912 ## out_fd.write('\n')913 ## out_fd.write('def getInfo(base_directory):\n')914 ## out_fd.write(' """\n')915 ## out_fd.write(' Return the weight factor and list of URS data filenames\n')916 ## out_fd.write('\n')917 ## out_fd.write(' (weight_factor, [filenames]) <- get_urs_data(base_directory)\n')918 ## out_fd.write('\n')919 ## out_fd.write(' where base_directory is the path to the mux files.\n')920 ## out_fd.write(' """\n')921 ## out_fd.write('\n')922 ## out_fd.write(' weight_factor = %f\n' % last_weight)923 ## out_fd.write(' mux_filenames = [')924 ## if filenames:925 ## for fn in filenames[:-1]:926 ## out_fd.write('"%%s" %% os.path.join(base_directory, "%s"),\n ' % fn)927 ## out_fd.write('"%%s" %% os.path.join(base_directory, "%s")\n ' % filenames[-1])928 ## out_fd.write(']\n')929 ## out_fd.write('\n')930 ## out_fd.write(' return (weight_factor, mux_filenames)\n')931 ## out_fd.close()932 933 893 ###### 934 894 # Call the get_grid function. … … 938 898 quake_ID = self.txtQuakeID.GetValue() 939 899 if len(quake_ID) == 0: 940 self.error('You must enter a quake ID first') 941 return 942 try: 943 quake_ID = int(quake_ID) 944 except: 945 self.error("You must enter a Quake ID") 946 return 900 self.error("You must enter a quake ID by clicking in " 901 "the 'list' result box") 902 return 903 quake_ID = int(quake_ID) 947 904 948 905 region_select = self.cbRegion.GetValue() … … 962 919 multimux_dir = os.path.join(BaseDirectory, region_dir_name, 'multimux') 963 920 grid_dir = os.path.join(BaseDirectory, region_dir_name, 'static_2m') 921 922 # check that the sub-directory has been created 923 if ResultSubdir == '' or not os.path.isdir(ResultSubdir): 924 self.error("Sorry, you must 'list' earthquakes first.") 925 return 964 926 965 927 #################################################################### … … 1048 1010 out_fd.write('WEIGHT_FACTOR=%f\n' % weight_factor) 1049 1011 out_fd.write('DATA_PATH=%s\n' % grid_dir) 1050 for fn in filenames[1:]: 1012 #for fn in filenames[1:]: 1013 for fn in filenames: 1051 1014 owning_dir = filenames[0].split('-')[0] 1052 1015 out_fd.write('GRID=%s\n' % (os.path.join(owning_dir, fn))) -
misc/tools/event_selection/installer/EventSelection.nsi
r6364 r7041 1 1 !define PRODUCT_NAME "EventSelection" 2 !define PRODUCT_VERSION "1. 0"2 !define PRODUCT_VERSION "1.1" 3 3 !define ICON_FILE "tsunami.ico" 4 4
Note: See TracChangeset
for help on using the changeset viewer.