Skip to content

Use cf-conventions to infer dimension names#106

Merged
nocollier merged 1 commit intorubisco-sfa:masterfrom
SeanBryan51:use-cf-conventions-to-infer-dimension-names
Sep 26, 2024
Merged

Use cf-conventions to infer dimension names#106
nocollier merged 1 commit intorubisco-sfa:masterfrom
SeanBryan51:use-cf-conventions-to-infer-dimension-names

Conversation

@SeanBryan51
Copy link
Copy Markdown
Contributor

Currently ILAMB requires dimensions for time, latitude and longitude in NetCDF files to be called time, lat and lon respectively which is not CF-compliant. This change allows ILAMB to be more flexible in inferring the spatiotemporal dimension names by examining standard CF attributes on coordinate types.

Currently ILAMB requires dimensions for time, latitude and longitude in
NetCDF files to be called `time`, `lat` and `lon` respectively which is
not CF-compliant. This change allows ILAMB to be more flexible in
inferring the spatiotemporal dimension names by examining standard CF
attributes on [coordinate types][cf_coordinate_types].

[cf_coordinate_types]: https://cfconventions.org/cf-conventions/cf-conventions.html#coordinate-types
@SeanBryan51 SeanBryan51 force-pushed the use-cf-conventions-to-infer-dimension-names branch from 7069ba2 to d40f997 Compare September 24, 2024 00:45
@SeanBryan51 SeanBryan51 marked this pull request as ready for review September 24, 2024 01:07
@SeanBryan51
Copy link
Copy Markdown
Contributor Author

Hi @nocollier, requesting your review for this pull request

@nocollier
Copy link
Copy Markdown
Collaborator

Thanks for your contribution and your patience while I get to looking at it.

I think this is great, and appreciate your effort to make ILAMB better. I just have a few comments to make in general in case you find yourself staring at a lot of my (ugly) code:

  • I want to be careful about CF-conventions / CMOR requirements. Your contribution does not apply here as it makes ILAMB more flexible than it was, but in general I try to require very little from model output. In my experience, it is work for model centers to convert output and if I can just be more flexible, then great.
  • My apologies for that code, it was written by ~8 years ago me staring at CMIP5 output which was not as well formatted as CMIP6 and before packages like xarray had really matured.
  • I have a a ilamb3 rewrite underway, but it has been a lot of work to try to cleanup everything and re-implement it. I will think about porting your functions there too.

I am going to accept and merge this, and then will run some larger tests on our bigger comparisons in the week to come.

Thanks!

@nocollier nocollier merged commit 6780ef0 into rubisco-sfa:master Sep 26, 2024
@SeanBryan51
Copy link
Copy Markdown
Contributor Author

Hi @nocollier, can you push a new release to conda/pip containing these changes? We require these changes for our work and it would be convenient if they were available directly via conda.

@abhaasgoyal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants