Skip to content

Commit

Permalink
Merge pull request #11 from esciencecenter-digital-skills/update-epis…
Browse files Browse the repository at this point in the history
…ode-5

update E5 dataset access
  • Loading branch information
fnattino authored May 24, 2022
2 parents 0942795 + ef57ff1 commit c91e4c5
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 764 deletions.
284 changes: 143 additions & 141 deletions _episodes/19-access-data.md → _episodes/05-access-data.md

Large diffs are not rendered by default.

Binary file removed fig/19-STAC-landsat8-B8-cutout.png
Binary file not shown.
Binary file removed fig/19-STAC-s2-preview.jpg
Binary file not shown.
Binary file removed fig/19-STAC-s2-true-color-image-cutout.png
Binary file not shown.
File renamed without changes
Binary file added fig/E05-02-STAC-browser-exercise.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/E05-03-STAC-s2-preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/E05-04-STAC-l8-preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion files/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ dependencies:
- earthpy>=0.9.0
- xarray-spatial
- descartes>=1.0.0 # necessary for geopandas plotting
- pystac-client
- pystac-client==0.3.2 # pin version to work with earth-search STAC API
- python-graphviz # necessary for plotting dask graphs
597 changes: 0 additions & 597 deletions notebooks/XX-access-data.ipynb

This file was deleted.

50 changes: 25 additions & 25 deletions setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Setup
## Setting up your Lesson Directory and Getting the Data

1. Open the terminal/shell:
* On **Windows**, open **Git Bash**.
* On **Windows**, open **Git Bash**.
* On **Mac OS** or **Linux**, open the **Terminal** app.

2. Change your working directory to your **Desktop** :
Expand Down Expand Up @@ -60,8 +60,8 @@ individually can be a bit difficult, however, so we recommend the all-in-one
installer [Anaconda][anaconda].

Regardless of how you choose to install it, please make sure you install Python
version 3.x (e.g., 3.7 is fine). Also, please set up your python environment at
least a day in advance of the workshop. If you encounter problems with the
version 3.x (e.g., 3.7 is fine). Also, please set up your python environment at
least a day in advance of the workshop. If you encounter problems with the
installation procedure, ask your workshop organizers via e-mail for assistance so
you are ready to go as soon as the workshop begins.

Expand All @@ -87,7 +87,7 @@ you are ready to go as soon as the workshop begins.

### Linux

Note that the following installation steps require you to work from the shell.
Note that the following installation steps require you to work from the shell.
If you run into any difficulties, please request help before the workshop begins.

1. Open [https://www.anaconda.com/distribution/][anaconda-linux] with your web browser.
Expand All @@ -112,20 +112,20 @@ If you run into any difficulties, please request help before the workshop begins
d. Press enter.

e. Follow the text-only prompts. When the license agreement appears (a colon
will be present at the bottom of the screen) press the space bar until you see the
bottom of the text. Type `yes` and press enter to approve the license. Press
enter again to approve the default location for the files. Type `yes` and
press enter to prepend Anaconda to your `PATH` (this makes the Anaconda
will be present at the bottom of the screen) press the space bar until you see the
bottom of the text. Type `yes` and press enter to approve the license. Press
enter again to approve the default location for the files. Type `yes` and
press enter to prepend Anaconda to your `PATH` (this makes the Anaconda
distribution your user's default Python).
## Setting up the workshop environment with conda
Once you have installed Anaconda, you should have access to the `conda` command in your terminal.
Once you have installed Anaconda, you should have access to the `conda` command in your terminal.
1. Test that this is so by running the `conda` command in the terminal. You should get an output that looks like this:
```bash
→ conda
→ conda
usage: conda [-h] [-V] command ...
conda is a tool for managing and deploying applications, environments and packages.
Expand Down Expand Up @@ -168,27 +168,27 @@ Once you have installed Anaconda, you should have access to the `conda` command
2. Create the environment using the `conda create` command. It's possible to paste the following
code on the Terminal:

```bash
conda create -n geospatial -c conda-forge -y \
jupyterlab numpy matplotlib \
xarray rasterio geopandas rioxarray earthpy descartes xarray-spatial pystac-client python-graphviz
xarray rasterio geopandas rioxarray earthpy descartes xarray-spatial pystac-client==0.3.2 python-graphviz
```

_Please note that this step may take several minutes to complete. If it takes more than a few minutes, see below for another method._

In this command, the `-n` argument specifies the environment name, the `-c` argument specifies the Conda channel
where the libraries are hosted, and the `-y` argument spares the need for confirmation. The following arguments are
the names of the libraries we are going to use. As you can see, geospatial analysis requires many libraries!
Luckily, package managers like `conda` facilitate the process of installing and managing them.

If the above command does not work, it's also possible to create the environment from a file:
Right-click and "Save Link As..." on this link:
[https://carpentries-incubator.github.io/geospatial-python/files/environment.yaml](files/environment.yaml)
Name it `environment.yaml` and save it to your `geospatial-python` folder.
The `environment.yaml` contains the names of Python libraries that are required to run the lesson:
Expand All @@ -210,10 +210,10 @@ code on the Terminal:
- xarray-spatial
- earthpy
- descartes # necessary for geopandas plotting
- pystac-client
- pystac-client==0.3.2 # pin version to work with earth-search STAC API
- python-graphviz
```
In the terminal, navigate to the directory where you saved the `environment.yaml` file using the `cd` command.
Then run:
Expand All @@ -222,9 +222,9 @@ code on the Terminal:
```
`conda` should begin to locate, download, and install the Python libraries listed in the `environment.yaml` file.
> ## Faster Environment Install With One Extra Step
> If you see a spinning `/` for more than a few minutes, you may want to try the following to speed up the environment installation.
> If you see a spinning `/` for more than a few minutes, you may want to try the following to speed up the environment installation.
> 1. Cancel the currently running `conda create` process with CTRL+C
> 2. Run `conda install -c conda-forge mamba`
> 3. Run `mamba env create -f environment.yaml`
Expand Down Expand Up @@ -260,16 +260,16 @@ code on the Terminal:
```

> ## IMPORTANT
> If you close the terminal, you will need to
> If you close the terminal, you will need to
reactivate this environment with `conda activate geospatial` to use the Python libraries required for the lesson and
> to start JupyterLab, which is also installed in the `geospatial` environment.
{: .callout}


## Starting JupyterLab

In order to follow the lessons on using Python (episode 5 and onward), you should launch JupyterLab
after activating the geospatial conda environment in your working directory that contains the data you downloaded.
In order to follow the lessons on using Python (episode 5 and onward), you should launch JupyterLab
after activating the geospatial conda environment in your working directory that contains the data you downloaded.
See [Starting JupyterLab][starting-jupyterlab] for guidance.

If all of the steps above completed successfully you are ready to follow along with the lesson!
Expand All @@ -290,7 +290,7 @@ If all of the steps above completed successfully you are ready to follow along w
% ls ~
> Applications Downloads Pictures
anaconda3 Library Public
Desktop Movies
Desktop Movies
Documents Music
```

Expand Down

0 comments on commit c91e4c5

Please sign in to comment.