- Timestamp:
- Jun 18, 2009, 2:47:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/numpy_misc/tools/event_selection/EventSelection.py
r7200 r7214 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 … … 803 803 quake_ID = self.txtQuakeID.GetValue() 804 804 if len(quake_ID) == 0: 805 self.error('You must enter a quake ID first') 806 return 807 try: 808 quake_ID = int(quake_ID) 809 except: 810 self.error("You must enter a Quake ID integer") 811 return 805 self.error("You must enter a quake ID by clicking in " 806 "the 'list' result box") 807 return 808 quake_ID = int(quake_ID) 812 809 813 810 region_select = self.cbRegion.GetValue() … … 891 888 filenames.append(filename) 892 889 893 ## No longer generate the python data file894 ## # write data to the file895 ## urs_filename = '%s/%s' % (ResultSubdir, URSDataFilename % quake_ID)896 ## try:897 ## out_fd = open(urs_filename, "w")898 ## except IOError, msg:899 ## self.error("Error opening output file %s': %s" %900 ## (urs_filename, msg))901 ## return902 ## if last_weight and filenames:903 ## out_fd.write('# Data for region %s,\n'904 ## '# hazard %d,\n'905 ## '# min height %.2f,\n'906 ## '# max height %.2f,\n'907 ## '# quake ID %d\n' %908 ## (Region, GaugeNumber, MinimumHeight,909 ## MaximumHeight, quake_ID))910 ## out_fd.write('# Generated on %s.\n' % time.asctime(time.localtime()))911 ## out_fd.write('\n')912 ## out_fd.write('import os.path\n')913 ## out_fd.write('\n')914 ## out_fd.write('def getInfo(base_directory):\n')915 ## out_fd.write(' """\n')916 ## out_fd.write(' Return the weight factor and list of URS data filenames\n')917 ## out_fd.write('\n')918 ## out_fd.write(' (weight_factor, [filenames]) <- get_urs_data(base_directory)\n')919 ## out_fd.write('\n')920 ## out_fd.write(' where base_directory is the path to the mux files.\n')921 ## out_fd.write(' """\n')922 ## out_fd.write('\n')923 ## out_fd.write(' weight_factor = %f\n' % last_weight)924 ## out_fd.write(' mux_filenames = [')925 ## if filenames:926 ## for fn in filenames[:-1]:927 ## out_fd.write('"%%s" %% os.path.join(base_directory, "%s"),\n ' % fn)928 ## out_fd.write('"%%s" %% os.path.join(base_directory, "%s")\n ' % filenames[-1])929 ## out_fd.write(']\n')930 ## out_fd.write('\n')931 ## out_fd.write(' return (weight_factor, mux_filenames)\n')932 ## out_fd.close()933 934 890 ###### 935 891 # Call the get_grid function. … … 939 895 quake_ID = self.txtQuakeID.GetValue() 940 896 if len(quake_ID) == 0: 941 self.error('You must enter a quake ID first') 942 return 943 try: 944 quake_ID = int(quake_ID) 945 except: 946 self.error("You must enter a Quake ID") 947 return 897 self.error("You must enter a quake ID by clicking in " 898 "the 'list' result box") 899 return 900 quake_ID = int(quake_ID) 948 901 949 902 region_select = self.cbRegion.GetValue() … … 963 916 multimux_dir = os.path.join(BaseDirectory, region_dir_name, 'multimux') 964 917 grid_dir = os.path.join(BaseDirectory, region_dir_name, 'static_2m') 918 965 919 # check that the sub-directory has been created 966 920 if ResultSubdir == '' or not os.path.isdir(ResultSubdir):
Note: See TracChangeset
for help on using the changeset viewer.