Hi all - I have a reasonably large time-series dataset (57777-by-20) of daily mean temperature for 1980 to present day, recorded from a weather station in Denmark. Within the time-series there are several large gaps in the coverage (> 1-2 months) due to maintenance and servicing of the weather station.
The gaps are too large to consider interpolating between missing data, so I would like to replace the missing values with data recorded from a temporary weather station, that was sited near the main station during periods when it was unable to operate. Having visually and statistically investigate the similarity between the two datasets, this seems a sound approach.
I've imported both datasets from .txt files, converted them to timetables, and located and replaced missing data with nan's.
However, I've been unable to successfully replace the nan's with like-for-like data from the secondary dataset (i.e., replacing with data from the exact same datetime). The datasets cover different temporal ranges, so indexing and replacing cells between the data has not worked (see code below).
I think I'm looking for a similar method but indexing both the rowtimes and the missing data from the temperature variable.
It would be great to hear from anyone with a solution to this problem, or with a similar method for replacing missing data within a time-series with values from a different dataset?
[idx] = find(data1.Temp == 999 | data1.Temp == -999);
data1.Temp(idx) = data2.Temp(idx);