Hi Mohammad,
At first I thought that the problem was caused by
data1 = QuantityMagnitude[data0["Values"]]
The values are not Quantity
objects so QuantityMagnitude
is not needed. QuantityMagnitude
is Identity
unless the value is Missing["NotAvailable"]
. In that case the result is QuantityMagnitude[Missing["NotAvailable"]]
. I though that was interfering with the interpolation.
The interpolation is working just fine, what look like gaps are cause by zero values, not missing values.
data0 = WeatherData["PHMK", "TotalPrecipitation", {{1950, 1, 1}, {2020, 12, 31}, "Day"}];
ts0 = TimeSeries[data0, MissingDataMethod -> {"Interpolation", 1}]
If you look at the following sample you will see that all missing values have been correctly interpolated.
data0["Values"][[2200 ;; 2500]]
ts0["Values"][[2200 ;; 2500]]
Zero precipitation for many consecutive days is not unusual.
The question you asked me via email is a more complex and will take some time to figure out.