Skip to content

Commit b52852a

Browse files
committed
Added xspec_timeout argument to inv_abel_fitted_model and inv_abel_data.
1 parent e04d319 commit b52852a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

xga/sourcetools/density.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ def inv_abel_fitted_model(sources: Union[GalaxyCluster, ClusterSample],
392392
conv_temp: Union[Quantity, Dict[str, Quantity]] = None, conv_outer_radius: Quantity = "r500",
393393
conv_inner_radius: Quantity = Quantity(0, 'arcsec'), inv_abel_method: str = None,
394394
num_cores: int = NUM_CORES, show_warn: bool = True, stacked_spectra: bool = False,
395-
telescope: Union[str, List[str]] = None) -> Dict[str, List[Union[GasDensity3D, None]]]:
395+
telescope: Union[str, List[str]] = None,
396+
xspec_timeout: Quantity = Quantity(300, "s")) -> Dict[str, List[Union[GasDensity3D, None]]]:
396397
"""
397398
A count-rate-map-based galaxy cluster gas density calculation method where a surface brightness profile
398399
is fit with a model and an inverse abel transform is used to infer the 3D count-rate/volume
@@ -482,6 +483,7 @@ def inv_abel_fitted_model(sources: Union[GalaxyCluster, ClusterSample],
482483
instead use individual spectra for an ObsID. The default is False.
483484
:param str/List[str] telescope: Telescope(s) to produce density profiles from. Default is None, in which
484485
case density profiles will be produced from all telescopes associated with a source.
486+
:parma Quantity xspec_timeout: Timeout argument for xspec functions.
485487
:return: A dictionary of 3D gas density profile lists measured by this function - the keys are telescope
486488
names. The values are lists with one entry per source, even if the source in question doesn't have
487489
that telescope associated or the profile construction process failed.
@@ -492,7 +494,7 @@ def inv_abel_fitted_model(sources: Union[GalaxyCluster, ClusterSample],
492494
sources, conv_factors, obs_id, inst, telescope = _dens_setup(sources, abund_table, lo_en, hi_en, group_spec,
493495
min_counts, min_sn, over_sample, obs_id, inst,
494496
conv_temp, conv_outer_radius, conv_inner_radius,
495-
num_cores, stacked_spectra, telescope)
497+
num_cores, stacked_spectra, telescope, xspec_timeout)
496498

497499
# Calls the handy spectrum region setup function to make a predictable set of outer radius
498500
# values
@@ -644,7 +646,8 @@ def inv_abel_data(sources: Union[GalaxyCluster, ClusterSample], outer_radius: Un
644646
obs_id: Union[str, list] = None, inst: Union[str, list] = None, conv_temp: Quantity = None,
645647
conv_outer_radius: Quantity = "r500", conv_inner_radius: Quantity = Quantity(0, 'arcsec'),
646648
num_cores: int = NUM_CORES, stacked_spectra: bool = False,
647-
telescope: Union[str, List[str]] = None) -> Dict[str, List[Union[GasDensity3D, None]]]:
649+
telescope: Union[str, List[str]] = None,
650+
xspec_timeout: Quantity = Quantity(300, "s") ) -> Dict[str, List[Union[GasDensity3D, None]]]:
648651
"""
649652
A count-rate-map-based galaxy cluster gas density calculation method where a surface brightness profile inverse
650653
abel transformed, thus inferring the 3D count-rate/volume profile. Then a conversion factor calculated from
@@ -750,6 +753,7 @@ def inv_abel_data(sources: Union[GalaxyCluster, ClusterSample], outer_radius: Un
750753
instead use individual spectra for an ObsID. The default is False.
751754
:param str/List[str] telescope: Telescope(s) to produce density profiles from. Default is None, in which
752755
case density profiles will be produced from all telescopes associated with a source.
756+
:parma Quantity xspec_timeout: Timeout argument for xspec functions.
753757
:return: A dictionary of 3D gas density profile lists measured by this function - the keys are telescope
754758
names. The values are lists with one entry per source, even if the source in question doesn't have
755759
that telescope associated or the profile construction process failed.
@@ -760,7 +764,7 @@ def inv_abel_data(sources: Union[GalaxyCluster, ClusterSample], outer_radius: Un
760764
sources, conv_factors, obs_id, inst, telescope = _dens_setup(sources, abund_table, lo_en, hi_en, group_spec,
761765
min_counts, min_sn, over_sample, obs_id, inst,
762766
conv_temp, conv_outer_radius, conv_inner_radius,
763-
num_cores, stacked_spectra, telescope)
767+
num_cores, stacked_spectra, telescope, xspec_timeout)
764768

765769
# Calls the handy spectrum region setup function to make a predictable set of outer radius values
766770
out_rads = region_setup(sources, outer_radius, Quantity(0, 'arcsec'), False, '')[-1]

0 commit comments

Comments
 (0)