jddingemanse / awtiCodeDev

Development of code for and by Arba Minch University Water Technology Institute
1 stars 2 forks source link

Consistency tests #16

Open jddingemanse opened 1 year ago

jddingemanse commented 1 year ago

Develop different codes for different consistency tests.

Any general remarks on consistency or data quality tests can be shared on the discussion on this topic.

Meselegithubmarkos commented 1 year ago

DMC

Double-mass curve is used not only to verify the relative consistency of a time series, but also to find correction factors for errors and fill in gaps. It is aplot of cummulative sum of the nearby stations versus cummulative sum of the station. This application is limited to monthly and yearly totals, as it normally does not work with daily ones.

Let: PA = is station_A cummulative sum of annual rainfall PB = is annual rainfall cummulative sum of the average of the nearby stations

fig, ax = plt.subplots()

ax = plt.scatter()

ax = plt.scatter(PB, PA)

Equation for trend line

y = np.polyfit(PB, PA, 1) p = np.poly1d(y)

add trendline to plot

plt.plot(PB, p(PB)) plt.xlabel('cummulative sum of the average annual rainfall of the nearby stations of station_A') plt.ylabel('cummulative sum of station_A annual rainfall') plt.legend()