Fix bug when calculating the differences in the time series (previously self.dates was a list and you cannot subtract lists).
Add function to write to netCDF.