From efe619204390d91ffa2c290e28e051190f57f3c5 Mon Sep 17 00:00:00 2001 From: jennifer Date: Mon, 7 Aug 2023 15:35:04 -0600 Subject: [PATCH 1/7] Add NOAA access subfolder with python notebook --- notebooks/NOAA_Access/img/nsidc_logo.png | Bin 0 -> 17603 bytes .../NOAA_Access/python_download_data.ipynb | 235 ++++++++++++++++++ 2 files changed, 235 insertions(+) create mode 100644 notebooks/NOAA_Access/img/nsidc_logo.png create mode 100644 notebooks/NOAA_Access/python_download_data.ipynb diff --git a/notebooks/NOAA_Access/img/nsidc_logo.png b/notebooks/NOAA_Access/img/nsidc_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..35a06e02d3e9d47b3a392d05a550364d8cfd8aaa GIT binary patch literal 17603 zcmXtAWmH?;5=Be!;O-XO-J!T!f#UA&?ry~$iWe>JE$&)U+})kx^78$7S?lITR+4i@ z_w1S67*%B%R3t(qC@3gYIoZ$ZkhAxH2jCOrp5L5j4swEXlaSK{KyLm3^JvI(L}yuD zHz+99o&OH#MJbO{$cqH-QabJ$PL}RoCaxAxUS3`-HjZ{~W+u)SEKaUgxfeo&P*CJh za-YRDz4OlUy|PHO2(E&x9DDrQ9x}|q$j9Nc6v48HLomg%T0k{bRk)h(oDPdYBk@SqZ{p2ffzCuC~o={!KE@wwd*HIMtrZr;R8IFRO#UZFz0^oL3*)9|IrA z`iQR}5E)K+4Wd zk`LCt4;(;-IuDE$^aylRYQ$_EwCJg4Ym=iD(dw%25ed?)AeY2qaN))_RFN!Gg>vCY z#NvKw}mwl+vQl%fNbfvn^+JTWe#Wwx9v*dwiqJWUhR};?(V>L%&Jewg*2H=-wxK zNJ}Caf1nRQN9GUZC-AboHkS(@o_wpEgI!=Ol27eeu{L*%IHvpcovb z<3uJSc|Qa)mF1!PBR>kM0wSXW&chsp9;T%W0_-HwBqD%{mDR=Y! zu@PK#teJ`HGCLV_q&~MG*qgS(kincKtz|=@x7w-O)|CIRYsKb*P)t6i7%Uk1veQ$Ot)jaeoht zF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v=BnS)iwV&keEmonq@$ zBKnW$+$+X5mXtG0X_^&m4}!nm*Urbud9Ox?T}yD7RQUtQETQ$r=@K?{L}1(PuD|4+ z|Kf&6P>HkrrY)BhLLW&71Drd6JLqIZZZ9iwDx{Mh{|im-U|uY)a?2zC;^+4~ zL8Pxc4XFu^P8K4Q!z{RNG(YjEU?EmNR)P>Hz9PPN@frN|!c!872AhDhgb*KERPc$w ze+#B1T;uzq0;4&e^o_%llqr-m%!3mI3o(kNG`8l?C zHtpu;4?NHFue^oy4`w+L(wqkAh#nV=#~r#KWlcpd412Ee<=b zq7u$nzKmbmk_Vvg25tfVB!t-aZ{B~*@Lxx80@4uuW8gqAPO|&Q+Z%b{`8RoW z<-2I1fRVdo3F&UZ^z}MnHzzpW^giXRpH>=s*55Weir2@&c{BOuStoGTu?ON#9XP%T zW1anrxv%Sg0{&+ZoB;D1PRoGvfX@OxFurN@+&de2_@8gH^8NJ$hlUN#&Wmu%+DRff z5yThyls60_usiS+6><2|`CRn*a|hv0OOQhI>p zz`4MQ@PFDnW0i)XC=7pBqjnIfwJ`+SqNtSWR>f7QZ|M{G5V{HCP+TfzvKWjsMIugZ z65H!=BE+C#7j2*)-05aS5YPV6$q|+~48&aF3(L7R}vSHhs1YoC0S`sR_JFf6r74oJMPH11HI8 z0k!n~Fp7Eb16)7A^L4S!S47YrveLj&N(IcAkr&\n", + "\n", + "\n", + "# How to download NOAA@NSIDC data using python\n", + "\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. Tutorial Overview \n", + "This notebook demonstrates how to download NOAA@NSIDC data using python, it includes examples for downloading a single file and all the files in a directory.\n", + "\n", + "### Credits \n", + "This notebook was developed by Jennifer Roebuck of NSIDC\n", + "\n", + "For questions regarding the notebook or to report problems, please create a new issue in the [NSIDC-Data-Tutorials repo](https://github.com/nsidc/NSIDC-Data-Tutorials/issues)\n", + "\n", + "### Learning Objectives\n", + "\n", + "By the end of this demonstration you will be able to:\n", + "\n", + "1. Download a single file from a NOAA@NSIDC data set\n", + "2. Download all the files in a directory on the NOAA@NSIDC HTTPS server \n", + "\n", + "### Prerequisites \n", + "\n", + "1. The `requests` and `bs4` libraries are already installed. \n", + "\n", + "### Time requirement \n", + "\n", + "Allow approximately 5 to 10 minutes to complete this tutorial." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Tutorial Steps \n", + "\n", + "### Import necessary libraries" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#import the requests library \n", + "import requests\n", + "from bs4 import BeautifulSoup" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Downloading a single file\n", + "This demonstrates how to download a single file.\n", + "\n", + "First we need to set the URL of the file we wish to download. The URL will follow the format of: https://noaadata.apps.nsidc.org/NOAA/ \\\n", + "\n", + "where \\ is specific to the data set and can be determined by exploring https://noaadata.apps.nsidc.org in a web browser. \n", + "\n", + "We will use the [Sea Ice Index (G02135)](https://nsidc.org/data/G02135) data set as an example, and download the text file containing daily sea ice extent values for the Arctic (N_seaice_extent_daily_v3.0.csv)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#URL of the file \n", + "file_url = \"https://noaadata.apps.nsidc.org/NOAA/G02135/north/daily/data/N_seaice_extent_daily_v3.0.csv\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next we need to create a HTTPS response object for that URL using the `get` method from the `requests` library." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Create a HTTPS response object\n", + "r = requests.get(file_url)\n", + "\n", + "#Catch any HTTPS errors\n", + "r.raise_for_status()\n", + "except requests.exceptions.HTTPError as err:\n", + " raise SystemExit(err)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now we need to set the filename that we want to save the downloaded file as, and download the file. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Download and save the file\n", + "with open(\"N_seaice_extent_daily_v3.0.csv\", \"wb\") as f:\n", + " f.write(r.content)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Downloading all the files in a directory \n", + "This demonstrates downloading all of the files in a single directory.\n", + "\n", + "First we need to set the URL path of the directory we wish to download. It follows a similar format to the one described above for downloading a single file.\n", + "\n", + "Again we will use the [Sea Ice Index (G02135)](https://nsidc.org/data/G02135) data set as an example and download all the daily GeoTIFFs for October 1978. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Set the URL of the directory we wish to download all the files from\n", + "archive_url = \"https://noaadata.apps.nsidc.org/NOAA/G02135/north/daily/geotiff/1978/10_Oct/\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next we need to create an HTTPS response object for the URL, again using the `get` method from the `requests` library. \n", + "\n", + "Then we will use `BeautifulSoup` to parse all the filenames that are in the directory. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Create a HTTPS response object\n", + "r = requests.get(archive_url)\n", + "\n", + "#Use BeautifulSoup to get a list of the filenames in the directory\n", + "data = BeautifulSoup(r.text, \"html.parser\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now we will create a URL for each of the filenames, set filenames that we want to save the downloaded files as, and download the files. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Loop through the list of the html links (excluding the first one which is just a link to the previous directory)\n", + "for l in data.find_all(\"a\")[1:]:\n", + " #generate URL to download each of the files \n", + " r = requests.get(archive_url + l[\"href\"])\n", + " print(r.status_code) #print status code\n", + " print(l[\"href\"]) #prints name of file\n", + " #Download and save files \n", + " with open(l[\"href\"], \"wb\") as f:\n", + " f.write(r.content)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Learning outcomes recap\n", + "\n", + "We have learned how to:\n", + "1. Download a single file from a NOAA@NSIDC data set\n", + "2. Download all the files in a directory related to a NOAA@NSIDC data set. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.15" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From 3631844928632e4a3c04da2fff21c598fe065d74 Mon Sep 17 00:00:00 2001 From: jennifer Date: Mon, 7 Aug 2023 15:43:40 -0600 Subject: [PATCH 2/7] Add R notebook for downloading data --- .../R_download_NOAA_NSIDC_data.ipynb | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 notebooks/NOAA_Access/R_download_NOAA_NSIDC_data.ipynb diff --git a/notebooks/NOAA_Access/R_download_NOAA_NSIDC_data.ipynb b/notebooks/NOAA_Access/R_download_NOAA_NSIDC_data.ipynb new file mode 100644 index 0000000..bb621c6 --- /dev/null +++ b/notebooks/NOAA_Access/R_download_NOAA_NSIDC_data.ipynb @@ -0,0 +1,207 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "2843fc8a", + "metadata": {}, + "source": [ + "
\n", + "\n", + "\n", + "# How to download NOAA@NSIDC data using python\n", + "\n", + "
" + ] + }, + { + "cell_type": "markdown", + "id": "1f0d8399", + "metadata": {}, + "source": [ + "## 1. Tutorial Overview \n", + "This notebook demonstrates how to download NOAA@NSIDC data using R, it includes examples for downloading a single file and all the files in a directory.\n", + "\n", + "### Credits \n", + "This notebook was developed by Jennifer Roebuck of NSIDC\n", + "\n", + "For questions regarding the notebook or to report problems, please create a new issue in the [NSIDC-Data-Tutorials repo](https://github.com/nsidc/NSIDC-Data-Tutorials/issues)\n", + "\n", + "### Learning Objectives\n", + "\n", + "By the end of this demonstration you will be able to:\n", + "\n", + "1. Download a single file from a NOAA@NSIDC data set\n", + "2. Download all the files in a directory on the NOAA@NSIDC HTTPS server \n", + "\n", + "### Prerequisites \n", + "\n", + "1. The `rvest` libraries are already installed. \n", + "\n", + "### Time requirement \n", + "\n", + "Allow approximately 5 to 10 minutes to complete this tutorial." + ] + }, + { + "cell_type": "markdown", + "id": "64d22028", + "metadata": {}, + "source": [ + "## 2. Tutorial Steps\n", + "\n", + "### Import necessary libraries\n", + "We need to import the following libraries" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "eaea2ddb", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Loading required package: xml2\n", + "Registered S3 method overwritten by 'rvest':\n", + " method from\n", + " read_xml.response xml2\n" + ] + } + ], + "source": [ + "library(base)\n", + "library(rvest)" + ] + }, + { + "cell_type": "markdown", + "id": "1b7523cd", + "metadata": {}, + "source": [ + "### Set the working directory\n", + "We need to set the directory we wish to download our files to. Edit the variable below to include the path to the directory where you wish to store the downloaded data." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "e1ed2d3c", + "metadata": {}, + "outputs": [], + "source": [ + "setwd(\"\")" + ] + }, + { + "cell_type": "markdown", + "id": "8082db96", + "metadata": {}, + "source": [ + "### Downloading a single file\n", + "This section demonstrates how to download a single file.\n", + "\n", + "First we need to set the URL of the file we wish to download. The URL will follow the format of: https://noaadata.apps.nsidc.org/NOAA/ \\\n", + "\n", + "where \\ is specific to the data set and can be determined by exploring https://noaadata.apps.nsidc.org in a web browser. \n", + "\n", + "We will use the [Sea Ice Index (G02135)](https://nsidc.org/data/G02135) data set as an example, and download the text file containing daily sea ice extent values for the Arctic (N_seaice_extent_daily_v3.0.csv)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "8b5ba837", + "metadata": {}, + "outputs": [], + "source": [ + "url <- \"https://noaadata.apps.nsidc.org/NOAA/G02135/north/daily/data/N_seaice_extent_daily_v3.0.csv\"\n", + "\n", + "# set the name of the file you are downloading\n", + "destination <- \"N_seaice_extent_daily_v3.0.csv\"\n", + "\n", + "# download the file \n", + "download.file(url, destination, mode = \"wb\")" + ] + }, + { + "cell_type": "markdown", + "id": "7dd9117c", + "metadata": {}, + "source": [ + "### Downloading all the files in a directory \n", + "This demonstrates downloading all of the files in a single directory.\n", + "\n", + "First we need to set the URL path of the directory we wish to download. It follows a similar format to the one described above for downloading a single file.\n", + "\n", + "Again we will use the [Sea Ice Index (G02135)](https://nsidc.org/data/G02135) data set as an example and download all the daily GeoTIFFs for the Antarctic for May 2023. " + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "3dc91623", + "metadata": {}, + "outputs": [], + "source": [ + "# set the URL for the directory you want to download files from\n", + "url <- \"https://noaadata.apps.nsidc.org/NOAA/G02135/south/daily/geotiff/2023/06_Jun\" \n", + "\n", + "# read html content from url\n", + "page <- read_html(url)\n", + "\n", + "# Get a list of the files listed in the directory at this url\n", + "files <- page %>% html_nodes(\"a\") %>% html_attr(\"href\")\n", + "\n", + "for(i in 2:length(files)){\n", + " # generate the url for each of the files \n", + " u <- paste(url,files[i], sep=\"/\")\n", + " # download each of the files\n", + " download.file(u,files[i], mode = \"wb\")\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "3e6084ed", + "metadata": {}, + "source": [ + "## 3. Learning outcomes recap\n", + "\n", + "We have learned how to:\n", + "1. Download a single file from a NOAA@NSIDC data set\n", + "2. Download all the files in a directory in a NOAA@NSIDC data set. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "601de3a2", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.15" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From 7917593e844f971c8660b9e5714255dec03e57d5 Mon Sep 17 00:00:00 2001 From: jennifer Date: Mon, 7 Aug 2023 15:46:23 -0600 Subject: [PATCH 3/7] Add R download files in R markdown format --- .../R_download_NOAA_NSIDC_data.Rmd | 88 ++++ .../R_download_NOAA_NSIDC_data.nb.html | 385 ++++++++++++++++++ 2 files changed, 473 insertions(+) create mode 100644 notebooks/NOAA_Access/R_download_NOAA_NSIDC_data.Rmd create mode 100644 notebooks/NOAA_Access/R_download_NOAA_NSIDC_data.nb.html diff --git a/notebooks/NOAA_Access/R_download_NOAA_NSIDC_data.Rmd b/notebooks/NOAA_Access/R_download_NOAA_NSIDC_data.Rmd new file mode 100644 index 0000000..f647199 --- /dev/null +++ b/notebooks/NOAA_Access/R_download_NOAA_NSIDC_data.Rmd @@ -0,0 +1,88 @@ + + +--- +title: "How to download NOAA@NSIDC data using R" +output: html_notebook +--- + +## 1. Tutorial Overview +This notebook demonstrates how to download NOAA@NSIDC data using R, it includes examples for downloading a single file and all the files in a directory. + +### Credits +This notebook was developed by Jennifer Roebuck of NSIDC. + +For questions regarding the notebook or to report problems, please create a new issue in the [NSIDC-Data-Tutorials repo](https://github.com/nsidc/NSIDC-Data-Tutorials/issues) + +### Learning Objectives + +By the end of this demonstration you will be able to: + +1. Download a single file from a NOAA@NSIDC data set +2. Download all the files in a directory on the NOAA@NSIDC HTTPS server + +### Prerequisites + +1. The library `rvest` installed + +### Time requirement + +Allow approximately 5 to 10 minutes to complete this tutorial. + +## 2. Tutorial steps + +### Import necessary libraries +We need to import the following libraries. +```{r} +library(base) +library(rvest) +``` + +### Set working directory +We need to set the directory we wish to download our files to. Edit the variable below to include the path to the directory where you wish to store the downloaded data. +```{r} +setwd("/Users/jero7025/Documents/NOAA/HTTPS_switch") +``` + + +### Downloading a single file +This demonstrates how to download a single file, we will use the Sea Ice Index (G02135) data set as an example. +```{r} +# set the url for the file you want to download +url <- "https://noaadata.apps.nsidc.org/NOAA/G02135/south/daily/geotiff/2023/05_May/S_20230501_concentration_v3.0.tif" + +# set the name of the file you are downloading +destination <- "S_20230501_concentration_v3.0.tif" + +# download the file +download.file(url, destination, mode = "wb") +``` + +### Downloading all the files in a directory +This demonstrates downloading all of the files in a single directory, again we will use the Sea Ice Index (G02135) data set as an example. +```{r} +# set the URL for the directory you want to download files from +url <- "https://noaadata.apps.nsidc.org/NOAA/G02135/south/daily/geotiff/2023/05_May" + +# read html content from url +page <- read_html(url) + +# Get a list of the files listed in the directory at this url +files <- page %>% html_nodes("a") %>% html_attr("href") + +for(i in 2:length(files)){ + # generate the url for each of the files + u <- paste(url,files[i], sep="/") + # download each of the files + download.file(u,files[i], mode = "wb") +} + + +``` + +## 3. Learning outcomes recap + +We have learned how to: +1. Download a single file from a NOAA@NSIDC data set +2. Download all the files in a directory related to a NOAA@NSIDC data set. + + diff --git a/notebooks/NOAA_Access/R_download_NOAA_NSIDC_data.nb.html b/notebooks/NOAA_Access/R_download_NOAA_NSIDC_data.nb.html new file mode 100644 index 0000000..5dd588b --- /dev/null +++ b/notebooks/NOAA_Access/R_download_NOAA_NSIDC_data.nb.html @@ -0,0 +1,385 @@ + + + + + + + + + + + + + +How to download NOAA@NSIDC data using R + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+

1. Tutorial Overview

+

This notebook demonstrates how to download data using R, it includes examples for downloading a single file and all the files in a directory.

+
+

Credits

+

This notebook was developed by Jennifer Roebuck of NSIDC.

+

For questions regarding the notebook or to report problems, please create a new issue in the NSIDC-Data-Tutorials repo

+
+
+

Learning Objectives

+

By the end of this demonstration you will be able to:

+
    +
  1. Download a single file from a data set
  2. +
  3. Download all the files in a directory on the HTTPS server
  4. +
+
+
+

Prerequisites

+
    +
  1. The library rvest installed
  2. +
+
+
+

Time requirement

+

Allow approximately 5 to 10 minutes to complete this tutorial.

+
+
+
+

2. Tutorial steps

+
+

Import necessary libraries

+

We need to import the following libraries.

+ + + +
library(base)
+library(rvest)
+ + + +
+
+

Set working directory

+

We need to set the directory we wish to download our files to. Edit the variable below to include the path to the directory where you wish to store the downloaded data.

+ + + +
setwd("/Users/jero7025/Documents/NOAA/HTTPS_switch")
+ + + +
+
+

Downloading a single file

+

This demonstrates how to download a single file, we will use the Sea Ice Index (G02135) data set as an example.

+ + + +
# set the url for the file you want to download
+url <- "https://noaadata.apps.nsidc.org/NOAA/G02135/south/daily/geotiff/2023/05_May/S_20230501_concentration_v3.0.tif"
+
+# set the name of the file you are downloading
+destination <- "S_20230501_concentration_v3.0.tif"
+
+# download the file 
+download.file(url, destination, mode = "wb")
+ + + +
+
+

Downloading all the files in a directory

+

This demonstrates downloading all of the files in a single directory, again we will use the Sea Ice Index (G02135) data set as an example.

+ + + +
# set the URL for the directory you want to download files from
+url <- "https://noaadata.apps.nsidc.org/NOAA/G02135/south/daily/geotiff/2023/05_May" 
+
+# read html content from url
+page <- read_html(url)
+
+# Get a list of the files listed in the directory at this url
+files <- page %>% html_nodes("a") %>% html_attr("href")
+
+for(i in 2:length(files)){
+  # generate the url for each of the files 
+  u <- paste(url,files[i], sep="/")
+  # download each of the files
+  download.file(u,files[i], mode = "wb")
+}
+
+ + + +
+
+
+

3. Learning outcomes recap

+

We have learned how to: 1. Download a single file from a data set 2. Download all the files in a directory related to a data set.

+ +
+ +
CgotLS0KdGl0bGU6ICJIb3cgdG8gZG93bmxvYWQgTk9BQUBOU0lEQyBkYXRhIHVzaW5nIFIiCm91dHB1dDogaHRtbF9ub3RlYm9vawotLS0KCiMjIDEuIFR1dG9yaWFsIE92ZXJ2aWV3IApUaGlzIG5vdGVib29rIGRlbW9uc3RyYXRlcyBob3cgdG8gZG93bmxvYWQgTk9BQUBOU0lEQyBkYXRhIHVzaW5nIFIsIGl0IGluY2x1ZGVzIGV4YW1wbGVzIGZvciBkb3dubG9hZGluZyBhIHNp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G8gYSBOT0FBQE5TSURDIGRhdGEgc2V0LiAKCgo=
+ + + +
+ + + + + + + + + + + + + + + + From ed965382b2f5d0f8defd61bf519a1fff99153868 Mon Sep 17 00:00:00 2001 From: jennifer Date: Mon, 7 Aug 2023 15:48:03 -0600 Subject: [PATCH 4/7] Rename python notebook --- ..._download_data.ipynb => Python_download_NOAA_NSIDC_data.ipynb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename notebooks/NOAA_Access/{python_download_data.ipynb => Python_download_NOAA_NSIDC_data.ipynb} (100%) diff --git a/notebooks/NOAA_Access/python_download_data.ipynb b/notebooks/NOAA_Access/Python_download_NOAA_NSIDC_data.ipynb similarity index 100% rename from notebooks/NOAA_Access/python_download_data.ipynb rename to notebooks/NOAA_Access/Python_download_NOAA_NSIDC_data.ipynb From eca62588b9ef5454be45a029409a3c0a404472d1 Mon Sep 17 00:00:00 2001 From: jennifer Date: Mon, 7 Aug 2023 15:55:45 -0600 Subject: [PATCH 5/7] Add Readme file --- notebooks/NOAA_Access/README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 notebooks/NOAA_Access/README.md diff --git a/notebooks/NOAA_Access/README.md b/notebooks/NOAA_Access/README.md new file mode 100644 index 0000000..d810921 --- /dev/null +++ b/notebooks/NOAA_Access/README.md @@ -0,0 +1,7 @@ +## Download single or multiple NOAA@NSIDC data files + +### Summary +In this tutorial we demonstrate how to download NOAA@NSIDC data, whether it be one file or all the files in a directory. The tutorial is provided in two different languages: Python and R. + +We use one NOAA@NSIDC data set as an example: +* [Sea Ice Index (G02135)](https://nsidc.org/data/G02135) From f920836d26b42c7aea6d975cf1afdbf431cd4b25 Mon Sep 17 00:00:00 2001 From: asteiker Date: Tue, 7 Nov 2023 22:45:45 +0000 Subject: [PATCH 6/7] minor markdown updates and fix single file access error --- .../Python_download_NOAA_NSIDC_data.ipynb | 115 +++++++++++++----- 1 file changed, 86 insertions(+), 29 deletions(-) diff --git a/notebooks/NOAA_Access/Python_download_NOAA_NSIDC_data.ipynb b/notebooks/NOAA_Access/Python_download_NOAA_NSIDC_data.ipynb index 34e5f7c..1a1f6ac 100644 --- a/notebooks/NOAA_Access/Python_download_NOAA_NSIDC_data.ipynb +++ b/notebooks/NOAA_Access/Python_download_NOAA_NSIDC_data.ipynb @@ -17,10 +17,10 @@ "metadata": {}, "source": [ "## 1. Tutorial Overview \n", - "This notebook demonstrates how to download NOAA@NSIDC data using python, it includes examples for downloading a single file and all the files in a directory.\n", + "This notebook demonstrates how to download NOAA@NSIDC data using python. It includes examples for downloading a single file and all the files in a directory.\n", "\n", "### Credits \n", - "This notebook was developed by Jennifer Roebuck of NSIDC\n", + "This notebook was developed by Jennifer Roebuck of NSIDC.\n", "\n", "For questions regarding the notebook or to report problems, please create a new issue in the [NSIDC-Data-Tutorials repo](https://github.com/nsidc/NSIDC-Data-Tutorials/issues)\n", "\n", @@ -51,13 +51,15 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 1, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "#import the requests library \n", "import requests\n", - "from bs4 import BeautifulSoup" + "from bs4 import BeautifulSoup #TBD Describe what htis library does. Do we need to add it to our support set??" ] }, { @@ -67,7 +69,7 @@ "### Downloading a single file\n", "This demonstrates how to download a single file.\n", "\n", - "First we need to set the URL of the file we wish to download. The URL will follow the format of: https://noaadata.apps.nsidc.org/NOAA/ \\\n", + "First we need to set the URL of the file we wish to download. The URL will follow the format of: `https://noaadata.apps.nsidc.org/NOAA/`\n", "\n", "where \\ is specific to the data set and can be determined by exploring https://noaadata.apps.nsidc.org in a web browser. \n", "\n", @@ -76,8 +78,10 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 2, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "#URL of the file \n", @@ -88,21 +92,24 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Next we need to create a HTTPS response object for that URL using the `get` method from the `requests` library." + "Next we need to create a HTTPS response object for that URL using the `get` method from the `requests` library. We will raise an exception if the response returns an error." ] }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 5, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "#Create a HTTPS response object\n", "r = requests.get(file_url)\n", - "\n", - "#Catch any HTTPS errors\n", - "r.raise_for_status()\n", - "except requests.exceptions.HTTPError as err:\n", + " \n", + "try:\n", + " r = requests.get(file_url)\n", + " r.raise_for_status()\n", + "except requests.exceptions.RequestException as err:\n", " raise SystemExit(err)" ] }, @@ -115,8 +122,10 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 6, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "#Download and save the file\n", @@ -138,8 +147,10 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 7, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "#Set the URL of the directory we wish to download all the files from\n", @@ -157,29 +168,75 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 13, + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "\n", + "Index of /NOAA/G02135/north/daily/geotiff/1978/10_Oct/\n", + "\n", + "

Index of /NOAA/G02135/north/daily/geotiff/1978/10_Oct/


../\n",
+       "N_19781026_concentration_v3.0.tif                  21-Jul-2017 03:51              666434\n",
+       "N_19781026_extent_v3.0.tif                         21-Jul-2017 12:25              138426\n",
+       "N_19781028_concentration_v3.0.tif                  21-Jul-2017 03:51              666434\n",
+       "N_19781028_extent_v3.0.tif                         21-Jul-2017 12:25              138426\n",
+       "N_19781030_concentration_v3.0.tif                  21-Jul-2017 03:51              666434\n",
+       "N_19781030_extent_v3.0.tif                         21-Jul-2017 12:25              138426\n",
+       "

\n", + "" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "#Create a HTTPS response object\n", "r = requests.get(archive_url)\n", "\n", - "#Use BeautifulSoup to get a list of the filenames in the directory\n", - "data = BeautifulSoup(r.text, \"html.parser\")\n" + "#Use BeautifulSoup to get a list of the files in the directory\n", + "data = BeautifulSoup(r.text, \"html.parser\")\n", + "data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Now we will create a URL for each of the filenames, set filenames that we want to save the downloaded files as, and download the files. " + "Now we will create a URL for each of the files, set filenames for each of our downloaded files, and download the files. " ] }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 16, + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n", + "N_19781026_concentration_v3.0.tif\n", + "200\n", + "N_19781026_extent_v3.0.tif\n", + "200\n", + "N_19781028_concentration_v3.0.tif\n", + "200\n", + "N_19781028_extent_v3.0.tif\n", + "200\n", + "N_19781030_concentration_v3.0.tif\n", + "200\n", + "N_19781030_extent_v3.0.tif\n" + ] + } + ], "source": [ "#Loop through the list of the html links (excluding the first one which is just a link to the previous directory)\n", "for l in data.find_all(\"a\")[1:]:\n", @@ -227,7 +284,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.15" + "version": "3.10.12" } }, "nbformat": 4, From 6d09537ea698ee401da83f2504d05b58e4221ef1 Mon Sep 17 00:00:00 2001 From: asteiker Date: Tue, 7 Nov 2023 22:46:46 +0000 Subject: [PATCH 7/7] updated single file code block to improve error handling --- .../Python_download_NOAA_NSIDC_data.ipynb | 59 +++---------------- 1 file changed, 9 insertions(+), 50 deletions(-) diff --git a/notebooks/NOAA_Access/Python_download_NOAA_NSIDC_data.ipynb b/notebooks/NOAA_Access/Python_download_NOAA_NSIDC_data.ipynb index 1a1f6ac..7298b19 100644 --- a/notebooks/NOAA_Access/Python_download_NOAA_NSIDC_data.ipynb +++ b/notebooks/NOAA_Access/Python_download_NOAA_NSIDC_data.ipynb @@ -51,7 +51,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "tags": [] }, @@ -78,7 +78,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "tags": [] }, @@ -97,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": { "tags": [] }, @@ -122,7 +122,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": { "tags": [] }, @@ -147,7 +147,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": { "tags": [] }, @@ -168,33 +168,11 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "text/plain": [ - "\n", - "Index of /NOAA/G02135/north/daily/geotiff/1978/10_Oct/\n", - "\n", - "

Index of /NOAA/G02135/north/daily/geotiff/1978/10_Oct/


../\n",
-       "N_19781026_concentration_v3.0.tif                  21-Jul-2017 03:51              666434\n",
-       "N_19781026_extent_v3.0.tif                         21-Jul-2017 12:25              138426\n",
-       "N_19781028_concentration_v3.0.tif                  21-Jul-2017 03:51              666434\n",
-       "N_19781028_extent_v3.0.tif                         21-Jul-2017 12:25              138426\n",
-       "N_19781030_concentration_v3.0.tif                  21-Jul-2017 03:51              666434\n",
-       "N_19781030_extent_v3.0.tif                         21-Jul-2017 12:25              138426\n",
-       "

\n", - "" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "#Create a HTTPS response object\n", "r = requests.get(archive_url)\n", @@ -213,30 +191,11 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "200\n", - "N_19781026_concentration_v3.0.tif\n", - "200\n", - "N_19781026_extent_v3.0.tif\n", - "200\n", - "N_19781028_concentration_v3.0.tif\n", - "200\n", - "N_19781028_extent_v3.0.tif\n", - "200\n", - "N_19781030_concentration_v3.0.tif\n", - "200\n", - "N_19781030_extent_v3.0.tif\n" - ] - } - ], + "outputs": [], "source": [ "#Loop through the list of the html links (excluding the first one which is just a link to the previous directory)\n", "for l in data.find_all(\"a\")[1:]:\n",