Read multi .nc files along new dimension

Late to the party, but RasterSeries in Rasters.jl is designed for this use-case. Use the regex from @Fliks, then:

using Rasters
series = RasterSeries(filelist, Ti(timestamps))
# Retreive something
series[Ti=At(DateTime(2001, 1, 1)]

If you need to join the files into a single Raster variable with a time dimension, use Rasters.combine:

combined_raster = combine(series, Ti)
write("combined.nc", combined_raster)

You can do the same thing with a series of tif or whatever, and still write to netcdf.

3 Likes