I am using 250 years precipitation data. I am trying to composite the precipitation during ENSO event by using NINO index. kindly help me to produce composite analysis using conditional if ?
Assuming that the timeseries of the Niño index has exactly the same time axis as your precipitation variable,
let masked_precip = if index gt threshold then precip
In this way, the new precipitation variable is defined only when index is larger than the threshold. Then your composite is a simple average over the time axis because the averaging operator ignores undefined time steps.
Hope this helps,
Ryo
Best regards
Deni