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

Home » Public Forums » archive » help with cgDrawVectors in write_gif procedure
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: help with cgDrawVectors in write_gif procedure [message #91101 is a reply to message #91100] Wed, 03 June 2015 08:47 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Wednesday, June 3, 2015 at 5:39:15 PM UTC+2, g.na...@gmail.com wrote:
>> "OPENW: Filename argument must be a scalar string: FILE."
>> you should check if your variable file is a string or a scalar.
>
> I used
> help, file
> to check whether is a string or a scalar and I got the following
>
> FILE UNDEFINED = <Undefined>
> OPENW: Filename argument must be a scalar string: FILE.
>
> I will share my code because maybe I did a mistake somewhere else and I am not able to find it. I have the following procedure. (Image,VX,VY are 3D arrays.)
>
>
> PRO vectors_overlaid, Image, VX, VY, name
>
> dims_i_need = Size(Dindgen(20,20), /Dimensions)
>
> pos_x = Rebin(Findgen(dims_i_need[0]), dims_i_need[0], dims_i_need[1])
> pos_y = Rebin(Reform(Findgen(dims_i_need[1]), 1, dims_i_need[1]), dims_i_need[0], dims_i_need[1])
>
> for i=0L, n-1 do begin
> cgDisplay, 500, 550
> Image = BYTSCL(Image, min=0.,max=160.)
> cgimage,Reform(Image[i,*,*])
> cgDrawVectors, REFORM(VX[i,*,*]), REFORM(VY[i,*,*]), pos_x, pos_y,VECCOLORS='yellow', /ORDERED, overplot = 1
> write_gif,file, Reform(Image[i,*,*]), /multiple
> endfor
>
> write_gif, file, /close
> END
>
> Then I called the vectors_overlaid in my main program like this
>
> vectors_overlaid, Image, VX,VY, 'C:\Users\Desktop\Vectors('+string(i,format='(i3.3)')+','+st ring(level)+','+strtrim(iter)+')'.gif'
>
> Why the file is undefined?

Ok, this is something you should be able to solve by looking at what the error messages tell you and what the help, file told you (file is undefined!).

In your procedure declaration you use:
PRO vectors_overlaid, Image, VX, VY, name

These variable names have to be used in the procedure. This means that when you call:
vectors_overlaid, Image, VX,VY, 'C:\Users\Desktop\Vectors('+string(i,format='(i3.3)')+','+st ring(level)+','+strtrim(iter)+')'.gif'

the variable "name" assumes the value 'C:\Users\Desktop\Vectors('+string(i,format='(i3.3)')+','+st ring(level)+','+strtrim(iter)+')'.gif'

so in *all* your write_gif commands you should substitute "file" with "name".

That should bring you a step further.

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Vertical text orientation?
Next Topic: Pure IDL interface for video cameras -- linux only

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

Current Time: Thu Oct 09 19:59:14 PDT 2025

Total time taken to generate the page: 1.20078 seconds