process.chandra
process.chandra.assemble
- daxa.process.chandra.assemble.chandra_repro(obs_archive, destreak=True, check_very_faint=False, pix_adj='default', asol_update=True, grating_pi_filter=True, num_cores=1, disable_progress=False, timeout=None)[source]
The DAXA implementation of the CIAO (‘chandra_repro’; https://cxc.cfa.harvard.edu/ciao/ahelp/chandra_repro.html) tool, which takes downloaded Chandra observations and re-reduces them, with the latest calibrations applied. It is the first stage of most Chandra analyses, and we decided to implement a wrapper rather than re-creating the whole process from the ground up. We provide most of the same configurations as the CIAO command-line tool.
This process requires that the ‘prepare_chandra_info’ function has been run on the observation archive, as without it, we cannot know what data there are to process.
- Parameters:
obs_archive (Archive) – An Archive instance containing a Chandra mission instance. This function will fail if no Chandra missions are present in the archive.
destreak (bool) – Controls whether a ‘destreaking’ technique is applied to ACIS data, to account for a flaw in the readout of one of the CCDs. Default is True, in which case streak events are filtered out of the events list.
check_very_faint (bool) – Sets whether the ACIS particle background for ‘very faint mode’ observations is cleaned, default is False. Setting to True can lead to good events being removed in observations with modestly bright point sources.
pix_adj (str) – Controls the pixel randomization applied to ACIS data to avoid spatial aliasing effects. The default is ‘default’ but ‘edser’, ‘none’, ‘randomize’ may also be passed - read more on the CIAO documentation website (https://cxc.harvard.edu/ciao/why/acispixrand.html).
asol_update (bool) – If True (the default) then a boresight correction will be applied to the observation to update the location of the aimpoint.
grating_pi_filter (bool) – This parameter controls whether an optional grating filter should be used, default is True - the filter is meant to suppress the background.
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.
timeout (Quantity) – The amount of time each individual process is allowed to run for, the default is None. Please note that this is not a timeout for the entire process, but a timeout for individual ObsID-instrument processes.
- daxa.process.chandra.assemble.cleaned_chandra_evts(obs_archive, lo_en=None, hi_en=None, allowed_grades=None, num_cores=1, disable_progress=False, timeout=None)[source]
This function is used to apply the soft-proton filtering (along with any other filtering you may desire, including the setting of energy limits) to Chandra event lists, resulting in the creation of sets of cleaned event lists which are ready to be analysed. We require that the ‘deflare’ function has been run before running ‘cleaned_chandra_evts’.
Note that a STATUS=0 cut is applied to all cleaned event lists.
- Parameters:
obs_archive (Archive) – An Archive instance containing a Chandra mission instance. This function will fail if no Chandra missions are present in the archive.
lo_en (Quantity) – The lower bound of an energy filter to be applied to the cleaned, filtered, event lists. If ‘lo_en’ is set to an Astropy Quantity, then ‘hi_en’ must be as well. Default is None, in which case no energy filter is applied. Note that no energy filter can be applied to HRC data.
hi_en (Quantity) – The upper bound of an energy filter to be applied to the cleaned, filtered, event lists. If ‘hi_en’ is set to an Astropy Quantity, then ‘lo_en’ must be as well. Default is None, in which case no energy filter is applied. Note that no energy filter can be applied to HRC data.
allowed_grades (list) – A list of event grades that should be kept in the final cleaned event list. Default is None, as the ‘chandra_repro’ step already imposes a filter of grades [0,2,3,4,6], any more conservative grade filter should be passed as a list of integers. Note that passed values should be in the ASCA grade system, NOT THE ACIS FLIGHT GRADE SYSTEM.
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.
timeout (Quantity) – The amount of time each individual process is allowed to run for, the default is None. Please note that this is not a timeout for the entire process, but a timeout for individual ObsID-Inst processes.
process.chandra.setup
- daxa.process.chandra.setup.parse_oif(oif_path)[source]
A function that takes a path to a Chandra ‘oif.fits’ file included in each ObsID directory on the remote archive. The file will be filtered and parsed so that data relevant to DAXA processing valid scientific observations can be extracted. This includes things like which mode the detector was in, whether a grating was deployed, etc.
The information will be simpler than what we tend to retrieve for XMM observations, as only one instrument is deployed in a particular observation.
- Parameters:
oif_path (str) – The path to the Chandra ‘oif.fits’ file that is to be parsed into a dictionary of relevant information and returned.
- Returns:
Multi-level dictionary of information.
- Return type:
dict
- daxa.process.chandra.setup.prepare_chandra_info(archive)[source]
A simple function that runs through all Chandra observations, reads through their file inventory, and includes that information in the Archive in a parsed, standardized form.
- Parameters:
archive (Archive) – A DAXA archive containing a Chandra mission.
process.chandra.clean
- daxa.process.chandra.clean.deflare(obs_archive, method='sigma', allowed_sigma=3.0, min_length=3, time_bin_size=<Quantity 200. s>, lc_lo_en=<Quantity 500. eV>, lc_hi_en=<Quantity 7000. eV>, num_cores=1, disable_progress=False, timeout=None)[source]
The DAXA wrapper for the Chandra CIAO task ‘deflare’, which attempts to identify good time intervals with minimal soft-proton flaring. Both ACIS and HRC observations will be processed by this function.
This function does not generate final event lists, but instead is used to create good-time-interval files which are then applied to the creation of final event lists, along with other user-specified filters.
- Parameters:
obs_archive (Archive) – An Archive instance containing a Chandra mission instance. This function will fail if no Chandra missions are present in the archive.
method (str) – The method for the flare-removal tool to use; default is ‘sigma’, and the other option is ‘clean’.
allowed_sigma (float) – For method=’sigma’, this will control which parts of the lightcurve (anything more than sigma standard deviations from the mean); for method=’clean’ this controls which data are used to calculate the mean count-rate. Default is 3.0.
min_length (int) – The minimum number of consecutive time bins that pass the count-rate filtering performed by the ‘sigma’ method before a good-time-interval (GTI) is declared. Default is 3.
time_bin_size (Quantity) – Sets the size of the time bin that will be used to generate a light curve for the deflaring method to work with. Default is 200 seconds.
lc_lo_en (Quantity) – The lower energy bound for the light curve used for soft proton flaring identification in ACIS data, it will be ignored for HRC due to the limited energy resolution. Default is 0.5 keV.
lc_hi_en (Quantity) – The upper energy bound for the light curve used for soft proton flaring identification in ACIS data, it will be ignored for HRC due to the limited energy resolution. Default is 7.0 keV.
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.
timeout (Quantity) – The amount of time each individual process is allowed to run for, the default is None. Please note that this is not a timeout for the entire process, but a timeout for individual ObsID-Inst processes.
process.chandra.generate
- daxa.process.chandra.generate.flux_image(obs_archive, en_bounds=<Quantity [[0.5, 7. ], [0.5, 1.2], [1.2, 2. ], [2. , 7. ], [0.2, 0.4]] keV>, effective_ens=<Quantity [2.3 , 0.92, 1.56, 3.8 , 0.4 ] keV>, acis_bin_size=4, hrc_bin_size=16, num_cores=1, disable_progress=False, timeout=None)[source]
This function is used to generate Chandra images, weighted exposure maps, and flux maps from processed and cleaned event lists - flux maps have units of photon/cm^2/s, and weighted exposure maps have units of cm^2 s ct/photon. PSF radius maps are also produced by this function. The energy bands and spatial binning can be controlled, with each run of this function capable of producing a set of products in different energy bands.
- Parameters:
obs_archive (Archive) – An Archive instance containing a Chandra mission instance. This function will fail if no Chandra missions are present in the archive.
en_bounds (Quantity) – The energy bounds in which to generate images, exposure maps, and flux maps/rate maps. Should be passed as a 2D array quantity with shape (N, 2), where N is the number of different energy bounds, in units convertible to keV. Default are the Chandra Source Catalog (CSC) boundaries - be aware that changing the ‘en_bounds’ parameter will also necessitate changes to the ‘effective_ens’ parameter. Energy bounds are NOT applied to HRC data products.
effective_ens (Quantity) – The effective energies for the energy bounds set in ‘en_bounds’ - consider them almost as a “central energy” at which exposure maps are calculated. The default values are the Chandra Source Catalog (CSC) effective energies (to match the default value of ‘en_bounds’). If the ‘en_bounds’ argument is altered, this argument will need to be changed as well.
acis_bin_size (int/float) – The image binning factor to be applied to ACIS image generation - this decides the size of output product pixels, with smaller values resulting in finer binning. The output product pixel size for ACIS will be ‘acis_bin_size’*0.492 arcseconds. Default is 4 (finer by default than CIAO flux_image).
hrc_bin_size (int/float) – The image binning factor to be applied to HRC image generation - this decides the size of output product pixels, with smaller values resulting in finer binning. The output product pixel size for HRC will be ‘hrc_bin_size’*0.1318 arcseconds. Default is 16 (finer by default than CIAO flux_image).
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.
timeout (Quantity) – The amount of time each individual process is allowed to run for, the default is None. Please note that this is not a timeout for the entire process, but a timeout for individual ObsID-Inst processes.
- daxa.process.chandra.generate.rate_image(obs_archive, en_bounds=<Quantity [[0.5, 7. ], [0.5, 1.2], [1.2, 2. ], [2. , 7. ], [0.2, 0.4]] keV>, effective_ens=<Quantity [2.3 , 0.92, 1.56, 3.8 , 0.4 ] keV>, acis_bin_size=4, hrc_bin_size=16, num_cores=1, disable_progress=False, timeout=None)[source]
This function is used to generate Chandra images, exposure maps, and rate maps from processed and cleaned event lists - rate maps have units of count/s, and weighted exposure maps have units of seconds. PSF radius maps are also produced by this function. The energy bands and spatial binning can be controlled, with each run of this function capable of producing a set of products in different energy bands.
- Parameters:
obs_archive (Archive) – An Archive instance containing a Chandra mission instance. This function will fail if no Chandra missions are present in the archive.
en_bounds (Quantity) – The energy bounds in which to generate images, exposure maps, and flux maps/rate maps. Should be passed as a 2D array quantity with shape (N, 2), where N is the number of different energy bounds, in units convertible to keV. Default are the Chandra Source Catalog (CSC) boundaries - be aware that changing the ‘en_bounds’ parameter will also necessitate changes to the ‘effective_ens’ parameter. Energy bounds are NOT applied to HRC data products.
effective_ens (Quantity) – The effective energies for the energy bounds set in ‘en_bounds’ - consider them almost as a “central energy” at which exposure maps are calculated. The default values are the Chandra Source Catalog (CSC) effective energies (to match the default value of ‘en_bounds’). If the ‘en_bounds’ argument is altered, this argument will need to be changed as well.
acis_bin_size (int/float) – The image binning factor to be applied to ACIS image generation - this decides the size of output product pixels, with smaller values resulting in finer binning. The output product pixel size for ACIS will be ‘acis_bin_size’*0.492 arcseconds. Default is 4 (finer by default than CIAO flux_image).
hrc_bin_size (int/float) – The image binning factor to be applied to HRC image generation - this decides the size of output product pixels, with smaller values resulting in finer binning. The output product pixel size for HRC will be ‘hrc_bin_size’*0.1318 arcseconds. Default is 16 (finer by default than CIAO flux_image).
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.
timeout (Quantity) – The amount of time each individual process is allowed to run for, the default is None. Please note that this is not a timeout for the entire process, but a timeout for individual ObsID-Inst processes.