I am making my way forward into timeseries processing with the scikit
I have a timeseries where NoData values are masked when loading the data
into the timeseries.
Now I would like to apply some filters on the data like discarding data
values below measurement device accuracy or above a certain threshold.
Therefore I followed the appraoch outlined in the FAQ .
But then I get the pasted below at the end.
Does that mean that one can only mask an array once and cannot mask more
values later on?
I would like to do something like:
1) create timeseries with NoData values => already can do that
2) apply various filters masking more and more data.
a) e.g. get a series with masked values below 10.
b) e.g. get a series with masked values above 100.
On Thursday 12 June 2008 17:14:03 Tim Michelsen wrote:
> Does that mean that one can only mask an array once and cannot mask more
> values later on?
No no, the message
> IndexError: Masked arrays must be filled before they can be used as
doesn't mean you can't mask arrays more than once, just that you can't use a
MaskedArray as index in a TimeSeries without having to fill it first. The
reason for this behavior is that we can't tell beforehand how you want to
deal with your masked values: should a masked value be considered True ?
So, when you want to do something like:
> mask[mask<0] = numpy.ma.masked
mask[(mask<0).filled(True)] = numpy.ma.masked
That way, you're masking the values of mask that are negative, and keep the
masked values as masked.