I have a list of NetCDF files, which contain geospatial data.
From each file, I want to read just a few non-consecutive pixels. The number of pixels to read from each file is always different.
I'm wondering what the best practice for reading them is, especially when the number of pixels is very high. It seems that after a certain threshold, it's faster to read the entire file and then select the pixels I need, but I feel like this could take a toll in the RAM usage if I am reading many files in parallel.
Right now, I'm considering simply reading the entire file if npixels < threshold and reading one by one if npixels > threshold, but is there a better way?