XGA icon indicating copy to clipboard operation
XGA copied to clipboard

Unstacked eROSITA XSPEC fits not working

Open DavidT3 opened this issue 1 year ago • 1 comments

single_temp_apec(srcs, Quantity(1000, 'kpc'), stacked_spectra=False, lum_en=lum_en, freeze_temp=False)

KeyError Traceback (most recent call last) /tmp/ipykernel_165722/55123879.py in ----> 1 single_temp_apec(srcs, Quantity(1000, 'kpc'), stacked_spectra=False, lum_en=lum_en, freeze_temp=False)

/mnt/pact/dt237/code/PycharmProjects/XGA/xga/xspec/run.py in wrapper(*args, **kwargs) 152 # run_type describes the type of XSPEC script being run, for instance a fit or a fakeit run to measure 153 # countrate to luminosity conversion constants --> 154 script_list, paths, cores, run_type, src_inds, radii, timeout = xspec_func(*args, **kwargs) 155 src_lookup = {repr(src): src_ind for src_ind, src in enumerate(sources)} 156 rel_src_repr = [repr(sources[src_ind]) for src_ind in src_inds]

/mnt/pact/dt237/code/PycharmProjects/XGA/xga/xspec/fit/general.py in single_temp_apec(sources, outer_radius, inner_radius, start_temp, start_met, lum_en, freeze_nh, freeze_met, freeze_temp, lo_en, hi_en, par_fit_stat, lum_conf, abund_table, fit_method, group_spec, min_counts, min_sn, over_sample, one_rmf, num_cores, spectrum_checking, timeout, stacked_spectra) 89 """ 90 ---> 91 sources, inn_rad_vals, out_rad_vals = _pregen_spectra(sources, outer_radius, inner_radius, group_spec, min_counts, 92 min_sn, over_sample, one_rmf, num_cores, stacked_spectra) 93 sources = _check_inputs(sources, lum_en, lo_en, hi_en, fit_method, abund_table, timeout)

/mnt/pact/dt237/code/PycharmProjects/XGA/xga/xspec/fit/_common.py in _pregen_spectra(sources, outer_radius, inner_radius, group_spec, min_counts, min_sn, over_sample, one_rmf, num_cores, stacked_spectra) 73 elif tel == 'erosita': 74 # This is the spectrum generation tool that is specific to eROSITA ---> 75 sources = srctool_spectrum(sources, outer_radius, inner_radius, group_spec, min_counts, min_sn, num_cores, 76 False, stacked_spectra) 77 else:

/mnt/pact/dt237/code/PycharmProjects/XGA/xga/generate/esass/run.py in wrapper(*args, **kwargs) 151 if product.type is not None and product.usable and prod_type_str != "annular spectrum set components": 152 # For each product produced for this source, we add it to the storage hierarchy --> 153 sources[ind].update_products(product) 154 elif product.type is not None and product.usable and prod_type_str == "annular spectrum set components": 155 # Really we're just re-creating the results dictionary here, but I want these products

/mnt/pact/dt237/code/PycharmProjects/XGA/xga/sources/base.py in update_products(self, prod_obj, update_inv) 2520 raise NotAssociatedError("{t}-{o} is not associated with source {n}.".format(t=tel, o=obs_id, 2521 n=self.name)) -> 2522 elif inst != "combined" and inst not in self.instruments[tel][obs_id]: 2523 raise NotAssociatedError("{i} is not associated with {t} observation " 2524 "{o} for source {n}.".format(i=inst, o=obs_id,

KeyError: 'combined'

DavidT3 avatar Oct 02 '24 15:10 DavidT3

This also happens with eFEDS data.

DavidT3 avatar Oct 02 '24 19:10 DavidT3

I'm almost certain this doesn't happen anymore, but I've added it to the multi-mission release project so we can just double check and be absolutely sure

DavidT3 avatar Jul 14 '25 14:07 DavidT3

Ive just tried this code and it runs without errors (on different sources but that shouldnt be relevant)

jessicapilling avatar Jul 15 '25 08:07 jessicapilling

Great, I'll close this issue!

DavidT3 avatar Jul 15 '25 08:07 DavidT3