source-file.rst 8.07 KB
Newer Older
BorjaEst's avatar
BorjaEst committed
1
Source file
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
==================================

This is an example configuration file for sources to be skimmed

Note the following **metadata_1** for keys and values 
(always following YAML standards):

 - **CUSTOMIZABLE_KEY**: Indicates the key can be any value
 - **FIXED_KEY**: The must match the example string
 - **CORRECT_VALUE**: The value must be in line with the source data


Note the following **metadata_2** for keys and values
(always following YAML standards):

  - **MANDATORY**: The key/value is mandatory to exist inside the section
  - **OPTIONAL**: The key/value is optional to exist inside the section


For example: At the 3rd level, the variables are specified. The configuration
specification for variables are "[**FIXED_KEY** -- **OPTIONAL**]"; If the variable 
key *tco3_zm* is specified, the application searches for tco3 data 
on the source. When it is not specified, variable data are not searched so the
output folder [x-]_[y-] does not contain tco3 dataset files.


First example - CCMI-1
---------------------------

In this example, the data source has only one model, therefore it is
expected to have only one folder output named "CCMI-1_IPSL".

This model has 2 variables (*tco3_zm* and *vmro3_zm*) which datasets are 
located in different directories. Therefore the key *path* is the different
in both of them. Therefore, the output expected at "CCMI-1_IPSL" is 
2 type of files: 

 - tco3_zm_[YEAR]-[YEAR].nc: With tco3 skimmed data
 - vmro3_zm_[YEAR]-[YEAR].nc: With vmro3 skimmed data

Where [YEAR] are optional text output depending on how the `–split_by` 
argument is configured at the :doc:`/getting_started/cli` call.


.. code-block:: yaml

    # This is the preceded -x1- string at the output folder: '[x1]_[y-]'
    # [CUSTOMIZABLE_KEY -- MANDATORY]
    CCMI-1:

        # This is the preceded -y1- string at the output folder: '[x1]_[y1]'
        # [CUSTOMIZABLE_KEY -- MANDATORY]
        IPSL:

            # Represents the information related to tco3 data
            # [FIXED_KEY -- OPTIONAL]
            tco3_zm:

                # Variable name for tco3 array inside the dataset
                # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                name: toz

                # Reg expression, how to load the netCDF files
                # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
BorjaEst's avatar
BorjaEst committed
66
                paths: Ccmi/mon/toz/*.nc
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

                # Coordinates description for tco3 data. 
                # [FIXED_KEY -- MANDATORY]:
                coordinates:

                    # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                    time: time

                    # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                    lat: lat

                    # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                    lon: lon

            # Represents the information related to vmro3 data
            # [FIXED_KEY -- OPTIONAL]
            vmro3_zm:

                # Variable name for vmro3 array inside the dataset
                # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY] 
                name: vmro3

                # Reg expression, how to load the netCDF files
                # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
BorjaEst's avatar
BorjaEst committed
91
                paths: Ccmi/mon/vmro3
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149

                # Coordinates description for vmro3 data. 
                # [FIXED_KEY -- MANDATORY]: 

                coordinates:
                    # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                    time: time

                    # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                    plev: plev
                    
                    # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                    lat: lat
                    
                    # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                    lon: lon 


Second example - ECMWF
-----------------------------------

In this example, the data source has two models, therefore it is
expected to have two folder outputs ["ECMWF_ERA-5", "ECMWF_ERA-i"].

The model ERA-5 has only information tco3 data, there is no vmro3 data.
Therefore, only one type of files is expected at "ECMWF_ERA-5": 

  - tco3_zm_[YEAR].nc: With tco3 skimmed data

This case of ERA-i indeed has 2 variables (*tco3_zm* and *vmro3_zm*) but in
this case, are located inside the same dataset files, therefore the 
key *path* should be the same for both variables. The output expected at 
"ECMWF_ERA-5" are 2 type of files: 

  - tco3_zm_[YEAR].nc: With tco3 skimmed data
  - vmro3_zm_[YEAR].nc: With vmro3 skimmed data


.. code-block:: yaml

  # This is the preceded -x2- string at the output folder: '[x2]_[y-]'
  # [CUSTOMIZABLE_KEY -- MANDATORY]
  ECMWF:

      # This is the preceded -y1- string at the output folder: '[x2]_[y1]'
      # [CUSTOMIZABLE_KEY -- MANDATORY]
      ERA-5:

          # Represents the information related to tco3 data
          # [FIXED_KEY -- OPTIONAL]
          tco3_zm:

              # Variable name for tco3 array inside the dataset
              # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
              name: tco3

              # Reg expression, how to load the netCDF files
              # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
BorjaEst's avatar
BorjaEst committed
150
              paths: Ecmwf/Era5
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178

              # Coordinates description for tco3 data. 
              # [FIXED_KEY -- MANDATORY]:
              coordinates:

                  # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                  lat: latitude

                  # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                  lon: longitude 

                  # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                  time: time

      # This is the preceded -y2- string at the output folder: '[x2]_[y2]'
      # [CUSTOMIZABLE_KEY -- MANDATORY]
      ERA-i:

          # Represents the information related to tco3 data
          # [FIXED_KEY -- OPTIONAL]
          tco3_zm:

              # Variable name for tco3 array inside the dataset
              # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
              name: toz

              # Reg expression, how to load the netCDF files
              # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
BorjaEst's avatar
BorjaEst committed
179
              paths: Ecmwf/Erai
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203

              # Coordinates description for tco3 data. 
              # [FIXED_KEY -- MANDATORY]:
              coordinates:

                  # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                  time: time

                  # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                  lat: latitude

                  # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                  lon: longitude 

          # Represents the information related to vmro3 data
          # [FIXED_KEY -- OPTIONAL]
          vmro3_zm:

              # Variable name for vmro3 array inside the dataset
              # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]         
              name: vmro3

              # Reg expression, how to load the netCDF files
              # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
BorjaEst's avatar
BorjaEst committed
204
              paths: Ecmwf/Erai
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233

              # Coordinates description for vmro3 data. 
              # [FIXED_KEY -- MANDATORY]: 

              coordinates:
                  # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                  time: time

                  # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                  plev: level

                  # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                  lat: latitude

                  # [FIXED_KEY -- MANDATORY]: [CORRECT_VALUE -- MANDATORY]
                  lon: longitude

One or two files?
-----------------

Note this two examples should be located into the same file when you want the 
module to skim both examples with only one call to the command.

If need to skim the data in two different steps, you can place each example into
a different file and call each one of them separately by the module using the 
input argument:

 ``-f, --sources_file SOURCES_FILE``