diff --git a/docs/tutorials/Example_searches.ipynb b/docs/tutorials/Example_searches.ipynb index 8ebb2bf..5aa4900 100644 --- a/docs/tutorials/Example_searches.ipynb +++ b/docs/tutorials/Example_searches.ipynb @@ -7,7 +7,7 @@ "metadata": {}, "outputs": [], "source": [ - "from newlk_search import *" + "from tssc import *" ] }, { @@ -92,7 +92,7 @@ " TESS\n", " 120.0\n", " 0.0\n", - " 2021\n", + " 2022\n", " Light curves\n", " \n", " \n", @@ -102,7 +102,7 @@ " TESS\n", " 120.0\n", " 0.0\n", - " 2021\n", + " 2022\n", " Target pixel files\n", " \n", " \n", @@ -132,7 +132,7 @@ " TESS\n", " 120.0\n", " 0.0\n", - " 2022\n", + " 2024\n", " Light curves\n", " \n", " \n", @@ -202,11 +202,11 @@ ], "text/plain": [ "MASTSearch object containing 102 data products target_name pipeline mission exptime distance year \\\n", - "0 268159861 SPOC TESS 120.0 0.0 2021 \n", - "1 268159861 SPOC TESS 120.0 0.0 2021 \n", + "0 268159861 SPOC TESS 120.0 0.0 2022 \n", + "1 268159861 SPOC TESS 120.0 0.0 2022 \n", "2 268159861 SPOC TESS 120.0 0.0 2022 \n", "3 268159861 SPOC TESS 120.0 0.0 2022 \n", - "4 268159861 SPOC TESS 120.0 0.0 2022 \n", + "4 268159861 SPOC TESS 120.0 0.0 2024 \n", ".. ... ... ... ... ... ... \n", "97 kplr008120608 Kepler Kepler 1800.0 0.0 2012 \n", "98 kplr008120608 Kepler Kepler 1800.0 0.0 2012 \n", @@ -618,114 +618,15 @@ " Light curves\n", " \n", " \n", - " 5\n", - " 268159861\n", - " TESS-SPOC\n", - " HLSP\n", - " 41\n", - " 600.0\n", - " 0.0\n", - " 2021\n", - " FITS\n", - " \n", - " \n", - " 6\n", - " 268159861\n", - " TESS-SPOC\n", - " HLSP\n", - " 54\n", - " 600.0\n", - " 0.0\n", - " 2022\n", - " FITS\n", - " \n", - " \n", - " 7\n", - " 268159861\n", - " TESS-SPOC\n", - " HLSP\n", - " 55\n", - " 600.0\n", - " 0.0\n", - " 2022\n", - " FITS\n", - " \n", - " \n", - " 8\n", - " 268159861\n", - " CDIPS\n", - " HLSP\n", - " 14\n", - " 1800.0\n", - " 0.0\n", - " 2019\n", - " FITS\n", - " \n", - " \n", - " 9\n", - " 268159861\n", - " TASOC\n", - " HLSP\n", - " 14\n", - " 1800.0\n", - " 0.0\n", - " 2019\n", - " FITS\n", - " \n", - " \n", - " 10\n", - " 268159861\n", - " TASOC\n", - " HLSP\n", - " 14\n", - " 1800.0\n", - " 0.0\n", - " 2019\n", - " FITS\n", - " \n", - " \n", - " 11\n", - " 268159861\n", - " CDIPS\n", - " HLSP\n", - " 15\n", - " 1800.0\n", - " 0.0\n", - " 2019\n", - " FITS\n", - " \n", - " \n", - " 12\n", - " 268159861\n", - " TASOC\n", - " HLSP\n", - " 15\n", - " 1800.0\n", - " 0.0\n", - " 2019\n", - " FITS\n", - " \n", - " \n", - " 13\n", - " 268159861\n", - " TASOC\n", - " HLSP\n", - " 15\n", - " 1800.0\n", - " 0.0\n", - " 2019\n", - " FITS\n", - " \n", - " \n", - " 14\n", - " 268159861\n", - " CDIPS\n", - " HLSP\n", - " 41\n", - " 1800.0\n", - " 0.0\n", - " 2021\n", - " FITS\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", " \n", " \n", " 15\n", @@ -784,52 +685,24 @@ " \n", " \n", "\n", + "

20 rows × 8 columns

\n", "" ], "text/plain": [ - "TESSSearch object containing 20 data products target_name pipeline mission sector exptime distance year \\\n", - "0 268159861 SPOC TESS 41 120.0 0.0 2021 \n", - "1 268159861 SPOC TESS 54 120.0 0.0 2022 \n", - "2 268159861 SPOC TESS 55 120.0 0.0 2022 \n", - "3 268159861 SPOC TESS 74 120.0 0.0 2024 \n", - "4 268159861 SPOC TESS 75 120.0 0.0 2024 \n", - "5 268159861 TESS-SPOC HLSP 41 600.0 0.0 2021 \n", - "6 268159861 TESS-SPOC HLSP 54 600.0 0.0 2022 \n", - "7 268159861 TESS-SPOC HLSP 55 600.0 0.0 2022 \n", - "8 268159861 CDIPS HLSP 14 1800.0 0.0 2019 \n", - "9 268159861 TASOC HLSP 14 1800.0 0.0 2019 \n", - "10 268159861 TASOC HLSP 14 1800.0 0.0 2019 \n", - "11 268159861 CDIPS HLSP 15 1800.0 0.0 2019 \n", - "12 268159861 TASOC HLSP 15 1800.0 0.0 2019 \n", - "13 268159861 TASOC HLSP 15 1800.0 0.0 2019 \n", - "14 268159861 CDIPS HLSP 41 1800.0 0.0 2021 \n", - "15 268159861 QLP HLSP 41 600.0 0.0 2021 \n", - "16 268159861 CDIPS HLSP 54 1800.0 0.0 2022 \n", - "17 268159861 QLP HLSP 54 600.0 0.0 2022 \n", - "18 268159861 CDIPS HLSP 55 1800.0 0.0 2022 \n", - "19 268159861 QLP HLSP 55 600.0 0.0 2022 \n", + "TESSSearch object containing 20 data products target_name pipeline mission sector exptime distance year description\n", + "0 268159861 SPOC TESS 41 120.0 0.0 2021 Light curves\n", + "1 268159861 SPOC TESS 54 120.0 0.0 2022 Light curves\n", + "2 268159861 SPOC TESS 55 120.0 0.0 2022 Light curves\n", + "3 268159861 SPOC TESS 74 120.0 0.0 2024 Light curves\n", + "4 268159861 SPOC TESS 75 120.0 0.0 2024 Light curves\n", + ".. ... ... ... ... ... ... ... ...\n", + "15 268159861 QLP HLSP 41 600.0 0.0 2021 FITS\n", + "16 268159861 CDIPS HLSP 54 1800.0 0.0 2022 FITS\n", + "17 268159861 QLP HLSP 54 600.0 0.0 2022 FITS\n", + "18 268159861 CDIPS HLSP 55 1800.0 0.0 2022 FITS\n", + "19 268159861 QLP HLSP 55 600.0 0.0 2022 FITS\n", "\n", - " description \n", - "0 Light curves \n", - "1 Light curves \n", - "2 Light curves \n", - "3 Light curves \n", - "4 Light curves \n", - "5 FITS \n", - "6 FITS \n", - "7 FITS \n", - "8 FITS \n", - "9 FITS \n", - "10 FITS \n", - "11 FITS \n", - "12 FITS \n", - "13 FITS \n", - "14 FITS \n", - "15 FITS \n", - "16 FITS \n", - "17 FITS \n", - "18 FITS \n", - "19 FITS " + "[20 rows x 8 columns]" ] }, "execution_count": 5, @@ -937,81 +810,15 @@ " Target pixel files\n", " \n", " \n", - " 5\n", - " 268159861\n", - " TESS-SPOC\n", - " HLSP\n", - " 41\n", - " 600.0\n", - " 0.0\n", - " 2021\n", - " FITS\n", - " \n", - " \n", - " 6\n", - " 268159861\n", - " TESS-SPOC\n", - " HLSP\n", - " 54\n", - " 600.0\n", - " 0.0\n", - " 2022\n", - " FITS\n", - " \n", - " \n", - " 7\n", - " 268159861\n", - " TESS-SPOC\n", - " HLSP\n", - " 55\n", - " 600.0\n", - " 0.0\n", - " 2022\n", - " FITS\n", - " \n", - " \n", - " 8\n", - " Kepler 186\n", - " TESScut\n", - " TESS Sector 14\n", - " 14\n", - " 1800.0\n", - " 0.0\n", - " 2019\n", - " TESS FFI Cutout (sector 14)\n", - " \n", - " \n", - " 9\n", - " Kepler 186\n", - " TESScut\n", - " TESS Sector 15\n", - " 15\n", - " 1800.0\n", - " 0.0\n", - " 2019\n", - " TESS FFI Cutout (sector 15)\n", - " \n", - " \n", - " 10\n", - " Kepler 186\n", - " TESScut\n", - " TESS Sector 41\n", - " 41\n", - " 600.0\n", - " 0.0\n", - " 2021\n", - " TESS FFI Cutout (sector 41)\n", - " \n", - " \n", - " 11\n", - " Kepler 186\n", - " TESScut\n", - " TESS Sector 54\n", - " 54\n", - " 600.0\n", - " 0.0\n", - " 2022\n", - " TESS FFI Cutout (sector 54)\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", " \n", " \n", " 12\n", @@ -1070,27 +877,22 @@ " \n", " \n", "\n", + "

17 rows × 8 columns

\n", "" ], "text/plain": [ - "TESSSearch object containing 17 data products target_name pipeline mission sector exptime distance year \\\n", - "0 268159861 SPOC TESS 41 120.0 0.0 2021 \n", - "1 268159861 SPOC TESS 54 120.0 0.0 2022 \n", - "2 268159861 SPOC TESS 55 120.0 0.0 2022 \n", - "3 268159861 SPOC TESS 74 120.0 0.0 2024 \n", - "4 268159861 SPOC TESS 75 120.0 0.0 2024 \n", - "5 268159861 TESS-SPOC HLSP 41 600.0 0.0 2021 \n", - "6 268159861 TESS-SPOC HLSP 54 600.0 0.0 2022 \n", - "7 268159861 TESS-SPOC HLSP 55 600.0 0.0 2022 \n", - "8 Kepler 186 TESScut TESS Sector 14 14 1800.0 0.0 2019 \n", - "9 Kepler 186 TESScut TESS Sector 15 15 1800.0 0.0 2019 \n", - "10 Kepler 186 TESScut TESS Sector 41 41 600.0 0.0 2021 \n", - "11 Kepler 186 TESScut TESS Sector 54 54 600.0 0.0 2022 \n", - "12 Kepler 186 TESScut TESS Sector 55 55 600.0 0.0 2022 \n", - "13 Kepler 186 TESScut TESS Sector 74 74 200.0 0.0 2024 \n", - "14 Kepler 186 TESScut TESS Sector 75 75 200.0 0.0 2024 \n", - "15 Kepler 186 TESScut TESS Sector 81 81 200.0 0.0 2024 \n", - "16 Kepler 186 TESScut TESS Sector 82 82 200.0 0.0 2024 \n", + "TESSSearch object containing 17 data products target_name pipeline mission sector exptime distance year \\\n", + "0 268159861 SPOC TESS 41 120.0 0.0 2021 \n", + "1 268159861 SPOC TESS 54 120.0 0.0 2022 \n", + "2 268159861 SPOC TESS 55 120.0 0.0 2022 \n", + "3 268159861 SPOC TESS 74 120.0 0.0 2024 \n", + "4 268159861 SPOC TESS 75 120.0 0.0 2024 \n", + ".. ... ... ... ... ... ... ... \n", + "12 Kepler 186 TESScut TESS Sector 55 55 600.0 0.0 2022 \n", + "13 Kepler 186 TESScut TESS Sector 74 74 200.0 0.0 2024 \n", + "14 Kepler 186 TESScut TESS Sector 75 75 200.0 0.0 2024 \n", + "15 Kepler 186 TESScut TESS Sector 81 81 200.0 0.0 2024 \n", + "16 Kepler 186 TESScut TESS Sector 82 82 200.0 0.0 2024 \n", "\n", " description \n", "0 Target pixel files \n", @@ -1098,18 +900,14 @@ "2 Target pixel files \n", "3 Target pixel files \n", "4 Target pixel files \n", - "5 FITS \n", - "6 FITS \n", - "7 FITS \n", - "8 TESS FFI Cutout (sector 14) \n", - "9 TESS FFI Cutout (sector 15) \n", - "10 TESS FFI Cutout (sector 41) \n", - "11 TESS FFI Cutout (sector 54) \n", + ".. ... \n", "12 TESS FFI Cutout (sector 55) \n", "13 TESS FFI Cutout (sector 74) \n", "14 TESS FFI Cutout (sector 75) \n", "15 TESS FFI Cutout (sector 81) \n", - "16 TESS FFI Cutout (sector 82) " + "16 TESS FFI Cutout (sector 82) \n", + "\n", + "[17 rows x 8 columns]" ] }, "execution_count": 6, @@ -1447,48 +1245,15 @@ " Light curves\n", " \n", " \n", - " 5\n", - " 268159861\n", - " SPOC\n", - " TESS\n", - " 55\n", - " 120.0\n", - " 0.0\n", - " 2022\n", - " Target pixel files\n", - " \n", - " \n", - " 6\n", - " 268159861\n", - " SPOC\n", - " TESS\n", - " 74\n", - " 120.0\n", - " 0.0\n", - " 2024\n", - " Light curves\n", - " \n", - " \n", - " 7\n", - " 268159861\n", - " SPOC\n", - " TESS\n", - " 74\n", - " 120.0\n", - " 0.0\n", - " 2024\n", - " Target pixel files\n", - " \n", - " \n", - " 8\n", - " 268159861\n", - " SPOC\n", - " TESS\n", - " 75\n", - " 120.0\n", - " 0.0\n", - " 2024\n", - " Light curves\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", " \n", " \n", " 9\n", @@ -1547,6 +1312,7 @@ " \n", " \n", "\n", + "

14 rows × 8 columns

\n", "" ], "text/plain": [ @@ -1556,10 +1322,7 @@ "2 268159861 SPOC TESS 54 120.0 0.0 2022 \n", "3 268159861 SPOC TESS 54 120.0 0.0 2022 \n", "4 268159861 SPOC TESS 55 120.0 0.0 2022 \n", - "5 268159861 SPOC TESS 55 120.0 0.0 2022 \n", - "6 268159861 SPOC TESS 74 120.0 0.0 2024 \n", - "7 268159861 SPOC TESS 74 120.0 0.0 2024 \n", - "8 268159861 SPOC TESS 75 120.0 0.0 2024 \n", + ".. ... ... ... ... ... ... ... \n", "9 268159861 SPOC TESS 75 120.0 0.0 2024 \n", "10 Kepler 186 TESScut TESS Sector 74 74 200.0 0.0 2024 \n", "11 Kepler 186 TESScut TESS Sector 75 75 200.0 0.0 2024 \n", @@ -1572,15 +1335,14 @@ "2 Light curves \n", "3 Target pixel files \n", "4 Light curves \n", - "5 Target pixel files \n", - "6 Light curves \n", - "7 Target pixel files \n", - "8 Light curves \n", + ".. ... \n", "9 Target pixel files \n", "10 TESS FFI Cutout (sector 74) \n", "11 TESS FFI Cutout (sector 75) \n", "12 TESS FFI Cutout (sector 81) \n", - "13 TESS FFI Cutout (sector 82) " + "13 TESS FFI Cutout (sector 82) \n", + "\n", + "[14 rows x 8 columns]" ] }, "execution_count": 9, @@ -1691,11 +1453,68 @@ "execution_count": 11, "id": "adae2b43", "metadata": {}, - "outputs": [], - "source": [ - "Kep186_lim.download()" - ] - }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Local PathStatusMessageURL
0/Users/tapritc2/.tssc/cache/mastDownload/TESS/...COMPLETENoneNone
0/Users/tapritc2/.tssc/cache/mastDownload/TESS/...COMPLETENoneNone
\n", + "
" + ], + "text/plain": [ + " Local Path Status Message URL\n", + "0 /Users/tapritc2/.tssc/cache/mastDownload/TESS/... COMPLETE None None\n", + "0 /Users/tapritc2/.tssc/cache/mastDownload/TESS/... COMPLETE None None" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Kep186_lim.download()" + ] + }, { "cell_type": "markdown", "id": "a0935d18", @@ -1714,7 +1533,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 12, "id": "ace8aad4", "metadata": {}, "outputs": [ @@ -1906,7 +1725,7 @@ "[82 rows x 8 columns]" ] }, - "execution_count": 7, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -1919,7 +1738,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 13, "id": "ed6138b3", "metadata": {}, "outputs": [ @@ -2111,7 +1930,7 @@ "[40 rows x 8 columns]" ] }, - "execution_count": 8, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -2123,18 +1942,10 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 14, "id": "cbedbf2a", "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Downloading URL s3://stpubdata/kepler/public/lightcurves/0074/007419318/kplr007419318-2009131105131_llc.fits to /Users/nthom/.newlk_search/cache/mastDownload/Kepler/kplr007419318_lc_Q111111111111111111/kplr007419318-2009131105131_llc.fits ... [Done]\n", - "Downloading URL s3://stpubdata/kepler/public/target_pixel_files/0074/007419318/kplr007419318-2009131105131_lpd-targ.fits.gz to /Users/nthom/.newlk_search/cache/mastDownload/Kepler/kplr007419318_lc_Q111111111111111111/kplr007419318-2009131105131_lpd-targ.fits.gz ... [Done]\n" - ] - }, { "data": { "text/html": [ @@ -2165,14 +1976,14 @@ " \n", " \n", " 0\n", - " /Users/nthom/.newlk_search/cache/mastDownload/...\n", + " /Users/tapritc2/.tssc/cache/mastDownload/Keple...\n", " COMPLETE\n", " None\n", " None\n", " \n", " \n", " 0\n", - " /Users/nthom/.newlk_search/cache/mastDownload/...\n", + " /Users/tapritc2/.tssc/cache/mastDownload/Keple...\n", " COMPLETE\n", " None\n", " None\n", @@ -2183,11 +1994,11 @@ ], "text/plain": [ " Local Path Status Message URL\n", - "0 /Users/nthom/.newlk_search/cache/mastDownload/... COMPLETE None None\n", - "0 /Users/nthom/.newlk_search/cache/mastDownload/... COMPLETE None None" + "0 /Users/tapritc2/.tssc/cache/mastDownload/Keple... COMPLETE None None\n", + "0 /Users/tapritc2/.tssc/cache/mastDownload/Keple... COMPLETE None None" ] }, - "execution_count": 12, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -2214,8 +2025,8 @@ { "data": { "text/plain": [ - "array(['/Users/nthom/.newlk_search/cache/mastDownload/Kepler/kplr007419318_lc_Q111111111111111111/kplr007419318-2009131105131_llc.fits',\n", - " '/Users/nthom/.newlk_search/cache/mastDownload/Kepler/kplr007419318_lc_Q111111111111111111/kplr007419318-2009131105131_lpd-targ.fits.gz'],\n", + "array(['/Users/tapritc2/.tssc/cache/mastDownload/Kepler/kplr007419318_lc_Q111111111111111111/kplr007419318-2009131105131_llc.fits',\n", + " '/Users/tapritc2/.tssc/cache/mastDownload/Kepler/kplr007419318_lc_Q111111111111111111/kplr007419318-2009131105131_lpd-targ.fits.gz'],\n", " dtype=object)" ] }, @@ -2429,7 +2240,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 17, "id": "a775a2f7", "metadata": {}, "outputs": [ @@ -2553,7 +2364,7 @@ "5 FITS " ] }, - "execution_count": 31, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -2565,7 +2376,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 18, "id": "d2cfa795", "metadata": {}, "outputs": [ @@ -2574,27 +2385,72 @@ "output_type": "stream", "text": [ "11\n", - "3\n", - "[]\n", - " Local Path Status Message URL\n", - "0 /Users/nthom/.newlk_search/cache/mastDownload/... COMPLETE None None\n", - "0 /Users/nthom/.newlk_search/cache/mastDownload/... COMPLETE None None\n" + "3\n" ] }, { - "ename": "HTTPError", - "evalue": "500 Server Error: Internal Server Error for url: https://mast.stsci.edu/tesscut/api/v0.1/astrocut?ra=289.07573265788994&dec=51.75743964614&y=10&x=10&units=px§or=%5B14%5D", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mHTTPError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn [2], line 5\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;28mlen\u001b[39m(results)) \u001b[38;5;66;03m# == 11\u001b[39;00m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;28mlen\u001b[39m(results\u001b[38;5;241m.\u001b[39mcubedata)) \u001b[38;5;66;03m# 3\u001b[39;00m\n\u001b[0;32m----> 5\u001b[0m manifest \u001b[38;5;241m=\u001b[39m \u001b[43mresults\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcubedata\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdownload\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 6\u001b[0m manifest\n", - "File \u001b[0;32m~/TESS_GI/newlk/newlk_search/src/newlk_search/search.py:1436\u001b[0m, in \u001b[0;36mTESSSearch.download\u001b[0;34m(self, cloud, cache, cloud_only, download_dir, TESScut_size)\u001b[0m\n\u001b[1;32m 1434\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m cloud:\n\u001b[1;32m 1435\u001b[0m Tesscut\u001b[38;5;241m.\u001b[39menable_cloud_dataset()\n\u001b[0;32m-> 1436\u001b[0m mf1 \u001b[38;5;241m=\u001b[39m \u001b[43mTesscut\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdownload_cutouts\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcoordinates\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mSkyCoord\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 1437\u001b[0m \u001b[43m \u001b[49m\u001b[43msize\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mTESScut_size\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 1438\u001b[0m \u001b[43m \u001b[49m\u001b[43msector\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtable\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43msequence_number\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mvalues\u001b[49m\u001b[43m[\u001b[49m\u001b[43mmask\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1439\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# Uncomment when astroquery 0.4.8 is released to enable TICA support\u001b[39;49;00m\n\u001b[1;32m 1440\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# product=TESScut_product, \u001b[39;49;00m\n\u001b[1;32m 1441\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# verbose=False\u001b[39;49;00m\n\u001b[1;32m 1442\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mPACKAGEDIR\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 1443\u001b[0m \u001b[43m \u001b[49m\u001b[43minflate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 1444\u001b[0m \u001b[43m \u001b[49m\u001b[43mmoving_target\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;66;43;03m#this could be added\u001b[39;49;00m\n\u001b[1;32m 1445\u001b[0m \u001b[43m \u001b[49m\u001b[43mmt_type\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 1446\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1447\u001b[0m \u001b[38;5;28mprint\u001b[39m(mf1)\n\u001b[1;32m 1448\u001b[0m \u001b[38;5;28mprint\u001b[39m(mf2)\n", - "File \u001b[0;32m~/opt/anaconda3/envs/py3/lib/python3.9/site-packages/astroquery/mast/cutouts.py:293\u001b[0m, in \u001b[0;36mTesscutClass.download_cutouts\u001b[0;34m(self, coordinates, size, sector, path, inflate, objectname, moving_target, mt_type)\u001b[0m\n\u001b[1;32m 291\u001b[0m path \u001b[38;5;241m=\u001b[39m os\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mjoin(path, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 292\u001b[0m zipfile_path \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124mtesscut_\u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m.zip\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(path, time\u001b[38;5;241m.\u001b[39mstrftime(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mY\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mm\u001b[39m\u001b[38;5;132;01m%d\u001b[39;00m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mH\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mM\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mS\u001b[39m\u001b[38;5;124m\"\u001b[39m))\n\u001b[0;32m--> 293\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_download_file\u001b[49m\u001b[43m(\u001b[49m\u001b[43mastrocut_url\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mzipfile_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 295\u001b[0m localpath_table \u001b[38;5;241m=\u001b[39m Table(names\u001b[38;5;241m=\u001b[39m[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mLocal Path\u001b[39m\u001b[38;5;124m\"\u001b[39m], dtype\u001b[38;5;241m=\u001b[39m[\u001b[38;5;28mstr\u001b[39m])\n\u001b[1;32m 297\u001b[0m \u001b[38;5;66;03m# Checking if we got a zip file or a json no results message\u001b[39;00m\n", - "File \u001b[0;32m~/opt/anaconda3/envs/py3/lib/python3.9/site-packages/astroquery/query.py:359\u001b[0m, in \u001b[0;36mBaseQuery._download_file\u001b[0;34m(self, url, local_filepath, timeout, auth, continuation, cache, method, head_safe, **kwargs)\u001b[0m\n\u001b[1;32m 354\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 355\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_session\u001b[38;5;241m.\u001b[39mrequest(method, url,\n\u001b[1;32m 356\u001b[0m timeout\u001b[38;5;241m=\u001b[39mtimeout, stream\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m,\n\u001b[1;32m 357\u001b[0m auth\u001b[38;5;241m=\u001b[39mauth, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m--> 359\u001b[0m \u001b[43mresponse\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mraise_for_status\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 360\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcontent-length\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m response\u001b[38;5;241m.\u001b[39mheaders:\n\u001b[1;32m 361\u001b[0m length \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(response\u001b[38;5;241m.\u001b[39mheaders[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcontent-length\u001b[39m\u001b[38;5;124m'\u001b[39m])\n", - "File \u001b[0;32m~/opt/anaconda3/envs/py3/lib/python3.9/site-packages/requests/models.py:1021\u001b[0m, in \u001b[0;36mResponse.raise_for_status\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1016\u001b[0m http_error_msg \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 1017\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstatus_code\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m Server Error: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mreason\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m for url: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39murl\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1018\u001b[0m )\n\u001b[1;32m 1020\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m http_error_msg:\n\u001b[0;32m-> 1021\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m HTTPError(http_error_msg, response\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m)\n", - "\u001b[0;31mHTTPError\u001b[0m: 500 Server Error: Internal Server Error for url: https://mast.stsci.edu/tesscut/api/v0.1/astrocut?ra=289.07573265788994&dec=51.75743964614&y=10&x=10&units=px§or=%5B14%5D" - ] + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Local PathStatusMessageURL
0/Users/tapritc2/.tssc/cache/mastDownload/TESS/...COMPLETENoneNone
1/Users/tapritc2/.tssc/cache/mastDownload/HLSP/...COMPLETENoneNone
2/Users/tapritc2/.tssc/cache/mastDownload/TESSC...COMPLETENaNNaN
\n", + "
" + ], + "text/plain": [ + " Local Path Status Message URL\n", + "0 /Users/tapritc2/.tssc/cache/mastDownload/TESS/... COMPLETE None None\n", + "1 /Users/tapritc2/.tssc/cache/mastDownload/HLSP/... COMPLETE None None\n", + "2 /Users/tapritc2/.tssc/cache/mastDownload/TESSC... COMPLETE NaN NaN" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -2608,7 +2464,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 19, "id": "8b10d4f6", "metadata": {}, "outputs": [ @@ -2693,7 +2549,7 @@ "2 TESS FFI Cutout (sector 14) " ] }, - "execution_count": 39, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -2704,7 +2560,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 20, "id": "21eedb6d", "metadata": {}, "outputs": [ @@ -2725,7 +2581,7 @@ "Name: provenance_name, Length: 11, dtype: object" ] }, - "execution_count": 40, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -2736,7 +2592,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 21, "id": "da99acf3", "metadata": {}, "outputs": [ @@ -2808,7 +2664,7 @@ "1 Target pixel files " ] }, - "execution_count": 2, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -2820,20 +2676,10 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 22, "id": "e2ca302c", "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[]\n", - " Local Path Status Message URL\n", - "0 /Users/nthom/.newlk_search/cache/mastDownload/... COMPLETE None None\n", - "0 /Users/nthom/.newlk_search/cache/mastDownload/... COMPLETE None None\n" - ] - }, { "data": { "text/html": [ @@ -2864,14 +2710,14 @@ " \n", " \n", " 0\n", - " /Users/nthom/.newlk_search/cache/mastDownload/...\n", + " /Users/tapritc2/.tssc/cache/mastDownload/TESS/...\n", " COMPLETE\n", " None\n", " None\n", " \n", " \n", " 0\n", - " /Users/nthom/.newlk_search/cache/mastDownload/...\n", + " /Users/tapritc2/.tssc/cache/mastDownload/TESS/...\n", " COMPLETE\n", " None\n", " None\n", @@ -2882,11 +2728,11 @@ ], "text/plain": [ " Local Path Status Message URL\n", - "0 /Users/nthom/.newlk_search/cache/mastDownload/... COMPLETE None None\n", - "0 /Users/nthom/.newlk_search/cache/mastDownload/... COMPLETE None None" + "0 /Users/tapritc2/.tssc/cache/mastDownload/TESS/... COMPLETE None None\n", + "0 /Users/tapritc2/.tssc/cache/mastDownload/TESS/... COMPLETE None None" ] }, - "execution_count": 3, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -2895,42 +2741,295 @@ "res.download()" ] }, + { + "cell_type": "markdown", + "id": "0fd9ffe2-43aa-496c-aa56-beb5ee814653", + "metadata": {}, + "source": [ + "# Can we get individual FFI info?" + ] + }, { "cell_type": "code", - "execution_count": 4, - "id": "c9b808c0", + "execution_count": 23, + "id": "d7bac166-9110-4ed2-8341-0ced027b9b16", + "metadata": {}, + "outputs": [], + "source": [ + "results = TESSSearch(\"Kepler 16b\")" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "a41178f6-2d5b-4e7c-808e-21d19eb7ff79", "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.4.6\n" - ] + "data": { + "text/html": [ + "TESSSearch object containing 1241 data products
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
target_namepipelinemissionsectorexptimedistanceyeardescription
0tess2019220045929-s0014-2-4-0150-sSPOCTESS141800NaN2019Calibrated full frame image
1tess2019200195929-s0014-2-4-0150-sSPOCTESS141800NaN2019Calibrated full frame image
2tess2019219202929-s0014-2-4-0150-sSPOCTESS141800NaN2019Calibrated full frame image
3tess2019220002929-s0014-2-4-0150-sSPOCTESS141800NaN2019Calibrated full frame image
4tess2019201155929-s0014-2-4-0150-sSPOCTESS141800NaN2019Calibrated full frame image
...........................
1236tess2019220162929-s0014-2-4-0150-sSPOCTESS141800NaN2019Calibrated full frame image
1237tess2019205002929-s0014-2-4-0150-sSPOCTESS141800NaN2019Calibrated full frame image
1238tess2019205125929-s0014-2-4-0150-sSPOCTESS141800NaN2019Calibrated full frame image
1239tess2019222162929-s0014-2-4-0150-sSPOCTESS141800NaN2019Calibrated full frame image
1240tess2019216132929-s0014-2-4-0150-sSPOCTESS141800NaN2019Calibrated full frame image
\n", + "

1241 rows × 8 columns

\n", + "
" + ], + "text/plain": [ + "TESSSearch object containing 1241 data products target_name pipeline mission sector exptime \\\n", + "0 tess2019220045929-s0014-2-4-0150-s SPOC TESS 14 1800 \n", + "1 tess2019200195929-s0014-2-4-0150-s SPOC TESS 14 1800 \n", + "2 tess2019219202929-s0014-2-4-0150-s SPOC TESS 14 1800 \n", + "3 tess2019220002929-s0014-2-4-0150-s SPOC TESS 14 1800 \n", + "4 tess2019201155929-s0014-2-4-0150-s SPOC TESS 14 1800 \n", + "... ... ... ... ... ... \n", + "1236 tess2019220162929-s0014-2-4-0150-s SPOC TESS 14 1800 \n", + "1237 tess2019205002929-s0014-2-4-0150-s SPOC TESS 14 1800 \n", + "1238 tess2019205125929-s0014-2-4-0150-s SPOC TESS 14 1800 \n", + "1239 tess2019222162929-s0014-2-4-0150-s SPOC TESS 14 1800 \n", + "1240 tess2019216132929-s0014-2-4-0150-s SPOC TESS 14 1800 \n", + "\n", + " distance year description \n", + "0 NaN 2019 Calibrated full frame image \n", + "1 NaN 2019 Calibrated full frame image \n", + "2 NaN 2019 Calibrated full frame image \n", + "3 NaN 2019 Calibrated full frame image \n", + "4 NaN 2019 Calibrated full frame image \n", + "... ... ... ... \n", + "1236 NaN 2019 Calibrated full frame image \n", + "1237 NaN 2019 Calibrated full frame image \n", + "1238 NaN 2019 Calibrated full frame image \n", + "1239 NaN 2019 Calibrated full frame image \n", + "1240 NaN 2019 Calibrated full frame image \n", + "\n", + "[1241 rows x 8 columns]" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ - "import astroquery\n", - "print(astroquery.__version__)" + "#tstart, tstop in mjd\n", + "ffi_res = results.search_individual_ffi(58682,58710, sector=14)\n", + "ffi_res" ] }, { - "cell_type": "code", - "execution_count": 5, - "id": "8b3053d5", + "cell_type": "markdown", + "id": "19dea707-aa7e-4aa2-9e85-62e1afcf613a", "metadata": {}, - "outputs": [], "source": [ - "astroquery.mast.TesscutClass.download_cutouts?" + "# Can we download a FFI?" ] }, { "cell_type": "code", - "execution_count": null, - "id": "6c14d449", + "execution_count": 25, + "id": "8d0fe5b0-cfd0-4a46-aefd-b03ca5cc1299", "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Local PathStatusMessageURL
0/Users/tapritc2/.tssc/cache/mastDownload/TESS/...COMPLETENoneNone
\n", + "
" + ], + "text/plain": [ + " Local Path Status Message URL\n", + "0 /Users/tapritc2/.tssc/cache/mastDownload/TESS/... COMPLETE None None" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ffi_res[0].download()" + ] } ], "metadata": { @@ -2949,7 +3048,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.12.2" } }, "nbformat": 4, diff --git a/src/tssc/TESSSearch.py b/src/tssc/TESSSearch.py index c5d938b..4cab112 100644 --- a/src/tssc/TESSSearch.py +++ b/src/tssc/TESSSearch.py @@ -380,12 +380,11 @@ def search_individual_ffi( new_table.table = None test_table = new_table._join_tables() - test_table.reset_index() + test_table.reset_index(inplace=True) new_table.table = new_table._update_table(test_table) - + new_table.table.reset_index(inplace=True) new_table.table["target_name"] = new_table.obs_table["obs_id"] new_table.table["obs_collection"] = ["TESS"] * len(new_table.table) - new_table.table["pipeline"] = [ new_table.prod_table["provenance_name"].values[0] ] * len(new_table.table) @@ -395,7 +394,7 @@ def search_individual_ffi( new_table.table["year"] = new_table.table["obs_id"].apply( (lambda x: int(x.split("-")[0][4:8])) ) - + new_table.table["sector"] = new_table.table["obs_id"].apply(lambda x: int(x.split("-")[1][1:])) return new_table def filter_table(