comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Array multiplication: implicit loop query
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Array multiplication: implicit loop query [message #26185] Fri, 10 August 2001 08:09 Go to previous message
Richard Younger is currently offline  Richard Younger
Messages: 43
Registered: November 2000
Member
"Bill B." wrote:
>
> george@apg.ph.ucl.ac.uk (george Millward) wrote in message

>> It
>> would seem that, to get this to work I need to make
>> Pres=fltarr(30,91,40).
>
> Yes.
>
> IDL> a = indgen(20,20)
> IDL> b = indgen(20)
> IDL> c = b * a
> IDL> help, c
> C INT = Array[20]
>
> I believe you need to REPLICATE 'Pres' as needed.
>
> -Bill B.

I've been converted to REBIN, myself.
(see the group archives for the dimensional juggling tutorial by JD
Smith this past spring)

IDL> Pres_expan = REBIN(Pres, 30, 91, 40)
IDL> help, Pres_expan
PRES_EXPAN FLOAT = Array[30, 91, 40]

This gives you the correct dimensions and avoids loops. You can even
resize inline if you dislike having the extra variable around:

DEN_H = MMR_H * REBIN(Pres, 30, 91, 40) * RMT / $
( atomic_mass_H * Gas_constant * TN )

Good luck,

Rich Younger
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Log IDLgrAxis
Next Topic: Discussion on global variables in IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:56:51 PDT 2025

Total time taken to generate the page: 0.00578 seconds