{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "**Brian Blaylock** \n", "*January 13, 2021*\n", "\n", "# Download GOES Data: Timerange\n", "For all options, refer to the GOES-2-go Reference Guide: [goes2go.data.goes_timerange](https://goes2go.readthedocs.io/en/latest/reference_guide/index.html#goes2go.data.goes_timerange)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from goes2go.data import goes_timerange\n", "\n", "from datetime import datetime\n", "import pandas as pd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "### Example 1: \n", "Download an ABI file from GOES-East for an hour period. Data is returned as a file list." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " _______________________________\n", " | Satellite: noaa-goes16 |\n", " | Product: ABI-L2-MCMIPC |\n", " | Domain: C |\n", "📦 Finished downloading [12] files to [/p/home/blaylock/data/noaa-goes16/ABI-L2-MCMIPC]. \n" ] } ], "source": [ "## Dates may be specified as datetime, pandas datetimes, or string dates\n", "## that pandas can interpret.\n", "\n", "## Specify start/end time with datetime object\n", "# start = datetime(2021, 1, 1, 0, 30)\n", "# end = datetime(2021, 1, 1, 1, 30)\n", "\n", "## Specify start/end time as a panda-parsable string\n", "start = \"2021-01-01 00:30\"\n", "end = \"2021-01-01 01:30\"\n", "\n", "g = goes_timerange(start, end, satellite=\"goes16\", product=\"ABI\", return_as=\"filelist\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
filestartendcreation
0noaa-goes16/ABI-L2-MCMIPC/2021/001/00/OR_ABI-L...2021-01-01 00:31:17.6002021-01-01 00:33:56.1002021-01-01 00:34:10.300
1noaa-goes16/ABI-L2-MCMIPC/2021/001/00/OR_ABI-L...2021-01-01 00:36:17.6002021-01-01 00:38:55.5002021-01-01 00:39:09.900
2noaa-goes16/ABI-L2-MCMIPC/2021/001/00/OR_ABI-L...2021-01-01 00:41:17.6002021-01-01 00:43:56.1002021-01-01 00:44:09.200
3noaa-goes16/ABI-L2-MCMIPC/2021/001/00/OR_ABI-L...2021-01-01 00:46:17.6002021-01-01 00:48:56.1002021-01-01 00:49:09.600
4noaa-goes16/ABI-L2-MCMIPC/2021/001/00/OR_ABI-L...2021-01-01 00:51:17.6002021-01-01 00:53:55.5002021-01-01 00:54:10.500
5noaa-goes16/ABI-L2-MCMIPC/2021/001/00/OR_ABI-L...2021-01-01 00:56:17.6002021-01-01 00:58:55.5002021-01-01 00:59:09.000
6noaa-goes16/ABI-L2-MCMIPC/2021/001/01/OR_ABI-L...2021-01-01 01:01:17.6002021-01-01 01:03:54.9002021-01-01 01:04:10.200
7noaa-goes16/ABI-L2-MCMIPC/2021/001/01/OR_ABI-L...2021-01-01 01:06:17.6002021-01-01 01:08:56.1002021-01-01 01:09:09.400
8noaa-goes16/ABI-L2-MCMIPC/2021/001/01/OR_ABI-L...2021-01-01 01:11:17.6002021-01-01 01:13:55.5002021-01-01 01:14:10.300
9noaa-goes16/ABI-L2-MCMIPC/2021/001/01/OR_ABI-L...2021-01-01 01:16:17.6002021-01-01 01:18:56.1002021-01-01 01:19:09.600
10noaa-goes16/ABI-L2-MCMIPC/2021/001/01/OR_ABI-L...2021-01-01 01:21:17.6002021-01-01 01:23:54.9002021-01-01 01:24:10.200
11noaa-goes16/ABI-L2-MCMIPC/2021/001/01/OR_ABI-L...2021-01-01 01:26:17.6002021-01-01 01:28:55.5002021-01-01 01:29:09.000
\n", "
" ], "text/plain": [ " file start \\\n", "0 noaa-goes16/ABI-L2-MCMIPC/2021/001/00/OR_ABI-L... 2021-01-01 00:31:17.600 \n", "1 noaa-goes16/ABI-L2-MCMIPC/2021/001/00/OR_ABI-L... 2021-01-01 00:36:17.600 \n", "2 noaa-goes16/ABI-L2-MCMIPC/2021/001/00/OR_ABI-L... 2021-01-01 00:41:17.600 \n", "3 noaa-goes16/ABI-L2-MCMIPC/2021/001/00/OR_ABI-L... 2021-01-01 00:46:17.600 \n", "4 noaa-goes16/ABI-L2-MCMIPC/2021/001/00/OR_ABI-L... 2021-01-01 00:51:17.600 \n", "5 noaa-goes16/ABI-L2-MCMIPC/2021/001/00/OR_ABI-L... 2021-01-01 00:56:17.600 \n", "6 noaa-goes16/ABI-L2-MCMIPC/2021/001/01/OR_ABI-L... 2021-01-01 01:01:17.600 \n", "7 noaa-goes16/ABI-L2-MCMIPC/2021/001/01/OR_ABI-L... 2021-01-01 01:06:17.600 \n", "8 noaa-goes16/ABI-L2-MCMIPC/2021/001/01/OR_ABI-L... 2021-01-01 01:11:17.600 \n", "9 noaa-goes16/ABI-L2-MCMIPC/2021/001/01/OR_ABI-L... 2021-01-01 01:16:17.600 \n", "10 noaa-goes16/ABI-L2-MCMIPC/2021/001/01/OR_ABI-L... 2021-01-01 01:21:17.600 \n", "11 noaa-goes16/ABI-L2-MCMIPC/2021/001/01/OR_ABI-L... 2021-01-01 01:26:17.600 \n", "\n", " end creation \n", "0 2021-01-01 00:33:56.100 2021-01-01 00:34:10.300 \n", "1 2021-01-01 00:38:55.500 2021-01-01 00:39:09.900 \n", "2 2021-01-01 00:43:56.100 2021-01-01 00:44:09.200 \n", "3 2021-01-01 00:48:56.100 2021-01-01 00:49:09.600 \n", "4 2021-01-01 00:53:55.500 2021-01-01 00:54:10.500 \n", "5 2021-01-01 00:58:55.500 2021-01-01 00:59:09.000 \n", "6 2021-01-01 01:03:54.900 2021-01-01 01:04:10.200 \n", "7 2021-01-01 01:08:56.100 2021-01-01 01:09:09.400 \n", "8 2021-01-01 01:13:55.500 2021-01-01 01:14:10.300 \n", "9 2021-01-01 01:18:56.100 2021-01-01 01:19:09.600 \n", "10 2021-01-01 01:23:54.900 2021-01-01 01:24:10.200 \n", "11 2021-01-01 01:28:55.500 2021-01-01 01:29:09.000 " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'satellite': 'noaa-goes16',\n", " 'product': 'ABI-L2-MCMIPC',\n", " 'start': Timestamp('2021-01-01 00:30:00'),\n", " 'end': Timestamp('2021-01-01 01:30:00'),\n", " 'filePath': PosixPath('/p/home/blaylock/data')}" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.attrs" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Show the files on my home drive..." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/p/home/blaylock/data\n", "└── noaa-goes16\n", " └── ABI-L2-MCMIPC\n", " └── 2021\n", " └── 001\n", " ├── 00\n", " │   ├── OR_ABI-L2-MCMIPC-M6_G16_s20210010031176_e20210010033561_c20210010034103.nc\n", " │   ├── OR_ABI-L2-MCMIPC-M6_G16_s20210010036176_e20210010038555_c20210010039099.nc\n", " │   ├── OR_ABI-L2-MCMIPC-M6_G16_s20210010041176_e20210010043561_c20210010044092.nc\n", " │   ├── OR_ABI-L2-MCMIPC-M6_G16_s20210010046176_e20210010048561_c20210010049096.nc\n", " │   ├── OR_ABI-L2-MCMIPC-M6_G16_s20210010051176_e20210010053555_c20210010054105.nc\n", " │   └── OR_ABI-L2-MCMIPC-M6_G16_s20210010056176_e20210010058555_c20210010059090.nc\n", " └── 01\n", " ├── OR_ABI-L2-MCMIPC-M6_G16_s20210010101176_e20210010103549_c20210010104102.nc\n", " ├── OR_ABI-L2-MCMIPC-M6_G16_s20210010106176_e20210010108561_c20210010109094.nc\n", " ├── OR_ABI-L2-MCMIPC-M6_G16_s20210010111176_e20210010113555_c20210010114103.nc\n", " ├── OR_ABI-L2-MCMIPC-M6_G16_s20210010116176_e20210010118561_c20210010119096.nc\n", " ├── OR_ABI-L2-MCMIPC-M6_G16_s20210010121176_e20210010123549_c20210010124102.nc\n", " └── OR_ABI-L2-MCMIPC-M6_G16_s20210010126176_e20210010128555_c20210010129090.nc\n", "\n", "6 directories, 12 files\n" ] } ], "source": [ "%%bash\n", "tree ~/data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.9" } }, "nbformat": 4, "nbformat_minor": 4 }