{ "cells": [ { "cell_type": "markdown", "id": "a13b8653", "metadata": {}, "source": [ "# Observations within the XXL-North region" ] }, { "cell_type": "markdown", "id": "2453f437", "metadata": {}, "source": [ "This case study demonstrates how we can use a DAXA filtering method to identify all observations whose coordinate falls within a rectangular region - we apply this to the task of selecting all the XMM and Chandra observations within the XXL-North (XXL is a project utilising the largest contiguous region observed by XMM, one in the north and one in the south). \n", "\n", "The filtering method we demonstrate here could just as easily be applied to other wide regions of interest (the Lockman hole for example), and will work with any DAXA mission, not just XMM and Chandra." ] }, { "cell_type": "markdown", "id": "5e2a28b1", "metadata": {}, "source": [ "## Import Statements" ] }, { "cell_type": "code", "execution_count": 1, "id": "aa9f16e8", "metadata": {}, "outputs": [], "source": [ "from astropy.coordinates import SkyCoord\n", "from astropy.units import hourangle\n", "\n", "from daxa.mission import XMMPointed, Chandra" ] }, { "cell_type": "markdown", "id": "fa824356", "metadata": {}, "source": [ "## Other Tutorials" ] }, { "cell_type": "markdown", "id": "cc8b77fc", "metadata": {}, "source": [ "These case studies are meant to be highly specific examples of how you might acquire data for a particular science case, they do not provide general instruction on how to use DAXA missions or archives. We instead direct you to:\n", "\n", "* [Using DAXA missions](../missions.html) - Here we explain what DAXA mission classes are and how to use them to select only the data you need.\n", "* [Creating a DAXA archive](../archives.html) - This explains how to create an archive, load an existing archive, and the various properties and features of DAXA archives.\n", "* [Processing telescope data](../../../tutorials.process.html) - The processing tutorials for different missions are presented here, though there may not yet be processing support for all missions.\n", "\n", "Reading through these should give you a good understanding of how DAXA can be used to acquire, organise, and process multi-mission X-ray datasets for your specific use case." ] }, { "cell_type": "markdown", "id": "cda7ed3b", "metadata": {}, "source": [ "## Defining missions" ] }, { "cell_type": "markdown", "id": "1db78091", "metadata": {}, "source": [ "The XXL project used XMM, so we knows there will be plenty of observations of the XXL region with XMM, but we will also search for any Chandra observations that fall within the same region:" ] }, { "cell_type": "code", "execution_count": 2, "id": "032436b4", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/dt237/code/DAXA/daxa/mission/xmm.py:83: UserWarning: 140 of the 17697 observations located for this mission have been removed due to NaN RA or Dec values\n", " self._fetch_obs_info()\n" ] } ], "source": [ "xm = XMMPointed()\n", "ch = Chandra()" ] }, { "cell_type": "markdown", "id": "c7dda794", "metadata": {}, "source": [ "## Searching for observations" ] }, { "cell_type": "markdown", "id": "df78c594", "metadata": {}, "source": [ "We are going to use a DAXA filtering method that allows for the selection of all observations whose central coordinate falls within a rectangle - for that search we need to define the lower-left and upper-right coordinates of the rectangular region. We define these coordinates with convention that RA increases from right-to-left (i.e. the upper-right RA is greater than the lower-left RA), but the search method can also handle rectangles that have RA increasing from left-to-right.\n", "\n", "The coordinates we've created broadly cover the XXL-North region:" ] }, { "cell_type": "code", "execution_count": 3, "id": "2e622e5a", "metadata": {}, "outputs": [], "source": [ "ll = SkyCoord(\"2h36m0s\", -8., unit=(hourangle, 'deg'))\n", "ur = SkyCoord(\"2h00m0s\", -2., unit=(hourangle, 'deg'))" ] }, { "cell_type": "markdown", "id": "0ecb9ffb", "metadata": {}, "source": [ "The `filter_on_rect_region` method is used, and we simply need to pass the corner coordinates we have already defined:" ] }, { "cell_type": "code", "execution_count": 4, "id": "667e923c", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/dt237/code/DAXA/daxa/mission/base.py:107: UserWarning: The passed corner coordinates are defined with RA increasing from right to left (upper-right RA is less than lower-left; we reversed this.\n", " any_ret = change_func(*args, **kwargs)\n" ] } ], "source": [ "xm.filter_on_rect_region(ll, ur)\n", "ch.filter_on_rect_region(ll, ur)" ] }, { "cell_type": "markdown", "id": "0a686f93", "metadata": {}, "source": [ "## Examining the available observations" ] }, { "cell_type": "markdown", "id": "510a2b94", "metadata": {}, "source": [ "As expected, we have selected many XMM observations - and there is also a not-insignificant number of Chandra observations." ] }, { "cell_type": "code", "execution_count": 5, "id": "f408e3e4", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
radecObsIDstartscience_usabledurationproprietary_end_daterevolutionproprietary_usableend
23435.666670-3.83333300379801012002-01-11 04:21:02True0 days 04:12:522003-02-13383True2002-01-11 08:33:54
23536.000000-3.83333300379802012002-01-11 14:20:11True0 days 03:52:552003-02-13383True2002-01-11 18:13:06
23636.333330-3.83333300379803012002-01-11 23:37:59True0 days 03:54:312003-02-08383True2002-01-12 03:32:30
23736.666660-3.83333300379804012002-01-26 02:24:12True0 days 04:23:512003-02-08390True2002-01-26 06:48:03
23837.000005-3.83333300379805012002-01-25 20:51:08True0 days 04:53:352003-02-08390True2002-01-26 01:44:43
.................................
1475931.332917-2.55161108708501012020-07-04 21:25:41True0 days 10:06:402021-07-273767True2020-07-05 07:32:21
1477838.402083-5.50769408626701012020-07-10 03:03:35True1 days 04:03:202021-09-173770True2020-07-11 07:06:55
1484638.402083-5.50772208626702012020-08-16 15:57:07True1 days 00:03:192021-09-173789True2020-08-17 16:00:26
1484738.402083-5.50772208626704012020-08-16 13:39:53True0 days 02:17:142021-09-173789True2020-08-16 15:57:07
1740936.930375-6.09169409202203012024-01-25 15:58:15True0 days 06:23:202025-02-084419False2024-01-25 22:21:35
\n", "

422 rows × 10 columns

\n", "
" ], "text/plain": [ " ra dec ObsID start science_usable \\\n", "234 35.666670 -3.833333 0037980101 2002-01-11 04:21:02 True \n", "235 36.000000 -3.833333 0037980201 2002-01-11 14:20:11 True \n", "236 36.333330 -3.833333 0037980301 2002-01-11 23:37:59 True \n", "237 36.666660 -3.833333 0037980401 2002-01-26 02:24:12 True \n", "238 37.000005 -3.833333 0037980501 2002-01-25 20:51:08 True \n", "... ... ... ... ... ... \n", "14759 31.332917 -2.551611 0870850101 2020-07-04 21:25:41 True \n", "14778 38.402083 -5.507694 0862670101 2020-07-10 03:03:35 True \n", "14846 38.402083 -5.507722 0862670201 2020-08-16 15:57:07 True \n", "14847 38.402083 -5.507722 0862670401 2020-08-16 13:39:53 True \n", "17409 36.930375 -6.091694 0920220301 2024-01-25 15:58:15 True \n", "\n", " duration proprietary_end_date revolution proprietary_usable \\\n", "234 0 days 04:12:52 2003-02-13 383 True \n", "235 0 days 03:52:55 2003-02-13 383 True \n", "236 0 days 03:54:31 2003-02-08 383 True \n", "237 0 days 04:23:51 2003-02-08 390 True \n", "238 0 days 04:53:35 2003-02-08 390 True \n", "... ... ... ... ... \n", "14759 0 days 10:06:40 2021-07-27 3767 True \n", "14778 1 days 04:03:20 2021-09-17 3770 True \n", "14846 1 days 00:03:19 2021-09-17 3789 True \n", "14847 0 days 02:17:14 2021-09-17 3789 True \n", "17409 0 days 06:23:20 2025-02-08 4419 False \n", "\n", " end \n", "234 2002-01-11 08:33:54 \n", "235 2002-01-11 18:13:06 \n", "236 2002-01-12 03:32:30 \n", "237 2002-01-26 06:48:03 \n", "238 2002-01-26 01:44:43 \n", "... ... \n", "14759 2020-07-05 07:32:21 \n", "14778 2020-07-11 07:06:55 \n", "14846 2020-08-17 16:00:26 \n", "14847 2020-08-16 15:57:07 \n", "17409 2024-01-25 22:21:35 \n", "\n", "[422 rows x 10 columns]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xm.filtered_obs_info" ] }, { "cell_type": "code", "execution_count": 6, "id": "e6a7d536", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
radecObsIDscience_usableproprietary_usablestartenddurationproprietary_end_datetarget_categoryinstrumentgratingdata_mode
7731.18436-5.092734129TrueTrue2003-06-13 01:01:52.0000032003-06-14 22:01:52.0000031 days 21:00:002004-06-27AGNACIS-INONETE_002AC
71134.58875-5.1741712882TrueTrue2010-09-27 04:39:01.9999962010-09-28 04:25:31.9999960 days 23:46:302011-09-29GCLACIS-SNONETE_0046E
88635.04167-6.0416714972TrueTrue2013-09-26 12:25:33.0000042013-09-27 09:50:03.0000040 days 21:24:302014-10-02AGNACIS-SNONETE_00AD8
89135.02417-5.1410013374TrueTrue2011-10-07 05:41:46.0000032011-10-08 02:59:26.0000030 days 21:17:402012-10-11GCLACIS-INONETE_00AB4
91336.68333-4.695839368TrueTrue2007-11-23 16:55:21.9999962007-11-24 14:01:11.9999960 days 21:05:502008-11-26GCLACIS-SNONETE_0046E
..........................................
1773333.34208-6.0980016574TrueTrue2015-08-05 17:22:51.0000012015-08-05 18:47:21.0000010 days 01:24:302016-08-06GCLACIS-SNONETE_0046E
1788531.54917-6.1930016575TrueTrue2015-06-24 05:19:51.9999972015-06-24 06:44:01.9999970 days 01:24:102016-06-25GCLACIS-SNONETE_0046E
1890037.90667-7.481813030TrueTrue2002-09-27 23:17:28.0000032002-09-28 00:28:18.0000030 days 01:10:502003-10-03AGNACIS-SNONETE_002A2
1914933.62208-5.295694767TrueTrue2003-11-26 16:45:20.9999982003-11-26 17:53:30.9999980 days 01:08:102004-12-01AGNACIS-SNONETE_002A2
2083135.27350-4.6837523741TrueTrue2020-12-06 12:06:00.0000032020-12-06 12:40:20.0000030 days 00:34:202021-12-07AGNACIS-SNONETE_004A6
\n", "

84 rows × 13 columns

\n", "
" ], "text/plain": [ " ra dec ObsID science_usable proprietary_usable \\\n", "77 31.18436 -5.09273 4129 True True \n", "711 34.58875 -5.17417 12882 True True \n", "886 35.04167 -6.04167 14972 True True \n", "891 35.02417 -5.14100 13374 True True \n", "913 36.68333 -4.69583 9368 True True \n", "... ... ... ... ... ... \n", "17733 33.34208 -6.09800 16574 True True \n", "17885 31.54917 -6.19300 16575 True True \n", "18900 37.90667 -7.48181 3030 True True \n", "19149 33.62208 -5.29569 4767 True True \n", "20831 35.27350 -4.68375 23741 True True \n", "\n", " start end duration \\\n", "77 2003-06-13 01:01:52.000003 2003-06-14 22:01:52.000003 1 days 21:00:00 \n", "711 2010-09-27 04:39:01.999996 2010-09-28 04:25:31.999996 0 days 23:46:30 \n", "886 2013-09-26 12:25:33.000004 2013-09-27 09:50:03.000004 0 days 21:24:30 \n", "891 2011-10-07 05:41:46.000003 2011-10-08 02:59:26.000003 0 days 21:17:40 \n", "913 2007-11-23 16:55:21.999996 2007-11-24 14:01:11.999996 0 days 21:05:50 \n", "... ... ... ... \n", "17733 2015-08-05 17:22:51.000001 2015-08-05 18:47:21.000001 0 days 01:24:30 \n", "17885 2015-06-24 05:19:51.999997 2015-06-24 06:44:01.999997 0 days 01:24:10 \n", "18900 2002-09-27 23:17:28.000003 2002-09-28 00:28:18.000003 0 days 01:10:50 \n", "19149 2003-11-26 16:45:20.999998 2003-11-26 17:53:30.999998 0 days 01:08:10 \n", "20831 2020-12-06 12:06:00.000003 2020-12-06 12:40:20.000003 0 days 00:34:20 \n", "\n", " proprietary_end_date target_category instrument grating data_mode \n", "77 2004-06-27 AGN ACIS-I NONE TE_002AC \n", "711 2011-09-29 GCL ACIS-S NONE TE_0046E \n", "886 2014-10-02 AGN ACIS-S NONE TE_00AD8 \n", "891 2012-10-11 GCL ACIS-I NONE TE_00AB4 \n", "913 2008-11-26 GCL ACIS-S NONE TE_0046E \n", "... ... ... ... ... ... \n", "17733 2016-08-06 GCL ACIS-S NONE TE_0046E \n", "17885 2016-06-25 GCL ACIS-S NONE TE_0046E \n", "18900 2003-10-03 AGN ACIS-S NONE TE_002A2 \n", "19149 2004-12-01 AGN ACIS-S NONE TE_002A2 \n", "20831 2021-12-07 AGN ACIS-S NONE TE_004A6 \n", "\n", "[84 rows x 13 columns]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ch.filtered_obs_info" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.0" } }, "nbformat": 4, "nbformat_minor": 5 }