Skip to content

Commit 0010406

Browse files
committed
Pointed eSASS spectrum generation commands to event list symlinks, rather than absolute paths, to hopefully solve issue #1400
1 parent 27773c2 commit 0010406

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

xga/generate/esass/spec.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This code is a part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS).
2-
# Last modified by David J Turner (turne540@msu.edu) 28/07/2025, 10:59. Copyright (c) The Contributors
2+
# Last modified by David J Turner (turne540@msu.edu) 28/07/2025, 11:02. Copyright (c) The Contributors
33

44
import os
55
from copy import deepcopy, copy
@@ -270,6 +270,8 @@ def _append_spec_info(evt_list):
270270
group_scale = ''
271271

272272
# Fills out the srctool command to make the main and background spectra
273+
# WE NOTE THAT, BECAUSE WE CREATE EVENT LIST SYMLINKS TO SOLVE ISSUE #1400, THE EVENT LIST PATHS
274+
# ARE JUST THE BASE FILENAME OF THE EVENT LIST
273275
if isinstance(source, ExtendedSource):
274276
try:
275277
if use_combine_obs and (len(source.obs_ids['erosita']) > 1):
@@ -278,20 +280,20 @@ def _append_spec_info(evt_list):
278280
else:
279281
# We only need the image path for extended source generation
280282
im = source.get_images(obs_id, lo_en=Quantity(0.2, 'keV'), hi_en=Quantity(10.0, 'keV'),
281-
telescope='erosita')
283+
telescope='erosita')
282284
# We have a slightly different command for extended and point sources
283-
s_cmd_str = ext_srctool_cmd.format(d=dest_dir, ef=evt_list.path, sc=coord_str, reg=src_reg_str,
284-
i=inst_no, ts=t_step, em=im.path, et=et)
285+
s_cmd_str = ext_srctool_cmd.format(d=dest_dir, ef=os.path.basename(evt_list.path), sc=coord_str,
286+
reg=src_reg_str, i=inst_no, ts=t_step, em=im.path, et=et)
285287
except:
286288
raise ValueError(f"it was this sources {source.name}")
287289

288290
else:
289-
s_cmd_str = pnt_srctool_cmd.format(d=dest_dir, ef=evt_list.path, sc=coord_str, reg=src_reg_str,
290-
i=inst_no, ts=t_step)
291+
s_cmd_str = pnt_srctool_cmd.format(d=dest_dir, ef=os.path.basename(evt_list.path), sc=coord_str,
292+
reg=src_reg_str, i=inst_no, ts=t_step)
291293

292294
# TODO FIGURE OUT WHAT TO DO ABOUT THE TIMESTEP
293-
sb_cmd_str = bckgr_srctool_cmd.format(ef=evt_list.path, sc=coord_str, breg=bsrc_reg_str,
294-
i=inst_no, ts=t_step*4)
295+
sb_cmd_str = bckgr_srctool_cmd.format(ef=os.path.basename(evt_list.path), sc=coord_str, breg=bsrc_reg_str,
296+
i=inst_no, ts=t_step * 4)
295297
# Filling out the grouping command
296298
grp_cmd_str = grp_cmd.format(infi=no_grp_spec, of=spec, gt=group_type, gs=group_scale)
297299

0 commit comments

Comments
 (0)