-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0a2d14
commit 0f6c59d
Showing
2 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
116 changes: 116 additions & 0 deletions
116
documentation/docs/practical-sessions/discovering-datasets-from-wis2-gdc.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- | ||
title: Discovering datasets from the WIS2 Global Discovery Catalogue | ||
--- | ||
|
||
# Discovering datasets from the WIS2 Global Discovery Catalogue | ||
|
||
!!! abstract "Learning outcomes!" | ||
|
||
By the end of this practical session, you will be able to: | ||
|
||
- use pywiscat to discover datasets from the Global Discovery Catalogue | ||
|
||
## Introduction | ||
|
||
In this session you will learn how to discover data from the WIS2 Global Discovery Catalogue (GDC). | ||
|
||
At the moment, the following GDCs are available: | ||
|
||
- Environment and Climate Change Canada, Meteorological Service of Canada: <https://wis2-gdc.weather.gc.ca> | ||
- China Meteorological Administration: <https://gdc.wis.cma.cn/api> | ||
- Deutscher Wetterdienst: <https://wis2.dwd.de/gdc> | ||
|
||
For this exercise, we will use the WIS2 GDC setup as part of the training, found at <http://192.168.7.153>. | ||
|
||
## Preparation | ||
|
||
!!! note | ||
Before starting please login to your student VM. | ||
|
||
## Installing pywiscat | ||
|
||
Use the `pip3` Python package installer to install pywiscat on your VM: | ||
```bash | ||
pip3 install pywiscat | ||
``` | ||
|
||
Verify that the installation was successful: | ||
|
||
```bash | ||
pywiscat --version | ||
``` | ||
|
||
## Finding data with pywiscat | ||
|
||
By default, pywiscat connects to Canada's Global Discovery Catalogue. Let's configure pywiscat to query the training GDC by setting the `PYWISCAT_GDC_URL` environment variable: | ||
|
||
```bash | ||
export PYWISCAT_GDC_URL=http://192.168.7.153 | ||
``` | ||
|
||
Let's use [pywiscat](https://github.com/wmo-im/pywiscat) to query the GDC setup as part of the training. | ||
|
||
```bash | ||
pywiscat search --help | ||
``` | ||
|
||
Now search the GDC for all records: | ||
|
||
```bash | ||
pywiscat search | ||
``` | ||
|
||
!!! question | ||
|
||
How many records are returned from the search? | ||
|
||
??? success "Click to reveal answer" | ||
There should be over 40 records returned | ||
|
||
Let's try querying the GDC with a keyword: | ||
|
||
```bash | ||
pywiscat search -q observations | ||
``` | ||
|
||
!!! question | ||
|
||
What is the data policy of the results? | ||
|
||
??? success "Click to reveal answer" | ||
All data returned should specify "core" data | ||
|
||
Try additional queries with `-q` | ||
|
||
!!! tip | ||
|
||
The `-q` flag allows for the following syntax: | ||
|
||
- `-q synop`: find all records with the word "synop" | ||
- `-q temp`: find all records with the word "temp" | ||
- `-q "observations AND fiji"`: find all records with the words "observations" and "fiji" | ||
- `-q "observations NOT fiji"`: find all records that contain the word "observations" but not the word "fiji" | ||
- `-q "synop OR temp"`: find all records with both "synop" or "temp" | ||
- `-q "obs~"`: fuzzy search | ||
|
||
When searching for terms with spaces, enclose in double quotes. | ||
|
||
Let's get more details on a specific search result that we are interested in: | ||
|
||
```bash | ||
pywiscat get <id> | ||
``` | ||
|
||
!!! tip | ||
|
||
Use the `id` value from the previous search. | ||
|
||
|
||
## Conclusion | ||
|
||
!!! success "Congratulations!" | ||
|
||
In this practical session, you learned how to: | ||
|
||
- use pywiscat to discover datasets from the WIS2 Global Discovery Catalogue | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters