开发者

python xarray write to netcdf file very slow

开发者 https://www.devze.com 2022-12-07 17:32 出处:网络
for fname in ids[\'fnames\'开发者_高级运维]: aq = xr.open_dataset(fname, chunks=\'auto\', mask_and_scale=False)
        for fname in ids['fnames'开发者_高级运维]:
            aq = xr.open_dataset(fname, chunks='auto', mask_and_scale=False)
            aq = aq[var_lists]

            aq = aq.isel(lat=slice(yoff, yoff+ysize), lon=slice(xoff, xoff+xsize))
            list_of_ds.append(aq)
            aq.close()
 
            
        all_ds = xr.concat(list_of_ds, dim='time')
        all_ds.to_netcdf('tmp.nc')

Hi all, I am making use of xarray to read netcdf files (around 1000) and save selected resutls to a temporary file, as shown above. However, the saving part runs very slow. How can I speed this up?

I also tried directly load the data, but still very slow.

0

精彩评论

暂无评论...
验证码 换一张
取 消