gmacgilchrist / gfdl_utils

MIT License
2 stars 1 forks source link

Integrate `gfdl_utils` with `doralite` #1

Open gmacgilchrist opened 1 year ago

gmacgilchrist commented 1 year ago

The doralite (repo here) package leverages some of the dora functionality to determine model metadata (for example the pp directory path) within python. It is now available to be used on PP/AN. It makes sense to integrate this with the functionality of gfdl_utils, so that one can go seamlessly from, say, the o-div number of an experiment, to dmget-ing and opening specific variables.

hdrake commented 1 year ago

Which way do you see this integration going? Importing doralite into gfdl_utils or vice versa?

I've found this integration do be incredibly efficient. I used to copy-paste PP paths from DORA and then manually explore them from the command line to see what output was available. Now this is as simple as:

import doralite
import gfdl_utils.core as gu

pp_name = gu.find_variable(pp, 'TKE_itidal')[0]
local = gu.get_local(pp, pp_name, "ts")
path = gu.get_pathspp(pp, pp_name, "ts", local, "*", "*")
gmacgilchrist commented 1 year ago

Really great that you're making use of this @hdrake (especially now that I can't, since my GFDL access is revoked). I had envisioned integrating doralite into gfdl_utils, or at least just using them alongside one another. I just wanted to be able to use the o-div number to get the pp path (or any other element that doralite can retrieve), and then use gfdl_utils from there.