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

Download and formatting of NOAA marine boundary layer data for CH4 (NOAA-MBL-CH4) #3301

Merged
merged 11 commits into from
Nov 3, 2023

Conversation

FranziskaWinterstein
Copy link
Contributor

@FranziskaWinterstein FranziskaWinterstein commented Jul 19, 2023

Description

This adds download and formatting scripts to import NOAA marine boundary layer (MBL) CH4 data.

It is downloading the provided .csv table provided here. It formats the .csv file into a netcdf file, adds dummy latitude and longitude (since it is a global value) and fixes metadata.

image


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 data reformatting script

@FranziskaWinterstein
Copy link
Contributor Author

Note, that the tests fail, because the necessary cmor table for the variable ch4s is missing in the ESMValCore:
ESMValCore/esmvalcore/cmor/tables/custom/CMOR_ch4s.dat

SOURCE: CMIP5
!============
variable_entry:    ch4s
!============
modeling_realm:    atmos
!----------------------------------
! Variable attributes:
!----------------------------------
standard_name:     mole_fraction_of_methane_in_air
units:             1e-06
cell_methods:      area: time: mean
cell_measures:     area: areacella
long_name:         Atmosphere CH4
comment:           As ch4, but only at the surface
!----------------------------------
! Additional variable information:
!----------------------------------
dimensions:        longitude latitude time
type:              real
!----------------------------------
!

I could make a pull request concerning this in the ESMValCore, however I also found the CMIP6 variable ch4global, which could fit at least to the NOAA dataset as well. I am testing that.

@hb326
Copy link
Contributor

hb326 commented Aug 8, 2023

Note, that the tests fail, because the necessary cmor table for the variable ch4s is missing in the ESMValCore: ESMValCore/esmvalcore/cmor/tables/custom/CMOR_ch4s.dat

SOURCE: CMIP5
!============
variable_entry:    ch4s
!============
modeling_realm:    atmos
!----------------------------------
! Variable attributes:
!----------------------------------
standard_name:     mole_fraction_of_methane_in_air
units:             1e-06
cell_methods:      area: time: mean
cell_measures:     area: areacella
long_name:         Atmosphere CH4
comment:           As ch4, but only at the surface
!----------------------------------
! Additional variable information:
!----------------------------------
dimensions:        longitude latitude time
type:              real
!----------------------------------
!

I could make a pull request concerning this in the ESMValCore, however I also found the CMIP6 variable ch4global, which could fit at least to the NOAA dataset as well. I am testing that.

Hey @FranziskaWinterstein,
I think the new cmor table entry is good. I have opened a branch with this (for the methane surface stations) in ESMValCore. The only significant difference between the two definitions is the unit. I have specified 1e-09. Would that work for you as well?

@FranziskaWinterstein
Copy link
Contributor Author

@hb326 Thank you! Yes, that is fine. 1e-09 is more common anyway I think.

Copy link
Contributor

@hb326 hb326 left a comment

Choose a reason for hiding this comment

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

@FranziskaWinterstein: Thanks for the formatter and cmorizer! I successfully downladed and formatted the data, tested the file with the recipe, and also looked at the data to check if it was in the correct units.
All works fine, the units look good, and everything runs smoothly with the recently merged "ch4s" entry to the custom cmor tables.

I have found a few minor things that I commented on, but nothing major. 👍

ch4s:
additional_datasets:
- {dataset: NOAA-MBL-CH4, project: OBS, mip: Amon, type: atmos, version: 1.0, tier: 2}
scripts: null

Copy link
Contributor

Choose a reason for hiding this comment

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

@FranziskaWinterstein: did you leave the years out here because the dataset is delivered in one file anyway? With not asking for a specific time period, this is recipe is flexible enough to just read whatever is there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I am unsure what would happen if the downloaded .csv file covers different years. Would you recommend to add years of the current available period?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would probably add the years just because the other datasets in the recipe have a specified time period. Not sure if we have a clear rule here... @schlunma, @valeriupredoi, any recommendations?

Copy link
Contributor

Choose a reason for hiding this comment

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

@valeriupredoi: any recommendations here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would indeed - it's good to have it, if the user wants only a few years rather than download/cmorize the entire data span. In this case my review below becomes void since I am suggesting removing exactly these optional arguments (start/end times), if they are not used 👍

esmvaltool/references/noaa-mbl-ch4.bibtex Outdated Show resolved Hide resolved
esmvaltool/cmorizers/data/formatters/datasets/gpcp_sg.py Outdated Show resolved Hide resolved
esmvaltool/cmorizers/data/cmor_config/NOAA-MBL-CH4.yml Outdated Show resolved Hide resolved
esmvaltool/recipes/examples/recipe_check_obs.yml Outdated Show resolved Hide resolved
@remi-kazeroni remi-kazeroni changed the title Download and formatting of NOAA marine boundary layer data for CH4 Download and formatting of NOAA marine boundary layer data for CH4 (NOAA-MBL-CH4) Aug 25, 2023
@remi-kazeroni remi-kazeroni added requires new ESMValCore release A new release of ESMValCore is needed to solve this issue/merge this pull request.. approved by technical reviewer and removed looking for technical reviewer labels Aug 25, 2023
Copy link
Contributor

@remi-kazeroni remi-kazeroni left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution, @FranziskaWinterstein! The code looks good to me and all works fine: downloader, formatter, recipe_check_obs. I agree with @hb326's suggestions and added a couple of very minor points you may want to consider.

There are a few failing tests but nothing that can be addressed (for now):

  • the remaining Codacy issues can be ignored
  • the CircleCI run_tests fails because the recently added custom table (ch4s) is not yet part of a released version of ESMValCore. The test will pass once a new ESMValCore release will be made. This PR could only be merged after that. Thus, I added the "requires a new ESMValCore release" label.

I can pre-approve on the technical side 👍

Copy link
Contributor

@hb326 hb326 left a comment

Choose a reason for hiding this comment

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

Looks good to me, @FranziskaWinterstein! Thanks for implementing the changes. I think the pull request is not ready to be merged (if we get the failing tests to pass...).

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.

couple minor points from me. Many thanks @FranziskaWinterstein - the tests run with the latest development ESMValCore so all's OK on that front 🍺

EDIT: I decided not to stress on about unused arguments since these are endemic to a lot of cmorizers, and we should check for the need and make them optional in the main cmorizer module first; but clearly, that needs to be done in a dedicated PR, not here, and not in @schlunma 's PR (sorry for busting your balls on this, guys) 🍺

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.

squashing my stale review - all fine, and many thanks, Franziska! Ready for merge, unless you want to implement a start time/end time optionality 🍺

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.

Blast! Re-blocking this due to the failed test - apologies 👍 Needing ESMValCore 2.10 that includes the cmor table for ch4s plopped by Birgit in ESMValGroup/ESMValCore#2168

@FranziskaWinterstein
Copy link
Contributor Author

@valeriupredoi Thank you for taking care of this pull request. I am currently a little bit lost. Do you need me to do anything?

@valeriupredoi
Copy link
Contributor

valeriupredoi commented Oct 19, 2023

@FranziskaWinterstein no not at all, I just put a temporary blocker on it so one doesn't accidentally merge it until we have a new ESMValCore that includes ESMValGroup/ESMValCore#2168 (sorry it took me a few minutes to dig out the relevant PR that was merged in Core). All good by me otherwise 🍺

@zklaus zklaus requested a review from valeriupredoi November 3, 2023 09:01
@zklaus zklaus dismissed valeriupredoi’s stale review November 3, 2023 09:46

The review block was put in place to wait for the core release. That has happened and the tests do indeed work.

@zklaus zklaus merged commit 29b20e7 into main Nov 3, 2023
6 of 7 checks passed
@zklaus zklaus deleted the cmorize_noaa_mbl_ch4 branch November 3, 2023 09:46
jvegreg pushed a commit that referenced this pull request Jan 14, 2024
…OAA-MBL-CH4) (#3301)

Co-authored-by: Birgit Hassler <33543691+hb326@users.noreply.github.com>
Co-authored-by: Valeriu Predoi <valeriu.predoi@gmail.com>
Co-authored-by: Klaus Zimmermann <klaus.zimmermann@smhi.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved by scientific reviewer approved by technical reviewer Data observations requires new ESMValCore release A new release of ESMValCore is needed to solve this issue/merge this pull request..
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add NOAA Marine Boundary Layer CH4 data
5 participants