Skip to content

Commit

Permalink
update instructions for local running
Browse files Browse the repository at this point in the history
  • Loading branch information
eeholmes committed May 24, 2024
1 parent e5bfe58 commit d44ed8f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
10 changes: 9 additions & 1 deletion content/02-local-setup-python.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
title: Setting up on your computer - Python users
---

The easiest way to run the Python tutorials locally is to use the Docker container `py-rocket-geospatial`; this is the environment that is being used in the JupyterHub. You'll need containerization software such as [Docker Desktop](https://www.docker.com/products/docker-desktop/) or [Podman](https://podman.io/) installed.
# Running from Google Colab

The standard [Google Colab](https://colab.research.google.com/) has most of the packages you will need. For most of the tutorials, you only need to install `earthaccess` with

`!pip install earthaccess`

# Running from a Docker file

The easiest way to run the Python tutorials locally is to use the Docker container `py-rocket-geospatial`; this has JupyterLab and the conda environment that is being used in the JupyterHub. You'll need containerization software such as [Docker Desktop](https://www.docker.com/products/docker-desktop/) or [Podman](https://podman.io/) installed.


## Start the docker image
Expand Down
24 changes: 23 additions & 1 deletion content/02-local-setup-r.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,29 @@
title: Setting up on your computer - R users
---

The easiest way to run the R tutorials locally is to use the Docker container `py-rocket-geospatial`; this is the environment that is being used in the JupyterHub. You'll need containerization software such as [Docker Desktop](https://www.docker.com/products/docker-desktop/) or [Podman](https://podman.io/) installed.
# Running locally

If you are set up locally to run R and have tidyverse installed, then for most of the tutorials, you only need to install `earthdatalogin` and `terra` with

```
devtools::install_github("boettiger-lab/earthdatalogin")
install.packages("terra")
```

RStudio should alert you if there are other packages that you need to install.

# Running from Posit Cloud

The standard [Posit Cloud](https://posit.cloud/) has most of the packages you will need. For most of the tutorials, you only need to install `earthdatalogin` and `terra` with

```
devtools::install_github("boettiger-lab/earthdatalogin")
install.packages("terra")
```

# Running from a Docker file

If you don't have RStudio or R installed, the easiest way to run the R tutorials locally is to use the Docker container `py-rocket-geospatial`; this is the environment that is being used in the JupyterHub. You'll need containerization software such as [Docker Desktop](https://www.docker.com/products/docker-desktop/) or [Podman](https://podman.io/) installed.

## Start the docker image

Expand Down
11 changes: 9 additions & 2 deletions tutorials/r/1-earthdatalogin.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ For more on `earthdatalogin` visit the [`earthdatalogin` GitHub](https://github.

An Earthdata Login account is required to access data from NASA Earthdata. Please visit <https://urs.earthdata.nasa.gov> to register as a new user and manage your Earthdata Login account. This account is free to create and only takes a moment to set up.

You will need earthdatalogin 0.0.2.99 (dev version)

## Load Required Packages

We are using the JupyterHub and all necessary packages are already installed for you.
Expand All @@ -37,6 +39,7 @@ netCDF files. Using a Docker image (and Python) is often less aggravating.*


```{r}
# devtools::install_github("boettiger-lab/earthdatalogin")
library(earthdatalogin)
library(terra)
```
Expand Down Expand Up @@ -184,8 +187,12 @@ If you get the following error:

> Error: [rast] file does not exist: /vsicurl/https://archive.podaac.earthdata.nasa.gov/podaac-ops-cumulus-protected/AVHRR_OI-NCEI-L4-GLOB-v2.1/20200115120000-NCEI-L4_GHRSST-SSTblend-AVHRR_OI-GLOB-v02.0-fv02.1.nc
It is likely because you do not have the End User Licence Agreement (EULA)/permissions to use that data set or are not properly logged in using `earthdatalogin::edl_netrc()`. Another reason may be that your
GDAL installation is not properly handling `netCDF` files.
The following are possible problems:

* you are not logged in using `earthdatalogin::edl_netrc()`. Try running the code again.
* you inadvertantly installed `terra` from source. Try deleting the package via the 'x' inthe package tab and reinstalling.
* you do not have the End User Licence Agreement (EULA)/permissions to use that data set. Go to https://urs.earthdata.nasa.gov/home, log in and then go to the EULA tab.
* GDAL installation is not properly handling `netCDF` files. That is hard. You may be out of luck.
:::

Also try this example script from the `?earthdatalogin::edl_netrc` documentation that uses a `.tif` file instead of `.netCDF`.
Expand Down

0 comments on commit d44ed8f

Please sign in to comment.