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

Home » Public Forums » archive » Re: Plot into an array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Plot into an array [message #25575] Tue, 03 July 2001 18:33
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Dick French writes:

> I'll give it a try next time I have a chance, but I thought someone
> might know the
> answer to this - is Z buffer memory attached to the computer (I hope
> so!), or to the monitor?

To the computer.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Plot into an array [message #25576 is a reply to message #25575] Tue, 03 July 2001 17:13 Go to previous message
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
Dennis Boccippio wrote:
>
>>
>>> does somebody know, how I can plot a function into an array, not into a
>>> window? Or can I get the array of the image of a window for saving as a jpeg
>>> or gif?
>>
>> Write into a pixmap window (a window in memory):
>>
>> Window, /Pixmap, /Free
>> Plot, myfunction
>> array = TVRD() ; or TVRD(True=1) on 24-bit display
>>
>
**** I have tried doing this over my cable modem, and it takes bloody
forever
to do TVRD() for a large pixmap over the internet to my remote
workstation.
Another problem is that the maximum memory size for a pixmap is limited
by
the video monitor, NOT by the RAM on the computer itself, as I
understand. Both
of these have really hobbled me for my particular application.

> IIRC, David's suggestion below of using the Z buffer is more efficient
> (don't know why) and greatly reduced the bottleneck, though I could be
> wrong...
>
>> Or, write into the Z-graphic buffer, if you want
>> to be assured of having a 2D array:
>>
>> thisDevice = !D.Name
>> Set_Plot, 'Z'
>> Plot, myfunction
>> array = TVRD()
>> Set_Plot, thisDevice
>>

**** I have not tried this yet, but am I correct in thinking that a Z
buffer is part
of RAM, and not part of the memory of the display? If so, then I could
avoid all
the network traffic involved in TVRD() from a pixmap, and that would be
ideal.
I'll give it a try next time I have a chance, but I thought someone
might know the
answer to this - is Z buffer memory attached to the computer (I hope
so!), or to
the monitor?

Dick French
Re: Plot into an array [message #25591 is a reply to message #25576] Tue, 03 July 2001 08:45 Go to previous message
Dennis Boccippio is currently offline  Dennis Boccippio
Messages: 23
Registered: July 2000
Junior Member
In article <MPG.15a62d86f1dbe18d989e18@news.frii.com>,
david@dfanning.com (David Fanning) wrote:

Correction, after seeing Mark Hadfield's post in a later thread, I
recall that the workaround to slow TVRD()'s in my case was to use
polyfillv (instead of polyfill), rather than using the Z-buffer. For an
arbitrary function/image, I'm not sure what the best way to things up
would be for repeated TVRD()'s. Keeping the windows small helps, at the
expense of resolution....

- DJB
Re: Plot into an array [message #25592 is a reply to message #25591] Tue, 03 July 2001 08:42 Go to previous message
Dennis Boccippio is currently offline  Dennis Boccippio
Messages: 23
Registered: July 2000
Junior Member
In article <MPG.15a62d86f1dbe18d989e18@news.frii.com>,
david@dfanning.com (David Fanning) wrote:

> Dominik Paul writes:
>
>> does somebody know, how I can plot a function into an array, not into a
>> window? Or can I get the array of the image of a window for saving as a jpeg
>> or gif?
>
> Write into a pixmap window (a window in memory):
>
> Window, /Pixmap, /Free
> Plot, myfunction
> array = TVRD() ; or TVRD(True=1) on 24-bit display
>

Warning: if you plan to do this repeatedly, and/or with very large
windows, TVRD() from graphics or pixmap windows is surprisingly slow,
even for pixmaps. (this from the IDL profiler; I once tried this on a
large looped calculation involving geolocation of satellite instrument
pixels, polyfilling the vertices, tvrd()'ing to an array, then summing
the arrays to estimate the spatial field of view - in all of that, the
tvrd() was by and large the bottleneck, not the math)

IIRC, David's suggestion below of using the Z buffer is more efficient
(don't know why) and greatly reduced the bottleneck, though I could be
wrong...

> Or, write into the Z-graphic buffer, if you want
> to be assured of having a 2D array:
>
> thisDevice = !D.Name
> Set_Plot, 'Z'
> Plot, myfunction
> array = TVRD()
> Set_Plot, thisDevice
>
Re: Plot into an array [message #25622 is a reply to message #25592] Fri, 29 June 2001 06:16 Go to previous message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Dominik Paul writes:

> does somebody know, how I can plot a function into an array, not into a
> window? Or can I get the array of the image of a window for saving as a jpeg
> or gif?

Write into a pixmap window (a window in memory):

Window, /Pixmap, /Free
Plot, myfunction
array = TVRD() ; or TVRD(True=1) on 24-bit display

Or, write into the Z-graphic buffer, if you want
to be assured of having a 2D array:

thisDevice = !D.Name
Set_Plot, 'Z'
Plot, myfunction
array = TVRD()
Set_Plot, thisDevice

> Or can I get the array of the image of a window for saving as a jpeg
> or gif?

If you don't want to worry about what kind
of device you are on and what keyword to use
with TVRD, and you want to write JPEG, TIFF,
PNG, GIF, etc files directly (you write JPEG
and GIF files in two completely different ways,
depending upon the type of device you are using),
get ahold of my TVRead program. It takes
care of all these details for you:

http://www.dfanning.com/programs/tvread.pro

Then you can use either a pixmap or the Z-buffer and
just do something like this:

array = TVRead(/JPEG)

To read the image from the display and create the
output file directly.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Satellite image remapping
Next Topic: Re: plotting free form ascii data

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

Current Time: Wed Oct 08 13:19:17 PDT 2025

Total time taken to generate the page: 0.00919 seconds