Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New plot_type 1d_profile in monitor #3178

Merged
merged 39 commits into from
Jun 7, 2023
Merged

New plot_type 1d_profile in monitor #3178

merged 39 commits into from
Jun 7, 2023

Conversation

FranziskaWinterstein
Copy link
Contributor

@FranziskaWinterstein FranziskaWinterstein commented May 16, 2023

Description

This implements a new one dimensional profile plot option '1d_profile' in the diagnostic monitor/multi_datasets.py. It allows one dimensional preprocessed data with only dimension height or pressure and plots all datasets in one figure. It is possible to plot the absolute values or differences. The latter as absolute differences or relative differences.

To prevent misunderstanding the former plot_type 'profile' is renamed to 'zonal_mean_profile'. Backward compatibility is given until the option 'profile' can be removed in future versions.

Example:
1d_profile


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.

New or updated recipe/diagnostic


@schlunma schlunma added this to the v2.9.0 milestone May 16, 2023
@schlunma
Copy link
Contributor

Hi @FranziskaWinterstein, thanks for this, this looks great!

I will try to review this soon. In the meantime, could I ask you to add an example usage of this to https://github.com/ESMValGroup/ESMValTool/blob/main/esmvaltool/recipes/monitor/recipe_monitor_with_refs.yml and an example plot to the bottom https://github.com/ESMValGroup/ESMValTool/blob/main/doc/sphinx/source/recipes/recipe_monitor.rst? That would be awesome, thanks!!

Copy link
Contributor

@schlunma schlunma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had a brief look at the code, looks very good already!! 👍

My two main comments:

  • At the very beginning of the diagnostic (in the __init__ method), you can add a check for plot_type == 'profile' and replace this if necessary with
    self.plots['zonal_mean_profile'] = self.plots.pop('profile')
    Then you can basically remove all further appearances of profile in the remaining code, which makes it much simpler.
  • I would recommend to not add a separate plot_bias option here but rather use the bias preprocessor in the recipe instead and then plot the output of this simply with 1d_profile. That will make your code here much simpler.

Thanks!! Let me know if you have any questions/comments!

esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
FranziskaWinterstein and others added 7 commits May 25, 2023 12:57
Co-authored-by: Manuel Schlund <32543114+schlunma@users.noreply.github.com>
Co-authored-by: Manuel Schlund <32543114+schlunma@users.noreply.github.com>
Co-authored-by: Manuel Schlund <32543114+schlunma@users.noreply.github.com>
Co-authored-by: Manuel Schlund <32543114+schlunma@users.noreply.github.com>
Co-authored-by: Manuel Schlund <32543114+schlunma@users.noreply.github.com>
Co-authored-by: Manuel Schlund <32543114+schlunma@users.noreply.github.com>
Co-authored-by: Manuel Schlund <32543114+schlunma@users.noreply.github.com>
@valeriupredoi
Copy link
Contributor

cheers both you guys! I can have a final look and merge when review's over and passed, remember to fix the flake issues and also please fix the PR description boxes (remove or strikethrough the ones that are not relevant, check mark the ones that are), yeah sorry, I sound like an accountant 😁

@FranziskaWinterstein
Copy link
Contributor Author

So, finally I think I addressed all comments. @schlunma would you be so kind as to review the changes again? There are still some codacy issues - can these be ignored?

Copy link
Contributor

@schlunma schlunma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is almost ready 👍 Just got a couple of minor comments below.

Could I also ask you to add an example usage of this to https://github.com/ESMValGroup/ESMValTool/blob/main/esmvaltool/recipes/monitor/recipe_monitor_with_refs.yml and an example plot to the bottom https://github.com/ESMValGroup/ESMValTool/blob/main/doc/sphinx/source/recipes/recipe_monitor.rst? It would also be good to modify profile -> zonal_mean_profile there.

Alternatively, could you post your recipe here? Then I can try to include a similar diagnostic into our recipe. Thanks!!

esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
esmvaltool/diag_scripts/monitor/multi_datasets.py Outdated Show resolved Hide resolved
@schlunma
Copy link
Contributor

schlunma commented Jun 7, 2023

@esmvalbot please run monitor/recipe_monitor_with_refs.yml

@esmvalbot
Copy link

esmvalbot bot commented Jun 7, 2023

Since @schlunma asked, ESMValBot will run recipe monitor/recipe_monitor_with_refs.yml as soon as possible, output will be generated here

@valeriupredoi
Copy link
Contributor

Since @schlunma asked, ESMValBot will run recipe monitor/recipe_monitor_with_refs.yml as soon as possible, output will be generated here

yeah bot's on the ropes today, possibly due to Lustre FS issues at DKRZ, RIP poor bot 🤖

@schlunma schlunma self-requested a review June 7, 2023 15:00
Copy link
Contributor

@schlunma schlunma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the new plot type to our example recipe and update the doc, this should be ready now!

Thanks @FranziskaWinterstein again for this great addition!

@valeriupredoi would you do us the honor and perform a final check and merge please? I ran the recipe locally to produce the new plots for the doc, everything went well 🚀

Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking great, beautiful plots too, well done you two! @schlunma would you want to add Franziska as an author to esmvaltool/recipes/monitor/recipe_monitor_with_refs.yml? If not, I can merge right now 👍

@schlunma
Copy link
Contributor

schlunma commented Jun 7, 2023

looking great, beautiful plots too, well done you two! @schlunma would you want to add Franziska as an author to esmvaltool/recipes/monitor/recipe_monitor_with_refs.yml? If not, I can merge right now +1

Good point, just did that 👍

@valeriupredoi valeriupredoi merged commit 54ace22 into main Jun 7, 2023
@valeriupredoi valeriupredoi deleted the monitor_1d_profile branch June 7, 2023 15:37
@valeriupredoi
Copy link
Contributor

great work here, guys! 🍺 x2

@esmvalbot
Copy link

esmvalbot bot commented Jun 8, 2023

ESMValBot is sorry to report it failed to run recipe monitor/recipe_monitor_with_refs.yml: exit is 1, output has been generated here

@FranziskaWinterstein
Copy link
Contributor Author

Thank you, too for reviewing and merging! =))

ehogan added a commit that referenced this pull request Jun 26, 2023
…old_and_clone_task_rtw

* recipe_test_workflow_prototype: (199 commits)
  #3169: Upgrade the RTW to work with ESMValTool v2.8.0
  [Condalock] Update Linux condalock file (#3237)
  Modified links to the tutorial (#3236)
  Add ESMValCore release `v2.8.1` into the documentation (#3235)
  Generate climatology on the fly for AutoAssess soil moisture (#3197)
  New recipe and diagnostic for Arctic-midlatitude research (#3021)
  Fixed pandas diagnostics for pandas>=2.0.0 (#3209)
  Update obs4MIPs dataset to the current naming scheme in recipe_smpi.yml (#2991)
  Add variable long names to provenance record in monitoring diagnostics (#3222)
  Extension of NASA MERRA2 CMORizer (cl, cli, clivi, clw, clwvi) (#3167)
  Remove "fx_variable" from recipe_wenzel14jgr.yml (#3212)
  [Condalock] Update Linux condalock file (#3217)
  Add Seaborn diagnostic (#3155)
  Remove fx_variables from ipccwg1ar5ch9 recipes (#3215)
  Remove "fx_variable" from recipe_tebaldi21esd.yml (#3211)
  Update recipe_impact.yml to work with newer versions of `pandas` (#3220)
  Use ESMValCore v2.9.0 release candidates (#3219)
  [Github Actions ] Check if python minor version changed after Julia install in development installation test (#3213)
  New plot_type 1d_profile in monitor  (#3178)
  Add support for using a dask distributed scheduler (#3151)
  ...
jvegreg pushed a commit that referenced this pull request Jan 14, 2024
Co-authored-by: Manuel Schlund <32543114+schlunma@users.noreply.github.com>
Co-authored-by: Valeriu Predoi <valeriu.predoi@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: valeriupredoi <valeriupredoi@users.noreply.github.com>
Co-authored-by: Manuel Schlund <manuel.schlund@dlr.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Monitor diagnostic: profile -> contour?
3 participants