[SciPy-user] scikits.timeseries : masking data after it has been read in using tsfromtxt

Dharhas Pothina Dharhas.Pothina@twdb.state.tx...
Wed Jun 17 10:43:45 CDT 2009


Hi,

I'm reading in a timeseries using :

SB1S = ts.tsfromtxt('SB1S.txt',freq='T',comments='#',dateconverter=dateconverter,datecols=(0,1,2,3,4),usecols =(0,1,2,3,4,7,9,8),names='Y,M,D,hh,mm,Temperature,Salinity,WaterLevel')

so SB1S looks like :

In [93]: SB1S
Out[93]:
timeseries([(18.710000000000001, -10000000000.0, 0.27100000000000002)
 (18.710000000000001, -10000000000.0, 0.27100000000000002)
 (18.920000000000002, -10000000000.0, 0.25900000000000001) ...,
 (21.379999999999999, 1.8200000000000001, 0.041000000000000002)
 (21.399999999999999, 1.79, 0.040000000000000001)
 (21.5, 1.77, 0.035000000000000003)],
   dtype = [('Temperature', '<f8'), ('Salinity', '<f8'), ('WaterLevel', '<f8')],
   dates = [27-Oct-2008 12:15 27-Oct-2008 12:15 27-Oct-2008 12:30 ...,
 18-May-2009 12:30 18-May-2009 12:45 18-May-2009 13:00],
   freq  = T)

I want to perform some extra masking. ie mask all salinities below 0 and above 100, mask all temperatures = -999 etc

I'm not sure how to do this. I tried a few things I found on SciPy cookbook and in the archives but had no luck.

Any help is appreciated.

thanks,

- dharhas



More information about the SciPy-user mailing list