Skip to content

Commit e9be392

Browse files
committed
markdown source builds
Auto-generated via `{sandpaper}` Source : df9bde8 Branch : main Author : Ou Ku <o.ku@esciencecenter.nl> Time : 2026-04-13 12:40:22 +0000 Message : Merge pull request carpentries-incubator#182 from esciencecenter-digital-skills/access_data Access data
1 parent e836e74 commit e9be392

File tree

5 files changed

+267
-168
lines changed

5 files changed

+267
-168
lines changed

05-access-data.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ exercises: 15
1717
- Open satellite imagery as raster data and save it to disk.
1818
:::
1919

20+
::::::::::::::::::::::::::::::::::::: instructor
2021

21-
## Considerations for the position of this episode in the workshop
22+
### Considerations for the position of this episode in the workshop
2223

2324
*When this workshop is taught to learners with limited prior knowledge of Python, it might be better to place this episode after episode 11 and before episode 12. This episode contains an introduction to working with APIs and dictionaries, which can be perceived as challenging by some learners. Another consideration for placing this episode later in the workshop is when it is taught to learners with prior GIS knowledge who want to perform GIS-like operations with data they have already collected or for learners interested in working with raster data but less interested in satellite images.*
2425

26+
:::::::::::::::::::::::::::::::::::::
27+
2528
## Introduction
2629

2730
A number of satellites take snapshots of the Earth's surface from space. The images recorded by these remote sensors
@@ -197,6 +200,17 @@ print(search.matched())
197200
You will notice that more than 500 scenes match our search criteria. We are however interested in the period right before and after the wildfire of Rhodes. In the following exercise you will therefore have to add a time filter to
198201
our search criteria to narrow down our search for images of that period.
199202

203+
::::::::::::::: instructor
204+
205+
### Extra attention for the following exercise
206+
207+
- The exercise **Exercise: Search satellite scenes using metadata filters** needs extra attention. Its output `search.json` is required for the later episodes. Therefore we recommend:
208+
- Do not skip this exercise;
209+
- Think twice when you would like to change the query arguments in this exercise;
210+
- Make sure all the audience have the output `search.json` before continuing.
211+
212+
::::::::::::::::
213+
200214
::: challenge
201215
## Exercise: Search satellite scenes with a time filter
202216

@@ -567,11 +581,13 @@ The authentication procedure for dataset with restricted access might differ dep
567581
NASA CMR, follow these steps in order to access data using Python:
568582

569583
* Create a NASA Earthdata login account [here](https://urs.earthdata.nasa.gov);
570-
* Set up a netrc file with your credentials, e.g. by using [this script](https://git.earthdata.nasa.gov/projects/LPDUR/repos/daac_data_download_python/browse/EarthdataLoginSetup.py);
571-
* Define the following environment variables:
584+
* Set up a netrc file with your credentials, e.g. by using [earthaccess](https://earthaccess.readthedocs.io/en/latest/user/authenticate/), which can be executed interactively in a Jupyter session, and creates a `.netrc` file in your home directory;
585+
* Define the following environment variables in your Jupyter session:
572586

573587
```python
574588
import os
589+
# These variables are needed by rasterio.open_rasterio function, which calls GDAL in the background
590+
# GDAL needs the path where to store cookies
575591
os.environ["GDAL_HTTP_COOKIEFILE"] = "./cookies.txt"
576592
os.environ["GDAL_HTTP_COOKIEJAR"] = "./cookies.txt"
577593
```

instructor-notes.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ title: Instructor Notes
44

55
## Instructor notes
66

7-
### Episode 1
8-
9-
- The exercise **Exercise: Search satellite scenes using metadata filters** needs extra attention. Its output `search.json` is required for the later episodes. Therefore we recommend:
10-
- Do not skip this exercise;
11-
- Think twice when you would like to change the query arguments in this exercise;
12-
- Make sure all the audience have the output `search.json` before continuing.
13-
147
### Episode 3
158

169
- `brpgewaspercelen_definitief_2020_small.gpkg` was created because the original file was too large to download and load. Original file, which was ~500Mb could take several minutes to load, and could crash the Jupyter terminal.

md5sum.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
"episodes/02-intro-vector-data.md" "8eda5808b184fd39286ec503e5c83ed3" "site/built/02-intro-vector-data.md" "2025-02-25"
1010
"episodes/03-crs.md" "da701bd7f61a26a5e617b80c09d2c621" "site/built/03-crs.md" "2026-04-09"
1111
"episodes/04-geo-landscape.md" "389e4a1251ae837bf6dc9ff7e88238ae" "site/built/04-geo-landscape.md" "2026-04-09"
12-
"episodes/05-access-data.md" "e6f98f2b531e3f63075fcc64dd5d93f6" "site/built/05-access-data.md" "2026-04-09"
12+
"episodes/05-access-data.md" "50a0e69f2044698f68250bee946117ec" "site/built/05-access-data.md" "2026-04-14"
1313
"episodes/06-raster-intro.md" "df117e17faa1f9f5149168bb1201f576" "site/built/06-raster-intro.md" "2026-04-09"
1414
"episodes/07-vector-data-in-python.md" "235db0013b1b35708c162086cb404e19" "site/built/07-vector-data-in-python.md" "2025-02-26"
1515
"episodes/08-crop-raster-data.md" "f1bed5014e3601cfb2e2ecaa01fb4215" "site/built/08-crop-raster-data.md" "2026-04-09"
1616
"episodes/09-raster-calculations.md" "f011028f5d2f2bc921596330479afcc5" "site/built/09-raster-calculations.md" "2025-05-20"
1717
"episodes/10-zonal-statistics.md" "6b6ff17570436c41d6e2cb75cdb0ce32" "site/built/10-zonal-statistics.md" "2025-02-25"
1818
"episodes/11-parallel-raster-computations.md" "186a8de9853218472427dc0ec4becde8" "site/built/11-parallel-raster-computations.md" "2025-02-26"
1919
"episodes/12-data-cube.md" "44bd42788ae417837d9ff3973c49e90f" "site/built/12-data-cube.md" "2026-04-09"
20-
"instructors/instructor-notes.md" "1b1cbfc8fff44565421842208ccdab4f" "site/built/instructor-notes.md" "2023-07-27"
21-
"learners/setup.md" "b0415e78f35b460b848b204d7cc30409" "site/built/setup.md" "2025-02-25"
20+
"instructors/instructor-notes.md" "19861d6274113b31911a556775f88f21" "site/built/instructor-notes.md" "2026-04-14"
21+
"learners/setup.md" "c662b21994a424432ff4118bbdfcfedd" "site/built/setup.md" "2026-04-14"
22+
"learners/setup_alternative.md" "6494c714dca5408c2030f5b1c5a81312" "site/built/setup_alternative.md" "2026-04-14"
2223
"profiles/learner-profiles.md" "ab92fe3511bf951857b47c0ecbf2ab79" "site/built/learner-profiles.md" "2023-07-27"

setup.md

Lines changed: 48 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -18,161 +18,85 @@ Now you should have the following files in the `data` directory:
1818

1919
## Software Setup
2020

21-
### Installing Python Using Anaconda
21+
[Python](https://python.org) is a popular language for scientific computing, and great for
22+
general-purpose programming as well. There are many ways to install Python and the
23+
required dependencies. In this workshop, we suggest to use [`uv`](https://docs.astral.sh/uv/)
24+
for its fast and easy installation process.
2225

23-
[Python][python] is a popular language for scientific computing, and great for
24-
general-purpose programming as well. Installing all of its scientific packages
25-
individually can be a bit difficult, however, so we recommend the all-in-one
26-
installer [Anaconda][anaconda].
26+
:::::::::::::::::::::::::::::::::::::::discussion
27+
28+
### Software Setup using uv
29+
30+
Please follow the instructions below according to your operating system.
2731

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

34-
::::::::::::::::::::::::::::::::::::::: discussion
35-
36-
### Installing Anaconda
37-
3838
:::::::::::::::::::::::::::::::::::::::::::::::::::
3939

4040
:::::::::::::::: solution
4141

42-
### Windows
43-
44-
[Video tutorial][video-windows]
45-
46-
1. Open [https://www.anaconda.com/download][anaconda-windows] with your web browser.
42+
### Linux / MacOS
4743

48-
2. Download the Anaconda for Windows installer with Python 3.
49-
50-
3. Install Python 3 by running the Anaconda Installer, using all of the defaults for installation *except* make sure that:
51-
* **Register Anaconda as my default Python 3.x** option is checked (it should be in the latest version of Anaconda).
52-
* **Add Anaconda to my PATH environment variable** is selected.
53-
54-
55-
:::::::::::::::::::::::::
56-
57-
:::::::::::::::: solution
44+
Open a terminal and install `uv` following the [official installation instructions](https://docs.astral.sh/uv/getting-started/installation/):
5845

59-
### Mac OS
46+
```sh
47+
curl -LsSf https://astral.sh/uv/install.sh | sh
48+
```
6049

61-
[Video tutorial][video-mac]
50+
Then make sure you are inside the `geospatial-python` directory you created during the data setup step by doing:
6251

63-
1. Open [https://www.anaconda.com/download][anaconda-mac] with your web browser.
52+
```sh
53+
cd ~/Desktop/geospatial-python
54+
```
6455

65-
2. Download the Anaconda installer with Python 3 for OS X. These instructions assume that you use the "Graphical Installer" `.pkg` file
56+
Finally, run the following command to create a virtual environment and install the required dependencies:
6657

67-
3. Follow the Python 3 installation instructions. Make sure that the install location is set to **Install only for me** so Anaconda will install its files locally, relative to your home directory. Installing the software for all users tends to create problems in the long run and should be avoided.
58+
```sh
59+
uv venv --python=3.12 && uv pip install -r https://raw.githubusercontent.com/carpentries-incubator/geospatial-python/main/files/requirements.txt
60+
```
6861

6962
:::::::::::::::::::::::::
7063

7164

7265
:::::::::::::::: solution
7366

74-
### Linux
75-
76-
Note that the following installation steps require you to work from the shell.
77-
If you run into any difficulties, please request help before the workshop begins.
78-
79-
1. Open [https://www.anaconda.com/download][anaconda-linux] with your web browser.
80-
81-
2. Download the Anaconda installer with Python 3 for Linux.
67+
### Windows
8268

83-
3. Open a terminal window and navigate to the directory where the executable is downloaded (e.g., `cd ~/Downloads`).
69+
On Windows, first we install `uv` using PowerShell following the [official installation instructions](https://docs.astral.sh/uv/getting-started/installation/):
8470

85-
4. Type:
71+
```powershell
72+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
73+
```
8674

87-
```bash
88-
bash Anaconda3-
89-
```
75+
After the installation, you may see suggestions on the PowerShell terminal like `$env:Path = "C:\Users\username\.local\bin;$env:Path"` This means you need to manually add the `uv` executable to your system's PATH variable. Please run the suggested command in your PowerShell terminal to add `uv` to your PATH. Otherwise PowerShell will not recognize the `uv` command in the next step.
9076

91-
and press "Tab" to autocomplete the full file name. The name of file you just downloaded should appear.
77+
Then make sure you are inside the `geospatial-python` directory you created during the data setup step by doing:
9278

93-
5. Press "Enter" (or "Return" depending on your keyboard).
79+
```powershell
80+
cd \Users\<Username>\Desktop\geospatial-python
81+
```
9482

95-
6. Follow the text-only prompts. When the license agreement appears (a colon will be present at the bottom of the screen) press "Spacebar" 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).
83+
And replace the `<Username>` pattern (including the angle brackets `<>`) with your Windows username.
84+
Finally, run the following command to create a virtual environment and install the required dependencies:
9685

97-
7. Close the terminal window.
86+
```powershell
87+
uv venv --python=3.12; if ($LASTEXITCODE -eq 0) { uv pip install -r https://raw.githubusercontent.com/carpentries-incubator/geospatial-python/main/files/requirements.txt}
88+
```
9889

9990
:::::::::::::::::::::::::
10091

92+
After the installation, a `.venv` directory will be created in the current directory, which contains the virtual environment with all the required dependencies.
10193

102-
### Setting up the workshop environment
103-
104-
If Anaconda was properly installed, you should have access to the `conda`
105-
command in your terminal (use the **Anaconda prompt** on **Windows**).
106-
107-
1. Test that `conda` is correctly installed by typing:
108-
109-
```bash
110-
conda --version
111-
```
94+
### Testing the installation
11295

113-
which should print the version of conda that is currently installed, e.g. :
96+
In order to follow the lesson, you should launch JupyterLab. Let's try it now to make sure everything is set up correctly. You should run the following command in your terminal from the `geospatial-python` directory:
11497

115-
```output
116-
conda 22.9.0
117-
```
118-
119-
2. Run the following command:
120-
121-
```bash
122-
conda install -c conda-forge mamba
123-
```
124-
125-
IMPORTANT: If your terminal responds to the above command with `conda: command not found` see the [Troubleshooting section](#troubleshooting-conda-command-not-found).
126-
127-
3. Create the Python environment for the workshop by running:
128-
129-
```bash
130-
mamba env create -n geospatial -f https://raw.githubusercontent.com/carpentries-incubator/geospatial-python/main/files/environment.yaml
131-
```
132-
133-
Note that this step can take several minutes.
134-
135-
4. When installation has finished you should see the following message in the terminal:
136-
137-
```output
138-
# To activate this environment, use
139-
# $ conda activate geospatial
140-
#
141-
# To deactivate an active environment, use
142-
# $ conda deactivate
143-
```
144-
145-
5. Now Activate the `geospatial` environment by running:
146-
147-
```bash
148-
conda activate geospatial
149-
```
150-
151-
If successful, the text `(base)` in your terminal prompt will now read
152-
`(geospatial)` indicating that you are now in the Anaconda virtual environment
153-
named `geospatial`. The command `which python` should confirm that we're using
154-
the Python installation in the `geospatial` virtual environment. For example:
155-
156-
```bash
157-
which python
158-
```
159-
160-
```output
161-
/Users/your-username/anaconda3/envs/geospatial/bin/python
16298
```
163-
164-
IMPORTANT: If you close the terminal, you will need to reactivate this
165-
environment with `conda activate geospatial` to use the Python libraries
166-
required for the lesson and to start JupyterLab, which is also installed in the
167-
`geospatial` environment.
168-
169-
### Starting JupyterLab
170-
171-
In order to follow the lesson, you should launch JupyterLab. After activating the
172-
geospatial conda environment, enter the following command in your terminal (use the **Anaconda prompt** on **Windows**):
173-
174-
```bash
175-
jupyter lab
99+
uv run jupyter lab
176100
```
177101

178102
Once you have launched JupyterLab, create a new Python 3 notebook, type the following code snippet in a cell and press the "Play" button:
@@ -183,42 +107,11 @@ import rioxarray
183107

184108
If all the steps above completed successfully you are ready to follow along with the lesson!
185109

186-
### Troubleshooting `conda: command not found`
187-
188-
* **Mac OS and Linux users:**
189-
190-
1. First, find out where Anaconda is installed.
191-
192-
The typical install location is in your `$HOME` directory (i.e., `/Users/your-username/`) so use `ls ~` to check whether an `anaconda3` directory is present in your home directory:
193-
194-
```bash
195-
ls ~
196-
```
197-
198-
```output
199-
Applications Downloads Pictures
200-
anaconda3 Library Public
201-
Desktop Movies
202-
Documents Music
203-
```
204-
205-
If, like above, you see a directory called `anaconda3` in the output we're in good shape. If not, **contact the instructor for help**.
206-
207-
2. Activate the `conda` command-line program by entering the following command:
208-
209-
```bash
210-
source ~/anaconda3/bin/activate
211-
```
212-
If all goes well, nothing will print to the terminal and your prompt will now have `(base)` floating around somewhere
213-
on the left. This is an indication that you are in the base Anaconda environment.
110+
::: callout
214111

215-
Continue from the beginning of step 3 to complete the creation of the `geospatial` virtual environment.
112+
### Alternative: software setup using Anaconda
216113

114+
If you prefer to use Anaconda, you can follow the alternative setup instructions on [this
115+
page](./setup_alternative.md).
217116

218-
[anaconda]: https://www.anaconda.com/
219-
[anaconda-mac]: https://www.anaconda.com/download/#macos
220-
[anaconda-linux]: https://www.anaconda.com/download/#linux
221-
[anaconda-windows]: https://www.anaconda.com/download/#windows
222-
[python]: https://python.org
223-
[video-mac]: https://www.youtube.com/watch?v=TcSAln46u9U
224-
[video-windows]: https://www.youtube.com/watch?v=xxQ0mzZ8UvA
117+
:::

0 commit comments

Comments
 (0)