Path: blob/main/doc/source/cookbook/fits_xray_images.ipynb
928 views
X-ray FITS Images
This notebook shows how to use yt to make plots and examine FITS X-ray images and events files.
Sloshing, Shocks, and Bubbles in Abell 2052
This example uses data provided by Scott Randall, presented originally in Blanton, E.L., Randall, S.W., Clarke, T.E., et al. 2011, ApJ, 737, 99. They consist of two files, a "flux map" in counts/s/pixel between 0.3 and 2 keV, and a spectroscopic temperature map in keV.
Since the flux and projected temperature images are in two different files, we had to use one of them (in this case the "flux" file) as a master file, and pass in the "temperature" file with the auxiliary_files
keyword to load
.
Next, let's derive some new fields for the number of counts, the "pseudo-pressure", and the "pseudo-entropy":
Here, we're deriving a "counts" field from the "flux" field by passing it a field_parameter
for the exposure time of the time and multiplying by the pixel scale. Second, we use the fact that the surface brightness is strongly dependent on density () to use the counts in each pixel as a "stand-in". Next, we'll grab the exposure time from the primary FITS header of the flux file and create a YTQuantity
from it, to be used as a field_parameter
:
Now, we can make the SlicePlot
object of the fields we want, passing in the exposure_time
as a field_parameter
. We'll also set the width of the image to 250 pixels.
To add the celestial coordinates to the image, we can use PlotWindowWCS
, if you have a recent version of AstroPy (>= 1.3) installed:
We can make use of yt's facilities for profile plotting as well.
Such as a radial profile plot:
Or a phase plot:
This region may now be used to compute derived quantities:
Or used in projections:
The Bullet Cluster
This example uses an events table file from a ~100 ks exposure of the "Bullet Cluster" from the Chandra Data Archive. In this case, the individual photon events are treated as particle fields in yt. However, you can make images of the object in different energy bands using the setup_counts_fields
function.
load
will handle the events file as FITS image files, and will set up a grid using the WCS information in the file. Optionally, the events may be reblocked to a new resolution. by setting the "reblock"
parameter in the parameters
dictionary in load
. "reblock"
must be a power of 2.
setup_counts_fields
will take a list of energy bounds (emin, emax) in keV and create a new field from each where the photons in that energy range will be deposited onto the image grid.
The "x", "y", "energy", and "time" fields in the events table are loaded as particle fields. Each one has a name given by "event_" plus the name of the field:
Now, we'll make a plot of the two counts fields we made, and pan and zoom to the bullet:
The counts fields can take the field parameter "sigma"
and use AstroPy's convolution routines to smooth the data with a Gaussian: