{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Example ESASky use\n", "\n", "This notebook illustrates some relatively more advanced usages of the ESASky implementation as a module of `astroquery`.\n", "\n", "Authors: Ivan Valtchanov, Nuria Álvarez and Henrik Norman.\n", "\n", "First you need to install `astroquery` which contains esasky.\n", "\n", "Astroquery can be installed with `pip install --pre astroquery`, the latest version should come with esasky. \n", "\n", "The documentation for `astroquery.esasky` is available [here](https://astroquery.readthedocs.io/en/latest/esasky/esasky.html).\n", "\n", "### Modification history:\n", "* Notebook updated to reflect backend changes as of July 2021.\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Created TAP+ (v20200428.1) - Connection:\n", "\tHost: sky.esa.int\n", "\tUse HTTPS: True\n", "\tPort: 443\n", "\tSSL Port: 443\n" ] } ], "source": [ "#\n", "# import some necessary packages\n", "#\n", "import matplotlib.pyplot as plt\n", "from matplotlib.legend_handler import HandlerLine2D\n", "from astropy.io import fits\n", "%matplotlib inline\n", "\n", "import numpy as np\n", "\n", "from astropy.wcs import WCS\n", "from astropy.visualization import PercentileInterval, ImageNormalize, AsinhStretch, LogStretch, LinearStretch\n", "from astroquery.esasky import ESASky\n", "from astropy.convolution import convolve, Kernel, Gaussian2DKernel" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Workflow\n", "\n", "This is a simple workflow.\n", "\n", "1. Load an XMM-Newton EPIC image of a target of choice.\n", "2. Smooth the image with a Gaussian with FWHM=5\".\n", "3. Generate 10 contours.\n", "4. Plot the original photon image in [0.2-7] keV (ESASky data) and overplot the contours.\n", "5. Load a Herschel 250 µm image of the same target.\n", "6. Plot the Herschel image and overplot the XMM smoothed image contours.\n", "7. Overplot the Planck PSZ catalogue sources." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['INTEGRAL',\n", " 'XMM',\n", " 'Chandra',\n", " 'SUZAKU',\n", " 'XMM-OM-OPTICAL',\n", " 'XMM-OM-UV',\n", " 'HST-UV',\n", " 'HST-OPTICAL',\n", " 'HST-IR',\n", " 'ISO-IR',\n", " 'Herschel',\n", " 'AKARI',\n", " 'Spitzer',\n", " 'ALMA']" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ESASky.list_maps()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "TableList with 2 tables:\n", "\t'0:XMM' with 15 column(s) and 11 row(s) \n", "\t'1:HERSCHEL' with 15 column(s) and 9 row(s) \n" ] } ], "source": [ "maps = ESASky.query_object_maps(position='M51', missions=[\"XMM\",\"HERSCHEL\"])\n", "print (maps)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['LAMOST',\n", " 'AllWise',\n", " 'AKARI-IRC-SC',\n", " 'TwoMASS',\n", " 'INTEGRAL',\n", " 'CHANDRA-SC2',\n", " 'XMM-EPIC-STACK',\n", " 'XMM-EPIC',\n", " 'XMM-OM',\n", " 'XMM-SLEW',\n", " 'Tycho-2',\n", " 'Gaia-eDR3',\n", " 'Hipparcos-2',\n", " 'HSC',\n", " 'Herschel-HPPSC-070',\n", " 'Herschel-HPPSC-100',\n", " 'Herschel-HPPSC-160',\n", " 'Herschel-SPSC-250',\n", " 'Herschel-SPSC-350',\n", " 'Herschel-SPSC-500',\n", " 'Planck-PGCC',\n", " 'Planck-PCCS2E-HFI',\n", " 'Planck-PCCS2-HFI',\n", " 'Planck-PCCS2-LFI',\n", " 'Planck-PSZ2']" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ESASky.list_catalogs()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "
dec | detflux | detflux_err | extended | frequency | highest_reliability_cat | name | pos | ra |
---|---|---|---|---|---|---|---|---|
deg | mJy | mJy | GHz | radians | deg | |||
float64 | float32 | float32 | int32 | int32 | int32 | object | object | float64 |
47.269458738155556 | 2487.3816 | 144.50739 | 1 | 857 | 99 | PCCS2 857 G104.70+68.45 | (3.53615979924974 , 0.825007690616419) | 202.60703218083844 |
47.29270496686151 | 8509.699 | 148.8071 | 1 | 857 | 99 | PCCS2 857 G104.89+68.46 | (3.5343989454277 , 0.825413413846009) | 202.50614268849597 |
47.078154678280164 | 1935.9907 | 154.44075 | 1 | 857 | 99 | PCCS2 857 G104.65+68.65 | (3.5344220449104 , 0.821668804899161) | 202.50746619136382 |
47.181795866475426 | 46454.07 | 382.1489 | 1 | 857 | 99 | PCCS2 857 G104.80+68.56 | (3.53405763720841 , 0.823477684873847) | 202.4865871680179 |