CliMA / OceanParameterizations.jl

Machine learning (and uncertainty quantification?) of climate model parameterizations using differentiable (and probabilistic?) programming.
MIT License
21 stars 2 forks source link

Use DataDeps.jl to depend on LESbrary.jl data #25

Open ali-ramadhan opened 3 years ago

ali-ramadhan commented 3 years ago

Now that the data is online at https://engaging-web.mit.edu/~alir/lesbrary/ it should be possible to make everything in this repo reproducible by registering data deps.

ali-ramadhan commented 3 years ago

@adelinehillier @xkykai A minimal working example for one file might look something like this:

using DataDeps

const ENGAGING_LESBRARY_DIR = "https://engaging-web.mit.edu/~alir/lesbrary"

dd = DataDep("lesbrary_free_convection_1",  # identifier
             "proto-LESbrary.jl free convection statistics (Qb = 5×10⁻⁷ m²/s³)",  # description
             joinpath(ENGAGING_LESBRARY_DIR, "three_layer_constant_fluxes_cubic_hr48_Qu0.0e+00_Qb5.0e-07_f1.0e-04_Nh256_Nz128_pilot2", "statistics.nc")  # URL
)

DataDeps.register(dd)

# open file!
using NCDatasets
ds = NCDataset(datadep"lesbrary_free_convection_1/statistics.nc")  # works just like a string filepath!