This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
"xarray.to_netcdf" needs too much memory for long datasets(e.g., R95P based on the ERA5 data) #1762
Closed
1 task done
Generic Issue
Description
Dear developers:
I want to calculate the R95P based on ERA5 data from 1950 to 2023. The function
create_ensemble
oropen_mfdataset
were used to load the dataset. The functionsensemble_percentiles
orpercentile_doy
were used to calculate the percentile of the day of the year. Then, according to the functionxclim.indicators.icclim.R95p
, the R95P we got. However, the computer memory exploded when the R95P results were exported. On the other hand, i'm confused about the difference between the functionquantile
and the functionpercentile_doy
.Code
Computer memory explodes when proceeding at this point (
results_R95P .to_netcdf('../R95P.nc', format='NETCDF4', engine='netcdf4')
)What I Did
I initially guessed that the computer memory was too small, so I loaded the data for each grid into the computer memory and finally concat all grids, but this way made the calculation too time-consuming. Do you have a better way?
Simple example for my solution
Thank you very much for your help, and I look forward to your reply!
Code of Conduct
The text was updated successfully, but these errors were encountered: