c_INTERANN — Function to calculate smoothed interannual daily values
[Qinta_Med,[Qinta_10,Qinta_90,Qinta_Mean]] = c_INTERANN(Q,DATEDEP,NBVAL,DATEDEPGENE,SCOEFF,PERCTL)
Data from which the inter-annual values will be calculated (matrix [Nx1]). Warning : Q values should be lower than 100 000
Date of the first value in Q vector (format 199901010000)
Number of values in the generated vectors
Date of the first value in the generated vector
Smoothing coefficient (SCOEFF = 1 >> no smoothing, SCOEFF=183 >> maximum smoothing)
Percentile calculated (value between 1 and 99). Two percentiles are calculate: PERCTL and 100-PERCTL
Generated vector with the median inter-annual daily value for each calendar day (matrix [NBVALx1])
Generated vector with the percentile PERCTL of inter-annual daily value for each calendar day (matrix [NBVALx1])
Generated vector with the percentile 100-PERCTL of inter-annual daily value for each calendar day (matrix [NBVALx1])
Generated vector with the mean inter-annual daily value for each calendar day (matrix [NBVALx1])
WARNING : This function is written in C language and interfaced with SCILAB (HYDROGR.dll).
WARNING : Q values should be lower than 100 000.
After the calculation of the raw interannual values from the input time series, the functions performs a smoothing based on a convolution with a decreasing exponential kernel. Smoothing is controlled by the SCOEFF parameters that determines the parameter of the kernel (kernel = exp[-1/SCOEFF x i]).
// Generation of fictious discharge data with the GR4J model (see GR4J help) P = max(0,exp(convol(1/3*ones(1,3),rand(4998,1)+0.2).^5)*10-12)'; // Rainfall T = [0.687;0.498;2.774;6.086;10.565;13.702;16.159;15.585;12.619;8.486;3.300;0.778]; ETP = c_ETP(5000,24,%pi/4,T,198001010000,1); // Potentiel Evapotranspiration X =[665;1.18;90;3.8;0]; // GR4J parameters Q=c_GR4J(24,X,P,ETP,[0.6;0.7]); // GR4J simulation // Calculation of internannual values [Qd_Med,Qd_P1,Qd_P2] = c_INTERANN(Q,197001010000,366,197001010000,4,20); subplot(1,2,1),plot(Q) subplot(1,2,2),plot([Qd_Med,Qd_P1,Qd_P2]);xtitle('Julian day','Discharge (m3/s)');