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

Home » Public Forums » archive » TV/postscript problem
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
TV/postscript problem [message #13395] Thu, 05 November 1998 00:00 Go to next message
R.Balthazor is currently offline  R.Balthazor
Messages: 7
Registered: June 1996
Junior Member
I'd be grateful if anyone could point me in the right direction with
this problem.

I'm running a program with the general form shown below. It cycles over
20 timesets of two datasets, each time reading them both in and
displaying one as a false-color image on a map projection and then
displaying the second as a contour image overlaid on it. Each time it
flashes up the completed image satisfactorily on the X-windows, and the
postscript file builds up until it is 20 pages long.

However, each page of the postscript file is a horrible two-tone mess of
black and white, looking like it is an 'overexposed' photograph and
nothing like what was on the screen; and moreover, the TV,imageset is
larger than and displaced from the desired position.

What have I done wrong? I've tried;

- doing a single dataset read in case it was to do with multiple pages
written to the postscript file - but still the horrible mess.

- using CONTOUR,dataset1,/FILL as an approximation to TV,imageset1; this
works perfectly (but I want more than 26 levels)

- using WRITE_GIF; this works perfectly.

I'd be very grateful for any suggestions; I presume the problem is in
the postscript writing.

;==============
PRO myprogram

SET_PLOT,'X'
mainprogram

SET_PLOT,'PS'
DEVICE,file='image.ps',/LANDSCAPE,XSIZE=27,YSIZE=17,XOFFSET= 2,YOFFSET=28.5,/TIMES,/COLOR
mainprogram
DEVICE,/CLOSE

END
;=============
mainprogram

time=-1
REPEAT BEGIN
time=time+1
;(Read in dataset1,dataset2, and some processing)

MAP_SET,(arguments)
imageset1=MAP_IMAGE(dataset1,startx,starty,other arguments)
TV,imageset1,startx,starty
CONTOUR,dataset2,/OVERPLOT
ENDREP UNTIL time EQ 19

END
;==============
Re: TV/postscript problem [message #13603 is a reply to message #13395] Tue, 24 November 1998 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
philip aldis wrote:

> R Balthazor wrote:
>
>> However, each page of the postscript file is a horrible two-tone mess of
>> black and white, looking like it is an 'overexposed' photograph and
>> nothing like what was on the screen; and moreover, the TV,imageset is
>> larger than and displaced from the desired position.
>
>> - doing a single dataset read in case it was to do with multiple pages
>
>> written to the postscript file - but still the horrible mess.
>>
>> - using CONTOUR,dataset1,/FILL as an approximation to TV,imageset1; this
>> works perfectly (but I want more than 26 levels)
>>
>> - using WRITE_GIF; this works perfectly.
>>
>>
>
>>
>
> I'm not entirely sure if this is the problem and it may well be something a lot more
> complicated than I can cope with - but I noticed that on your device, ..... you did not set
> bits_per_pixel=8, failure to do this means that the postscript file can only print with 16
> colours, which may have caused the problem.
>
> A second point I noticed is to do with the colours available. When you are working on the
> screen, you probably don't have all 256 colours available due to the window manager nicking
> some, however in postscript there are always 256 colours available. There are two options to
> correct this:
>

If you like to have on a unix 256 colors you should try in your startup file

window,0,xsize=10,ysize=10,colors=256
wdelete,0

I learned this from someone else from this news group

Unfortunately It don't work on a Windows PC.


>
> * If you want to scale the screen image to the number of colours available on the screen
> and then scale the postscript output to the number of colours available there then use
> TVSCL, instead of TV. This simply scales the image to the number of colours available.
> * Or if you want both images to be scaled to the same value - the number of colours
> available on the screen-, then after the set_plot, 'x' put scale_factor = !d.n_colors .
> !d.n_colors, as you may have guessed, is simply the number of available colours. Then
> when you tv the image, don't tv just the image but instead
>
> TV, bytscl(image, top=scale_factor)
>
> I hope this solves the problem, although there seems to be something more fundamental
> because I haven't been able to explain the positioning problems or the black and white only.
> I hope someone else can give you a slightly more informed answer than mine.
>
> cheers,
> Phil Aldis
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Running IDL programs from CGI/Perl on windows NT
Next Topic: Suppress return with readf ?

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

Current Time: Wed Oct 08 14:21:56 PDT 2025

Total time taken to generate the page: 0.00522 seconds