0

I like to read multiple NetCDF files, e.g. 90 files each contains 30 years of daily weather values for one of 3 parameter respectively (temperature, precipitation, radiation).

  • l1 <- list("temperature_1991.nc", "temperature_1992.nc", ..., "temperature_2020.nc")
  • l2 <- list("precipitation_1991.nc", "precipitation_1992.nc", ..., "precipitation_2020.nc")
  • l3 <- list("radiation_1991.nc", "radiation_1992.nc", ..., "radiation_2020.nc")

With stars::read_stars it is easy to read 3 times 30 files of one parameter respectively. so that I have 3 stars objects.

x1 <- stars::read_stars(l1)
x2 <- stars::read_stars(l2)
x3 <- stars::read_stars(l3)

Is there an efficient way to read all files directly/fast in perhaps one stars object? My main problem is that I only need the time series from one coordinate (one tile) of the 90 large files, which currently takes a very long time. At the moment I use stars::st_extract to extract the time series of the desired coordinate/tile.

I am very grateful for ideas/examples of how to efficiently read out the time series of the same tile from 90 very big NetCDF files.

Thank you very much

ckluss
  • 1,477
  • 4
  • 21
  • 33

0 Answers0