Skip to content

Commit

Permalink
implementing the function in the _spec_cmds function
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicapilling committed Dec 9, 2024
1 parent 2702ddb commit 744a5db
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions xga/generate/esass/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,20 +266,18 @@ def _append_spec_info(evt_list):

# Fills out the srctool command to make the main and background spectra
if isinstance(source, ExtendedSource):
try:
if use_combine_obs and (len(source.obs_ids['erosita']) > 1):
im = source.get_combined_images(lo_en=Quantity(0.2, 'keV'), hi_en=Quantity(10.0, 'keV'),
telescope='erosita')

else:
# We only need the image path for extended source generation
im = source.get_images(obs_id, lo_en=Quantity(0.2, 'keV'), hi_en=Quantity(10.0, 'keV'),
telescope='erosita')
# We have a slightly different command for extended and point sources
s_cmd_str = ext_srctool_cmd.format(d=dest_dir, ef=evt_list.path, sc=coord_str, reg=src_reg_str,
i=inst_no, ts=t_step, em=im.path, et=et)
except:
raise ValueError(f"it was this sources {source.name}")
if use_combine_obs and (len(source.obs_ids['erosita']) > 1):
# We only need the extmap path for extended source generation
extmap_path = _ext_map_creation(source, outer_radii[src_ind], dest_dir, True)

else:
# We only need the extmap path for extended source generation
extmap_path = _ext_map_creation(source, outer_radii[src_ind], dest_dir, False)

# We have a slightly different command for extended and point sources
s_cmd_str = ext_srctool_cmd.format(d=dest_dir, ef=evt_list.path, sc=coord_str,
reg=src_reg_str, i=inst_no, ts=t_step,
em=extmap_path, et=et)

else:
s_cmd_str = pnt_srctool_cmd.format(d=dest_dir, ef=evt_list.path, sc=coord_str, reg=src_reg_str,
Expand Down

0 comments on commit 744a5db

Please sign in to comment.