Skip to content

Commit

Permalink
changing the randidents to the old version
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicapilling committed Dec 18, 2024
1 parent 10da35e commit 5b7bfbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xga/generate/esass/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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
Expand Down

0 comments on commit 5b7bfbf

Please sign in to comment.