Skip to content

Commit

Permalink
removing the old map function
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicapilling committed Dec 18, 2024
1 parent 51bcf5c commit 0ed85a2
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions xga/generate/esass/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,22 +265,19 @@ def _append_spec_info(evt_list):

# Fills out the srctool command to make the main and background spectra
if isinstance(source, ExtendedSource):
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,
i=inst_no, ts=t_step)
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}")

# TODO FIGURE OUT WHAT TO DO ABOUT THE TIMESTEP
sb_cmd_str = bckgr_srctool_cmd.format(ef=evt_list.path, sc=coord_str, breg=bsrc_reg_str,
Expand Down

0 comments on commit 0ed85a2

Please sign in to comment.