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

Home » Public Forums » archive » improve calculation time
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: improve calculation time [message #88988 is a reply to message #88987] Thu, 10 July 2014 06:46 Go to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
> I just change the dimensions of my array before. The above are the original one

Yes, you will have to alter my example to fit your data.

In my example, X is originally a 301 element array:

x = indgen(1,301)

In order to add X to Bx and to access SIM and DIM (which are 301x301 arrays), I converted X to a 301x301 array. This allowed me to eliminate FOR loops.

x = lindgen(1,301)
x = round(rebin(x, 301, 301) + Bx)

The error that you mention usually is a result of comparing an array to a scalar

IDL> if bytarr(348,348) eq 0 then print, 'No Error'
% Expression must be a scalar or 1 element array in this context: <BYTE Array[348, 348]>.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Comparison between arrays with different lenght
Next Topic: No Raster Image via Imagemagick

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

Current Time: Wed Oct 08 17:31:01 PDT 2025

Total time taken to generate the page: 0.00505 seconds