cli.rst 2.56 KB
Newer Older
BorjaEst's avatar
BorjaEst committed
1
2
3
Command Line Interface
=======================

4
5
6
7
8
9
Usage:

.. code-block:: bash

    usage: main [-h] [-f SOURCES_FILE] [-s {year,decade}]
                [-v {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
10
                {lon_mean,lat_mean} [{lon_mean,lat_mean} ...]
11
12
13
14
15
16
17

To run the the application using **udocker** at the **Runtime machine** 
you need to provide the following volumes to the container:

 - --volume, mount `/app/data`: Input path with data to skim.
 - --volume, mount `/app/output`: Output path for skimmed results.
 - --volume, mount `/app/sources.yaml`: Configuration file with a data structure 
BorjaEst's avatar
BorjaEst committed
18
   description at the input path in YAML_ format.
19
   See :doc:`../getting_started/source-file` for a configuration example.
20
21
22
23
24

.. _YAML: https://yaml.org/


Also, in the specific case of udocker_, it is needed to specify that the 
BorjaEst's avatar
BorjaEst committed
25
26
user `application` should run inside the container:

27
28
29
30
31
.. _udocker: https://indigo-dc.gitbook.io/udocker


For example,to run the container using udocker_ use the following:

BorjaEst's avatar
BorjaEst committed
32
33
34
35
36
37
38
.. code-block:: bash

    $ udocker run \
      --user=application \
      --volume=${PWD}/sources.yaml:/app/sources.yaml \
      --volume=${PWD}/data:/app/data \
      --volume=${PWD}/output:/app/output \
39
      o3skim --verbosity INFO lon_mean
BorjaEst's avatar
BorjaEst committed
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
    ...
    executing: main
    ...
    2020-08-25 12:42:34,151 - INFO     - Configuration found at: './sources.yaml'
    2020-08-25 12:42:34,152 - INFO     - Loading data from './data' 
    2020-08-25 12:42:34,261 - INFO     - Skimming data to './output' 


For the main function description and commands help you can call:

.. code-block:: bash

    $ udocker run --user=application o3skim --help


55
Where positional arguments are the o3skim operations to perform:
56

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
.. code-block:: bash

  o3skim is a tool for data pre-processing of ozone applications:
  - lon_mean: Mean operation over longitude axis.
  - lat_mean: Mean operation over latitude axis.

  positional arguments:
    {lon_mean,lat_mean}   o3skim operations to perform

  optional arguments:
    -h, --help            Show this help message and exit
    -f SOURCES_FILE, --sources_file SOURCES_FILE
                          Custom sources YAML configuration; default:./sources.yaml
    -s {year,decade}, --split_by {year,decade}
                          Period time to split output; default: None
    -v {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --verbosity {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                          Sets the logging level; default: ERROR
74

BorjaEst's avatar
BorjaEst committed
75
Note that SOURCES_FILE is only modified for development purposes as usually any 
76
77
file from host can be mounted using the container directive '--volume'.