comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: Multiply matrix

Re: Multiply matrix
type: item
description: On Feb 16, 1:26 pm, "L. Testut" <gaillac.s...@free.fr> wrote: > Hi all, > A simple question. I want to multiply the third dimension of a matrix > whitout using loop > > H[lon,lat,time]*filter along the time dimension for all lat,lon > > Thanks, > L. Does this work: filter = [[filter*0],[filter*0],[filter]] hnew = h*filter
creator: Vince Hradil
date: 2007-02-16T20:08:27-00:00

Re: Multiply matrix
type: item
description: > filter = [[filter*0],[filter*0],[filter]] > hnew = h*filter That would zero out all the lat & lon values wouldn't it? filter = [[filter/filter],[filter/filter],[filter]] should retain the lat & lon values.
creator: Bob[3]
date: 2007-02-16T20:24:51-00:00

Re: Multiply matrix
type: item
description: On Feb 16, 2:24 pm, "Bob Crawford" <Snowma...@gmail.com> wrote: >> filter = [[filter*0],[filter*0],[filter]] >> hnew = h*filter > > That would zero out all the lat & lon values wouldn't it? > > filter = [[filter/filter],[filter/filter],[filter]] > > should retain the lat & lon values. Of course, I was trying to do two things at once...
creator: Vince Hradil
date: 2007-02-16T21:36:58-00:00

Re: Multiply matrix
type: item
description: On 16 fév, 21:36, "hradilv" <hrad...@yahoo.com> wrote: > On Feb 16, 2:24 pm, "Bob Crawford" <Snowma...@gmail.com> wrote:> > filter = [[filter*0],[filter*0],[filter]] >>> hnew = h*filter > >> That would zero out all the lat & lon values wouldn't it? > >> filter = [[filter/filter],[filter/filter],[filter]] > >> should retain the lat & lon values. > > Of course, I was trying to do two things at once... Sorry it doesn't work in my case I want to avoid this loop: FOR I=0,nz-1 DO z[indgen(nx),indgen(ny),I]=Z[indgen(nx),indgen(ny),I]*filter I have a H[nx,ny,nz] where nz is the time. So i have nz field in time that i want to multiply by a filter of size nz. Is it possible to avoid this loop ? Thanks Laurent
creator: L. Testut
date: 2007-02-18T15:12:05-00:00

Re: Multiply matrix
type: item
description: This: FOR I=0,nz-1 DO z[indgen(nx),indgen(ny),I]=Z[indgen(nx),indgen(ny),I]*filter can be done like this: z*=rebin(reform(indgen(nz),1,1,nz),nx,ny,nz,/sample) However, is this really what you want? i have the feeling you want to do something else here, or is it just me :-)? On 18 Feb 2007 07:12:05 -0800, "L. Testut" <gaillac.spam@free.fr> wrote: > Sorry it doesn't work in my case I want to avoid this loop: > > FOR I=0,nz-1 DO > z[indgen(nx),indgen(ny),I]=Z[indgen(nx),indgen(ny),I]*filter > > I have a H[nx,ny,nz] where nz is the time. So i have nz field in time > that i want to multiply by a filter of size nz. > > Is it possible to avoid this loop ?
creator: Wox
date: 2007-02-19T09:26:36-00:00

Re: Multiply matrix
type: item
description: Oeps, indgen(nz) must be filter. On Mon, 19 Feb 2007 10:26:36 +0100, Wox <nomail@hotmail.com> wrote: > z*=rebin(reform(indgen(nz),1,1,nz),nx,ny,nz,/sample)
creator: Wox
date: 2007-02-19T09:27:30-00:00