sourcetools

sourcetools.density module

sourcetools.temperature module

sourcetools.entropy module

sourcetools.mass module

sourcetools.match module

xga.sourcetools.match.simple_xmm_match(src_ra, src_dec, distance=<Quantity 30. arcmin>, num_cores=1)[source]

Returns ObsIDs within a given distance from the input ra and dec values.

Parameters:
  • src_ra (float/np.ndarray) – RA coordinate(s) of the source(s), in degrees. To find matches for multiple coordinate pairs, pass an array.

  • src_dec (float/np.ndarray) – DEC coordinate(s) of the source(s), in degrees. To find matches for multiple coordinate pairs, pass an array.

  • distance (Quantity) – The distance to search for XMM observations within, default should be able to match a source on the edge of an observation to the centre of the observation.

  • num_cores (int) – The number of cores to use, default is set to 90% of system cores. This is only relevant if multiple coordinate pairs are passed.

Returns:

A dataframe containing ObsID, RA_PNT, and DEC_PNT of matching XMM observations, and a dataframe containing information on observations that would have been a match, but that are in the blacklist.

Return type:

Tuple[Union[DataFrame, List[DataFrame]], Union[DataFrame, List[DataFrame]]]

xga.sourcetools.match.on_xmm_match(src_ra, src_dec, num_cores=1)[source]

An extension to the simple_xmm_match function, this first finds ObsIDs close to the input coordinate(s), then it generates exposure maps for those observations, and finally checks to see whether the value of the exposure maps at an input coordinate is zero. If the value is zero for all the instruments of an observation, then that coordinate does not fall on the observation, otherwise if even one of the instruments has a non-zero exposure, the coordinate does fall on the observation.

Parameters:
  • src_ra (float/np.ndarray) – RA coordinate(s) of the source(s), in degrees. To find matches for multiple coordinate pairs, pass an array.

  • src_dec (float/np.ndarray) – Dec coordinate(s) of the source(s), in degrees. To find matches for multiple coordinate pairs, pass an array.

  • num_cores (int) – The number of cores to use, default is set to 90% of system cores. This is only relevant if multiple coordinate pairs are passed.

Returns:

For a single input coordinate, a numpy array of ObsID(s) will be returned. For multiple input coordinates an array of arrays of ObsID(s) and None values will be returned. Each entry corresponds to the input coordinate array, a None value indicates that the coordinate did not fall on an XMM observation at all.

Return type:

np.ndarray

xga.sourcetools.match.xmm_region_match(src_ra, src_dec, src_type, num_cores=1)[source]

A function which, if XGA has been configured with access to pre-generated region files, will search for region matches for a set of source coordinates passed in by the user. A region match is defined as when a source coordinate falls within a source region with a particular colour (largely used to represent point vs extended) - the type of region that should be matched to can be defined using the src_type argument.

The simple_xmm_match function will be run before the source matching process, to narrow down the sources which need to have the more expensive region matching performed, as well as to identify which ObsID(s) should be examined for each source.

Parameters:
  • src_ra (float/np.ndarray) – RA coordinate(s) of the source(s), in degrees. To find matches for multiple coordinate pairs, pass an array.

  • src_dec (float/np.ndarray) – Dec coordinate(s) of the source(s), in degrees. To find matches for multiple coordinate pairs, pass an array.

  • src_type (str/List[str]) – The type(s) of region that should be matched to. Pass either ‘ext’ or ‘pnt’ or a list containing both.

  • num_cores (int) – The number of cores that can be used for the matching process.

Returns:

An array the same length as the sets of input coordinates (ordering is the same). If there are no matches for a source then the element will be None, if there are matches then the element will be a dictionary, with the key(s) being ObsID(s) and the values being a list of region objects (or more likely just one object).

Return type:

np.ndarray

sourcetools.misc module

sourcetools.stack module

sourcetools.deproj module