diff --git a/xga/generate/esass/spec.py b/xga/generate/esass/spec.py index c4f52ac3..81ee08d3 100644 --- a/xga/generate/esass/spec.py +++ b/xga/generate/esass/spec.py @@ -124,11 +124,11 @@ def _append_spec_info(evt_list): if use_combine_obs and (len(source.obs_ids['erosita']) > 1): # The files produced by this function will now be stored in the combined directory. final_dest_dir = OUTPUT + "erosita/combined/" - rand_ident = randint(0, int(1e+8)) + rand_ident = randint(0, 1e+8) # Makes absolutely sure that the random integer hasn't already been used while len([f for f in os.listdir(final_dest_dir) if str(rand_ident) in f.split(OUTPUT+"erosita/combined/")[-1]]) != 0: - rand_ident = randint(0, int(1e+8)) + rand_ident = randint(0, 1e+8) dest_dir = os.path.join(final_dest_dir, "temp_srctool_{}".format(rand_ident)) @@ -137,7 +137,7 @@ def _append_spec_info(evt_list): # function for generating annular spectra doesn't clash and try to use the same folder # The temporary region files necessary to generate eROSITA spectra (if contaminating sources are # being removed) will be written to a different temporary folder using the same random identifier. - rand_ident = randint(0, int(1e+8)) + rand_ident = randint(0, 1e+8) dest_dir = OUTPUT + "erosita/" + "{o}/{i}_{n}_temp_{r}/".format(o=obs_id, i=inst, n=source_name, r=rand_ident) # If something got interrupted and the temp directory still exists, this will remove it