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

Home » Public Forums » archive » Re: Making a ginormous 54 panel plot...
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: Making a ginormous 54 panel plot... [message #73814] Thu, 02 December 2010 07:40
OUWxGuesser is currently offline  OUWxGuesser
Messages: 7
Registered: October 2010
Junior Member
Oh and FYI, the memory issues were related to the patched IDL 8. The
non TV/TVRD method works fine in IDL 7.x
Re: Making a ginormous 54 panel plot... [message #73815 is a reply to message #73814] Thu, 02 December 2010 07:39 Go to previous message
OUWxGuesser is currently offline  OUWxGuesser
Messages: 7
Registered: October 2010
Junior Member
First of all, thanks for all of the suggestions! In the end, I
decided to do some experimentation with TVRD to see what it can
handle. While I don't have an exact size for all of you, I was able
to creatively edit my individual panels to decrease the resolution
slightly. I was successfully able to create an image using TVRD with
a resolution of 6930x3780. At this size, there is an audible increase
in fan-speed in my computer while IDL is humming away. Ah, the sound
of success!
Re: Making a ginormous 54 panel plot... [message #73817 is a reply to message #73815] Thu, 02 December 2010 06:39 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<6fc9ecfb-a3ea-4afa-a371-186420318ec2@y3g2000vbm.googlegroups.com>,
OUWxGuesser <aaron.kennedy@und.nodak.edu> wrote:

> Sadly, the big array is too large for the memory. When I use the TV
> route and try to TVRD at the end, it spits out "TVRD: An error has
> occurred. Unable to complete command."

I still don't understand why are you using TV.

This code snippet reads a PNG file and creates a new PNG
file with the original image in a 2 x 2 tiling.

No TV or TVRD necessary.

Ken



IDL> img = READ_PNG('test.png')
% Loaded DLM: PNG.
IDL> help, img
IMG BYTE = Array[3, 1024, 612]
IDL> new_img = BYTARR(3, 2*1024, 2*612)
IDL> new_img[0,0,0] = img
IDL> new_img[0,1024,0] = img
IDL> new_img[0,1024,612] = img
IDL> new_img[0,0,612] = img
IDL> write_png, 'test1.png', new_img
Re: Making a ginormous 54 panel plot... [message #73819 is a reply to message #73817] Thu, 02 December 2010 03:33 Go to previous message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
I use this to merge png files - might be helpful. If memory is the
problem, at least you can combine as far as possible before resorting
to GIMP.

Greg


pro gm_merge_png,filenames,outfile,frame,vertical=vertical
;filenames - png files to be merged
;outfile - output filename
;frame - white border between images, in pixels
;vertical - set to merge vertically instead of default
horizontal

for i=0,n_elements(filenames)-1 do begin
im0=read_png(filenames[i])
if n_elements(frame) gt 0 then begin
sz=size(im0,/dim)
im1=make_array(3,sz[1]+frame*2,sz[2]+frame*2,/byte,value=255 b)
im1[*,frame:sz[1]+frame-1,frame:sz[2]+frame-1]=im0
im0=im1
endif
case i of
0:im=im0
else:im=keyword_set(vertical)?[[[im]],[[im0]]]:[[im],[im0]]
endcase
endfor
write_png,outfile,im
end
Re: Making a ginormous 54 panel plot... [message #73821 is a reply to message #73819] Wed, 01 December 2010 16:15 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Dec 1, 7:57 pm, OUWxGuesser <aaron.kenn...@und.nodak.edu> wrote:
> Sadly, the big array is too large for the memory.  When I use the TV
> route and try to TVRD at the end, it spits out "TVRD: An error has
> occurred.  Unable to complete command."

That is still the option with the potential to use the least memory.
If the array is too large and you would downsize it anyway to get to
less than 9000x4200, you can downsample the individual images before
putting them into the big array (which would not be so big).

Anyway, you probably do have enough memory to make the big array at
100%: 9000x4200 pixels at 24 bpp is only ~108MB. You were able to make
a buffer 81% of that size, which may (probably does?) use more memory
than the array would.
Re: Making a ginormous 54 panel plot... [message #73824 is a reply to message #73821] Wed, 01 December 2010 14:23 Go to previous message
OUWxGuesser is currently offline  OUWxGuesser
Messages: 7
Registered: October 2010
Junior Member
Darn. I was hoping to avoid crossing that bridge but that may be the
only solution!



On Dec 1, 4:05 pm, David Fanning <n...@dfanning.com> wrote:
> OUWxGuesser writes:
>> Sadly, the big array is too large for the memory.  When I use the TV
>> route and try to TVRD at the end, it spits out "TVRD: An error has
>> occurred.  Unable to complete command."
>
> Why don't you just output your images to a PostScript file?
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Making a ginormous 54 panel plot... [message #73825 is a reply to message #73824] Wed, 01 December 2010 14:10 Go to previous message
manodeep@gmail.com is currently offline  manodeep@gmail.com
Messages: 33
Registered: June 2006
Member
On Dec 1, 2:49 pm, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> In article
> < 5d27124d-2a89-4667-b024-dd293bda5...@f21g2000prn.googlegroup s.com >,
>
>
>
>  OUWxGuesser <aaron.kenn...@und.nodak.edu> wrote:
>> Here's the deal.  I have 54 .png plots I want to combine into a 9x6
>> panel plot in IDL.  Native resolution for each image is 1000x700
>> pixels.  This exceeds the maximum buffer size of 8192x8192.
>
>> No problem... I use congrid and shrink everything to 90% of the
>> original size which gives me a final image size of 8100x3780.
>
>> In my code, I first specify the window as:
>> p=window(dimensions=[8100,3780])
>
>> I then loop through the files I need to panelize (or is it
>> penalize? :) )  and place them in the appropriate places.  This
>> works.
>
>> The issue I have is IDL does not listen to my dimensions for the
>> original window! Instead, it creates a window that is 8192x2632.
>> This creates large whitespace between the columns and shrinks the
>> individual panels beyond the original 90% of the original size I
>> specified.  This makes things tough to read which defeats the
>> purpose... I want to place these plots on a poster for a conference.
>> My alternative *cringe* is to use GIMP to cut and paste the 54 plots
>> manually.  Yikes!
>
>> I have tried messing with the buffer settings thinking this might be
>> the source of the problem, but I just end up getting  MESA frame
>> buffer errors and in some cases, IDL crashes to the desktop with no
>> warning. If anyone has any suggestions or assistance, I'd greatly
>> appreciate it!
>
> Why are you opening a window?
>
> Can't you just read the PNG files, concatenate or copy them
> into your big array, then write the array out as a new PNG.
>
> Ken Bowman

If not using IDL for the final image is an option, then you should try
montage (from Imagemagick) to tile the images. You have control over
the layout, the individual image sizes and the spacing between the
images.

Here is the man page for montage:
http://www.imagemagick.org/Usage/montage/

If all else fails, convert from the images from png to eps, include in
a tex file in the layout you want and generate a ps or pdf file.

Cheers,
Manodeep
Re: Making a ginormous 54 panel plot... [message #73826 is a reply to message #73825] Wed, 01 December 2010 14:05 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
OUWxGuesser writes:

> Sadly, the big array is too large for the memory. When I use the TV
> route and try to TVRD at the end, it spits out "TVRD: An error has
> occurred. Unable to complete command."

Why don't you just output your images to a PostScript file?

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Making a ginormous 54 panel plot... [message #73828 is a reply to message #73826] Wed, 01 December 2010 13:57 Go to previous message
OUWxGuesser is currently offline  OUWxGuesser
Messages: 7
Registered: October 2010
Junior Member
Sadly, the big array is too large for the memory. When I use the TV
route and try to TVRD at the end, it spits out "TVRD: An error has
occurred. Unable to complete command."





On Dec 1, 2:49 pm, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> In article
> < 5d27124d-2a89-4667-b024-dd293bda5...@f21g2000prn.googlegroup s.com >,
>
>
>
>  OUWxGuesser <aaron.kenn...@und.nodak.edu> wrote:
>> Here's the deal.  I have 54 .png plots I want to combine into a 9x6
>> panel plot in IDL.  Native resolution for each image is 1000x700
>> pixels.  This exceeds the maximum buffer size of 8192x8192.
>
>> No problem... I use congrid and shrink everything to 90% of the
>> original size which gives me a final image size of 8100x3780.
>
>> In my code, I first specify the window as:
>> p=window(dimensions=[8100,3780])
>
>> I then loop through the files I need to panelize (or is it
>> penalize? :) )  and place them in the appropriate places.  This
>> works.
>
>> The issue I have is IDL does not listen to my dimensions for the
>> original window! Instead, it creates a window that is 8192x2632.
>> This creates large whitespace between the columns and shrinks the
>> individual panels beyond the original 90% of the original size I
>> specified.  This makes things tough to read which defeats the
>> purpose... I want to place these plots on a poster for a conference.
>> My alternative *cringe* is to use GIMP to cut and paste the 54 plots
>> manually.  Yikes!
>
>> I have tried messing with the buffer settings thinking this might be
>> the source of the problem, but I just end up getting  MESA frame
>> buffer errors and in some cases, IDL crashes to the desktop with no
>> warning. If anyone has any suggestions or assistance, I'd greatly
>> appreciate it!
>
> Why are you opening a window?
>
> Can't you just read the PNG files, concatenate or copy them
> into your big array, then write the array out as a new PNG.
>
> Ken Bowman
Re: Making a ginormous 54 panel plot... [message #73833 is a reply to message #73828] Wed, 01 December 2010 12:49 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<5d27124d-2a89-4667-b024-dd293bda55a1@f21g2000prn.googlegroups.com>,
OUWxGuesser <aaron.kennedy@und.nodak.edu> wrote:

> Here's the deal. I have 54 .png plots I want to combine into a 9x6
> panel plot in IDL. Native resolution for each image is 1000x700
> pixels. This exceeds the maximum buffer size of 8192x8192.
>
> No problem... I use congrid and shrink everything to 90% of the
> original size which gives me a final image size of 8100x3780.
>
> In my code, I first specify the window as:
> p=window(dimensions=[8100,3780])
>
> I then loop through the files I need to panelize (or is it
> penalize? :) ) and place them in the appropriate places. This
> works.
>
> The issue I have is IDL does not listen to my dimensions for the
> original window! Instead, it creates a window that is 8192x2632.
> This creates large whitespace between the columns and shrinks the
> individual panels beyond the original 90% of the original size I
> specified. This makes things tough to read which defeats the
> purpose... I want to place these plots on a poster for a conference.
> My alternative *cringe* is to use GIMP to cut and paste the 54 plots
> manually. Yikes!
>
> I have tried messing with the buffer settings thinking this might be
> the source of the problem, but I just end up getting MESA frame
> buffer errors and in some cases, IDL crashes to the desktop with no
> warning. If anyone has any suggestions or assistance, I'd greatly
> appreciate it!

Why are you opening a window?

Can't you just read the PNG files, concatenate or copy them
into your big array, then write the array out as a new PNG.

Ken Bowman
Re: Making a ginormous 54 panel plot... [message #73834 is a reply to message #73833] Wed, 01 December 2010 12:58 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
OUWxGuesser writes:

> Here's the deal. I have 54 .png plots I want to combine into a 9x6
> panel plot in IDL. Native resolution for each image is 1000x700
> pixels. This exceeds the maximum buffer size of 8192x8192.
>
> No problem... I use congrid and shrink everything to 90% of the
> original size which gives me a final image size of 8100x3780.
>
> In my code, I first specify the window as:
> p=window(dimensions=[8100,3780])
>
> I then loop through the files I need to panelize (or is it
> penalize? :) ) and place them in the appropriate places. This
> works.
>
> The issue I have is IDL does not listen to my dimensions for the
> original window! Instead, it creates a window that is 8192x2632.
> This creates large whitespace between the columns and shrinks the
> individual panels beyond the original 90% of the original size I
> specified. This makes things tough to read which defeats the
> purpose... I want to place these plots on a poster for a conference.
> My alternative *cringe* is to use GIMP to cut and paste the 54 plots
> manually. Yikes!
>
> I have tried messing with the buffer settings thinking this might be
> the source of the problem, but I just end up getting MESA frame
> buffer errors and in some cases, IDL crashes to the desktop with no
> warning. If anyone has any suggestions or assistance, I'd greatly
> appreciate it!

Oh, my gosh. Have you tried TVImage? :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: problem calling histoplot
Next Topic: Re: Negative array indices

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

Current Time: Wed Oct 08 13:35:47 PDT 2025

Total time taken to generate the page: 0.00706 seconds