CIAO

ciao.phot module

xga.generate.ciao.phot.chandra_image_expmap(sources, lo_en=<Quantity 0.5 keV>, hi_en=<Quantity 2. keV>, num_cores=1, disable_progress=False)[source]

Generates Chandra images, exposure maps, and rate maps using CIAO’s fluximage in rate mode.

Parameters:
  • sources (Union[BaseSource, NullSource, BaseSample]) – A source object, null source, or sample of sources.

  • lo_en (Quantity) – Lower energy bound (default = 0.5 keV).

  • hi_en (Quantity) – Upper energy bound (default = 2.0 keV).

  • num_cores (int) – Number of cores for parallel processing (default = NUM_CORES).

  • disable_progress (bool) – Disable progress bar if True.

Returns:

A tuple with commands, stack, execute, num_cores, product types, paths, metadata, and disable_progress flag.

ciao.spec module

xga.generate.ciao.spec.specextract_spectrum(sources, outer_radius, inner_radius=<Quantity 0. arcsec>, group_spec=True, min_counts=5, min_sn=None, over_sample=None, num_cores=1, disable_progress=False)[source]

A wrapper for all the CIAO processes necessary to generate Chandra spectra that can be analysed in XSPEC. Every observation associated with this source, and every instrument associated with that observation, will have a spectrum generated using the specified outer and inner radii as a boundary. The default inner radius is zero, so by default this function will produce circular spectra out to the outer_radius. It is possible to generate both grouped and ungrouped spectra using this function, with the degree of grouping set by the min_counts, min_sn, and oversample parameters.

Parameters:
  • sources (BaseSource/BaseSample) – A single source object, or a sample of sources.

  • outer_radius (str/Quantity) – The name or value of the outer radius to use for the generation of the spectrum (for instance ‘r200’ would be acceptable for a GalaxyCluster, or Quantity(1000, ‘kpc’)). If ‘region’ is chosen (to use the regions in region files), then any inner radius will be ignored. If you are generating for multiple sources then you can also pass a Quantity with one entry per source.

  • inner_radius (str/Quantity) – The name or value of the inner radius to use for the generation of the spectrum (for instance ‘r500’ would be acceptable for a GalaxyCluster, or Quantity(300, ‘kpc’)). By default this is zero arcseconds, resulting in a circular spectrum. If you are generating for multiple sources then you can also pass a Quantity with one entry per source.

  • group_spec (bool) – A boolean flag that sets whether generated spectra are grouped or not.

  • min_counts (int) – If generating a grouped spectrum, this is the minimum number of counts per channel. To disable minimum counts set this parameter to None.

  • min_sn (float) – If generating a grouped spectrum, this is the minimum signal-to-noise in each channel. To disable minimum signal-to-noise set this parameter to None.

  • num_cores (int) – The number of cores to use, default is set to 90% of available.

  • disable_progress (bool) – Setting this to true will turn off the CIAO generation progress bar.

xga.generate.ciao.spec.ciao_spectrum_set(sources, radii, group_spec=True, min_counts=5, min_sn=None, over_sample=None, one_rmf=True, num_cores=1, force_regen=False, disable_progress=False)[source]

This function can be used to produce ‘sets’ of XGA Spectrum objects, generated in concentric circular annuli. Such spectrum sets can be used to measure projected spectroscopic quantities, or even be de-projected to attempt to measure spectroscopic quantities in a three dimensional space.

Parameters:
  • sources (BaseSource/BaseSample) – A single source object, or a sample of sources.

  • radii (List[Quantity]/Quantity) – A list of non-scalar quantities containing the boundary radii of the annuli for the sources. A single quantity containing at least three radii may be passed if one source is being analysed, but for multiple sources there should be a quantity (with at least three radii), PER source.

  • group_spec (bool) – A boolean flag that sets whether generated spectra are grouped or not.

  • min_counts (int) – If generating a grouped spectrum, this is the minimum number of counts per channel. To disable minimum counts set this parameter to None.

  • min_sn (float) – If generating a grouped spectrum, this is the minimum signal-to-noise in each channel. To disable minimum signal-to-noise set this parameter to None.

  • over_sample (float) – The minimum energy resolution for each group, set to None to disable. e.g. if over_sample=3 then the minimum width of a group is 1/3 of the resolution FWHM at that energy.

  • one_rmf (bool) – This flag tells the method whether it should only generate one RMF for a particular ObsID-instrument combination - this is much faster in some circumstances, however the RMF does depend slightly on position on the detector.

  • num_cores (int) – The number of cores to use, default is set to 90% of available.

  • force_regen (bool) – This will force all the constituent spectra of the set to be regenerated, use this if your call to this function was interrupted and an incomplete AnnularSpectrum is being read in.

  • disable_progress (bool) – Setting this to true will turn off the CIAO generation progress bar.

ciao.run module

xga.generate.ciao.run.ciao_avail_check()[source]

Check function for the CIAO mission software.

xga.generate.ciao.run.ciao_call(ciao_func)[source]

This is used as a decorator for functions that produce CIAO command strings. Depending on the system that XGA is running on (and whether the user requests parallel execution), the method of executing the CIAO command will change. :return: