Skip to content

Commit

Permalink
use file templating, rename template files, update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Aug 31, 2023
1 parent b89061d commit 14605c6
Show file tree
Hide file tree
Showing 7 changed files with 325 additions and 239 deletions.
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
data:
COUNTRY_CODE.CENTRE_ID.data.core.weather.surface-based-observations.synop:
$COUNTRY_CODE.$CENTRE_ID.data.core.weather.surface-based-observations.synop:
plugins:
txt:
- plugin: wis2box.data.synop2bufr.ObservationDataSYNOP2BUFR
notify: true
buckets:
- ${WIS2BOX_STORAGE_INCOMING}
file-pattern: '^.*-(\d{4})(\d{2}).*\.txt$'
- $${WIS2BOX_STORAGE_INCOMING}
file-pattern: '^.*-(\d{4})(\d{2}).*\.txt$$'
csv:
- plugin: wis2box.data.csv2bufr.ObservationDataCSV2BUFR
template: /data/wis2box/csv2bufr_mappings.json
notify: true
buckets:
- ${WIS2BOX_STORAGE_INCOMING}
file-pattern: '^.*\.csv$'
- $${WIS2BOX_STORAGE_INCOMING}
file-pattern: '^.*\.csv$$'
bin:
- plugin: wis2box.data.bufr4.ObservationDataBUFR
notify: true
buckets:
- ${WIS2BOX_STORAGE_INCOMING}
file-pattern: '^.*\.bin$'
- $${WIS2BOX_STORAGE_INCOMING}
file-pattern: '^.*\.bin$$'
bufr:
- plugin: wis2box.data.bufr4.ObservationDataBUFR
notify: true
buckets:
- ${WIS2BOX_STORAGE_INCOMING}
file-pattern: '^.*\.bufr$'
- $${WIS2BOX_STORAGE_INCOMING}
file-pattern: '^.*\.bufr$$'
bufr4:
- plugin: wis2box.data.bufr2geojson.ObservationDataBUFR2GeoJSON
buckets:
- ${WIS2BOX_STORAGE_PUBLIC}
file-pattern: '^WIGOS_(\d-\d+-\d+-\w+)_.*\.bufr4$'
- $${WIS2BOX_STORAGE_PUBLIC}
file-pattern: '^WIGOS_(\d-\d+-\d+-\w+)_.*\.bufr4$$'
COUNTRY_CODE.CENTRE_ID.data.core.weather.surface-based-observations.temp:
plugins:
bin:
- plugin: wis2box.data.bufr4.ObservationDataBUFR
notify: true
buckets:
- ${WIS2BOX_STORAGE_INCOMING}
file-pattern: '^.*\.bin$'
- $${WIS2BOX_STORAGE_INCOMING}
file-pattern: '^.*\.bin$$'
bufr:
- plugin: wis2box.data.bufr4.ObservationDataBUFR
notify: true
buckets:
- ${WIS2BOX_STORAGE_INCOMING}
file-pattern: '^.*\.bufr$'
- $${WIS2BOX_STORAGE_INCOMING}
file-pattern: '^.*\.bufr$$'
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
wis2box:
retention: P30D
topic_hierarchy: COUNTRY_CODE.CENTRE_ID.data.core.weather.surface-based-observations.synop
country: COUNTRY_CODE
centre_id: CENTRE_ID
topic_hierarchy: $COUNTRY_CODE.$CENTRE_ID.data.core.weather.surface-based-observations.synop
country: $COUNTRY_CODE
centre_id: $CENTRE_ID

mcf:
version: 1.0

metadata:
identifier: urn:x-wmo:md:COUNTRY_CODE:CENTRE_ID:surface-based-observations.synop
identifier: urn:x-wmo:md:$COUNTRY_CODE:$CENTRE_ID:surface-based-observations.synop
language: en
charset: utf8
hierarchylevel: dataset

identification:
language: en
charset: utf8
title: Surface weather observations from CENTRE_NAME
abstract: Surface weather observations from CENTRE_NAME
title: Surface weather observations from $CENTRE_NAME
abstract: Surface weather observations from $CENTRE_NAME
dates:
creation: CREATION_DATE
publication: PUBLICATION_DATE
creation: $CREATION_DATE
publication: $PUBLICATION_DATE
keywords:
default:
keywords:
Expand All @@ -35,7 +35,7 @@ identification:
url: https://github.com/wmo-im/wcmp-codelists/blob/main/codelists/WMO_CategoryCode.csv
extents:
spatial:
- bbox: [MINX, MINY, MAXX, MAXY]
- bbox: [$BOUNDING_BOX]
crs: 4326
temporal:
- begin: BEGIN_DATE
Expand All @@ -45,7 +45,7 @@ identification:

contact:
pointOfContact: &contact_poc
organization: CENTRE_NAME
organization: $CENTRE_NAME
url: NA
individualname: NA
positionname: NA
Expand All @@ -56,7 +56,7 @@ contact:
administrativearea: NA
postalcode: NA
country: NA
email: WIS2BOX_EMAIL
email: $WIS2BOX_EMAIL
hoursofservice: NA
contactinstructions: email

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
wis2box:
retention: P30D
topic_hierarchy: COUNTRY_CODE.CENTRE_ID.data.core.weather.surface-based-observations.temp
country: COUNTRY_CODE
centre_id: CENTRE_ID
topic_hierarchy: $COUNTRY_CODE.$CENTRE_ID.data.core.weather.surface-based-observations.temp
country: $COUNTRY_CODE
centre_id: $CENTRE_ID

mcf:
version: 1.0

metadata:
identifier: urn:x-wmo:md:COUNTRY_CODE:CENTRE_ID:surface-based-observations.temp
identifier: urn:x-wmo:md:$COUNTRY_CODE:$CENTRE_ID:surface-based-observations.temp
language: en
charset: utf8
hierarchylevel: dataset

identification:
language: en
charset: utf8
title: Upper-air weather observations from CENTRE_NAME
abstract: Upper-air weather observations from CENTRE_NAME
title: Upper-air weather observations from $CENTRE_NAME
abstract: Upper-air weather observations from $CENTRE_NAME
dates:
creation: CREATION_DATE
publication: PUBLICATION_DATE
creation: $CREATION_DATE
publication: $PUBLICATION_DATE
keywords:
default:
keywords:
Expand All @@ -35,7 +35,7 @@ identification:
url: https://github.com/wmo-im/wcmp-codelists/blob/main/codelists/WMO_CategoryCode.csv
extents:
spatial:
- bbox: [MINX, MINY, MAXX, MAXY]
- bbox: [$BOUNDING_BOX]
crs: 4326
temporal:
- begin: BEGIN_DATE
Expand All @@ -45,7 +45,7 @@ identification:

contact:
pointOfContact: &contact_poc
organization: CENTRE_NAME
organization: $CENTRE_NAME
url: NA
individualname: NA
positionname: NA
Expand All @@ -56,7 +56,7 @@ contact:
administrativearea: NA
postalcode: NA
country: NA
email: WIS2BOX_EMAIL
email: $WIS2BOX_EMAIL
hoursofservice: NA
contactinstructions: email

Expand Down
12 changes: 6 additions & 6 deletions docs/source/user/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Installation and configuration
==============================

This section summarizes the steps required to install a wis2box instance and setup your own datasets using initial configuration files
provided by using the 'wis2box-create-config.py' script.
provided by using the ``wis2box-create-config.py`` script.

Ensure you have Docker, Docker Compose and Python installed on your host, as detailed in :ref:`getting-started`.

Expand Down Expand Up @@ -38,7 +38,7 @@ Run the following command to create the initial configuration files for your wis
Adding your own station data
----------------------------

The 'wis2box-create-config.py' script will create the file ``metadata/station/station_list.csv`` file in the directory
The ``wis2box-create-config.py`` script will create the file ``metadata/station/station_list.csv`` file in the directory
you specified for your configuration files. You will have to edit this file to add your own station data using the examples provided.

.. note::
Expand All @@ -53,7 +53,7 @@ Discovery metadata provides the data description needed for users to discover yo

The discovery metadata is provided in the form of a YAML file.

If you used the 'python3 wis2box-create-config.py' command to initialize your wis2box, you will find two initial the discovery metadata files in
If you used the ``python3 wis2box-create-config.py`` command to initialize your wis2box, you will find two initial the discovery metadata files in
the directory you specified for your configuration files, under the ``metadata/discovery/`` directory:

* ``metadata-synop.yml``: contains the discovery metadata for the ``synop`` dataset
Expand Down Expand Up @@ -146,15 +146,15 @@ Login to the wis2box-management container
The first step is to add your collection to the wis2box API, using the discovery metadata file you created above.

For example to add the data-collection defined in ``metadata/discovery/metadata-synop.yml`` in the directory you specified for your configuration files:
For example to add the data collection defined in ``metadata/discovery/metadata-synop.yml`` in the directory you specified for your configuration files:

.. code-block:: bash
wis2box data add-collection /data/wis2box/metadata/discovery/metadata-synop.yml
.. note::

If you see an error like ``ValueError: No plugins for XXX defined in data mappings``, exit the wis2box-container and edit the ``data-mappings.yml`` file
in your wis2box-configuration-directory.
If you see an error like ``ValueError: No plugins for XXX defined in data mappings``, exit the wis2box-management container and edit the ``data-mappings.yml`` file
in your wis2box configuration directory.

You can view the collection you just added, by re-visiting ``/oapi/collections`` in a web browser.

Expand Down
Loading

0 comments on commit 14605c6

Please sign in to comment.