Skip to content

Commit

Permalink
fix figure notebook configs
Browse files Browse the repository at this point in the history
  • Loading branch information
raehik committed Oct 18, 2023
1 parent 12a9dbd commit d5755c3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion examples/cli-configs/data-paper-fig-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ long-max: 80
ntimes: 4000
factor: 4

co2-increase: true
co2-increase: false
12 changes: 12 additions & 0 deletions examples/cli-configs/data-paper-fig-6-1pct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# One forcing generation configuration for Figure 6 in the 2021 paper.
# Same as Figure 1, but using 1% annual CO2 increase dataset.

lat-min: -80
lat-max: 80
long-min: -280
long-max: 80

ntimes: 4000
factor: 4

co2-increase: true
12 changes: 0 additions & 12 deletions examples/cli-configs/data-paper-fig-6-ctrl.yaml

This file was deleted.

1 change: 0 additions & 1 deletion examples/cli-configs/data-paper.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Approximates data step configuration used in the 2021 paper.
# Also generates forcing data used to generate Figure 1 (via Jupyter notebook).

lat-min: -80
lat-max: 80
Expand Down
25 changes: 12 additions & 13 deletions examples/jupyter-notebooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,22 @@ forcing][gz21-paper-agupubs]. The exact version of the code used to produce said
paper can be found on [Zenodo][gz21-paper-code-zenodo].

## 2021 paper figures
There are several notebooks which were used to generate the figures in the 2021 paper.
There are several notebooks which were used to generate the figures in the 2021
paper.

The data for `generate-paper-figure-1.ipynb` can be generated by running
`generate-paper-figure-1.ipynb` generates figure 1b. The forcings it uses can be
generated by running the data step with the following configuration:

```
mlflow run . --experiment-name <name>--env-manager=local \
-P lat_min=-80 -P lat_max=80 -P long_min=-280 -P long_max=80 \
-P factor=4 \
-P CO2=1 -P global=0 \
-P ntimes=4000 \
-P chunk_size=1
python src/gz21_ocean_momentum/cli/data.py \
--config-file examples/cli-configs/data-paper-fig-1.yaml \
--out-dir tmp/generated/forcings/paper-fig-1
```
. The notebook generates figure 1b.

For `generate-paper-figure-6.ipynb`, which generates figure 6b,
the same call has to be run with again with `CO2=1`.
The notebook is then asking for the data set with `CO2=0` first and the one with `CO2=1` second.
`generate-paper-figure-6.ipynb`, which generates figure 6b, requires the above
forcing data, plus another set of forcings generated using the 1% annual CO2
increase CM2.6 dataset. Use `--config-file
examples/cli-configs/data-paper-fig-6-1pct.yaml`.

`test-global-control.ipynb` generates figures 4, 5 and 7, as well as D4 and D5. For this, the inference step with
the trained neural network has to be run both on the data with `CO2=0` and with `CO2=1`, and then the notebook needs to
Expand All @@ -33,4 +32,4 @@ with pre-industrial CO2 levels), and the figures referring to _1pctCO2_ are thos
year in CO2 levels for the first 70 years, after which they remain constant).
The notebook needs to be handed the experiment and run ID of the inference run, which is linked to the data and training
runs through `params.data_run_id` (run ID of data run) and `params.model_run_id` (run ID of training run),
respectively.
respectively.

0 comments on commit d5755c3

Please sign in to comment.