NCPP / ocgis

OpenClimateGIS is a set of geoprocessing and calculation tools for CF-compliant climate datasets.
Other
70 stars 20 forks source link

Icclim indice PRCPTOT is returning empty values #420

Closed bekozi closed 8 years ago

bekozi commented 8 years ago

who: @nilshempelmann

The icclim indices PRCPTOT is returning zeros/empty data.

bekozi commented 8 years ago

@nilshempelmann it appears there is an icclim default threshold which will mask all values below 1.0: https://github.com/cerfacs-globc/icclim/blob/09f54aafefdd93c161e334f697d1a7bef9ff7343/icclim/calc_indice.py#L611. I need to make sure that these parameters are appropriately exposed.

bekozi commented 8 years ago

@nilshempelmann I just noticed thresh (threshold) is in fact locked down in icclim: https://github.com/cerfacs-globc/icclim/blob/09f54aafefdd93c161e334f697d1a7bef9ff7343/icclim/calc_indice.py#L594. Is this causing your problem? If so, we'll have to look into modifying icclim.

nilshempelmann commented 8 years ago

OK, that's confusing and responsible for the zero results: :param arr: daily precipitation (liquid form) flux (e.g. "pr") in mm/day an issue for the other precipitation based indices as well!

precipitation includes all kind of water (including snow). only the liquid form is indicated as rainfall (http://cfconventions.org/Data/cf-standard-names/32/build/cf-standard-name-table.html)

next confusion is flux with mm/day. mm/day (or kg m-2 / time step ) is the unit for the precipitation amount while flux is given in (kg m-2 s-1). And pr (used in CMIP5 or CORDEX) is precipitation flux in kg m-2 s-1. This values are small numbers e.g. 0.00001 and get filtered by the treshhold.

A unit conversion kg m-2 s-1 to kg m-2 / time step is necessary. icclim is expecting mm/day also for other indices. So I suggest the perform the unit adaptation in ocgis.

nilshempelmann commented 8 years ago

included a quick solution in WPS birdhouse indices calculation:

https://github.com/bird-house/flyingpigeon/blob/master/flyingpigeon/indices.py#L162

bekozi commented 8 years ago

This conversion has been needed for some time (https://github.com/NCPP/ocgis/issues/359)! I'll try to get it implemented soon. It sounds like you have a workaround for the moment.