Is there a convenient way to read netCDF datasets stored in nested groups when using NCDatasets.jl?

Hi,

I’m relatively new to Julia and trying to use NCDatasets.jl to read satellite data stored in netCDF files. The data are stored in compound groups at the end of a path like this

/BAND1_RADIANCE/STANDARD_MODE/GEODATA/latitude

Through trial-and-error I learned I can get at the data by chaining group() functions together,

using NCDatasets
ds = Dataset("OMI-Aura_L1-OML1BRUG_2023m0710t0018-o100973_v0401-2023m0710t0603.nc", "r")
longitude = ds.group["BAND1_RADIANCE"].group["STANDARD_MODE"].group["GEODATA"]["longitude"]

But since I have do to this often for several dozen datasets, I’m wondering, is there’s an easier way than building this kind of statement manually for each of them?

I figure I could write a function like this,

dataset = getdata(ds, "/artbitary/series/of/groups/to/dataset")

but as I’m new to the language so I thought I’d join the discussion and ask. I’d appreciate any advice. Thanks.

RemoteS?

Thanks, I’ll give that a shot. I’ve had success reading these data with GDAL before. The OMI instrument is very different than MODIS but it’s on Aura, sibling of Aqua and Terra. Would be nice to have a package fit for all three.

Yep, I only tested it with MODIS but if GDAL reads it, it should work too. But the MODIS automatism’s may fail. Please open issues with reproducible cases if that’s the case.