Skip to content

Commit

Permalink
Documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
RoryPTB committed Feb 1, 2024
1 parent 9687e77 commit d9b5404
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ RUN echo "Acquire::Check-Valid-Until \"false\";\nAcquire::Check-Date \"false\";"
# Environment variables

ENV LOG_LEVEL=INFO
# (Example of originating centre and subcentre codes for the WMO Secretariat, this should be changed for each centre!)
ENV BUFR_ORIGINATING_CENTRE=0
ENV BUFR_ORIGINATING_SUBCENTRE=0
# The following need to changed to the correct values for your centre!
ENV BUFR_ORIGINATING_CENTRE=123
ENV BUFR_ORIGINATING_SUBCENTRE=123

# copy the app
COPY . /build
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ The synop2bufr Python module contains both a command line interface and API to c

Dependencies are listed in [requirements.txt](https://github.com/wmo-im/synop2bufr/blob/main/requirements.txt). Dependencies are automatically installed during synop2bufr installation.

### Setting Environment Variables

Before using synop2bufr, you need to set the `BUFR_ORIGINATING_CENTRE` and `BUFR_ORIGINATING_SUBCENTRE` environment variables. These variables are used to specify the originating centre and subcentre of the SYNOP messages. **Without these set, the conversion to BUFR will fail.**

It is recommended that you set these environment variables in the Dockerfile, by editing the following lines with your originating centre and subcentre values:

```bash
ENV BUFR_ORIGINATING_CENTRE=<centre_value>
ENV BUFR_ORIGINATING_SUBCENTRE=<subcentre_value>
```

Alternatively, you can set these environment variables in your shell if you want to run synop2bufr on your local machine. Here's how you can do it in a Bash shell:

```bash
export BUFR_ORIGINATING_CENTRE=<centre_value>
export BUFR_ORIGINATING_SUBCENTRE=<subcentre_value>
```

## Running

To run synop2bufr from a Docker container:
Expand All @@ -33,9 +51,9 @@ synop2bufr data transform --metadata data/station_list.csv --year 2023 --month 0

To run synop2bufr inside a Lambda function on Amazon Web Services, please refer to [aws-lambda/README.md](aws-lambda/README.md) and use this [Dockerfile](aws-lambda/Dockerfile) to build the container image for the Lambda function.

## Usage Guide
## API Usage Guide

Here we detail how synop2bufr can be used.
Here we detail how the synop2bufr API can be used in Python.

To begin, suppose we have some SYNOP data.

Expand Down
11 changes: 7 additions & 4 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ Command line interface (CLI)
Setting Environment Variables
-----------------------------

Before running the `synop2bufr data transform` command, you need to set the `BUFR_ORIGINATING_CENTRE` and `BUFR_ORIGINATING_SUBCENTRE` environment variables. These variables are used to specify the originating centre and subcentre of the SYNOP messages. Without these set, the conversion will fail.
Before running the `synop2bufr data transform` command, you need to set the `BUFR_ORIGINATING_CENTRE` and `BUFR_ORIGINATING_SUBCENTRE` environment variables. These variables are used to specify the originating centre and subcentre of the SYNOP messages. **Without these set, the conversion to BUFR will fail.**

It is recommended that you set these environment variables in the Dockerfile, by editing the lines `ENV BUFR_ORIGINATING_CENTRE=` and `ENV BUFR_ORIGINATING_SUBCENTRE=`.
It is recommended that you set these environment variables in the Dockerfile, by editing the following lines with your originating centre and subcentre values:

.. code-block:: shell
ENV BUFR_ORIGINATING_CENTRE=<centre_value>
ENV BUFR_ORIGINATING_SUBCENTRE=<subcentre_value>
Alternatively, you can set these environment variables in your shell if you want to run synop2bufr on your local machine. Here's how you can do it in a Bash shell:

Expand All @@ -45,8 +50,6 @@ Alternatively, you can set these environment variables in your shell if you want
export BUFR_ORIGINATING_CENTRE=<centre_value>
export BUFR_ORIGINATING_SUBCENTRE=<subcentre_value>
Replace `<centre_value>` and `<subcentre_value>` with the appropriate values for your use case.

Now, you can run the `synop2bufr data transform` command as described in the previous section.

Input FM-12 file (input-fm12.txt)
Expand Down

0 comments on commit d9b5404

Please sign in to comment.