Skip to content

MAR utility functions #16

@hdrake

Description

@hdrake

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions