Skip to content

Commit

Permalink
add documentation and volume for custom cvs2bufr-mapping-templates
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed Dec 9, 2024
1 parent 489b007 commit fefdd35
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
8 changes: 7 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ services:

wis2box-api:
container_name: wis2box-api
image: ghcr.io/wmo-im/wis2box-api:latest
image: wis2box-api:issue-806
#image: ghcr.io/wmo-im/wis2box-api:latest
restart: always
env_file:
- wis2box.env
Expand All @@ -40,6 +41,8 @@ services:
test: ["CMD", "curl", "-f", "http://localhost/oapi/admin/resources"]
interval: 5s
retries: 100
volumes:
- ${WIS2BOX_HOST_DATADIR}/mappings:/data/wis2box/mappings:ro

minio:
container_name: wis2box-minio
Expand Down Expand Up @@ -100,6 +103,8 @@ services:
context: ./wis2box-broker
env_file:
- wis2box.env
volumes:
- mosquitto-config:/mosquitto/config

wis2box-management:
container_name: wis2box-management
Expand Down Expand Up @@ -150,3 +155,4 @@ volumes:
minio-data:
auth-data:
htpasswd:
mosquitto-config:
18 changes: 17 additions & 1 deletion docs/source/reference/running/data-pipeline-plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,21 @@ A typical csv2bufr plugin workflow definition would by defined as follows:
csv:
- plugin: wis2box.data.csv2bufr.ObservationDataCSV2BUFR
template: /data/wis2box/synop_bufr.json # locally created csv2bufr mapping (located in $WIS2BOX_HOST_DATADIR)
template: aws-template # using one of the built-in templates
notify: true # trigger GeoJSON publishing for API and UI
file-pattern: '^.*\.csv$'
The default templates are defined by the `csv2bufr-templates`_ repository.

In the case the user wants to use a custom template, the template should be located in the ``$WIS2BOX_HOST_DATADIR/mappings`` directory.

The plugin configuration would then be defined as follows:

.. code-block:: yaml
csv:
- plugin: wis2box.data.csv2bufr.ObservationDataCSV2BUFR
template: /data/wis2box/mappings/my_own_template.json # locally created csv2bufr mapping (located in $WIS2BOX_HOST_DATADIR/mappings)
notify: true # trigger GeoJSON publishing for API and UI
file-pattern: '^.*\.csv$'
Expand Down Expand Up @@ -146,5 +160,7 @@ For example, to publish GRIB2 data matching the file-pattern ``^.*_(\d{8})\d{2}.
See :ref:`data-mappings` for a full example data mapping configuration.

.. _`csv2bufr`: https://csv2bufr.readthedocs.io
.. _`csv2bufr-templates`: https://github.com/wmo-im/csv2bufr-templates
.. _`bufr2geojson`: https://github.com/wmo-im/bufr2geojson
.. _`synop2bufr`: https://synop2bufr.readthedocs.io

2 changes: 1 addition & 1 deletion docs/source/user/data-ingest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The wis2box provides 3 types of built-in plugins to publish data in BUFR format:

* `bufr2bufr` : the input is received in BUFR format and split by subset, where each subset is published as a separate bufr message
* `synop2bufr` : the input is received in `FM-12 SYNOP format <https://library.wmo.int/idviewer/35713/33>`_ and converted to BUFR format. The year and month are extracted from the file pattern
* `csv2bufr` : the input is received in csv format and converted to BUFR format
* `csv2bufr` : the input is received in csv format and converted to BUFR format, a mapping template is used to convert the csv columns to BUFR encoded values. Custom mapping templates need to be placed in the ``$WIS2BOX_HOST_DATADIR/mappings`` directory. See :ref:`csv2bufr-templates` for examples of mapping templates.

Check warning on line 43 in docs/source/user/data-ingest.rst

View workflow job for this annotation

GitHub Actions / main

undefined label: csv2bufr-templates (if the link has no caption the label must precede a section header)

To publish data for other data formats you can use the 'Universal' plugin, which will pass through the data without any conversion.
Please note that you will need to ensure that the date timestamp can be extracted from the file pattern when using this plugin.
Expand Down

0 comments on commit fefdd35

Please sign in to comment.