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

MAR utility functions #16

Open
hdrake opened this issue Jun 17, 2024 · 0 comments
Open

MAR utility functions #16

hdrake opened this issue Jun 17, 2024 · 0 comments

Comments

@hdrake
Copy link
Contributor

hdrake commented Jun 17, 2024

I find myself copy-pasting code to the following in several of my MAR notebooks:

  • overwriting the config dictionary with the MAR environment variables
  • getting local parameters and downloading files
  • loading model data from those files

It seems unnecessary to expose these to the typical user; for the vast majority of use cases we can replace the many lines of code that do this with a function that takes a config dictionary and outputs a dictionary of xr.Dataset or momgrid instances.

I think this would dramatically lower the barriers for new contributors to MAR. After just two commands of set up,

config = {
    "startyr": "1975",
    "endyr": "2015",
    "dora_id": "odiv-399, odiv-400",
    "pathPP": None,
}
models = load_om5_output(config)

users should be able to make a basic plot, e.g.:

models["odiv-399"]["gds"].data.tos.mean("time").plot()

to produce
Screenshot 2024-06-17 at 11 56 38 AM

@hdrake hdrake changed the title MAR utility functions? MAR utility functions Jun 17, 2024
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

No branches or pull requests

1 participant