{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Access ESASky products with astroquery.esasky\n", "\n", "##### Authors: Ivan Valtchanov, Belén López Martí, H. Norman, Nuria Álvarez Crespo\n", "\n", "#### Last update: Jul 07, 2021\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This notebook illustrates some example usages of the ESASky implementation in astroquery.\n", "\n", "First you need to install astroquery and esasky.\n", "\n", "Astroquery can be installed with `pip install --pre astroquery`, the latest version should come with esasky. Alternatively, you can grab the latest astroquery with esasky from [here](https://github.com/astropy/astroquery/).\n", "\n", "The documentation for astroquery.esasky is available [here](https://astroquery.readthedocs.io/en/latest/esasky/esasky.html).\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Use Case 1: Retrieve imaging data for a single object\n", "\n", "In this use case, imaging data are retrieved for a single object, indicated by its name (resolved by Simbad) or coordinates.\n", "\n", "We start by importing the ESASky astroquery module and other necessary packages:\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": [ "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "from matplotlib.colors import LogNorm\n", "import os\n", "from astroquery.esasky import ESASky" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First, let's check the available maps: " ] }, { "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": "markdown", "metadata": {}, "source": [ "Let's do a search around the position of our object:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "TableList with 12 tables:\n", "\t'0:INTEGRAL' with 18 column(s) and 1 row(s) \n", "\t'1:XMM' with 15 column(s) and 11 row(s) \n", "\t'2:CHANDRA' with 53 column(s) and 17 row(s) \n", "\t'3:XMM-OM-OPTICAL' with 17 column(s) and 12 row(s) \n", "\t'4:XMM-OM-UV' with 17 column(s) and 19 row(s) \n", "\t'5:HST-UV' with 15 column(s) and 19 row(s) \n", "\t'6:HST-OPTICAL' with 15 column(s) and 260 row(s) \n", "\t'7:HST-IR' with 15 column(s) and 41 row(s) \n", "\t'8:ISO-IR' with 18 column(s) and 7 row(s) \n", "\t'9:HERSCHEL' with 15 column(s) and 9 row(s) \n", "\t'10:AKARI' with 11 column(s) and 3 row(s) \n", "\t'11:SPITZER' with 14 column(s) and 4 row(s) \n" ] } ], "source": [ "maps = ESASky.query_object_maps(position='M51')\n", "print (maps)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The output is a TableList with the keys corresponding to the mission (or in some cases, mission and instrument) names for which there are images available covering our target position.\n", "\n", "We can also do a search by coordinates, either by using an [astroquery.coordinates](http://docs.astropy.org/en/stable/coordinates/) object or by typing the coordinates. In this latter case, we have to define the units we are using (d = degrees; h = hours; m = minutes; s = seconds)." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "WARNING: InputWarning: Coordinate string is being interpreted as an ICRS coordinate. [astroquery.utils.commons]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "TableList with 12 tables:\n", "\t'0:INTEGRAL' with 18 column(s) and 1 row(s) \n", "\t'1:XMM' with 15 column(s) and 11 row(s) \n", "\t'2:CHANDRA' with 53 column(s) and 17 row(s) \n", "\t'3:XMM-OM-OPTICAL' with 17 column(s) and 12 row(s) \n", "\t'4:XMM-OM-UV' with 17 column(s) and 19 row(s) \n", "\t'5:HST-UV' with 15 column(s) and 19 row(s) \n", "\t'6:HST-OPTICAL' with 15 column(s) and 260 row(s) \n", "\t'7:HST-IR' with 15 column(s) and 41 row(s) \n", "\t'8:ISO-IR' with 18 column(s) and 7 row(s) \n", "\t'9:HERSCHEL' with 15 column(s) and 9 row(s) \n", "\t'10:AKARI' with 11 column(s) and 3 row(s) \n", "\t'11:SPITZER' with 14 column(s) and 4 row(s) \n" ] } ], "source": [ "maps = ESASky.query_object_maps(position='13h29m52.7s +47d11m43s')\n", "print (maps)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The method has a tolerance of 5 arcsec to allow for positional errors." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's check the content of the 'XMM-OM-OPTICAL' table:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "