-
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.
* Update initializing-wis2box.md * Update configuring-station-metadata.md * add section on bulk station metadata loading * add section for instructor helpers * Addresses #103, links to FM-12 definition and OSCAR/Surface added. * editorial * subscribe only to cache * enumerate GDCs, fix pip3 text * enumerate GDCs, fix pip3 text * Update README.md update student VM info, add information about DNS --------- Co-authored-by: david-i-berry <[email protected]> Co-authored-by: Maaike <[email protected]>
- Loading branch information
1 parent
8bc5d48
commit 7aef174
Showing
12 changed files
with
175 additions
and
38 deletions.
There are no files selected for viewing
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
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
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
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
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
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 |
---|---|---|
|
@@ -31,20 +31,18 @@ pywis-pubsub subscribe --help | |
``` | ||
|
||
!!! note | ||
pywis-pubsub is pre-installed on the local training environment, but can be installed from anywhere with `pip3 pywis-pubsub` | ||
pywis-pubsub is pre-installed on the local training environment, but can be installed from anywhere with `pip3 install pywis-pubsub` | ||
|
||
Update the sample configuration (see the sections marked **TBD**) to connect to the Météo-France Global Broker: | ||
|
||
```bash | ||
vi ~/exercise-materials/pywis-pubsub-exercises/config.yml | ||
``` | ||
|
||
Open MQTT Explorer and connect to the Météo-France Global Broker. | ||
|
||
Update the following values in the configuration: | ||
|
||
- **broker**: `mqtts://everyone:[email protected]:8883` | ||
- **subscribe_topics**: fill in one to many topics `origin/#` and `cache/#` (on separate lines) | ||
- **subscribe_topics**: fill in one to many topics `cache/#` (on separate lines) | ||
- **storage.option.path**: add a directory to where data should be downloaded | ||
|
||
Run the `pywis-pubsub` command: | ||
|
@@ -91,13 +89,22 @@ pywis-pubsub subscribe -c ~/exercise-materials/pywis-pubsub-exercises/config.yml | |
|
||
Let's use [pywiscat](https://github.com/wmo-im/pywiscat) to query the GDC | ||
|
||
At the moment, the available GDCs are as follows: | ||
|
||
- Environment and Climate Change Canada, Meteorological Service of Canada: https://api.weather.gc.ca/collections/wis2-discovery-metadata | ||
- China Meteorological Administration: https://api.weather.gc.ca/api/collections/wis2-discovery-metadata | ||
|
||
```bash | ||
pywiscat wis2 search --help | ||
``` | ||
|
||
!!! note | ||
pywiscat is pre-installed on the local training environment, but can be installed from anywhere with `pip3 install pywiscat` | ||
|
||
!!! note | ||
by default, pywiscat connects to Canada's Global Discovery Catalogue. To set to a different catalogue, set the `PYWISCAT_GDC_URL` | ||
environment variable | ||
|
||
```bash | ||
pywiscat wis2 search | ||
``` | ||
|
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
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
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,41 @@ | ||
# Instructor helpers | ||
|
||
This directory contains resources that may be valuable for instructors as part of | ||
delivery of the training. Note that the below need to be run while connected to | ||
the **WIS2-training** Wi-Fi network. | ||
|
||
# Local global services | ||
|
||
Local global services provide a test environment to simulate WIS2 workflows using | ||
the classroom as a network of WIS2 nodes. | ||
|
||
## Global Broker | ||
|
||
TBD | ||
|
||
### Live map (`live.html`) | ||
|
||
Serve this webpage via HTTP on your VM. Ensure that the following line: | ||
|
||
```javascript | ||
const host = 'ws://tbd.wis2.training:8884/ws'; | ||
``` | ||
|
||
...is updated to point to the Global Broker installed above. | ||
|
||
## Global Cache | ||
|
||
[wis2-gc](https://github.com/wmo-im/wis2-gc) is a Reference Implememtation of | ||
a WIS2 Global Cache (GC). Follow the setup instructions, pointing | ||
to the Global Broker installed above. | ||
|
||
## Global Discovery Catalogue | ||
|
||
[wis2-gdc](https://github.com/wmo-im/wis2-gdc) is a Reference Implememtation of | ||
a WIS2 Global Discovery Catalogue (GDC). Follow the setup instructions, pointing | ||
to the Global Broker installed above. | ||
|
||
# Other | ||
|
||
* `instructor_bashrc.sh`: sample bash prompt to help with screen readability while | ||
displaying a termnial during a practical session. |
File renamed without changes.
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,75 @@ | ||
!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>wis2box training live data and metadata notifications</title> | ||
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" /> | ||
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/mqtt.min.js"></script> | ||
<script> | ||
|
||
const host = 'ws://tbd.wis2.training:8884/ws'; | ||
const options = { | ||
username: 'everyone', | ||
password: 'everyone', | ||
keepalive: 60, | ||
protocolVersion: 5, | ||
reconnectPeriod: 1000, | ||
connectTimeout: 30 * 1000, | ||
}; | ||
|
||
console.log('Connecting mqtt client'); | ||
const client = mqtt.connect(host, options); | ||
|
||
client.on('connect', function () { | ||
client.subscribe('origin/#', function (err) { | ||
if (!err) { | ||
console.log('Connected!') | ||
} | ||
}) | ||
}) | ||
|
||
client.on('error', (err) => { | ||
console.log('Connection error: ', err) | ||
client.end() | ||
}); | ||
|
||
client.on('reconnect', () => { | ||
console.log('Reconnecting...') | ||
}); | ||
|
||
</script> | ||
</head> | ||
|
||
<body> | ||
<header> | ||
<h1>wis2box training live data and metadata notifications</h1> | ||
</header> | ||
<div id="map" style="height: 600px;"></div> | ||
<footer> | ||
Powered by WIS2 | ||
</footer> | ||
</body> | ||
<script> | ||
var map = L.map('map').setView([0, 0], 2); | ||
var tiles = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}', { | ||
maxZoom: 19, | ||
attributionControl: false | ||
}).addTo(map); | ||
map.attributionControl.setPrefix(''); | ||
|
||
client.on('message', function (topic, message) { | ||
const content = JSON.parse(message.toString()) | ||
addMarker(content); | ||
console.log(content); | ||
}) | ||
|
||
function addMarker(feature) { | ||
var marker = L.geoJSON(feature).addTo(map); | ||
marker.bindPopup('<h1><a target="_blank" href="' + feature.links[0].href + '">' + feature.id + '</a>'); | ||
setTimeout(removeMarker, 5000, marker); | ||
} | ||
function removeMarker(feature) { | ||
feature.removeFrom(map); | ||
} | ||
</script> | ||
</html> |
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