diff --git a/wetb/hawc2/hawc2_simulation.py b/wetb/hawc2/hawc2_simulation.py index f3096d04a0804f726dcab8bdfe97a3a6679efbc0..244ea68bcacdc08b5349c19f08be8017625aea58 100644 --- a/wetb/hawc2/hawc2_simulation.py +++ b/wetb/hawc2/hawc2_simulation.py @@ -153,6 +153,8 @@ class Hawc2_Simulation(object): old_home = os.getcwd() # Change to the htc directory + if not os.path.isdir(self.write_directory): + os.mkdir(self.write_directory) os.chdir(self.write_directory) # scale sensors for writing diff --git a/wetb/hawc2/st_file.py b/wetb/hawc2/st_file.py index 03f94406375bc1d07c624e98bb4884c69e12340b..ae29fb868205eb97e561da40fbd6073f0c7f5926 100644 --- a/wetb/hawc2/st_file.py +++ b/wetb/hawc2/st_file.py @@ -176,6 +176,7 @@ class StBaseData(object): else: raise IndexError('The keys cannot have more than 3 terms') if len(sub_set_data)!=len(val): + print('The size of the data is %d and the size of the value is %d'%(len(sub_set_data), len(val))) raise IndexError('The value is not the same size as the data') if data_id in key_str: col_id = key_str.index(data_id) @@ -277,6 +278,9 @@ class StBaseData(object): if not is_int(header_words[0]): raise Exception('First term in the header of an ST file must be the number of main sets') no_maindata_sets = int(header_words[0]) + if no_maindata_sets != txt.count("#"): + print('About to throw an error because the file "%s" does not have the correct number of # characters'%(filename)) + print('The number of sets in the header is %d and the number of sets in the file is %d'%(no_maindata_sets,txt.count("#"))) assert no_maindata_sets == txt.count("#") self.main_data_sets = {} for mset in main_sets[1:]: