[SciPy-user] detrend

Pearu Peterson pearu at cens.ioc.ee
Wed Aug 14 07:19:58 CDT 2002


On Wed, 14 Aug 2002, Nils Wagner wrote:

> Hi,
> 
> detrend works here for
> 
> signal.detrend(arange(128.),-1,'linear')
> 
> but
> 
> >>> signal.detrend(arange(129.),-1,'linear')

And in my case

detrend(arange(160.),-1,'linear')

works but not

detrend(arange(161.),-1,'linear')

that gives

lwork = 166

The same lwork I get for signal.detrend(arange(128.),-1,'linear').

Obviously something strange is going on with lwork calculation for gelss
routine. As a quick fix, replace the following code

     273         lwork = calc_lwork.gelss(gelss.prefix,m,n,nrhs)[1]
     274         v,x,s,rank,info = gelss(a1,b1,cond = cond,
     275                                 lwork = lwork,
     276                                 overwrite_a = overwrite_a,
     277                                 overwrite_b = overwrite_b)

with

     273         #lwork = calc_lwork.gelss(gelss.prefix,m,n,nrhs)[1]
     274         v,x,s,rank,info = gelss(a1,b1,cond = cond,
     275                                 #lwork = lwork,
     276                                 overwrite_a = overwrite_a,
     277                                 overwrite_b = overwrite_b)

in scipy/basic.py and you should able to continue with your work.

I'll investigate this further ... You'll get the
final fix from CVS when you update and when it is there.

Pearu




More information about the SciPy-user mailing list