rc-qlc 0.3.24__cp311-cp311-macosx_11_0_arm64.whl → 0.3.27__cp311-cp311-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qlc/cli/__init__.py +100 -9
- qlc/cli/installer.py +23 -5
- qlc/cli/qlc_main.py +54 -32
- qlc/cli/qlc_py_main.py +43 -38
- qlc/config/json/qlc_config.json +94 -10
- qlc/config/nml/mars_A1_sfc.nml +4 -5
- qlc/config/nml/mars_A3_sfc.nml +0 -1
- qlc/config/nml/mars_B1_pl.nml +2 -2
- qlc/{examples/cams_case_1/config/nml/mars_A3_sfc.nml → config/nml/mars_B1_sfc.nml} +7 -8
- qlc/config/nml/mars_C1_pl.nml +1 -1
- qlc/{examples/cams_case_1/config/nml/mars_C1_pl.nml → config/nml/mars_C1_sfc.nml} +7 -8
- qlc/config/nml/mars_C2_pl.nml +1 -1
- qlc/{examples/cams_case_1/config/qlc_cams.conf → config/qlc.conf} +80 -18
- qlc/{examples/cams_case_1/mod/b2ro/2018/b2ro_20181215-20181231_A3_sfc.grb → doc/CAMS_b2ro-b2rn_20181201-20181221_qlc_Z1-png_202509090814.pdf} +0 -0
- qlc/doc/README.md +213 -49
- qlc/doc/USAGE.md +266 -29
- qlc/examples/cams_case_1/mod/b2rn/2018/b2rn_20181201-20181221_B1_pl.grb +0 -0
- qlc/examples/cams_case_1/mod/b2rn/2018/b2rn_20181201-20181221_C1_sfc.grb +0 -0
- qlc/examples/cams_case_1/mod/b2ro/2018/b2ro_20181201-20181221_B1_pl.grb +0 -0
- qlc/examples/cams_case_1/mod/b2ro/2018/b2ro_20181201-20181221_C1_sfc.grb +0 -0
- qlc/install.py +272 -107
- qlc/py/__main__.cpython-311-darwin.so +0 -0
- qlc/py/averaging.cpython-311-darwin.so +0 -0
- qlc/py/bias_plots.cpython-311-darwin.so +0 -0
- qlc/py/control.cpython-311-darwin.so +0 -0
- qlc/py/io.cpython-311-darwin.so +0 -0
- qlc/py/loadmod.cpython-311-darwin.so +0 -0
- qlc/py/loadobs.cpython-311-darwin.so +0 -0
- qlc/py/logging_utils.cpython-311-darwin.so +0 -0
- qlc/py/map_plots.cpython-311-darwin.so +0 -0
- qlc/py/matched.cpython-311-darwin.so +0 -0
- qlc/py/plot_config.cpython-311-darwin.so +0 -0
- qlc/py/plotting.cpython-311-darwin.so +0 -0
- qlc/py/plugin_loader.cpython-311-darwin.so +0 -0
- qlc/py/processing.cpython-311-darwin.so +0 -0
- qlc/py/scatter_plots.cpython-311-darwin.so +0 -0
- qlc/py/stations.cpython-311-darwin.so +0 -0
- qlc/py/statistics.cpython-311-darwin.so +0 -0
- qlc/py/style.cpython-311-darwin.so +0 -0
- qlc/py/timeseries_plots.cpython-311-darwin.so +0 -0
- qlc/py/utils.cpython-311-darwin.so +0 -0
- qlc/py/version.cpython-311-darwin.so +0 -0
- qlc/sh/qlc_A1.sh +30 -11
- qlc/sh/qlc_B1a.sh +1 -18
- qlc/sh/qlc_B2.sh +8 -1
- qlc/sh/qlc_C5.sh +90 -65
- qlc/sh/qlc_D1.sh +287 -56
- qlc/sh/qlc_Z1.sh +6 -6
- qlc/sh/qlc_batch.sh +61 -0
- qlc/sh/qlc_common_functions.sh +17 -29
- qlc/sh/qlc_main.sh +49 -26
- qlc/sh/tex_template/beamercolorthemeCAMS2_35.sty +51 -0
- qlc/sh/tex_template/beamerfontthemeCAMS2_35.sty +166 -0
- qlc/sh/tex_template/beamerthemeCAMS2_35.sty +25 -0
- qlc/sh/tex_template/subcaption.sty +170 -0
- qlc/sh/tex_template/template.tex +109 -0
- rc_qlc-0.3.27.dist-info/METADATA +309 -0
- rc_qlc-0.3.27.dist-info/RECORD +103 -0
- qlc/config/json/qlc_config_example_1a_all-obs.json +0 -237
- qlc/config/json/qlc_config_example_1b_all-mod.json +0 -353
- qlc/config/json/qlc_config_example_1c_all-coll.json +0 -266
- qlc/config/json/qlc_config_example_2a_all-obs.json +0 -237
- qlc/config/json/qlc_config_example_2b_all-mod.json +0 -353
- qlc/config/json/qlc_config_example_2c_all-coll.json +0 -265
- qlc/config/json/qlc_config_example_3a-us_obs.json +0 -82
- qlc/config/json/qlc_config_example_3b-us_mod.json +0 -122
- qlc/config/json/qlc_config_example_3c-us_coll.json +0 -46
- qlc/config/json/qlc_config_example_4a_eu-obs.json +0 -41
- qlc/config/json/qlc_config_example_4b_eu-mod.json +0 -122
- qlc/config/json/qlc_config_example_4c_eu-coll.json +0 -45
- qlc/config/qlc_cams.conf +0 -26
- qlc/config/qlc_test.conf +0 -26
- qlc/config/qlc_tex.conf +0 -107
- qlc/examples/cams_case_1/config/json/qlc_config.json +0 -41
- qlc/examples/cams_case_1/config/nml/mars_B1_pl.nml +0 -19
- qlc/examples/cams_case_1/mod/iqi9/2018/iqi9_20181215-20181231_A3_sfc.grb +0 -0
- qlc/sh/qlc_start.sh +0 -23
- qlc/sh/qlc_start_batch.sh +0 -46
- rc_qlc-0.3.24.dist-info/METADATA +0 -142
- rc_qlc-0.3.24.dist-info/RECORD +0 -113
- {rc_qlc-0.3.24.dist-info → rc_qlc-0.3.27.dist-info}/WHEEL +0 -0
- {rc_qlc-0.3.24.dist-info → rc_qlc-0.3.27.dist-info}/entry_points.txt +0 -0
- {rc_qlc-0.3.24.dist-info → rc_qlc-0.3.27.dist-info}/licenses/LICENSE +0 -0
- {rc_qlc-0.3.24.dist-info → rc_qlc-0.3.27.dist-info}/top_level.txt +0 -0
qlc/doc/USAGE.md
CHANGED
@@ -1,58 +1,295 @@
|
|
1
1
|
# QLC Usage Guide
|
2
2
|
|
3
|
-
|
3
|
+
This guide provides detailed instructions on how to use the QLC command-line tools and configure the workflow.
|
4
4
|
|
5
|
-
|
5
|
+
---
|
6
6
|
|
7
|
-
|
8
|
-
Runs the full shell-based QLC pipeline (retrieval, processing, plotting).
|
7
|
+
## Installed CLI Tools
|
9
8
|
|
10
|
-
|
11
|
-
Runs the standalone Python-based observation–model comparison.
|
9
|
+
Once installed, QLC provides the following command-line entry points:
|
12
10
|
|
13
|
-
|
14
|
-
|
11
|
+
- **`qlc`**: The main driver. Runs the full shell-based QLC pipeline, which now integrates the `qlc-py` engine for all data processing and plotting. Use this for standard, end-to-end model evaluation runs.
|
12
|
+
- **`qlc-py`**: The standalone Python engine. Can be run directly with a JSON configuration file for rapid, iterative analysis without re-running the entire shell pipeline.
|
13
|
+
- **`sqlc`**: A wrapper to submit a `qlc` run as a batch job to a scheduling system like SLURM.
|
15
14
|
|
16
15
|
---
|
17
16
|
|
18
|
-
##
|
17
|
+
## Running QLC
|
19
18
|
|
20
|
-
|
19
|
+
After installation (`qlc-install --mode test` or `--mode cams`), you can immediately run the main drivers. It's recommended to run `qlc` from within the active installation directory.
|
21
20
|
|
22
|
-
### CAMS Mode
|
23
|
-
For users connected to the CAMS data infrastructure.
|
24
21
|
```bash
|
25
|
-
|
22
|
+
# Navigate to the active QLC directory
|
23
|
+
cd $(readlink -f $HOME/qlc)
|
26
24
|
```
|
27
25
|
|
28
|
-
###
|
29
|
-
|
26
|
+
### `qlc`: The Main Pipeline
|
27
|
+
|
28
|
+
This is the standard workflow. It performs data retrieval (if needed), processes model and observation data, and generates all plots and a final PDF report.
|
29
|
+
|
30
|
+
**Syntax**
|
31
|
+
```
|
32
|
+
qlc <exp1> <exp2> <start_date> <end_date> [mars]
|
33
|
+
```
|
34
|
+
|
35
|
+
**Examples**
|
30
36
|
```bash
|
31
|
-
|
37
|
+
# Run a comparison of experiments b2ro and b2rn for the first three weeks of Dec 2018
|
38
|
+
# This uses the example data included in the 'test' installation.
|
39
|
+
qlc b2ro b2rn 2018-12-01 2018-12-21
|
40
|
+
|
41
|
+
# Run the same comparison, but first retrieve the data from MARS
|
42
|
+
qlc b2ro b2rn 2018-12-01 2018-12-21 mars
|
43
|
+
|
44
|
+
# Run without options to see the help message
|
45
|
+
qlc
|
32
46
|
```
|
33
47
|
|
34
|
-
|
48
|
+
### `qlc-py`: Standalone Python Engine
|
35
49
|
|
36
|
-
|
50
|
+
Use this tool for rapid data analysis and plotting without the overhead of the full shell pipeline. It is controlled by a JSON configuration file. By default, it uses the configuration file located at `$HOME/qlc/config/json/qlc_config.json`, but you can provide your own.
|
37
51
|
|
38
|
-
|
52
|
+
This is useful for developers or for regenerating plots with different settings after an initial `qlc` run has completed.
|
39
53
|
|
54
|
+
**Examples**
|
40
55
|
```bash
|
41
|
-
#
|
42
|
-
|
43
|
-
qlc-
|
56
|
+
# Run with the default configuration
|
57
|
+
# This can be used to re-run the Python analysis after a 'qlc' run
|
58
|
+
qlc-py
|
59
|
+
|
60
|
+
# Run with a specific, user-defined configuration file
|
61
|
+
qlc-py --config /path/to/my_config.json
|
44
62
|
```
|
45
63
|
|
46
|
-
|
64
|
+
### `sqlc`: Submitting a Batch Job
|
47
65
|
|
48
|
-
|
66
|
+
For long-running jobs, you can submit the QLC pipeline to a batch scheduling system like SLURM.
|
49
67
|
|
50
|
-
|
68
|
+
**Examples**
|
51
69
|
```bash
|
52
|
-
#
|
53
|
-
|
70
|
+
# Submit a job with default parameters from qlc.conf
|
71
|
+
sqlc
|
54
72
|
|
55
|
-
#
|
56
|
-
|
73
|
+
# Submit with specific experiments and dates, including MARS retrieval
|
74
|
+
sqlc b2ro b2rn 2018-12-01 2018-12-21 mars
|
57
75
|
```
|
58
76
|
|
77
|
+
---
|
78
|
+
|
79
|
+
## Python Workflow and Configuration
|
80
|
+
|
81
|
+
The new Python-based workflow is integrated into the main `qlc` pipeline via the `qlc_D1.sh` script. This script dynamically discovers available variables (e.g., `NH3`, `NH4_as`) from your NetCDF files in the `Analysis` directory. It then generates a temporary JSON configuration file and passes it to `qlc-py` for processing.
|
82
|
+
|
83
|
+
You can customize this workflow by editing the variables in your main configuration file: **`$HOME/qlc/config/qlc.conf`**.
|
84
|
+
|
85
|
+
### Key Configuration Variables
|
86
|
+
|
87
|
+
| Variable | Description | Example |
|
88
|
+
| --- | --- | --- |
|
89
|
+
| `STATION_FILE` | Path to the CSV file containing station metadata (ID, name, lat, lon). | `"${QLC_HOME}/obs/data/ebas_station-locations.csv"` |
|
90
|
+
| `OBS_DATA_PATH` | Root path to the observation NetCDF files. | `"${QLC_HOME}/obs/data/ver0d"` |
|
91
|
+
| `OBS_DATASET_TYPE`| The specific observation dataset to use (e.g., `ebas_hourly`, `ebas_daily`, ...). | `"ebas_daily"` |
|
92
|
+
| `MODEL_LEVEL` | The model level index to extract. If left empty (`""`), the code intelligently defaults to the highest index (closest to the surface). | 9 |
|
93
|
+
| `TIME_AVERAGE` | The time averaging to apply to the data (e.g., `daily`, `monthly`, `yearly`, ...). | `"daily"` |
|
94
|
+
| `REGION` | The geographical region to focus on for plots and analysis (e.g., `"EU"`, `"US"`, `"ASIA"` , `"Globe"`, ...). | `"EU"` |
|
95
|
+
| `EXP_LABELS` | Comma-separated labels for experiments, used in plot legends. Must match the order of experiments passed to `qlc`. | `"MyExp,MyREF"` |
|
96
|
+
| `PLOTEXTENSION` | The file format for the output plots (e.g., `pdf`, `png`, ...). | `"png"` |
|
97
|
+
|
98
|
+
---
|
99
|
+
|
100
|
+
## Available `qlc-py` Options
|
101
|
+
|
102
|
+
The Python engine is highly configurable through the `qlc.conf` file or a custom JSON configuration. Below is an overview of the most common options available.
|
103
|
+
|
104
|
+
### Plotting Regions (`REGION`)
|
105
|
+
|
106
|
+
You can set the `REGION` variable to any of the following codes to automatically set the map bounds for plots.
|
107
|
+
|
108
|
+
| Category | Region Codes |
|
109
|
+
| --- | --- |
|
110
|
+
| **Continents & Global** | `Globe`, `EU` (Europe), `ASIA`, `AFRICA`, `NA` (North America), `SA` (South America), `OC` (Oceania), `ANT` (Antarctica), `NP` (North Pole) |
|
111
|
+
| **Oceans & Water Bodies** | `PAC` (Pacific), `ATLA` (Atlantic), `INDO` (Indian), `ARC` (Arctic), `SOU` (Southern) |
|
112
|
+
| **Major Deserts** | `SAH` (Sahara), `ARA` (Arabian), `GOBI`, `OUTBACK` (Australian), `ATACAMA` |
|
113
|
+
| **Key Countries** | `GB` (Great Britain), `US` (United States), `CN` (China), `JP` (Japan), `SA` (Saudi Arabia), `IR` (Iran), `EG` (Egypt), `MA` (Morocco), `NG` (Nigeria), `KE` (Kenya), `ZA` (South Africa), `IS` (Iceland) |
|
114
|
+
| **European Countries**| `DE` (Germany), `FR` (France), `IT` (Italy), `ES` (Spain), `PL` (Poland), `SE` (Sweden), `FI` (Finland), `NO` (Norway), `NL` (Netherlands), `BE` (Belgium), `AT` (Austria), `CH` (Switzerland), `CZ` (Czech Rep.), `GR` (Greece) |
|
115
|
+
| **US States** | `CA-US` (California), `NY-US` (New York), `TX-US` (Texas), `FL-US` (Florida), `IL-US` (Illinois), `WA-US` (Washington), `CO-US` (Colorado), `AZ-US` (Arizona) |
|
116
|
+
| **Specific Regions** | `MENA` (Middle East/North Africa), `SSA` (Sub-Saharan Africa) |
|
117
|
+
| **Major Cities** | `LA-US`, `NYC-US`, `SHA-CN` (Shanghai), `BEI-CN` (Beijing), `TOK-JP` (Tokyo), `FR-PAR` (Paris), `DE-MUC` (Munich), `DE-FRA` (Frankfurt), `IT-ROM` (Rome), `ES-MAD` (Madrid), `PL-WAW` (Warsaw), `NL-AMS` (Amsterdam), `BE-BRU` (Brussels), `AT-VIE` (Vienna), `CZ-PRG` (Prague), `GR-ATH` (Athens), `CH-ZUR` (Zurich) |
|
118
|
+
| **German Regions** | `BW-DE` (Baden-Württemberg), `B-DE` (Berlin), `HH-DE` (Hamburg), `FR-DE` (Freiburg) |
|
119
|
+
|
120
|
+
### Time Averaging (`TIME_AVERAGE`)
|
121
|
+
|
122
|
+
The `TIME_AVERAGE` variable controls the temporal aggregation of the time series data.
|
123
|
+
|
124
|
+
- **`raw`**: No averaging is applied.
|
125
|
+
- **`mean`**: The mean over the entire time period is calculated.
|
126
|
+
- **Time Frequencies**: `1min`, `10min`, `30min`, `hourly`, `3hourly`, `6hourly`, `12hourly`, `daily`, `weekly`, `monthly`, `annual`, `seasonal`, `decadal`.
|
127
|
+
|
128
|
+
### Observation Datasets (`OBS_DATASET_TYPE`)
|
129
|
+
|
130
|
+
The `OBS_DATASET_TYPE` variable specifies which observation network data to use. The following datasets are supported:
|
131
|
+
|
132
|
+
- `ebas` / `ebas_hourly` / `ebas_daily` (EBAS - European Monitoring and Evaluation Programme)
|
133
|
+
- `airbase` / `airbase_ineris` (European air quality database)
|
134
|
+
- `airnow` (U.S. EPA's AirNow program)
|
135
|
+
- `castnet` (Clean Air Status and Trends Network)
|
136
|
+
- `AMoN` (Ammonia Monitoring Network)
|
137
|
+
- `NNDMN` (National Network of Deposition Monitoring in the Netherlands)
|
138
|
+
- `china_gsv` / `china_aq` (Chinese air quality data)
|
139
|
+
|
140
|
+
### Supported Variables (`variable`)
|
141
|
+
|
142
|
+
The `qlc` pipeline automatically discovers variables from your data files. The system supports a wide range of chemical species and physical properties. The list below contains all variables recognized by the EBAS observation dataset mapping, which is the most extensive. Other datasets may support a subset of these.
|
143
|
+
|
144
|
+
- **Gases**: `NO2`, `SO2`, `SO4`, `HNO3`, `NO3`, `NH3`, `NH4`, `NO`, `NOx`, `O3`, `CO`, `HONO` (Nitrous Acid), `ethanal`, `methanol`, `ethene`, `ethyne`, `propene`, `benzene`, `ethane`, `propane`, `ethylbenzene`, `m-p-xylene`, `o-xylene`, `toluene`.
|
145
|
+
- **Mole Fractions**: `SO2_mf`, `NH3_mf`, `NO_mf`, `NO2_mf`, `NOx_mf`, `O3_mf`, `CO_mf`, `ethanal_mf`, `methanol_mf`, `ethene_mf`, `ethyne_mf`, `propene_mf`, `benzene_mf`, `ethane_mf`, `propane_mf`, `ethylbenzene_mf`, `m-p-xylene_mf`, `o-xylene_mf`, `toluene_mf`.
|
146
|
+
- **Halocarbons (Mole Fractions)**: `CCl4_mf`, `CH3Cl_mf`, `CH2Br2_mf`, `CH2Cl2_mf`, `CHCl3_mf`.
|
147
|
+
- **Greenhouse Gases (Mole Fractions)**: `carbon_dioxide_mf`, `methane_mf`, `hydrogen_mf`, `nitrous_oxide_mf`.
|
148
|
+
- **Aerosol Properties**:
|
149
|
+
- **Mass Density**: `PM1`, `PM2.5`, `PM10`.
|
150
|
+
- **Composition (Dry Aerosol)**: `Dry_Nitrate`, `Dry_Ammonium`, `Dry_Chloride`, `Dry_Calcium`, `Dry_Sodium`, `Dry_Iron`, `Dry_Sulphate_Corrected`.
|
151
|
+
- **Composition (PM2.5)**: `PM2.5_Nitrate`, `PM2.5_Sodium`, `PM2.5_Calcium`, `PM2.5_Ammonium`, `PM2.5_Chloride`, `PM2.5_Total_Sulphate`, `PM2.5_Sulphate_Corrected`, `PM2.5_EC` (Elemental Carbon), `PM2.5_OC` (Organic Carbon), `PM2.5_TC` (Total Carbon).
|
152
|
+
- **Composition (PM10)**: `PM10_Nitrate`, `PM10_Sodium`, `PM10_Calcium`, `PM10_Ammonium`, `PM10_Chloride`, `PM10_Lead`, `PM10_Iron`, `PM10_Manganese`, `PM10_Total_Sulphate`, `PM10_Sulphate_Corrected`, `PM10_EC`, `PM10_OC`, `PM10_TC`.
|
153
|
+
- **Number Concentration**: `Dry_NA_NumConc`.
|
154
|
+
- **Optical Properties**:
|
155
|
+
- **Aerosol Optical Depth (AOD)**: `AOD_380`, `AOD_500`, `AOD_675` (and many other wavelengths).
|
156
|
+
- **Scattering Coefficient**: `Scatt_450`, `Scatt_525`, `Scatt_550`, `Scatt_635`, `Scatt_700`.
|
157
|
+
- **Absorption Coefficient**: `Abs_370`, `Abs_470`, `Abs_520`, `Abs_660`, `Abs_880` (and many other wavelengths between 370nm and 950nm).
|
158
|
+
- **Backscattering**: `Backscatt_700`.
|
159
|
+
- **Meteorology**: `Pressure`, `Temperature`.
|
160
|
+
|
161
|
+
#### Model-Specific Variables
|
162
|
+
|
163
|
+
The following variables are specifically mapped for model (`mod`) data types. These often include different aerosol size bins or speciated components.
|
164
|
+
|
165
|
+
- **Aerosol Mass**: `PM1`, `PM2.5`, `PM10`
|
166
|
+
- **Aerosol Number Concentration**: `N`, `N_ks` (nucleation mode), `N_as` (aitken mode), `N_cs` (coarse mode)
|
167
|
+
- **Sulphate Species**: `SO4`, `SO4_ks`, `SO4_as`, `SO4_cs`
|
168
|
+
- **Ammonium Species**: `NH4`, `NH4_ks`, `NH4_as`, `NH4_cs`
|
169
|
+
- **Nitrate Species**: `NO3`, `NO3a`, `NO3b`, `NO3_ks`, `NO3_as`, `NO3_cs`
|
170
|
+
- **Gases (Mass Mixing Ratios)**: `NH3`, `HNO3`, `NO2`, `SO2`, `CO`, `O3`
|
171
|
+
|
172
|
+
*Note: The list of supported variables is actively being expanded. Future releases will include a more comprehensive mapping and direct integration with the GHOST (Globally Harmonised Observations in Space and Time) database [[Bowdalo et al., 2024]](https://essd.copernicus.org/articles/16/4417/2024/).*
|
173
|
+
|
174
|
+
---
|
175
|
+
|
176
|
+
## Advanced `qlc-py` Configuration
|
177
|
+
|
178
|
+
The `qlc-py` engine offers several advanced configuration options for more complex analysis workflows.
|
179
|
+
|
180
|
+
### Using Custom Station Lists
|
181
|
+
|
182
|
+
For targeted analysis, you can provide a custom list of stations via the `station_file` parameter in your configuration. This should be a path to a CSV file containing station metadata (e.g., ID, name, latitude, longitude).
|
183
|
+
|
184
|
+
- This is useful for focusing on specific station types (e.g., urban, rural) or networks.
|
185
|
+
- If a station from your list is not found in the observation dataset for a given period, it will still be included in the model-only analysis and plots.
|
186
|
+
- In addition to plots showing the average across all stations, you can configure `qlc-py` to generate plots and statistics for each individual station in the list.
|
187
|
+
|
188
|
+
### Multi-Entry and Parallel Processing
|
189
|
+
|
190
|
+
The JSON configuration file passed to `qlc-py` can be a single JSON object or an array of multiple objects. This enables powerful and flexible workflow designs.
|
191
|
+
|
192
|
+
- **Serial Processing**: If you provide an array of configuration objects, `qlc-py` will process them sequentially. This is useful for workflows with distinct steps, such as:
|
193
|
+
1. An entry for processing observations only.
|
194
|
+
2. An entry for processing model results only.
|
195
|
+
3. A final entry that uses both outputs for a combined collocation analysis.
|
196
|
+
- **Parallel Processing**: Within a single configuration entry, you can enable parallel processing for time-consuming tasks (like loading and processing many model files at once) by setting `"multiprocessing": true`.
|
197
|
+
|
198
|
+
### Example: Multi-Variable Observation Configuration
|
199
|
+
|
200
|
+
Below is an example of a single configuration entry for processing daily EBAS observations for two variables (`NH3` and `NH4_as`). It also includes the optional `global_attributes` block, which allows you to embed custom metadata into the output NetCDF files.
|
201
|
+
|
202
|
+
```json
|
203
|
+
{
|
204
|
+
"name": "CAMS",
|
205
|
+
"logdir": "./log",
|
206
|
+
"workdir": "./run",
|
207
|
+
"output_base_name": "$HOME/qlc/Plots/PY",
|
208
|
+
"station_file": "$HOME/qlc/obs/data/ebas_station-locations.csv",
|
209
|
+
"obs_path": "$HOME/qlc/obs/data/ver0d",
|
210
|
+
"obs_dataset_type": "ebas_daily",
|
211
|
+
"obs_dataset_version": "latest",
|
212
|
+
"start_date": "2018-12-01",
|
213
|
+
"end_date": "2018-12-21",
|
214
|
+
"variable": "NH3,NH4_as",
|
215
|
+
"station_radius_deg": 0.5,
|
216
|
+
"plot_type": "",
|
217
|
+
"plot_region": "EU",
|
218
|
+
"time_average": "daily",
|
219
|
+
"station_plot_group_size": 5,
|
220
|
+
"show_stations": false,
|
221
|
+
"show_min_max": true,
|
222
|
+
"log_y_axis": false,
|
223
|
+
"fix_y_axis": true,
|
224
|
+
"show_station_map": true,
|
225
|
+
"load_station_timeseries_obs": true,
|
226
|
+
"show_station_timeseries_obs": true,
|
227
|
+
"show_station_timeseries_mod": false,
|
228
|
+
"show_station_timeseries_com": false,
|
229
|
+
"save_plot_format": "pdf",
|
230
|
+
"save_data_format": "nc",
|
231
|
+
"multiprocessing": false,
|
232
|
+
"n_threads": "20",
|
233
|
+
"debug": false,
|
234
|
+
"global_attributes": {
|
235
|
+
"title": "Air pollutants over Europe, SO2,SO4,HNO3,NO3,NH3,NH4",
|
236
|
+
"summary": "Custom summary for netCDF output: Ebas daily observations for selected EU stations.",
|
237
|
+
"author": "Swen Metzger, sm@researchconcepts.io",
|
238
|
+
"history": "Processed for CAMS2_35bis (qlc_v0.3.27)",
|
239
|
+
"Conventions": "CF-1.8"
|
240
|
+
}
|
241
|
+
}
|
242
|
+
```
|
243
|
+
|
244
|
+
---
|
245
|
+
|
246
|
+
## Advanced Workflow: Data Processing and Configuration
|
247
|
+
|
248
|
+
For advanced users, it is helpful to understand the underlying data processing pipeline, which is controlled by a series of shell scripts and configured via `qlc.conf`. This allows for significant customization of data retrieval and analysis.
|
249
|
+
|
250
|
+
### The Shell Script Pipeline
|
251
|
+
|
252
|
+
When you run the main `qlc` command, it executes a chain of scripts to process data. The scripts to be run are defined by the `SUBSCRIPT_NAMES` array in `$HOME/qlc/config/qlc.conf`. A typical workflow is:
|
253
|
+
|
254
|
+
1. **`qlc_A1.sh`**: Handles data retrieval from the MARS archive. It fetches the required variables in GRIB format. The specific variables are defined by the `MARS_RETRIEVALS` array in `qlc.conf`, which must correspond to entries in the `nml/mars_*.nml` namelist files.
|
255
|
+
2. **`qlc_B1a.sh`**: Converts the retrieved GRIB files into NetCDF format.
|
256
|
+
3. **`qlc_B2.sh`**: Performs post-processing and variable substitution on the NetCDF files. This step is crucial as it renames the variables to the user-friendly names (`myvar_*`) expected by the plotting scripts.
|
257
|
+
4. **`qlc_D1.sh`**: Drives the station time-series analysis by generating a configuration and calling `qlc-py`.
|
258
|
+
5. **`qlc_C5.sh`**: Generates global overview plots, including 3D surface maps, vertical integrals (burden), and zonal/meridional means for selected variables.
|
259
|
+
|
260
|
+
The raw data retrieved from MARS is stored in the `$HOME/qlc/Results` directory, while the final, post-processed NetCDF files used for analysis are placed in `$HOME/qlc/Analysis`.
|
261
|
+
|
262
|
+
### Variable Mapping Explained
|
263
|
+
|
264
|
+
QLC uses a flexible three-part system defined in `qlc.conf` to map variables from the MARS archive to user-defined names for plotting.
|
265
|
+
|
266
|
+
- **`param_*`**: This is the official ECMWF parameter ID from the GRIB tables (e.g., `param_A1_sfc="73.210"`). This value is required by MARS for data retrieval and must be correct.
|
267
|
+
- **`ncvar_*`**: This is the short name that is automatically assigned to the variable when the GRIB file is converted to NetCDF (e.g., `ncvar_A1_sfc="var73"`). This name can differ depending on the data type (surface, pressure levels, model levels).
|
268
|
+
- **`myvar_*`**: This is the final, user-defined name for the variable (e.g., `myvar_A1_sfc="PM25"`). This is the name that will be used in plot labels, titles, and filenames throughout the QLC system.
|
269
|
+
|
270
|
+
This system allows you to work with consistent, human-readable variable names (`PM25`) while ensuring the underlying retrieval from MARS uses the correct, official parameter codes.
|
271
|
+
|
272
|
+
### Automatic Unit Conversion and Collocation
|
273
|
+
|
274
|
+
During the collocation step (comparing model data to observations), `qlc-py` automatically handles variable mapping and unit conversion. For example, when comparing model output (`mod`) to `castnet` observations:
|
275
|
+
|
276
|
+
- If a model variable named `SO4` or `SO4_as` (in units of `kg/kg`) is being compared to a `castnet` observation variable also named `SO4` (in units of `ug/m3`), the system will automatically convert the model data to `ug/m3` before calculating statistics. The observational unit is always treated as the target for conversion.
|
277
|
+
|
278
|
+
### Using Custom Data with `qlc-py`
|
279
|
+
|
280
|
+
While the shell script pipeline is designed for a seamless workflow, you can also use `qlc-py` as a standalone tool with your own NetCDF data. Simply provide absolute paths to your data files in the `mod_path` and `obs_path` fields of your JSON configuration. The data must be CF-compliant, but this allows you to bypass the MARS retrieval and processing steps entirely.
|
281
|
+
|
282
|
+
### Example Report
|
283
|
+
|
284
|
+
An example of the final PDF report generated by the `qlc` pipeline can be found in the `$HOME/qlc/doc/` directory. This provides a complete overview of all selected plots and analyses produced. The `$HOME/qlc/Presentations/` directory contains the report of a successful run.
|
285
|
+
|
286
|
+
### Accessing Raw Outputs for Custom Analysis
|
287
|
+
|
288
|
+
The QLC pipeline generates a wide range of outputs that can be used for further analysis outside of the main workflow.
|
289
|
+
|
290
|
+
- **Comprehensive Plots**: The `$HOME/qlc/Plots` directory contains all of the individual plots created during the run, e.g., in higher resolution or with more detail than what is included in the final summary report.
|
291
|
+
- **Exportable Data**: You can configure `qlc-py` to save the intermediate, collocated data in either NetCDF (`.nc`) or CSV (`.csv`) format.
|
292
|
+
- **Multiple Plot Formats**: Plots can be saved in various formats, including `.pdf`, `.png`, and `.jpg`.
|
293
|
+
|
294
|
+
This flexibility allows you to easily import QLC-processed data and graphics into your own analysis scripts, presentations, or reports.
|
295
|
+
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|