ARCCSS-extremes / climpact

Calculate the ET-SCI climate extremes indices
GNU General Public License v3.0
42 stars 29 forks source link

Calculation of thresholds seems to not work with the netcdf example #84

Closed bzah closed 3 years ago

bzah commented 3 years ago

Hello, I'm trying to calculate Tx90p based on the climpact.sampledata.gridded.1991-2010.nc sample file.

I followed the user guide. I skip step 1 because I'm really only interested in the bootstrapping process. On step 2, it works fine, the nc file generated seems correct when I open it with Panoply. However, on step 3 I get the following error

Error in check.quantile.validity(quantiles, present.var.list, days.in.base) : 
  Temperature in-base quantiles must contain 10th and 90th percentiles.
Calls: create.indices.from.files ... compute.climdex.indices -> <Anonymous> -> check.quantile.validity
Execution halted

Did I miss something? Thank you for your help.

heroldn commented 3 years ago

A good error message needs to be written for this. I think the problem is simply that you're pointing to a thresholds file that contains data for the same time period as your "infiles". So in your processing file just set thresholds.files to NULL and it should work. You only need to set thresholds.files if the threshold years you're interested in are outside of the years in your data file(s). Otherwise climpact just calculates them at runtime. But let me know if that isn't the issue.

bzah commented 3 years ago

Thanks for your reply. My goal is actually to compare the results of climpact bootstrapping with the ones from icclim and xclim (python libraries). I assumed the bootstrapping process is only triggered when thresholds.files is not NULL but I'm not sure about that.

heroldn commented 3 years ago

If you mean you want to look at percentiles calculated inside the base period I don't think that's possible with climpact, but I'd have to confirm. But climpact uses the excellent package climdex.pcic for all of these calculations so you might want to look at that directly - and you might find it more practical than having to put everything through climpact, if you just want to test a time series for comparison.

bzah commented 3 years ago

I don't really intent to look at the percentiles themself but more at the resulting netcdf. I wanted to use climpact instead of climdex because my inputs are netcdf files and there is much more documentation on climpact to setup a quick test. Anyway thanks for your help.

heroldn commented 3 years ago

In that case you don't need to use a thresholds file, just run the wrapper script and boot strapping will be used.