Proposal Preparation Solution#
The Story: Suppose that you are preparing to write a proposal on NGC1365, aiming to investigate the intriguing black hole spin this galaxy with Chandra grating observations (see: Monster Blackhole Spin Revealed)
In writing proposals, there are often the same tasks that are required: including finding and analyzing previous observations of the proposal, and creating figures that include, e.g., multiwavelength images and spectrum for the source.
# As a hint, we include the code block for Python modules that you will likely need to import:
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
# For downloading files
from astropy.utils.data import download_file
from astropy.io import fits
import pyvo as vo
## There are a number of relatively unimportant warnings that
## show up, so for now, suppress them:
import warnings
warnings.filterwarnings("ignore", module="astropy.io.votable.*")
warnings.filterwarnings("ignore", module="pyvo.utils.xml.*")
Step 1: Find out what the previously quoted Chandra 2-10 keV flux of the central source is for NGC 1365#
Hint: Do a Registry search for tables served by the HEASARC (where high energy data are archived) to find potential table with this information
# This gets all services matching, which should be a list of only one:
tap_services=vo.regsearch(servicetype='table',keywords=['heasarc'])
# This fetches the list of tables that this service serves:
heasarc_tables=tap_services[0].service.tables
Hint: The Chansngcat table is likely the best table. Create a table with ra, dec, exposure time, and flux (and flux errors) from the public.chansngcat catalog for Chandra observations matched within 0.1 degree.
for tablename in heasarc_tables.keys():
if "chansng" in tablename:
print("Table {} has columns={}\n".format(
tablename,
sorted([k.name for k in heasarc_tables[tablename].columns ])))
Table chansngcat has columns=['"__row"', '"__x_ra_dec"', '"__y_ra_dec"', '"__z_ra_dec"', '"distance"', 'agn_flag', 'bii', 'class', 'dec', 'exposure', 'fit_chi_squared', 'fit_dof', 'flux', 'flux_lower', 'flux_upper', 'hardness_ratio_0', 'hardness_ratio_0_error', 'hardness_ratio_1', 'hardness_ratio_1_error', 'hardness_ratio_2', 'hardness_ratio_2_error', 'hubble_type', 'instrument', 'lii', 'log_blackhole_mass', 'log_blackhole_mass_lower', 'log_blackhole_mass_upper', 'log_l_cpt1', 'log_l_cpt2', 'log_l_halpha', 'log_l_halpha_flag', 'log_lx', 'log_lx_lower', 'log_lx_note', 'log_lx_upper', 'name', 'nh', 'nh_from_hr', 'nh_from_hr_lower', 'nh_from_hr_upper', 'nh_gal', 'nh_lower', 'nh_upper', 'nuclear_class', 'obsid', 'off_set', 'ra', 'ref_spectrum', 'sigma', 'sigma_error', 'source_number', 'spectral_index', 'spectral_index_lower', 'spectral_index_upper', 'spectral_model', 'spectral_norm_cpt1', 'spectral_norm_cpt2', 'temperature', 'temperature_lower', 'temperature_upper']
# Get the coordinate for NGC 1365
import astropy.coordinates as coord
pos=coord.SkyCoord.from_name("ngc1365")
# Construct a query that will get the ra, dec, exposure time, flux, and flux errors
# from this catalog in the region around this source:
query="""SELECT ra, dec, exposure, flux, flux_lower, flux_upper FROM public.chansngcat as cat
where contains(point('ICRS',cat.ra,cat.dec),circle('ICRS',{},{},0.1))=1
and cat.exposure > 0 order by cat.exposure""".format(pos.ra.deg, pos.dec.deg)
# Submit the query. (See the CS_Catalog_queries.md for
# information about these two search options.)
results=tap_services[0].service.run_async(query)
#results=tap_services[0].search(query)
# Look at the results
results.to_table()
ra | dec | exposure | flux | flux_lower | flux_upper |
---|---|---|---|---|---|
deg | deg | s | erg/s/cm^2 | erg/s/cm^2 | erg/s/cm^2 |
float64 | float64 | float64 | float64 | float64 | float64 |
53.40192 | -36.14067 | 15500 | 7.751e-12 | 7.1727e-12 | 8.2075e-12 |
Step 2: Make Images#
Create ultraviolet and X-ray images#
Hint: Start by checking what UV image services exist (e.g., GALEX?)
## Note that to browse the columns, use the .to_table() method
uv_services=vo.regsearch(servicetype='sia',keywords='galex', waveband='uv')
uv_services.to_table()['ivoid','short_name']
ivoid | short_name |
---|---|
object | object |
ivo://archive.stsci.edu/sia/galex | GALEX |
ivo://mast.stsci/siap/galex_atlas | GALEX_Atlas |
ivo://nasa.heasarc/skyview/galex | GALEX |
The keyword search for ‘galex’ returned a bunch of things that may have mentioned it, but let’s just use the ones that have GALEX as their short name:
uv_services.to_table()[
np.array(['GALEX' in u.short_name for u in uv_services])
]['ivoid', 'short_name']
ivoid | short_name |
---|---|
object | object |
ivo://archive.stsci.edu/sia/galex | GALEX |
ivo://mast.stsci/siap/galex_atlas | GALEX_Atlas |
ivo://nasa.heasarc/skyview/galex | GALEX |
Though using the result as an Astropy Table makes it easier to look at the contents, to call the service itself, we cannot use the row of that table. You have to use the entry in the service result list itself. So use the table to browse, but select the list of services itself using the properties that have been defined as attributes such as short_name and ivoid:
galex_stsci=[s for s in uv_services if 'GALEX' in s.short_name and 'stsci' in s.ivoid][0]
galex_heasarc=[s for s in uv_services if 'GALEX' in s.short_name and 'heasarc' in s.ivoid][0]
Hint: Next create a UV image for the source
# Do an image search for NGC 1365 in the UV service found above
im_table_stsci=galex_stsci.search(pos=pos,size=0.1)
im_table_stsci.to_table()
productType | imageFormat | contentLength | name | collection | insname | metaRelease | dataRelease | trgposRA | trgPosDec | s_region | position_naxes | position_naxis | position_scale | crpix | crval | cdmatrix | coordFrame | projection | position_ctype1 | position_ctype2 | position_cunit1 | position_cunit2 | timBoundsSTCS | time_bounds_cval1 | time_bounds_cval2 | time_bounds_center | timExposure | energy_bandpassName | energy_bounds_cval1 | energy_bounds_cval2 | energy_bounds_center | energy_units | publisherDID | accessURL | cloud_access |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object | object | int32 | object | object | object | object | object | float64 | float64 | object | int32 | object | object | object | object | object | object | str3 | object | object | object | object | object | float64 | float64 | float64 | float64 | object | float64 | float64 | float64 | object | object | object | object |
science | image/fits | 12544983 | FORNAX_MOS06-xd-mcat.fits.gz | GALEX | GALEX | 5/11/2010 12:15:31 AM | 5/11/2010 12:15:31 AM | 53.0653359237686 | -36.3609134371405 | CIRCLE ICRS 53.06533592 -36.36091344 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.0653 -36.3609] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54106.382801 54117.283171 | 54106.3828009259 | 54117.2831712963 | 54111.8329861111 | 3445.05 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?2555302543848636416 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-xd-mcat.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-xd-mcat.fits.gz"}} |
AUXILIARY | image/fits | 22647591 | FORNAX_MOS06-nd-intbgsub.fits.gz | GALEX | GALEX | 5/11/2010 12:15:31 AM | 5/11/2010 12:15:31 AM | 53.0653359237686 | -36.3609134371405 | CIRCLE ICRS 53.06533592 -36.36091344 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.0653 -36.3609] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54106.382801 54117.283171 | 54106.3828009259 | 54117.2831712963 | 54111.8329861111 | 3445.05 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?2555302543848636416 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-nd-intbgsub.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-nd-intbgsub.fits.gz"}} |
AUXILIARY | image/fits | 43549 | FORNAX_MOS06-nd-flags.fits.gz | GALEX | GALEX | 5/11/2010 12:15:31 AM | 5/11/2010 12:15:31 AM | 53.0653359237686 | -36.3609134371405 | CIRCLE ICRS 53.06533592 -36.36091344 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.0653 -36.3609] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54106.382801 54117.283171 | 54106.3828009259 | 54117.2831712963 | 54111.8329861111 | 3445.05 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?2555302543848636416 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-nd-flags.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-nd-flags.fits.gz"}} |
AUXILIARY | image/fits | 24262 | FORNAX_MOS06-nd-flagstar.fits.gz | GALEX | GALEX | 5/11/2010 12:15:31 AM | 5/11/2010 12:15:31 AM | 53.0653359237686 | -36.3609134371405 | CIRCLE ICRS 53.06533592 -36.36091344 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.0653 -36.3609] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54106.382801 54117.283171 | 54106.3828009259 | 54117.2831712963 | 54111.8329861111 | 3445.05 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?2555302543848636416 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-nd-flagstar.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-nd-flagstar.fits.gz"}} |
THUMBNAIL | image/jpeg | 10251 | FORNAX_MOS06-xd-int_2color_thumb.jpg | GALEX | GALEX | 5/11/2010 12:15:31 AM | 5/11/2010 12:15:31 AM | 53.0653359237686 | -36.3609134371405 | CIRCLE ICRS 53.06533592 -36.36091344 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.0653 -36.3609] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54106.382801 54117.283171 | 54106.3828009259 | 54117.2831712963 | 54111.8329861111 | 3445.05 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?2555302543848636416 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/qa/FORNAX_MOS06-xd-int_2color_thumb.jpg | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/qa/FORNAX_MOS06-xd-int_2color_thumb.jpg"}} |
INFO | image/fits | 14617 | FORNAX_MOS06-nd-cat_mch_rtastar.fits.gz | GALEX | GALEX | 5/11/2010 12:15:31 AM | 5/11/2010 12:15:31 AM | 53.0653359237686 | -36.3609134371405 | CIRCLE ICRS 53.06533592 -36.36091344 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.0653 -36.3609] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54106.382801 54117.283171 | 54106.3828009259 | 54117.2831712963 | 54111.8329861111 | 3445.05 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?2555302543848636416 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-nd-cat_mch_rtastar.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-nd-cat_mch_rtastar.fits.gz"}} |
PREVIEW | image/jpeg | 543324 | FORNAX_MOS06-xd-int_2color_medium_annot.jpg | GALEX | GALEX | 5/11/2010 12:15:31 AM | 5/11/2010 12:15:31 AM | 53.0653359237686 | -36.3609134371405 | CIRCLE ICRS 53.06533592 -36.36091344 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.0653 -36.3609] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54106.382801 54117.283171 | 54106.3828009259 | 54117.2831712963 | 54111.8329861111 | 3445.05 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?2555302543848636416 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/qa/FORNAX_MOS06-xd-int_2color_medium_annot.jpg | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/qa/FORNAX_MOS06-xd-int_2color_medium_annot.jpg"}} |
SCIENCE | image/fits | 17443052 | FORNAX_MOS06-nd-int.fits.gz | GALEX | GALEX | 5/11/2010 12:15:31 AM | 5/11/2010 12:15:31 AM | 53.0653359237686 | -36.3609134371405 | CIRCLE ICRS 53.06533592 -36.36091344 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.0653 -36.3609] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54106.382801 54117.283171 | 54106.3828009259 | 54117.2831712963 | 54111.8329861111 | 3445.05 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?2555302543848636416 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-nd-int.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-nd-int.fits.gz"}} |
AUXILIARY | image/fits | 5756688 | FORNAX_MOS06-nd-cnt.fits.gz | GALEX | GALEX | 5/11/2010 12:15:31 AM | 5/11/2010 12:15:31 AM | 53.0653359237686 | -36.3609134371405 | CIRCLE ICRS 53.06533592 -36.36091344 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.0653 -36.3609] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54106.382801 54117.283171 | 54106.3828009259 | 54117.2831712963 | 54111.8329861111 | 3445.05 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?2555302543848636416 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-nd-cnt.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/01-vsn/07090-FORNAX_MOS06/d/01-main/0001-img/07-try/FORNAX_MOS06-nd-cnt.fits.gz"}} |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
PREVIEW | image/jpeg | 134331 | AIS_423_0002_sg49-xd-int_2color_small.jpg | GALEX | GALEX | 6/16/2010 2:52:42 AM | 6/16/2010 2:52:42 AM | 53.9452301043047 | -36.1117650864775 | CIRCLE ICRS 53.94523010 -36.11176509 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.9452 -36.1118] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54460.401030 54460.402222 | 54460.4010300926 | 54460.4022222222 | 54460.4016261574 | 103.0 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?6385798660088659968 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/02-vsn/50423-AIS_423/d/00-visits/0002-img/07-try/qa/AIS_423_0002_sg49-xd-int_2color_small.jpg | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/02-vsn/50423-AIS_423/d/00-visits/0002-img/07-try/qa/AIS_423_0002_sg49-xd-int_2color_small.jpg"}} |
INFO | image/fits | 8737 | AIS_423_0002_sg49-asp.fits.gz | GALEX | GALEX | 6/16/2010 2:52:42 AM | 6/16/2010 2:52:42 AM | 53.9452301043047 | -36.1117650864775 | CIRCLE ICRS 53.94523010 -36.11176509 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.9452 -36.1118] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54460.401030 54460.402222 | 54460.4010300926 | 54460.4022222222 | 54460.4016261574 | 103.0 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?6385798660088659968 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/02-vsn/50423-AIS_423/d/00-visits/0002-img/07-try/AIS_423_0002_sg49-asp.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/02-vsn/50423-AIS_423/d/00-visits/0002-img/07-try/AIS_423_0002_sg49-asp.fits.gz"}} |
AUXILIARY | image/fits | 64456 | AIS_423_0002_sg49-nd-cat_mch_flagstar.fits.gz | GALEX | GALEX | 6/16/2010 2:52:42 AM | 6/16/2010 2:52:42 AM | 53.9452301043047 | -36.1117650864775 | CIRCLE ICRS 53.94523010 -36.11176509 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.9452 -36.1118] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54460.401030 54460.402222 | 54460.4010300926 | 54460.4022222222 | 54460.4016261574 | 103.0 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?6385798660088659968 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/02-vsn/50423-AIS_423/d/00-visits/0002-img/07-try/AIS_423_0002_sg49-nd-cat_mch_flagstar.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/02-vsn/50423-AIS_423/d/00-visits/0002-img/07-try/AIS_423_0002_sg49-nd-cat_mch_flagstar.fits.gz"}} |
AUXILIARY | image/fits | 25691 | AIS_423_0002_sg49-nd-flag_tbl.fits.gz | GALEX | GALEX | 6/16/2010 2:52:42 AM | 6/16/2010 2:52:42 AM | 53.9452301043047 | -36.1117650864775 | CIRCLE ICRS 53.94523010 -36.11176509 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.9452 -36.1118] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54460.401030 54460.402222 | 54460.4010300926 | 54460.4022222222 | 54460.4016261574 | 103.0 | NUV | 1.693e-07 | 3.007e-07 | 2.35e-07 | meters | ivo://archive.stsci.edu/GALEX?6385798660088659968 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/02-vsn/50423-AIS_423/d/00-visits/0002-img/07-try/AIS_423_0002_sg49-nd-flag_tbl.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/02-vsn/50423-AIS_423/d/00-visits/0002-img/07-try/AIS_423_0002_sg49-nd-flag_tbl.fits.gz"}} |
SCIENCE | image/fits | 1970004 | AIS_423_sg49-fd-int.fits.gz | GALEX | GALEX | 8/18/2010 1:25:11 AM | 8/18/2010 1:25:11 AM | 53.9552232357184 | -36.108680599578 | CIRCLE ICRS 53.95522324 -36.10868060 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.9552 -36.1087] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54385.423877 54460.402153 | 54385.4238773148 | 54460.4021527778 | 54422.9130150463 | 200.0 | FUV | 1.34e-07 | 1.806e-07 | 1.573e-07 | meters | ivo://archive.stsci.edu/GALEX?6385798797494059008 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/02-vsn/50423-AIS_423/d/01-main/0001-img/07-try/AIS_423_sg49-fd-int.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/02-vsn/50423-AIS_423/d/01-main/0001-img/07-try/AIS_423_sg49-fd-int.fits.gz"}} |
AUXILIARY | image/fits | 10548360 | AIS_423_sg49-fd-rrhr.fits.gz | GALEX | GALEX | 8/18/2010 1:25:11 AM | 8/18/2010 1:25:11 AM | 53.9552232357184 | -36.108680599578 | CIRCLE ICRS 53.95522324 -36.10868060 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.9552 -36.1087] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54385.423877 54460.402153 | 54385.4238773148 | 54460.4021527778 | 54422.9130150463 | 200.0 | FUV | 1.34e-07 | 1.806e-07 | 1.573e-07 | meters | ivo://archive.stsci.edu/GALEX?6385798797494059008 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/02-vsn/50423-AIS_423/d/01-main/0001-img/07-try/AIS_423_sg49-fd-rrhr.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/02-vsn/50423-AIS_423/d/01-main/0001-img/07-try/AIS_423_sg49-fd-rrhr.fits.gz"}} |
AUXILIARY | image/fits | 2797390 | AIS_423_sg49-fd-skybg.fits.gz | GALEX | GALEX | 8/18/2010 1:25:11 AM | 8/18/2010 1:25:11 AM | 53.9552232357184 | -36.108680599578 | CIRCLE ICRS 53.95522324 -36.10868060 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.9552 -36.1087] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54385.423877 54460.402153 | 54385.4238773148 | 54460.4021527778 | 54422.9130150463 | 200.0 | FUV | 1.34e-07 | 1.806e-07 | 1.573e-07 | meters | ivo://archive.stsci.edu/GALEX?6385798797494059008 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/02-vsn/50423-AIS_423/d/01-main/0001-img/07-try/AIS_423_sg49-fd-skybg.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/02-vsn/50423-AIS_423/d/01-main/0001-img/07-try/AIS_423_sg49-fd-skybg.fits.gz"}} |
AUXILIARY | image/fits | 14254446 | AIS_423_sg49-fd-wt.fits.gz | GALEX | GALEX | 8/18/2010 1:25:11 AM | 8/18/2010 1:25:11 AM | 53.9552232357184 | -36.108680599578 | CIRCLE ICRS 53.95522324 -36.10868060 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.9552 -36.1087] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54385.423877 54460.402153 | 54385.4238773148 | 54460.4021527778 | 54422.9130150463 | 200.0 | FUV | 1.34e-07 | 1.806e-07 | 1.573e-07 | meters | ivo://archive.stsci.edu/GALEX?6385798797494059008 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/02-vsn/50423-AIS_423/d/01-main/0001-img/07-try/AIS_423_sg49-fd-wt.fits.gz | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/02-vsn/50423-AIS_423/d/01-main/0001-img/07-try/AIS_423_sg49-fd-wt.fits.gz"}} |
THUMBNAIL | image/jpeg | 9914 | AIS_423_sg49-xd-int_2color_thumb.jpg | GALEX | GALEX | 8/18/2010 1:25:11 AM | 8/18/2010 1:25:11 AM | 53.9552232357184 | -36.108680599578 | CIRCLE ICRS 53.95522324 -36.10868060 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.9552 -36.1087] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54385.423877 54460.402153 | 54385.4238773148 | 54460.4021527778 | 54422.9130150463 | 200.0 | FUV | 1.34e-07 | 1.806e-07 | 1.573e-07 | meters | ivo://archive.stsci.edu/GALEX?6385798797494059008 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/02-vsn/50423-AIS_423/d/01-main/0001-img/07-try/qa/AIS_423_sg49-xd-int_2color_thumb.jpg | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/02-vsn/50423-AIS_423/d/01-main/0001-img/07-try/qa/AIS_423_sg49-xd-int_2color_thumb.jpg"}} |
PREVIEW | image/jpeg | 576442 | AIS_423_sg49-xd-int_2color_medium_annot.jpg | GALEX | GALEX | 8/18/2010 1:25:11 AM | 8/18/2010 1:25:11 AM | 53.9552232357184 | -36.108680599578 | CIRCLE ICRS 53.95522324 -36.10868060 0.625 | 2 | [3840 3840] | [-0.00041666667 0.00041666667] | [1920.5 1920.5] | [53.9552 -36.1087] | [-0.000416667 -0.0 -0.0 0.000416667] | ICRS | TAN | RA---TAN | DEC--TAN | deg | deg | RANGE 54385.423877 54460.402153 | 54385.4238773148 | 54460.4021527778 | 54422.9130150463 | 200.0 | FUV | 1.34e-07 | 1.806e-07 | 1.573e-07 | meters | ivo://archive.stsci.edu/GALEX?6385798797494059008 | https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:GALEX/url/data/GR6/pipe/02-vsn/50423-AIS_423/d/01-main/0001-img/07-try/qa/AIS_423_sg49-xd-int_2color_medium_annot.jpg | {"aws": {"bucket_name":"stpubdata","region":"us-east-1","access":"open","key":"galex/GR6/pipe/02-vsn/50423-AIS_423/d/01-main/0001-img/07-try/qa/AIS_423_sg49-xd-int_2color_medium_annot.jpg"}} |
# Let's see what HEASARC offers, and this time limit it to FITS
# this option doesn't currently work for STScI's service)
im_table_heasarc=galex_heasarc.search(pos=pos,size=0.1,format='image/fits')
im_table_heasarc.to_table()
Survey | Ra | Dec | Dim | Size | Scale | Format | PixFlags | URL | LogicalName |
---|---|---|---|---|---|---|---|---|---|
object | float64 | float64 | int32 | object | object | object | object | object | object |
galexnear | 53.40190833 | -36.14065833 | 2 | [300 300] | [-0.0003333333333333334 0.0003333333333333334] | image/fits | F | https://skyview.gsfc.nasa.gov/cgi-bin/images?position=53.40190833%2C-36.14065833&survey=galexnear&pixels=300%2C300&sampler=LI&size=0.10000000000000002%2C0.10000000000000002&projection=Tan&coordinates=J2000.0&requestID=skv1730925208063&return=FITS | 1 |
galexfar | 53.40190833 | -36.14065833 | 2 | [300 300] | [-0.0003333333333333334 0.0003333333333333334] | image/fits | F | https://skyview.gsfc.nasa.gov/cgi-bin/images?position=53.40190833%2C-36.14065833&survey=galexfar&pixels=300%2C300&sampler=LI&size=0.10000000000000002%2C0.10000000000000002&projection=Tan&coordinates=J2000.0&requestID=skv1730925208298&return=FITS | 2 |
## If you only run this once, you can do it in memory in one line:
## This fetches the FITS as an astropy.io.fits object in memory
#dataobj=im_table_heasarc[0].getdataobj()
## But if you might run this notebook repeatedly with limited bandwidth,
## download it once and cache it.
file_name = download_file(im_table_heasarc[0].getdataurl(), cache=True, timeout=600)
dataobj=fits.open(file_name)
print(type(dataobj))
<class 'astropy.io.fits.hdu.hdulist.HDUList'>
# Get the FITS file (which is index 0 for the NUV image or index=2 for the FUV image)
from pylab import figure, cm
from matplotlib.colors import LogNorm
plt.matshow(dataobj[0].data, origin='lower', cmap=cm.gray_r, norm=LogNorm(vmin=0.005, vmax=0.3))
<matplotlib.image.AxesImage at 0x7f2ac740ad10>
Hint: Repeat steps for X-ray image. (Note: Ideally, we would find an image in the Chandra ‘cxc’ catalog)
x_services=vo.regsearch(servicetype='sia',keywords=['chandra'], waveband='x-ray')
print(x_services.to_table()['short_name','ivoid'])
short_name ivoid
----------- --------------------------------------
CDA ivo://cxc.harvard.edu/cda.siap
CSC ivo://cxc.harvard.edu/csc.siap
CSCR1 ivo://cxc.harvard.edu/cscr1.siap
CSC ivo://cxc.harvard.edu/cscr2.1.siap
CSCR2 ivo://cxc.harvard.edu/cscr2.siap
Chandra ivo://nasa.heasarc/chanmaster
GOODSACISFB ivo://nasa.heasarc/skyview/goodsacisfb
## Do an image search for NGC 1365 in the X-ray CDA service found above
xim_table=x_services[0].search(pos=pos,size=0.2)
## Some of these are FITS and some JPEG. Look at the columns:
print( xim_table.to_table().columns )
first_fits_image_row = [x for x in xim_table if 'image/fits' in x.format][0]
<TableColumns names=('name','instrument','date_obs','ra','dec','naxis','imgscale','imgfmt','accref','filesize','obsid')>
## Create an image from the first FITS file (index=1) by downloading:
## See above for options
#xhdu_list=first_fits_image_row.getdataobj()
file_name = download_file(first_fits_image_row.getdataurl(), cache=True, timeout=600)
xhdu_list=fits.open(file_name)
plt.imshow(xhdu_list[0].data, origin='lower', cmap='cool', norm=LogNorm(vmin=0.1, vmax=500.))
plt.xlim(460, 560)
plt.ylim(460, 560)
(460.0, 560.0)
Step 3: Make a spectrum#
Find what Chandra spectral observations exist already for this source#
Hint: try searching for X-ray spectral data tables using the registry query
# Use the TAP protocol to list services that contain X-ray spectral data
xsp_services=vo.regsearch(servicetype='ssa',waveband='x-ray')
xsp_services.to_table()['short_name','ivoid','waveband']
short_name | ivoid | waveband |
---|---|---|
object | object | object |
Chandra | ivo://nasa.heasarc/chanmaster | x-ray |
HITOMASTER | ivo://nasa.heasarc/hitomaster | x-ray |
INTEGRAL/BSC | ivo://nasa.heasarc/intbsc | gamma-ray#x-ray |
XRISMMASTR | ivo://nasa.heasarc/xrismmastr | x-ray |
RXTE | ivo://nasa.heasarc/xtemaster | x-ray |
NED_SED | ivo://ned.ipac/sed_data_near_position | radio#millimeter#infrared#optical#uv#euv#x-ray#gamma-ray |
HEAVENS @ ISDC | ivo://wfau.roe.ac.uk/heavens_at_isdc/light-curves | x-ray#gamma-ray |
Hint 2: Take a look at what data exist for our candidate, NGC 1365.
spec_tables=xsp_services[0].search(pos=pos,radius=0.2,verbose=True)
spec_tables.to_table()
obsid | status | name | ra | dec | time | detector | grating | exposure | type | pi | public_date | datalink | SSA_start_time | SSA_tmid | SSA_stop_time | SSA_duration | SSA_coord_obs | SSA_ra | SSA_dec | SSA_fov | SSA_title | SSA_reference | SSA_datalength | SSA_datamodel | SSA_instrument | SSA_publisher | SSA_format | SSA_wavelength_min | SSA_wavelength_max | SSA_bandwidth | SSA_bandpass | cloud_access |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
deg | deg | d | s | d | d | d | d | s | deg | deg | deg | deg | m | m | m | m | ||||||||||||||||
object | object | object | float64 | float64 | float64 | object | object | float64 | object | object | int32 | object | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | object | object | object | object | object | object | object | float64 | float64 | float64 | float64 | object |
24788 | archived | NGC 1365 | 53.40192 | -36.14066 | 59342.738 | ACIS-S | HETG | 25080 | GTO | Canizares | 59710 | 4639:chandra.obs.misc | 59342.737974537 | -- | -- | 25080.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf24788N001_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/8/24788/primary/acisf24788N001_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/8/24788/primary/acisf24788N001_pha2.fits.gz"}} |
24737 | archived | NGC 1365 | 53.40192 | -36.14066 | 59319.8031 | ACIS-S | HETG | 20080 | GTO | Canizares | 59710 | 4640:chandra.obs.misc | 59319.8030787037 | -- | -- | 20080.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf24737N002_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/7/24737/primary/acisf24737N002_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/7/24737/primary/acisf24737N002_pha2.fits.gz"}} |
24787 | archived | NGC 1365 | 53.40192 | -36.14066 | 59340.0616 | ACIS-S | HETG | 39090 | GTO | Canizares | 59710 | 4641:chandra.obs.misc | 59340.0615740741 | -- | -- | 39090.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf24787N001_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/7/24787/primary/acisf24787N001_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/7/24787/primary/acisf24787N001_pha2.fits.gz"}} |
24789 | archived | NGC 1365 | 53.40192 | -36.14066 | 59333.3037 | ACIS-S | HETG | 21280 | GTO | Canizares | 59710 | 4642:chandra.obs.misc | 59333.30375 | -- | -- | 21280.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf24789N001_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/9/24789/primary/acisf24789N001_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/9/24789/primary/acisf24789N001_pha2.fits.gz"}} |
24790 | archived | NGC 1365 | 53.40192 | -36.14066 | 59343.4834 | ACIS-S | HETG | 18080 | GTO | Canizares | 59710 | 4643:chandra.obs.misc | 59343.4834143519 | -- | -- | 18080.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf24790N001_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/0/24790/primary/acisf24790N001_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/0/24790/primary/acisf24790N001_pha2.fits.gz"}} |
24791 | archived | NGC 1365 | 53.40192 | -36.14066 | 59326.8302 | ACIS-S | HETG | 26580 | GTO | Canizares | 59710 | 4644:chandra.obs.misc | 59326.8301736111 | -- | -- | 26580.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf24791N001_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/1/24791/primary/acisf24791N001_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/1/24791/primary/acisf24791N001_pha2.fits.gz"}} |
24792 | archived | NGC 1365 | 53.40192 | -36.14066 | 59344.0923 | ACIS-S | HETG | 17080 | GTO | Canizares | 59710 | 4645:chandra.obs.misc | 59344.0923148148 | -- | -- | 17080.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf24792N001_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/2/24792/primary/acisf24792N001_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/2/24792/primary/acisf24792N001_pha2.fits.gz"}} |
24793 | archived | NGC 1365 | 53.40192 | -36.14066 | 59335.6602 | ACIS-S | HETG | 17080 | GTO | Canizares | 59710 | 4646:chandra.obs.misc | 59335.6602083333 | -- | -- | 17080.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf24793N001_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/3/24793/primary/acisf24793N001_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/3/24793/primary/acisf24793N001_pha2.fits.gz"}} |
24794 | archived | NGC 1365 | 53.40192 | -36.14066 | 59321.5437 | ACIS-S | HETG | 38090 | GTO | Canizares | 59710 | 4647:chandra.obs.misc | 59321.5437152778 | -- | -- | 38090.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf24794N001_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/4/24794/primary/acisf24794N001_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/4/24794/primary/acisf24794N001_pha2.fits.gz"}} |
24795 | archived | NGC 1365 | 53.40192 | -36.14066 | 59328.2974 | ACIS-S | HETG | 27880 | GTO | Canizares | 59710 | 4648:chandra.obs.misc | 59328.2974189815 | -- | -- | 27880.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf24795N001_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/5/24795/primary/acisf24795N001_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/5/24795/primary/acisf24795N001_pha2.fits.gz"}} |
25015 | archived | NGC 1365 | 53.40192 | -36.14066 | 59336.1988 | ACIS-S | HETG | 17080 | GTO | Canizares | 59710 | 4649:chandra.obs.misc | 59336.1987962963 | -- | -- | 17080.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf25015N001_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/5/25015/primary/acisf25015N001_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/5/25015/primary/acisf25015N001_pha2.fits.gz"}} |
25024 | archived | NGC 1365 | 53.40192 | -36.14066 | 59340.9376 | ACIS-S | HETG | 14080 | GTO | Canizares | 59710 | 4650:chandra.obs.misc | 59340.9376041667 | -- | -- | 14080.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf25024N002_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/4/25024/primary/acisf25024N002_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/4/25024/primary/acisf25024N002_pha2.fits.gz"}} |
25036 | archived | NGC 1365 | 53.40192 | -36.14066 | 59345.6677 | ACIS-S | HETG | 18180 | GTO | Canizares | 59710 | 4651:chandra.obs.misc | 59345.6677199074 | -- | -- | 18180.0 | -- | 53.40192 | -36.14066 | 0.81 | acisf25036N001_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/6/25036/primary/acisf25036N001_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/6/25036/primary/acisf25036N001_pha2.fits.gz"}} |
13920 | archived | NGC 1365 | 53.40167 | -36.14028 | 56026.4065 | ACIS-S | HETG | 90040 | GO | Reeves | 56398 | 4659:chandra.obs.misc | 56026.4065162037 | -- | -- | 90040.0 | -- | 53.40167 | -36.14028 | 0.81 | acisf13920N002_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/0/13920/primary/acisf13920N002_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/0/13920/primary/acisf13920N002_pha2.fits.gz"}} |
13921 | archived | NGC 1365 | 53.40167 | -36.14028 | 56029.0272 | ACIS-S | HETG | 110050 | GO | Reeves | 56398 | 4660:chandra.obs.misc | 56029.0271643518 | -- | -- | 110050.0 | -- | 53.40167 | -36.14028 | 0.81 | acisf13921N002_pha2.fits | https://heasarc.gsfc.nasa.gov/FTP/chandra/data/byobsid/1/13921/primary/acisf13921N002_pha2.fits.gz | 12 | Spectrum-1.0 | ACIS-S | HEASARC | application/fits | 1.2398e-10 | 6.1992e-09 | 6.07522e-09 | 3.16159e-09 | {"aws":{"bucket_name":"nasa-heasarc","region":"us-east-1","policy":"open","key":"chandra/data/byobsid/1/13921/primary/acisf13921N002_pha2.fits.gz"}} |
Hint 3: Download the data to make a spectrum. Note: you might end here and use Xspec to plot and model the spectrum. Or … you can also try to take a quick look at the spectrum.
# Get it and look at it:
#hdu_list=spec_tables[0].getdataobj()
file_name = download_file(spec_tables[0].getdataurl(), cache=True, timeout=600)
hdu_list=fits.open(file_name)
spectra=hdu_list[1].data
print(spectra.columns)
print(len(spectra))
ColDefs(
name = 'SPEC_NUM'; format = '1I'; null = 0
name = 'TG_M'; format = '1I'; null = 99
name = 'TG_PART'; format = '1I'
name = 'TG_SRCID'; format = '1I'; null = 0
name = 'X'; format = '1E'; unit = 'pixel'
name = 'Y'; format = '1E'; unit = 'pixel'
name = 'CHANNEL'; format = '8192I'; null = 0
name = 'COUNTS'; format = '8192I'; unit = 'count'; null = -1
name = 'STAT_ERR'; format = '8192E'; unit = 'count'
name = 'BACKGROUND_UP'; format = '8192I'; unit = 'count'; null = -1
name = 'BACKGROUND_DOWN'; format = '8192I'; unit = 'count'; null = -1
name = 'BIN_LO'; format = '8192D'; unit = 'angstrom'
name = 'BIN_HI'; format = '8192D'; unit = 'angstrom'
)
12
## Or write it to disk
import os
if not os.path.isdir('downloads'):
os.makedirs("downloads")
fname=spec_tables[0].make_dataset_filename()
# Known issue where the suffix is incorrect:
fname=fname.replace('None','fits')
with open('downloads/{}'.format(fname),'wb') as outfile:
outfile.write(spec_tables[0].getdataset().read())
Extension: Making a “quick look” spectrum. For our purposes, the 1st order of the HEG grating data would be sufficient.
j=1
for i in range(len(spectra)):
matplotlib.rcParams['figure.figsize'] = (8, 3)
if abs(spectra['TG_M'][i]) == 1 and (spectra['TG_PART'][i]) == 1:
ax=plt.subplot(1,2,j)
pha = plt.plot( spectra['CHANNEL'][i],spectra['COUNTS'][i])
ax.set_yscale('log')
if spectra['TG_PART'][i] == 1:
instr='HEG'
ax.set_title("{grating}{order:+d}".format(grating=instr, order=spectra['TG_M'][i]))
plt.tight_layout()
j=j+1
This can then be analyzed in your favorite spectral analysis tool, e.g., pyXspec. (For the winter 2018 AAS workshop, we demonstrated this in a notebook that you can consult for how to use pyXspec, but the pyXspec documentation will have more information.)
Congratulations! You have completed this notebook exercise.