fido-demo.ipynb 442 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "2de8612e",
   "metadata": {},
   "source": [
    "# Downloading and inspecting data from the KIS SDC"
   ]
  },
11 12 13 14 15 16 17 18
  {
   "cell_type": "markdown",
   "id": "72bc3557",
   "metadata": {},
   "source": [
    "Programmatic access to the SDC data will be provided by a custom client for `Fido`, SunPy's search and download interface. This approach will allow the user to query and download data using SunPy, which will provide consistency with users' experiences working with other solar data in Python, and compatibility with the large and growing number of available scientific Python packages."
   ]
  },
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
  {
   "cell_type": "markdown",
   "id": "6a561de5",
   "metadata": {},
   "source": [
    "## A brief introduction to SunPy"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4c909d72",
   "metadata": {},
   "source": [
    "SunPy is an open-source, community-developed package which provides a wide range of general tools for research in solar physics. It is written in Python, which also allows easy integration with the large and growing ecosystem of scientific Python packages.\n",
    "\n",
    "The main features of SunPy are:\n",
    "- the `Map` object which provides a single, coordinate-aware interface for loading and plotting solar image data;\n",
    "- `TimeSeries`, a similar interface for time-series data;\n",
    "- solar physical constants;\n",
    "- use of Astropy's  `units` submodule for physical quantities;\n",
    "- tools for parsing time strings and dealing with time ranges;\n",
    "- `Fido`, a unified search and download interface for obtaining solar data from a variety of different sources;\n",
    "- a `database` submodule for tracking locally downloaded files.\n",
    "\n",
    "A full tutorial on any of these topics would be beyond the scope of this document, but for a quick primer you can check out [this tutorial](https://github.com/aperiosoftware/stfc_sunpy_intro_2021) which was run by Aperio Software for an STFC summer school in Durham. It demonstrates some basic analysis using several of the tools listed above. An introduction to all of these features can be found on the [SunPy website](https://docs.sunpy.org/en/stable/guide/tour.html), and the [documentation](https://docs.sunpy.org/en/stable/) provides more detailed explanations and examples. Some of you may also be interested in the [SSWIDL/sunpy Cheat Sheet](https://docs.sunpy.org/en/stable/guide/ssw.html).\n",
    "\n",
    "For the purposes of this tutorial, the feature that will interest us most is `Fido`."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "df4f0c40",
   "metadata": {},
   "source": [
    "### Getting help or helping out\n",
    "\n",
    "SunPy is a community-driven project, and the developers are always willing to welcome  new users and provide help where needed. The best place to start if you want help with anything in SunPy is the [SunPy matrix room](https://matrix.to/#/#sunpy:openastronomy.org).\n",
    "\n",
    "As well as being open-source, SunPy has a philosophy of being open development. This means that anyone can get involved, either by contributing to the package itself (adding features, fixing bugs, writing documentation, etc) or by supporting the project more broadly (giving the developers feedback, helping other users, and so on). Again, the best place to start with this is [matrix](https://matrix.to/#/#sunpy:openastronomy.org), and you can find repositories for the code base, documentation, website and more at [SunPy's GitHub page](https://github.com/sunpy)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "41ee2518",
   "metadata": {},
   "source": [
    "## A brief introduction to Fido"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "76d7b729",
   "metadata": {},
   "source": [
73
    "`Fido` is SunPy's unified search and download interface. It allows users to query many different data sources at once using a system of attributes to specify the particular data the user is looking for. A query returns a table of results which can be inspected and sliced, such that the user can either download all of those results or a subset of them."
74 75 76 77
   ]
  },
  {
   "cell_type": "markdown",
78
   "id": "71fce49e",
79 80
   "metadata": {},
   "source": [
81
    "The below is adapted from the [documentation on the SunPy website](https://docs.sunpy.org/en/stable/guide/acquiring_data/fido.html#fido-guide)."
82 83 84 85
   ]
  },
  {
   "cell_type": "markdown",
86
   "id": "3dec202f",
87 88
   "metadata": {},
   "source": [
89 90 91 92 93 94 95 96 97 98 99
    "`Fido` and `attrs` can both be imported from `sunpy.net`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "2179db02",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sunpy.net import Fido, attrs as a"
100 101 102 103
   ]
  },
  {
   "cell_type": "markdown",
104
   "id": "44bb4a5c",
105 106
   "metadata": {},
   "source": [
107
    "Attributes are used to specify particular aspects of the data, such as instrument, time range or wavelength."
108 109 110 111
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
112
   "execution_count": 2,
113
   "id": "65c205bb",
114
   "metadata": {},
115 116 117 118 119 120 121
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<sunpy.net.attrs.Time(2012-03-04 00:00:00.000, 2012-03-06 00:00:00.000)>"
      ]
     },
Drew Leonard's avatar
Drew Leonard committed
122
     "execution_count": 2,
123 124 125 126
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
127
   "source": [
128
    "a.Time('2012/03/04', '2012/03/06')"
129 130 131 132
   ]
  },
  {
   "cell_type": "code",
133 134
   "execution_count": 3,
   "id": "50872d8c",
135
   "metadata": {},
136 137 138 139
   "outputs": [
    {
     "data": {
      "text/plain": [
Drew Leonard's avatar
Drew Leonard committed
140
       "<sunpy.net.attrs.Instrument: aia object at 0x7fbc17391870>"
141 142 143 144 145 146 147
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
148
   "source": [
149
    "a.Instrument('aia')"
150 151 152 153
   ]
  },
  {
   "cell_type": "markdown",
154
   "id": "1aa34322",
155 156
   "metadata": {},
   "source": [
157
    "To query data we pass one or more attributes to `Fido.search()`, which returns data that match those attributes. So to find level one AIA data in a particular two-day period we can do:"
158 159 160 161
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
162
   "execution_count": 4,
163
   "id": "fcc9573a",
164 165 166
   "metadata": {},
   "outputs": [],
   "source": [
167 168 169 170 171
    "result = Fido.search(a.Time('2012/3/4', '2012/3/6'), a.Instrument.aia, a.Level.one)"
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
172
   "execution_count": 5,
173 174 175 176 177 178 179
   "id": "99307ae6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "Results from 1 Provider:</br></br>2647 Results from the VSOClient:</br><div><i>VSOQueryResponseTable length=2647</i>\n",
Drew Leonard's avatar
Drew Leonard committed
180
       "<table id=\"table140445820201248\" class=\"table-striped table-bordered table-condensed\">\n",
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
       "<thead><tr><th>Start Time</th><th>End Time</th><th>Source</th><th>Instrument</th><th>Wavelength [2]</th><th>Provider</th><th>Physobs</th><th>Wavetype</th><th>Extent Width</th><th>Extent Length</th><th>Extent Type</th><th>Size</th><th>Extra Flags</th><th>Info</th></tr></thead>\n",
       "<thead><tr><th></th><th></th><th></th><th></th><th>Angstrom</th><th></th><th></th><th></th><th></th><th></th><th></th><th>Mibyte</th><th></th><th></th></tr></thead>\n",
       "<thead><tr><th>object</th><th>object</th><th>str3</th><th>str3</th><th>float64</th><th>str4</th><th>str9</th><th>str6</th><th>str4</th><th>str4</th><th>str8</th><th>float64</th><th>str1</th><th>str106</th></tr></thead>\n",
       "<tr><td>2012-03-04 00:00:00.000</td><td>2012-03-04 00:09:25.000</td><td>SDO</td><td>AIA</td><td>171.0 .. 171.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3103.125</td><td>S</td><td>AIA level 1, 4096x4096 [48 records] [0 eclipse] [0 darks] [1.999 to 1.999 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:00:00.000</td><td>2012-03-04 00:09:13.000</td><td>SDO</td><td>AIA</td><td>211.0 .. 211.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3038.47656</td><td>S</td><td>AIA level 1, 4096x4096 [47 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:00:02.000</td><td>2012-03-04 00:09:15.000</td><td>SDO</td><td>AIA</td><td>94.0 .. 94.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3038.47656</td><td>S</td><td>AIA level 1, 4096x4096 [47 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:00:03.000</td><td>2012-03-04 00:09:16.000</td><td>SDO</td><td>AIA</td><td>335.0 .. 335.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3038.47656</td><td>S</td><td>AIA level 1, 4096x4096 [47 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:00:07.000</td><td>2012-03-04 00:09:20.000</td><td>SDO</td><td>AIA</td><td>193.0 .. 193.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3038.47656</td><td>S</td><td>AIA level 1, 4096x4096 [47 records] [0 eclipse] [0 darks] [2.000 to 2.000 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:00:08.000</td><td>2012-03-04 00:09:21.000</td><td>SDO</td><td>AIA</td><td>304.0 .. 304.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3038.47656</td><td>S</td><td>AIA level 1, 4096x4096 [47 records] [0 eclipse] [0 darks] [2.902 to 2.902 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:00:08.000</td><td>2012-03-04 00:00:09.000</td><td>SDO</td><td>AIA</td><td>4500.0 .. 4500.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>64.64844</td><td>S</td><td>AIA level 1, 4096x4096 [0.501 exposure] [100.00 percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:00:09.000</td><td>2012-03-04 00:09:22.000</td><td>SDO</td><td>AIA</td><td>131.0 .. 131.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3038.47656</td><td>S</td><td>AIA level 1, 4096x4096 [47 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:00:17.000</td><td>2012-03-04 00:09:06.000</td><td>SDO</td><td>AIA</td><td>1600.0 .. 1600.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>1486.91406</td><td>S</td><td>AIA level 1, 4096x4096 [23 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:00:31.000</td><td>2012-03-04 00:09:20.000</td><td>SDO</td><td>AIA</td><td>1700.0 .. 1700.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>1486.91406</td><td>S</td><td>AIA level 1, 4096x4096 [23 records] [0 eclipse] [0 darks] [1.000 to 1.000 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:09:24.000</td><td>2012-03-04 00:19:13.000</td><td>SDO</td><td>AIA</td><td>211.0 .. 211.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3232.42188</td><td>S</td><td>AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:09:26.000</td><td>2012-03-04 00:19:15.000</td><td>SDO</td><td>AIA</td><td>94.0 .. 94.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3232.42188</td><td>S</td><td>AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:09:27.000</td><td>2012-03-04 00:19:16.000</td><td>SDO</td><td>AIA</td><td>335.0 .. 335.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3232.42188</td><td>S</td><td>AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:09:29.000</td><td>2012-03-04 00:19:06.000</td><td>SDO</td><td>AIA</td><td>1600.0 .. 1600.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>1616.21094</td><td>S</td><td>AIA level 1, 4096x4096 [25 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:09:31.000</td><td>2012-03-04 00:19:20.000</td><td>SDO</td><td>AIA</td><td>193.0 .. 193.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3232.42188</td><td>S</td><td>AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.000 to 2.000 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-04 00:09:32.000</td><td>2012-03-04 00:19:21.000</td><td>SDO</td><td>AIA</td><td>304.0 .. 304.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3232.42188</td><td>S</td><td>AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.902 to 2.902 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td></tr>\n",
       "<tr><td>2012-03-05 23:49:27.000</td><td>2012-03-05 23:59:16.000</td><td>SDO</td><td>AIA</td><td>335.0 .. 335.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3232.42188</td><td>S</td><td>AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:49:29.000</td><td>2012-03-05 23:59:06.000</td><td>SDO</td><td>AIA</td><td>1600.0 .. 1600.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>1616.21094</td><td>S</td><td>AIA level 1, 4096x4096 [25 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:49:31.000</td><td>2012-03-05 23:59:21.000</td><td>SDO</td><td>AIA</td><td>193.0 .. 193.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3232.42188</td><td>S</td><td>AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [0.398 to 2.000 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:49:32.000</td><td>2012-03-05 23:59:21.000</td><td>SDO</td><td>AIA</td><td>304.0 .. 304.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3232.42188</td><td>S</td><td>AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.902 to 2.902 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:49:33.000</td><td>2012-03-05 23:59:22.000</td><td>SDO</td><td>AIA</td><td>131.0 .. 131.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3232.42188</td><td>S</td><td>AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:49:36.000</td><td>2012-03-05 23:59:13.000</td><td>SDO</td><td>AIA</td><td>171.0 .. 171.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>3167.77344</td><td>S</td><td>AIA level 1, 4096x4096 [49 records] [0 eclipse] [0 darks] [0.398 to 2.000 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:49:43.000</td><td>2012-03-05 23:59:20.000</td><td>SDO</td><td>AIA</td><td>1700.0 .. 1700.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>1616.21094</td><td>S</td><td>AIA level 1, 4096x4096 [25 records] [0 eclipse] [0 darks] [1.000 to 1.001 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:59:24.000</td><td>2012-03-06 00:00:01.000</td><td>SDO</td><td>AIA</td><td>171.0 .. 171.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>258.59375</td><td>S</td><td>AIA level 1, 4096x4096 [4 records] [0 eclipse] [0 darks] [1.713 to 1.999 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:59:24.000</td><td>2012-03-06 00:00:01.000</td><td>SDO</td><td>AIA</td><td>211.0 .. 211.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>258.59375</td><td>S</td><td>AIA level 1, 4096x4096 [4 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:59:26.000</td><td>2012-03-05 23:59:51.000</td><td>SDO</td><td>AIA</td><td>94.0 .. 94.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>193.94531</td><td>S</td><td>AIA level 1, 4096x4096 [3 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:59:27.000</td><td>2012-03-05 23:59:52.000</td><td>SDO</td><td>AIA</td><td>335.0 .. 335.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>193.94531</td><td>S</td><td>AIA level 1, 4096x4096 [3 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:59:29.000</td><td>2012-03-05 23:59:54.000</td><td>SDO</td><td>AIA</td><td>1600.0 .. 1600.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>129.29688</td><td>S</td><td>AIA level 1, 4096x4096 [2 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:59:31.000</td><td>2012-03-05 23:59:56.000</td><td>SDO</td><td>AIA</td><td>193.0 .. 193.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>193.94531</td><td>S</td><td>AIA level 1, 4096x4096 [3 records] [0 eclipse] [0 darks] [2.000 to 2.000 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:59:32.000</td><td>2012-03-05 23:59:57.000</td><td>SDO</td><td>AIA</td><td>304.0 .. 304.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>193.94531</td><td>S</td><td>AIA level 1, 4096x4096 [3 records] [0 eclipse] [0 darks] [2.902 to 2.902 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:59:33.000</td><td>2012-03-05 23:59:58.000</td><td>SDO</td><td>AIA</td><td>131.0 .. 131.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>193.94531</td><td>S</td><td>AIA level 1, 4096x4096 [3 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]</td></tr>\n",
       "<tr><td>2012-03-05 23:59:43.000</td><td>2012-03-05 23:59:44.000</td><td>SDO</td><td>AIA</td><td>1700.0 .. 1700.0</td><td>JSOC</td><td>intensity</td><td>NARROW</td><td>4096</td><td>4096</td><td>FULLDISK</td><td>64.64844</td><td>S</td><td>AIA level 1, 4096x4096 [1.001 exposure] [100.00 percentd]</td></tr>\n",
       "</table></div></br>"
      ],
      "text/plain": [
Drew Leonard's avatar
Drew Leonard committed
220
       "<sunpy.net.fido_factory.UnifiedResponse object at 0x7fbb6eb25720>\n",
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
       "Results from 1 Provider:\n",
       "\n",
       "2647 Results from the VSOClient:\n",
       "       Start Time               End Time        Source ... Extra Flags                                                    Info                                                   \n",
       "                                                       ...                                                                                                                       \n",
       "----------------------- ----------------------- ------ ... ----------- ----------------------------------------------------------------------------------------------------------\n",
       "2012-03-04 00:00:00.000 2012-03-04 00:09:25.000    SDO ...           S AIA level 1, 4096x4096 [48 records] [0 eclipse] [0 darks] [1.999 to 1.999 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:00:00.000 2012-03-04 00:09:13.000    SDO ...           S AIA level 1, 4096x4096 [47 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:00:02.000 2012-03-04 00:09:15.000    SDO ...           S AIA level 1, 4096x4096 [47 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:00:03.000 2012-03-04 00:09:16.000    SDO ...           S AIA level 1, 4096x4096 [47 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:00:07.000 2012-03-04 00:09:20.000    SDO ...           S AIA level 1, 4096x4096 [47 records] [0 eclipse] [0 darks] [2.000 to 2.000 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:00:08.000 2012-03-04 00:09:21.000    SDO ...           S AIA level 1, 4096x4096 [47 records] [0 eclipse] [0 darks] [2.902 to 2.902 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:00:08.000 2012-03-04 00:00:09.000    SDO ...           S                                                  AIA level 1, 4096x4096 [0.501 exposure] [100.00 percentd]\n",
       "2012-03-04 00:00:09.000 2012-03-04 00:09:22.000    SDO ...           S AIA level 1, 4096x4096 [47 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:00:17.000 2012-03-04 00:09:06.000    SDO ...           S AIA level 1, 4096x4096 [23 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:00:31.000 2012-03-04 00:09:20.000    SDO ...           S AIA level 1, 4096x4096 [23 records] [0 eclipse] [0 darks] [1.000 to 1.000 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:09:24.000 2012-03-04 00:19:13.000    SDO ...           S AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:09:26.000 2012-03-04 00:19:15.000    SDO ...           S AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:09:27.000 2012-03-04 00:19:16.000    SDO ...           S AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:09:29.000 2012-03-04 00:19:06.000    SDO ...           S AIA level 1, 4096x4096 [25 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:09:31.000 2012-03-04 00:19:20.000    SDO ...           S AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.000 to 2.000 exposure] [100.00 avg. percentd]\n",
       "2012-03-04 00:09:32.000 2012-03-04 00:19:21.000    SDO ...           S AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.902 to 2.902 exposure] [100.00 avg. percentd]\n",
       "                    ...                     ...    ... ...         ...                                                                                                        ...\n",
       "2012-03-05 23:49:26.000 2012-03-05 23:59:15.000    SDO ...           S AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:49:27.000 2012-03-05 23:59:16.000    SDO ...           S AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:49:29.000 2012-03-05 23:59:06.000    SDO ...           S AIA level 1, 4096x4096 [25 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:49:31.000 2012-03-05 23:59:21.000    SDO ...           S AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [0.398 to 2.000 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:49:32.000 2012-03-05 23:59:21.000    SDO ...           S AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.902 to 2.902 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:49:33.000 2012-03-05 23:59:22.000    SDO ...           S AIA level 1, 4096x4096 [50 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:49:36.000 2012-03-05 23:59:13.000    SDO ...           S AIA level 1, 4096x4096 [49 records] [0 eclipse] [0 darks] [0.398 to 2.000 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:49:43.000 2012-03-05 23:59:20.000    SDO ...           S AIA level 1, 4096x4096 [25 records] [0 eclipse] [0 darks] [1.000 to 1.001 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:59:24.000 2012-03-06 00:00:01.000    SDO ...           S  AIA level 1, 4096x4096 [4 records] [0 eclipse] [0 darks] [1.713 to 1.999 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:59:24.000 2012-03-06 00:00:01.000    SDO ...           S  AIA level 1, 4096x4096 [4 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:59:26.000 2012-03-05 23:59:51.000    SDO ...           S  AIA level 1, 4096x4096 [3 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:59:27.000 2012-03-05 23:59:52.000    SDO ...           S  AIA level 1, 4096x4096 [3 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:59:29.000 2012-03-05 23:59:54.000    SDO ...           S  AIA level 1, 4096x4096 [2 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:59:31.000 2012-03-05 23:59:56.000    SDO ...           S  AIA level 1, 4096x4096 [3 records] [0 eclipse] [0 darks] [2.000 to 2.000 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:59:32.000 2012-03-05 23:59:57.000    SDO ...           S  AIA level 1, 4096x4096 [3 records] [0 eclipse] [0 darks] [2.902 to 2.902 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:59:33.000 2012-03-05 23:59:58.000    SDO ...           S  AIA level 1, 4096x4096 [3 records] [0 eclipse] [0 darks] [2.901 to 2.901 exposure] [100.00 avg. percentd]\n",
       "2012-03-05 23:59:43.000 2012-03-05 23:59:44.000    SDO ...           S                                                  AIA level 1, 4096x4096 [1.001 exposure] [100.00 percentd]\n",
       "Length = 2647 rows\n"
      ]
     },
Drew Leonard's avatar
Drew Leonard committed
264
     "execution_count": 5,
265 266 267 268 269 270
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
271 272 273 274
   ]
  },
  {
   "cell_type": "markdown",
275
   "id": "77b479da",
276 277
   "metadata": {},
   "source": [
278
    "Searches can be made arbitrarily complex by including many different attributes, and also by using the `|` (OR) operator. So for example we can search for data from either of two different instruments:"
279 280 281 282
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
283
   "execution_count": 6,
284
   "id": "d4370288",
285
   "metadata": {},
286 287 288 289 290 291 292 293 294 295
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/scratch/anaconda3/envs/sdc-api/lib/python3.10/site-packages/astropy/table/table.py:3409: FutureWarning: elementwise == comparison failed and returning scalar instead; this will raise an error or perform elementwise comparison in the future.\n",
      "  result = self.as_array() == other\n"
     ]
    }
   ],
296
   "source": [
297
    "result = Fido.search(a.Time('2012/3/4', '2012/3/4 02:00'), a.Instrument.lyra | a.Instrument.rhessi)"
298 299 300
   ]
  },
  {
301
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
302
   "execution_count": 7,
303
   "id": "ce8fc72c",
304
   "metadata": {},
305 306 307 308 309
   "outputs": [
    {
     "data": {
      "text/html": [
       "Results from 3 Providers:</br></br>2 Results from the LYRAClient:</br><div><i>QueryResponse length=2</i>\n",
Drew Leonard's avatar
Drew Leonard committed
310
       "<table id=\"table140442959932592\" class=\"table-striped table-bordered table-condensed\">\n",
311 312 313 314 315
       "<thead><tr><th>Start Time</th><th>End Time</th><th>Instrument</th><th>Physobs</th><th>Source</th><th>Provider</th><th>Level</th></tr></thead>\n",
       "<thead><tr><th>object</th><th>object</th><th>str4</th><th>str10</th><th>str6</th><th>str3</th><th>int64</th></tr></thead>\n",
       "<tr><td>2012-03-04 00:00:00.000</td><td>2012-03-04 23:59:59.999</td><td>LYRA</td><td>irradiance</td><td>PROBA2</td><td>ESA</td><td>2</td></tr>\n",
       "<tr><td>2012-03-04 00:00:00.000</td><td>2012-03-04 23:59:59.999</td><td>LYRA</td><td>irradiance</td><td>PROBA2</td><td>ESA</td><td>3</td></tr>\n",
       "</table></div></br>1 Results from the RHESSIClient:</br><div><i>QueryResponse length=1</i>\n",
Drew Leonard's avatar
Drew Leonard committed
316
       "<table id=\"table140442959930576\" class=\"table-striped table-bordered table-condensed\">\n",
317 318 319 320
       "<thead><tr><th>Start Time</th><th>End Time</th><th>Instrument</th><th>Physobs</th><th>Source</th><th>Provider</th></tr></thead>\n",
       "<thead><tr><th>object</th><th>object</th><th>str6</th><th>str18</th><th>str6</th><th>str4</th></tr></thead>\n",
       "<tr><td>2012-03-04 00:00:00.000</td><td>2012-03-04 23:59:59.999</td><td>RHESSI</td><td>summary_lightcurve</td><td>RHESSI</td><td>NASA</td></tr>\n",
       "</table></div></br>3 Results from the VSOClient:</br><div><i>VSOQueryResponseTable length=3</i>\n",
Drew Leonard's avatar
Drew Leonard committed
321
       "<table id=\"table140442959936624\" class=\"table-striped table-bordered table-condensed\">\n",
322 323 324 325 326 327 328 329 330
       "<thead><tr><th>Start Time</th><th>End Time</th><th>Source</th><th>Instrument</th><th>Wavelength [2]</th><th>Provider</th><th>Physobs</th><th>Extent Type</th><th>Size</th><th>Info</th></tr></thead>\n",
       "<thead><tr><th></th><th></th><th></th><th></th><th>keV</th><th></th><th></th><th></th><th>Mibyte</th><th></th></tr></thead>\n",
       "<thead><tr><th>object</th><th>object</th><th>str6</th><th>str6</th><th>float64</th><th>str4</th><th>str9</th><th>str11</th><th>float64</th><th>str14</th></tr></thead>\n",
       "<tr><td>2012-03-03 22:57:40.000</td><td>2012-03-04 00:33:20.000</td><td>RHESSI</td><td>RHESSI</td><td>3.0 .. 17000.0</td><td>LSSP</td><td>intensity</td><td>PARTIAL_SUN</td><td>-0.00098</td><td>RHESSI level-0</td></tr>\n",
       "<tr><td>2012-03-04 00:33:20.000</td><td>2012-03-04 01:45:40.000</td><td>RHESSI</td><td>RHESSI</td><td>3.0 .. 17000.0</td><td>LSSP</td><td>intensity</td><td>PARTIAL_SUN</td><td>-0.00098</td><td>RHESSI level-0</td></tr>\n",
       "<tr><td>2012-03-04 01:45:40.000</td><td>2012-03-04 02:09:00.000</td><td>RHESSI</td><td>RHESSI</td><td>3.0 .. 17000.0</td><td>LSSP</td><td>intensity</td><td>PARTIAL_SUN</td><td>-0.00098</td><td>RHESSI level-0</td></tr>\n",
       "</table></div></br>"
      ],
      "text/plain": [
Drew Leonard's avatar
Drew Leonard committed
331
       "<sunpy.net.fido_factory.UnifiedResponse object at 0x7fbb6cbce860>\n",
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
       "Results from 3 Providers:\n",
       "\n",
       "2 Results from the LYRAClient:\n",
       "       Start Time               End Time        Instrument  Physobs   Source Provider Level\n",
       "----------------------- ----------------------- ---------- ---------- ------ -------- -----\n",
       "2012-03-04 00:00:00.000 2012-03-04 23:59:59.999       LYRA irradiance PROBA2      ESA     2\n",
       "2012-03-04 00:00:00.000 2012-03-04 23:59:59.999       LYRA irradiance PROBA2      ESA     3\n",
       "\n",
       "1 Results from the RHESSIClient:\n",
       "       Start Time               End Time        Instrument      Physobs       Source Provider\n",
       "----------------------- ----------------------- ---------- ------------------ ------ --------\n",
       "2012-03-04 00:00:00.000 2012-03-04 23:59:59.999     RHESSI summary_lightcurve RHESSI     NASA\n",
       "\n",
       "3 Results from the VSOClient:\n",
       "       Start Time               End Time        Source Instrument Wavelength [2] Provider  Physobs  Extent Type   Size        Info     \n",
       "                                                                       keV                                       Mibyte                \n",
       "----------------------- ----------------------- ------ ---------- -------------- -------- --------- ----------- -------- --------------\n",
       "2012-03-03 22:57:40.000 2012-03-04 00:33:20.000 RHESSI     RHESSI 3.0 .. 17000.0     LSSP intensity PARTIAL_SUN -0.00098 RHESSI level-0\n",
       "2012-03-04 00:33:20.000 2012-03-04 01:45:40.000 RHESSI     RHESSI 3.0 .. 17000.0     LSSP intensity PARTIAL_SUN -0.00098 RHESSI level-0\n",
       "2012-03-04 01:45:40.000 2012-03-04 02:09:00.000 RHESSI     RHESSI 3.0 .. 17000.0     LSSP intensity PARTIAL_SUN -0.00098 RHESSI level-0\n"
      ]
     },
Drew Leonard's avatar
Drew Leonard committed
354
     "execution_count": 7,
355 356 357 358
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
359
   "source": [
360
    "result"
361 362 363 364
   ]
  },
  {
   "cell_type": "markdown",
365
   "id": "c2879af0",
366 367
   "metadata": {},
   "source": [
368
    "Notice here that this search has returned results from several different data providers. These can be indexed either numerically or with the name of the provider, and each one can be further indexed individually."
369 370 371 372
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
373
   "execution_count": 8,
374 375
   "id": "969408c7",
   "metadata": {},
376 377 378 379
   "outputs": [
    {
     "data": {
      "text/html": [
380
       "<div><i>VSOQueryResponseTable length=3</i>\n",
Drew Leonard's avatar
Drew Leonard committed
381
       "<table id=\"table140442959928320\" class=\"table-striped table-bordered table-condensed\">\n",
382 383 384 385 386 387 388
       "<thead><tr><th>Start Time</th><th>End Time</th><th>Source</th><th>Instrument</th><th>Wavelength [2]</th><th>Provider</th><th>Physobs</th><th>Extent Type</th><th>Size</th><th>Info</th></tr></thead>\n",
       "<thead><tr><th></th><th></th><th></th><th></th><th>keV</th><th></th><th></th><th></th><th>Mibyte</th><th></th></tr></thead>\n",
       "<thead><tr><th>object</th><th>object</th><th>str6</th><th>str6</th><th>float64</th><th>str4</th><th>str9</th><th>str11</th><th>float64</th><th>str14</th></tr></thead>\n",
       "<tr><td>2012-03-03 22:57:40.000</td><td>2012-03-04 00:33:20.000</td><td>RHESSI</td><td>RHESSI</td><td>3.0 .. 17000.0</td><td>LSSP</td><td>intensity</td><td>PARTIAL_SUN</td><td>-0.00098</td><td>RHESSI level-0</td></tr>\n",
       "<tr><td>2012-03-04 00:33:20.000</td><td>2012-03-04 01:45:40.000</td><td>RHESSI</td><td>RHESSI</td><td>3.0 .. 17000.0</td><td>LSSP</td><td>intensity</td><td>PARTIAL_SUN</td><td>-0.00098</td><td>RHESSI level-0</td></tr>\n",
       "<tr><td>2012-03-04 01:45:40.000</td><td>2012-03-04 02:09:00.000</td><td>RHESSI</td><td>RHESSI</td><td>3.0 .. 17000.0</td><td>LSSP</td><td>intensity</td><td>PARTIAL_SUN</td><td>-0.00098</td><td>RHESSI level-0</td></tr>\n",
       "</table></div>"
389 390
      ],
      "text/plain": [
Drew Leonard's avatar
Drew Leonard committed
391
       "<sunpy.net.vso.table_response.VSOQueryResponseTable object at 0x7fbb6cbcf940>\n",
392 393 394 395 396 397
       "       Start Time               End Time        Source Instrument Wavelength [2] Provider  Physobs  Extent Type   Size        Info     \n",
       "                                                                       keV                                       Mibyte                \n",
       "----------------------- ----------------------- ------ ---------- -------------- -------- --------- ----------- -------- --------------\n",
       "2012-03-03 22:57:40.000 2012-03-04 00:33:20.000 RHESSI     RHESSI 3.0 .. 17000.0     LSSP intensity PARTIAL_SUN -0.00098 RHESSI level-0\n",
       "2012-03-04 00:33:20.000 2012-03-04 01:45:40.000 RHESSI     RHESSI 3.0 .. 17000.0     LSSP intensity PARTIAL_SUN -0.00098 RHESSI level-0\n",
       "2012-03-04 01:45:40.000 2012-03-04 02:09:00.000 RHESSI     RHESSI 3.0 .. 17000.0     LSSP intensity PARTIAL_SUN -0.00098 RHESSI level-0"
398 399
      ]
     },
Drew Leonard's avatar
Drew Leonard committed
400
     "execution_count": 8,
401 402 403 404 405
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
406 407 408 409 410
    "result[2]"
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
411
   "execution_count": 9,
412 413 414 415 416 417 418
   "id": "22243e9c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><i>VSOQueryResponseTable length=2</i>\n",
Drew Leonard's avatar
Drew Leonard committed
419
       "<table id=\"table140442959936432\" class=\"table-striped table-bordered table-condensed\">\n",
420 421 422 423 424 425 426 427
       "<thead><tr><th>Start Time</th><th>End Time</th><th>Source</th><th>Instrument</th><th>Wavelength [2]</th><th>Provider</th><th>Physobs</th><th>Extent Type</th><th>Size</th><th>Info</th></tr></thead>\n",
       "<thead><tr><th></th><th></th><th></th><th></th><th>keV</th><th></th><th></th><th></th><th>Mibyte</th><th></th></tr></thead>\n",
       "<thead><tr><th>object</th><th>object</th><th>str6</th><th>str6</th><th>float64</th><th>str4</th><th>str9</th><th>str11</th><th>float64</th><th>str14</th></tr></thead>\n",
       "<tr><td>2012-03-04 00:33:20.000</td><td>2012-03-04 01:45:40.000</td><td>RHESSI</td><td>RHESSI</td><td>3.0 .. 17000.0</td><td>LSSP</td><td>intensity</td><td>PARTIAL_SUN</td><td>-0.00098</td><td>RHESSI level-0</td></tr>\n",
       "<tr><td>2012-03-04 01:45:40.000</td><td>2012-03-04 02:09:00.000</td><td>RHESSI</td><td>RHESSI</td><td>3.0 .. 17000.0</td><td>LSSP</td><td>intensity</td><td>PARTIAL_SUN</td><td>-0.00098</td><td>RHESSI level-0</td></tr>\n",
       "</table></div>"
      ],
      "text/plain": [
Drew Leonard's avatar
Drew Leonard committed
428
       "<sunpy.net.vso.table_response.VSOQueryResponseTable object at 0x7fbb6cbcd060>\n",
429 430 431 432 433 434 435
       "       Start Time               End Time        Source Instrument Wavelength [2] Provider  Physobs  Extent Type   Size        Info     \n",
       "                                                                       keV                                       Mibyte                \n",
       "----------------------- ----------------------- ------ ---------- -------------- -------- --------- ----------- -------- --------------\n",
       "2012-03-04 00:33:20.000 2012-03-04 01:45:40.000 RHESSI     RHESSI 3.0 .. 17000.0     LSSP intensity PARTIAL_SUN -0.00098 RHESSI level-0\n",
       "2012-03-04 01:45:40.000 2012-03-04 02:09:00.000 RHESSI     RHESSI 3.0 .. 17000.0     LSSP intensity PARTIAL_SUN -0.00098 RHESSI level-0"
      ]
     },
Drew Leonard's avatar
Drew Leonard committed
436
     "execution_count": 9,
437 438 439 440 441
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
Drew Leonard's avatar
Drew Leonard committed
442
    "result['vso'][1:] # or result[2, 1:]"
443 444 445 446 447 448 449 450 451 452 453 454
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cf2b71e8",
   "metadata": {},
   "source": [
    "Once we've selected which files we want, these can then be downloaded using `Fido.fetch()`, which takes as an argument a results table of the kind returned by `search()`."
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
455
   "execution_count": 10,
456 457 458 459 460 461
   "id": "660b7a14",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Drew Leonard's avatar
Drew Leonard committed
462
       "model_id": "e61982869b764f6ebd631f44c307aa74",
463 464 465 466 467 468 469 470 471 472 473 474 475
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Files Downloaded:   0%|          | 0/6 [00:00<?, ?file/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "files = Fido.fetch(result)"
476 477 478 479
   ]
  },
  {
   "cell_type": "markdown",
480
   "id": "ac97ffca",
481 482
   "metadata": {},
   "source": [
483 484 485 486 487 488 489 490 491
    "`fetch()` downloads these results to the location specified in the SunPy configuration (by default `/home/<user>/sunpy/data`) and returns a list of the names of the downloaded files. Here we've passed the whole search result to download all of the files, but we could also have sliced it as we did above, to download only certain files."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ef8b9058",
   "metadata": {},
   "source": [
    "If you run the command above more than once, you will notice that it is much faster the second time. This is because internally `Fido` checks whether or not the files already exist. If they do, it skips the download and just returns the filename."
492 493 494 495
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
496
   "execution_count": 11,
497 498 499 500 501 502
   "id": "625a362b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
Drew Leonard's avatar
Drew Leonard committed
503 504
       "<parfive.results.Results object at 0x7fbb6c8d3400>\n",
       "['/home/ajl/sunpy/data/lyra_20120304-000000_lev2_std.fits', '/home/ajl/sunpy/data/hsi_20120304_014540_003.fits', '/home/ajl/sunpy/data/lyra_20120304-000000_lev3_std.fits', '/home/ajl/sunpy/data/hsi_20120304_003320_003.fits', '/home/ajl/sunpy/data/hsi_obssumm_20120304_058.fits', '/home/ajl/sunpy/data/hsi_20120303_225740_001.fits']"
505 506
      ]
     },
Drew Leonard's avatar
Drew Leonard committed
507
     "execution_count": 11,
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "files"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c954de0f",
   "metadata": {},
   "source": [
    "## KIS Data interface"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ebda782d",
   "metadata": {},
   "source": [
    "The custom client is required to provide access to the SDC servers. The client is automatically registered with Fido when it is imported, allowing the user to interact with the existing SunPy interfaces rather than directly with the custom client."
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
534
   "execution_count": 12,
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551
   "id": "9473ffc3",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sdc.client import KISClient"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c188f347",
   "metadata": {},
   "source": [
    "Querying SDC data is then done in the same way as any other Fido query, as described above, e.g.:"
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
552
   "execution_count": 13,
553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569
   "id": "27d5dbb3",
   "metadata": {},
   "outputs": [],
   "source": [
    "result = Fido.search(a.Instrument(\"GRIS\"), a.Time(\"2014/04/26\", \"2014/04/27\"), a.Level(1))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4674bb90",
   "metadata": {},
   "source": [
    "**Note:** it is currently necessary to specify the processing level of the data you want - in this case level one. This is expected to change at a later date so that level one is the default, but it will still be possible to specify other levels."
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
570
   "execution_count": 14,
571
   "id": "094db511",
572 573 574 575 576 577 578
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
579
       "Results from 1 Provider:</br></br>105 Results from the KISClient:</br><div><i>QueryResponseTable length=105</i>\n",
Drew Leonard's avatar
Drew Leonard committed
580
       "<table id=\"table140442962381600\" class=\"table-striped table-bordered table-condensed\">\n",
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616
       "<thead><tr><th>_id</th><th>upload_date_utc</th><th>links</th><th>test</th><th>tags</th><th>ATMOS_R0_MAX</th><th>ATMOS_R0_MIN</th><th>BTYPE</th><th>CALIB_LEVEL</th><th>DATAPRODUCT_TYPE</th><th>DATE_BEG</th><th>DATE_END</th><th>EM_RES_POWER</th><th>EM_XEL</th><th>EXPTIME</th><th>FILTER</th><th>HPLN_TAN_MAX</th><th>HPLN_TAN_MIN</th><th>HPLT_TAN_MAX</th><th>HPLT_TAN_MIN</th><th>INSTRUMENT</th><th>MU</th><th>N_DIMENSIONS</th><th>OBS_COLLECTION</th><th>OBS_MODE</th><th>OBS_NAME</th><th>POL_STATES</th><th>POL_XEL</th><th>SCAN_STEP_SIZE</th><th>S_RESOLUTION</th><th>S_XEL1</th><th>S_XEL2</th><th>TARGET</th><th>TELESCOPE</th><th>THETA</th><th>T_RESOLUTION</th><th>T_XEL</th><th>WAVELENGTH_MAX</th><th>WAVELENGTH_MIN</th><th>data_type</th></tr></thead>\n",
       "<thead><tr><th></th><th></th><th></th><th></th><th></th><th>cm</th><th>cm</th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th>s</th><th></th><th>arcsec</th><th>arcsec</th><th>arcsec</th><th>arcsec</th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th>arcsec</th><th></th><th></th><th></th><th></th><th>deg</th><th>deg</th><th></th><th>nm</th><th>nm</th><th></th></tr></thead>\n",
       "<thead><tr><th>object</th><th>object</th><th>object</th><th>str16</th><th>object</th><th>float64</th><th>float64</th><th>str10</th><th>float64</th><th>str4</th><th>object</th><th>object</th><th>int64</th><th>int64</th><th>float64</th><th>str7</th><th>float64</th><th>float64</th><th>float64</th><th>float64</th><th>str4</th><th>float64</th><th>int64</th><th>str17</th><th>str14</th><th>str17</th><th>str4</th><th>int64</th><th>float64</th><th>float64</th><th>int64</th><th>int64</th><th>str10</th><th>str6</th><th>float64</th><th>float64</th><th>int64</th><th>float64</th><th>float64</th><th>str7</th></tr></thead>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e74f22a63bc6fb138d84&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e6e922a63bc6fb138d08&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e64922a63bc6fb138c6d&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31ed4822a63bc6fb139164&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31edc122a63bc6fb1391ff&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31edaa22a63bc6fb1391c1&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e06922a63bc6fb138621&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31ec8422a63bc6fb139107&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e25a22a63bc6fb138928&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31eca722a63bc6fb139126&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31eec822a63bc6fb13925c&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e12b22a63bc6fb1387d3&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e05722a63bc6fb1385e3&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e9a622a63bc6fb138f17&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e32322a63bc6fb138a20&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e80e22a63bc6fb138e1f&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31ed9f22a63bc6fb1391a2&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e67522a63bc6fb138cab&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e17322a63bc6fb138830&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31eb8c22a63bc6fb13908b&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e6dc22a63bc6fb138ce9&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e7dd22a63bc6fb138e00&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e15b22a63bc6fb138811&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e37622a63bc6fb138a7d&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e5fc22a63bc6fb138c4e&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e2a622a63bc6fb138966&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e23a22a63bc6fb1388ea&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e9e922a63bc6fb138f55&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31ed7022a63bc6fb139183&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e35222a63bc6fb138a3f&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e54522a63bc6fb138bd2&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
       "<tr><td>{&apos;$oid&apos;: &apos;5ee0feb97a92554c6de920ab&apos;}</td><td>{&apos;$date&apos;: 1618566414615}</td><td>{&apos;$oid&apos;: &apos;5d31e36522a63bc6fb138a5e&apos;}</td><td>$upload_date_utc</td><td>{&apos;embargo_until&apos;: {&apos;$date&apos;: 1760629194829}}</td><td>0.0</td><td>0.0</td><td>phot.count</td><td>1.0</td><td>cube</td><td>1398505619.0</td><td>1398506021.3</td><td>392201</td><td>1010</td><td>60.0</td><td>1.565um</td><td>147.33436578512737</td><td>87.4269799623221</td><td>-279.95023082706894</td><td>-329.36508718479445</td><td>gris</td><td>0.9400576214085846</td><td>4</td><td>gris_observations</td><td>single map pol</td><td>gris_20140426_000</td><td>IQUV</td><td>4</td><td>0.135</td><td>-0.13655</td><td>105</td><td>471</td><td>Sunspot(s)</td><td>GREGOR</td><td>19.938764575320242</td><td>402.0</td><td>1</td><td>1568.0461</td><td>1564.0199</td><td>l1_data</td></tr>\n",
617
       "</table></div></br>"
618 619
      ],
      "text/plain": [
Drew Leonard's avatar
Drew Leonard committed
620
       "<sunpy.net.fido_factory.UnifiedResponse object at 0x7fbb6c7fe2c0>\n",
621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661
       "Results from 1 Provider:\n",
       "\n",
       "105 Results from the KISClient:\n",
       "                _id                      upload_date_utc                     links                       test       ... T_XEL WAVELENGTH_MAX WAVELENGTH_MIN data_type\n",
       "                                                                                                                    ...             nm             nm                \n",
       "------------------------------------ ------------------------ ------------------------------------ ---------------- ... ----- -------------- -------------- ---------\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e74f22a63bc6fb138d84'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e6e922a63bc6fb138d08'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e64922a63bc6fb138c6d'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31ed4822a63bc6fb139164'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31edc122a63bc6fb1391ff'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31edaa22a63bc6fb1391c1'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e06922a63bc6fb138621'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31ec8422a63bc6fb139107'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e25a22a63bc6fb138928'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31eca722a63bc6fb139126'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31eec822a63bc6fb13925c'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e12b22a63bc6fb1387d3'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e05722a63bc6fb1385e3'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e9a622a63bc6fb138f17'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e32322a63bc6fb138a20'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e80e22a63bc6fb138e1f'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "                                 ...                      ...                                  ...              ... ...   ...            ...            ...       ...\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e4bd22a63bc6fb138b94'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31ed9f22a63bc6fb1391a2'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e67522a63bc6fb138cab'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e17322a63bc6fb138830'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31eb8c22a63bc6fb13908b'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e6dc22a63bc6fb138ce9'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e7dd22a63bc6fb138e00'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e15b22a63bc6fb138811'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e37622a63bc6fb138a7d'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e5fc22a63bc6fb138c4e'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e2a622a63bc6fb138966'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e23a22a63bc6fb1388ea'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e9e922a63bc6fb138f55'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31ed7022a63bc6fb139183'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e35222a63bc6fb138a3f'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e54522a63bc6fb138bd2'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "{'$oid': '5ee0feb97a92554c6de920ab'} {'$date': 1618566414615} {'$oid': '5d31e36522a63bc6fb138a5e'} $upload_date_utc ...     1      1568.0461      1564.0199   l1_data\n",
       "Length = 105 rows\n"
662 663
      ]
     },
Drew Leonard's avatar
Drew Leonard committed
664
     "execution_count": 14,
665 666 667 668 669
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
670
    "result"
671 672 673 674 675 676 677
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e1705703",
   "metadata": {},
   "source": [
678
    "As we saw earlier, we can download these files using `Fido.fetch()`. In this case, due to how the `KISClient` and the Data Centre are set up, it possible to download either the actual fits files containing the data, or json files containing the observation records. To download the data it is necessary to specify the keyword `binary=True`."
679 680 681 682
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
683
   "execution_count": 15,
684 685 686 687 688 689 690 691
   "id": "9f0b89b1",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Drew Leonard's avatar
Drew Leonard committed
692
       "model_id": "ea2dd84fef9b48e498e63491234134eb",
693 694 695 696 697 698 699 700 701 702 703 704
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Files Downloaded:   0%|          | 0/105 [00:00<?, ?file/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
705
    "files = Fido.fetch(result, binary=True)"
706 707 708 709
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
710
   "execution_count": 16,
711 712 713 714 715 716 717 718
   "id": "0a36c1a6",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
Drew Leonard's avatar
Drew Leonard committed
719 720
       "<parfive.results.Results object at 0x7fbb6ce247c0>\n",
       "['/home/ajl/sunpy/data/gris_20140426_000/5d31e32322a63bc6fb138a20.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31eded22a63bc6fb13921e.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31ebe522a63bc6fb1390aa.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e3d722a63bc6fb138ada.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e4b422a63bc6fb138b75.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e25a22a63bc6fb138928.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31eb2822a63bc6fb13902e.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e37622a63bc6fb138a7d.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31ec2622a63bc6fb1390c9.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31eb1b22a63bc6fb13900f.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31eca722a63bc6fb139126.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e43022a63bc6fb138b18.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31ed9f22a63bc6fb1391a2.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31eb1122a63bc6fb138ff0.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e06f22a63bc6fb13865f.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e05722a63bc6fb1385e3.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e75d22a63bc6fb138da3.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e67522a63bc6fb138cab.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31ee2c22a63bc6fb13923d.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31eacd22a63bc6fb138fd1.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e9a622a63bc6fb138f17.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e2ae22a63bc6fb138985.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31eb8c22a63bc6fb13908b.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e41622a63bc6fb138af9.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e45b22a63bc6fb138b37.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e0fa22a63bc6fb138795.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e09422a63bc6fb1386db.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e15b22a63bc6fb138811.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e07822a63bc6fb13867e.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e64922a63bc6fb138c6d.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31eb7d22a63bc6fb13906c.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e80e22a63bc6fb138e1f.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e13b22a63bc6fb1387f2.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e6dc22a63bc6fb138ce9.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e87b22a63bc6fb138e5d.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e92b22a63bc6fb138ed9.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e59d22a63bc6fb138c2f.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31eb3b22a63bc6fb13904d.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e23a22a63bc6fb1388ea.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e1bd22a63bc6fb13886e.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e89222a63bc6fb138e7c.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e1fb22a63bc6fb1388ac.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e57922a63bc6fb138bf1.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e7dd22a63bc6fb138e00.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e24822a63bc6fb138909.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e20e22a63bc6fb1388cb.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31ea8a22a63bc6fb138fb2.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e4f722a63bc6fb138bb3.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e9e922a63bc6fb138f55.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e39222a63bc6fb138a9c.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e12b22a63bc6fb1387d3.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e1c822a63bc6fb13888d.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e74722a63bc6fb138d65.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e58f22a63bc6fb138c10.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e5fc22a63bc6fb138c4e.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31ea7222a63bc6fb138f93.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31ed4822a63bc6fb139164.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e2c322a63bc6fb1389a4.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e28b22a63bc6fb138947.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e2d622a63bc6fb1389c3.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e2a622a63bc6fb138966.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e05222a63bc6fb1385c4.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31edc122a63bc6fb1391ff.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e9de22a63bc6fb138f36.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e0c022a63bc6fb138738.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e6c522a63bc6fb138cca.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e35222a63bc6fb138a3f.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e3a722a63bc6fb138abb.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e74f22a63bc6fb138d84.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e09922a63bc6fb1386fa.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e08622a63bc6fb13869d.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e05e22a63bc6fb138602.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31ed7022a63bc6fb139183.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e7b522a63bc6fb138de1.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e6e922a63bc6fb138d08.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e6f122a63bc6fb138d27.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e46f22a63bc6fb138b56.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e10622a63bc6fb1387b4.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e73322a63bc6fb138d46.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31ec8422a63bc6fb139107.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e17322a63bc6fb138830.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e0d022a63bc6fb138757.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e0e622a63bc6fb138776.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31ed3422a63bc6fb139145.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31edaa22a63bc6fb1391c1.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e66322a63bc6fb138c8c.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e30b22a63bc6fb138a01.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e0b022a63bc6fb138719.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e54522a63bc6fb138bd2.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e08e22a63bc6fb1386bc.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31eec822a63bc6fb13925c.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e06b22a63bc6fb138640.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e2e122a63bc6fb1389e2.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e76a22a63bc6fb138dc2.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e36522a63bc6fb138a5e.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e91022a63bc6fb138eba.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e06922a63bc6fb138621.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e85e22a63bc6fb138e3e.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e18422a63bc6fb13884f.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31ea2522a63bc6fb138f74.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e8d322a63bc6fb138e9b.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31ec6c22a63bc6fb1390e8.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e4bd22a63bc6fb138b94.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31e97222a63bc6fb138ef8.fits', '/home/ajl/sunpy/data/gris_20140426_000/5d31edb822a63bc6fb1391e0.fits']"
721 722
      ]
     },
Drew Leonard's avatar
Drew Leonard committed
723
     "execution_count": 16,
724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "files"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e886ca4e",
   "metadata": {},
   "source": [
    "## Interacting with the data"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e2602112",
   "metadata": {},
   "source": [
745 746 747 748 749 750 751 752 753 754 755
    "These files can now be loaded and interacted with in a variety of ways. The most basic would be to use `astropy.io.fits` to open files individually. This would return a HDU (Header-Data Unit) for each file, containing the metadata and the data array. However, for a large number of files this quickly becomes cumbersome. We might also slice the data into 2D images and plot them using SunPy's `Map` object, but again this would be unsuitable for most purposes with such a large dataset."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "99beb340",
   "metadata": {
    "scrolled": false
   },
   "source": [
    "To quickly inspect this many files, we are instead going to use `ndcube` to load and plot all of the data at once. `ndcube` is a package which provides tools for handling n-dimensional data cubes in a way which is coordinate-aware. The details of `ndcube` are outside the scope of this demo, but as with SunPy, the interested reader can find [help](https://openastronomy.element.io/#/room/#ndcube:openastronomy.org) and [documentation](https://docs.sunpy.org/projects/ndcube/en/stable/index.html) online."
756 757 758 759 760 761 762 763 764
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3add4f4d",
   "metadata": {
    "scrolled": false
   },
   "source": [
765
    "First, since the files are not necessarily ordered how we want them, we will have to sort them. We will inspect the headers of the files and sort them by the `\"ISTEP\"` keyword, which provides the slit position ID, and we will store the headers in the corresponding order:"
766 767 768 769
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
770
   "execution_count": 17,
771 772 773 774 775 776
   "id": "70cf0e9c",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
777 778
    "from astropy.io import fits\n",
    "\n",
779 780 781 782 783 784 785 786 787 788 789 790 791 792
    "sortedfiles = sorted(files, key=lambda f: fits.getheader(f)[\"ISTEP\"])\n",
    "headers = [fits.getheader(f) for f in sortedfiles]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "32c8bef8",
   "metadata": {},
   "source": [
    "Now, in order to construct the `ndcube` object we need the WCS (World Coordinate System) information from the file headers, which describes how the pixel grid of the images corresponds to physical coordinates."
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
793
   "execution_count": 18,
794 795 796 797 798 799 800 801 802
   "id": "3d6d7eec",
   "metadata": {},
   "outputs": [],
   "source": [
    "from astropy.wcs import WCS"
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
803
   "execution_count": 19,
804 805 806 807 808 809 810
   "id": "38f985ce",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
Drew Leonard's avatar
Drew Leonard committed
811 812
      "WARNING: FITSFixedWarning: 'datfix' made the change 'Set MJD-OBS to 56773.409236 from DATE-OBS.\n",
      "Set MJD-BEG to 56773.409236 from DATE-BEG'. [astropy.wcs.wcs]\n",
813 814 815 816 817 818 819 820 821 822 823 824
      "WARNING: FITSFixedWarning: 'obsfix' made the change 'Set OBSGEO-L to   -16.510724 from OBSGEO-[XYZ].\n",
      "Set OBSGEO-B to    28.301797 from OBSGEO-[XYZ].\n",
      "Set OBSGEO-H to     2386.995 from OBSGEO-[XYZ]'. [astropy.wcs.wcs]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "WCS Keywords\n",
       "\n",
       "Number of WCS axes: 4\n",
       "CTYPE : 'HPLN-TAN'  'HPLT-TAN'  'WAVE'  'STOKES'  \n",
Drew Leonard's avatar
Drew Leonard committed
825
       "CRVAL : 0.02497888888888889  -0.08943277777777779  1.5640199000000002e-06  1.0  \n",
826 827 828 829 830 831 832 833 834
       "CRPIX : 0.0  0.0  0.0  0.0  \n",
       "PC1_1 PC1_2 PC1_3 PC1_4  : -0.594823  -0.803857  0.0  0.0  \n",
       "PC2_1 PC2_2 PC2_3 PC2_4  : 0.803857  -0.594823  0.0  0.0  \n",
       "PC3_1 PC3_2 PC3_3 PC3_4  : 0.0  0.0  1.0  0.0  \n",
       "PC4_1 PC4_2 PC4_3 PC4_4  : 0.0  0.0  0.0  1.0  \n",
       "CDELT : -3.793055555555556e-05  -3.793055555555556e-05  3.9903e-12  1.0  \n",
       "NAXIS : 1  471  1010  4"
      ]
     },
Drew Leonard's avatar
Drew Leonard committed
835
     "execution_count": 19,
836 837 838 839 840 841 842 843 844 845 846 847 848 849 850
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "with fits.open(files[0]) as hdul:\n",
    "    wcs0 = WCS(hdul[0]) # extract WCS info from PrimaryHDU of first fits file\n",
    "wcs0"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6fd5ed52",
   "metadata": {},
   "source": [
851
    "So we can see from this that the data have two spatial dimensions, a wavelength axis and a Stokes axis."
852 853 854 855 856 857 858
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0edaaee5",
   "metadata": {},
   "source": [
859 860 861 862 863
    "In principle, in a set of files which constitute a single observation, the WCS headers should be constructed such that they all describe the same coordinate system - therefore the WCS keywords from any one of the files should enable us to construct a correct WCS object. That being the case, we will use only the WCS from the first file."
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
864
   "execution_count": 20,
865 866 867 868 869 870 871 872 873 874
   "id": "023e67fc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "WCS Keywords\n",
       "\n",
       "Number of WCS axes: 4\n",
       "CTYPE : 'HPLN-TAN'  'HPLT-TAN'  'WAVE'  'STOKES'  \n",
Drew Leonard's avatar
Drew Leonard committed
875
       "CRVAL : 0.02497888888888889  -0.08943277777777779  1.5640199000000002e-06  1.0  \n",
876 877 878 879 880 881 882 883 884
       "CRPIX : 0.0  0.0  0.0  0.0  \n",
       "PC1_1 PC1_2 PC1_3 PC1_4  : -0.594823  -0.803857  0.0  0.0  \n",
       "PC2_1 PC2_2 PC2_3 PC2_4  : 0.803857  -0.594823  0.0  0.0  \n",
       "PC3_1 PC3_2 PC3_3 PC3_4  : 0.0  0.0  1.0  0.0  \n",
       "PC4_1 PC4_2 PC4_3 PC4_4  : 0.0  0.0  0.0  1.0  \n",
       "CDELT : -3.793055555555556e-05  -3.793055555555556e-05  3.9903e-12  1.0  \n",
       "NAXIS : 1  471  1010  4"
      ]
     },
Drew Leonard's avatar
Drew Leonard committed
885
     "execution_count": 20,
886 887 888 889 890 891
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "wcs0"
892 893 894 895 896 897 898
   ]
  },
  {
   "cell_type": "markdown",
   "id": "86872d9b",
   "metadata": {},
   "source": [
Drew Leonard's avatar
Drew Leonard committed
899 900 901
    "_**Note for the Data Centre:** the above may not be strictly true because of the way the headers are currently recorded. In the observation used in this example, the CRVAL keyword (the reference value) changes from one file to the next, whereas CRPIX (the reference pixel) stays the same. This arrangement probably introduces a small inaccuracy when dealing with the WCS headers, because it means that the centre of the coordinate system moves during the observation. It would be more technically correct to keep the reference value constant across an observation, while changing the reference pixel - for most files this would mean the reference pixel being outside the grid of the image stored in the file._\n",
    "\n",
    "_The extent to which this is a problem may depend on how the instrument works, but it is something the Data Centre should consider._"
902 903 904 905 906 907 908 909 910 911 912 913
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2381b621",
   "metadata": {},
   "source": [
    "**Important workaround:** There is currently a bug in astropy which means that one of the WCS keywords is not processed properly for this data. This will be fixed in the future but for now it is necessary to use this workaround in order to avoid errors:"
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
914
   "execution_count": 21,
915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931
   "id": "1afbe770",
   "metadata": {},
   "outputs": [],
   "source": [
    "wcs0.wcs.specsys = 'TOPOCENT'"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "efbbb6f9",
   "metadata": {},
   "source": [
    "Next let's inspect a single file before we combine them. To do this we will load the data from the first file, and pass that and the WCS object to `ndcube`."
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
932
   "execution_count": 22,
933 934 935 936 937 938 939 940 941
   "id": "d2d7f473",
   "metadata": {},
   "outputs": [],
   "source": [
    "import ndcube"
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
942
   "execution_count": 23,
943 944 945 946 947 948 949 950 951 952
   "id": "bc951967",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = fits.getdata(sortedfiles[0])\n",
    "ndc = ndcube.NDCube(data, wcs0)"
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
953
   "execution_count": 24,
954 955 956 957 958 959 960 961 962
   "id": "7ec8b264",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4, 1010, 471, 1)"
      ]
     },
Drew Leonard's avatar
Drew Leonard committed
963
     "execution_count": 24,
964 965 966 967 968 969 970 971 972 973
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.shape"
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
974
   "execution_count": 25,
975 976 977 978 979 980
   "id": "dfefc62a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
Drew Leonard's avatar
Drew Leonard committed
981
       "<ndcube.ndcube.NDCube object at 0x7fbb6dd22830>\n",
982 983 984 985 986 987 988 989
       "NDCube\n",
       "------\n",
       "Dimensions: [4.00e+00 1.01e+03 4.71e+02 1.00e+00] pix\n",
       "Physical Types of Axes: [('phys.polarization.stokes',), ('em.wl',), ('custom:pos.helioprojective.lon', 'custom:pos.helioprojective.lat'), ('custom:pos.helioprojective.lon', 'custom:pos.helioprojective.lat')]\n",
       "Unit: None\n",
       "Data Type: >i4"
      ]
     },
Drew Leonard's avatar
Drew Leonard committed
990
     "execution_count": 25,
991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ndc"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "61c6f63a",
   "metadata": {},
   "source": [
    "Now we can use NDCube's built-in plotting capabilities to display the data. We are also going to use some jupyter notebook magic to do so interactively here in the notebook."
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
1009
   "execution_count": 26,
1010 1011 1012 1013 1014 1015 1016 1017 1018 1019
   "id": "1497e36d",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "%matplotlib notebook"
   ]
  },
  {
   "cell_type": "code",
Drew Leonard's avatar
Drew Leonard committed
1020
   "execution_count": 27,
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660