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

Convert {worldmet} to the Global Historical Climatology Network #34

Merged
merged 12 commits into from
Jun 13, 2024

Conversation

jack-davison
Copy link
Collaborator

@jack-davison jack-davison commented Jun 13, 2024

Note that the GHCN still only has majority US data, so this PR is a draft.

This PR fixes #32.

This PR is quite a large overhaul of {worldmet} to use the GHCN over the ISD. This PR:

  • Adds import_ghcn_stations() and import_ghcn_codes() to access GHCN metadata.
  • Adds import_ghcn_hourly() and import_ghcn_daily() to access data from the GHCNh and GHCNd.
  • Deprecates, but does not remove, getMeta(), importNOAA(), and weatherCodes.
  • Refreshes the {pkgdown} site, package documentation, vignette, and README files to reflect these changes.

Back Compatibility

The choice to deprecate getMeta() and importNOAA() rather than replace their internals was done for a couple of reasons:

  • Leaving importNOAA() where it is ensures back-compatibility for users using {worldmet} in production.
  • importNOAA() and getMeta() aren't particularly descriptive names - import what from NOAA? Get what metadata? More evocative function names make for nicer, more readable scripts.
  • getMeta() is an awkward function because it isn't clear whether it returns a map, a table, or just prints both, leading to the map and returnMap args. import_ghcn_stations() has the return arg, wherein a user can specify "map", "table", or "sf" (the latter of which returns a spatial dataframe).

Future

There are lots of data sources that are part of the GHCN that aren't accessible through {worldmet}. I think two that could be of interest are:

Questions

  • Currently the functions are in snake_case rather than camelCase like the rest of the {openair} toolkit - in part because importGHCNhHourly() looks dreadful written down. I'd probably prefer camelCase for consistency.

@davidcarslaw davidcarslaw marked this pull request as ready for review June 13, 2024 09:44
@davidcarslaw davidcarslaw merged commit fbe5e56 into davidcarslaw:master Jun 13, 2024
4 of 5 checks passed
@davidcarslaw
Copy link
Owner

thanks jack - important step for the future...

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.

ISD getting replaced by GHCNh
3 participants