Postscript output [message #7108] |
Wed, 02 October 1996 00:00  |
Richard Townsend
Messages: 1 Registered: October 1996
|
Junior Member |
|
|
I have a problem with postscript output that I'm hoping someone will be
able to help me with. I have some IDL arrays of dimension N x N which are
latitude/longitude maps of some function (a spherical harmonic) over the
surface of a sphere. I want to display these maps wrapped over the sphere
in an orthographic projection. The commands I am using are something of
the form:
set_plot,'ps'
device,/encapsulated,bits_per_pixel=8,xsize=5,ysize=5,/inche s
!p.multi=[0,2,2]
map_set,/orthographic,/noborder,/advance,/isotropic,45,0
mapped=map_patch(bytscl(array1),xstart=x0,ystart=y0, $
xsize=xs,ysize=ys,missing=255)
tv,k,x0,y0,xsize=xs,ysize=ys
map_grid,color=255
map_set,/orthographic,/noborder,/advance,/isotropic,45,0
mapped=map_patch(bytscl(array2),xstart=x0,ystart=y0, $
xsize=xs,ysize=ys,missing=255)
tv,mapped,x0,y0,xsize=xs,ysize=ys
map_grid,color=255
map_set,/orthographic,/noborder,/advance,/isotropic,45,0
mapped=map_patch(bytscl(array3),xstart=x0,ystart=y0, $
xsize=xs,ysize=ys,missing=255)
tv,mapped,x0,y0,xsize=xs,ysize=ys
map_grid,color=255
map_set,/orthographic,/noborder,/advance,/isotropic,45,0
mapped=map_patch(bytscl(array4),xstart=x0,ystart=y0, $
xsize=xs,ysize=ys,missing=255)
tv,mapped,x0,y0,xsize=xs,ysize=ys
map_grid,color=255
device,/close
...where array1-array4 are the data arrays (as you can see, I want to
plot four separate arrays). My problem is that the boundaries of the
globes which I plot are very jagged, and increasing the size N of the
arrays does not cure this. How can I increase the postscript resolution
and get rid of the jagged edges?
Thanks in advance,
Rich
+-------------------------------------+--------------------+
| Richard Townsend | |
| Department of Physics & Astrononmy | "Old pond, |
| University College London | frog jumps in - |
| Gower Street | plop" |
| London WC1E 6BT | |
| (0171) 419 3410 | Basho |
+-------------------------------------+--------------------+
|
|
|
Re: Postscript output [message #7185 is a reply to message #7108] |
Sat, 05 October 1996 00:00   |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Richard Townsend <rhdt@star.ucl.ac.uk> writes:
> I have a problem with postscript output that I'm hoping someone will be
> able to help me with. I have some IDL arrays of dimension N x N which are
> latitude/longitude maps of some function (a spherical harmonic) over the
> surface of a sphere. I want to display these maps wrapped over the sphere
> in an orthographic projection. The commands I am using are something of
> the form:
>
> map_set,/orthographic,/noborder,/advance,/isotropic,45,0
> mapped=map_patch(bytscl(array1),xstart=x0,ystart=y0, $
> xsize=xs,ysize=ys,missing=255)
> tv,k,x0,y0,xsize=xs,ysize=ys
> My problem is that the boundaries of the
> globes which I plot are very jagged, and increasing the size N of the
> arrays does not cure this. How can I increase the postscript resolution
> and get rid of the jagged edges?
I am not sure how to get rid of the jaggies with the routine MAP_PATCH.
But if you can use the MAP_IMAGE routine instead, you can increase the
smoothness of the edges by setting the COMPRESS keyword equal to 1.
This will solve the inverse map transformation for each pixel in the
output image and will improve the result dramatically for PostScript
output.
David
--
David Fanning, Ph.D.
Phone: 970-221-0438
Fax: 970-221-4728
E-Mail: davidf@fortnet.org
|
|
|
|
Re: Postscript Output [message #18731 is a reply to message #7108] |
Mon, 31 January 2000 00:00   |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
uq9j wrote:
> I'm trying to export the contents of an IDL graphics window to a
> postscript file. This is the IDL code I've been using so far in a
> subroutine:
>
> set_plot,'PS'
>
> device, /color, file='file.ps'
>
> tv,image ;the variable image contains the pixel raster to store
>
> device, /close
>
> A postscript file is generated, however, the page is empty.
> What is wrong? Who can help me?
When TV is used to display an image on the Postscript device, you must
use the XSIZE and YSIZE keywords to specify the image size.
However I think you'll find it much easier to grab my IMDISP program
from
http://cimss.ssec.wisc.edu/~gumley/imdisp.html
and try the following:
entry_device = !d.name
set_plot, 'PS'
device, /color, bits=8, file='image.ps'
imdisp, image
device, /close
Note the use of the BITS keyword. I think you'll find IMDISP much easier
to use in graphics windows as well, e.g.
set_plot, entry_device
imdisp, image
Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
|
|
|
Re: Postscript Output [message #18734 is a reply to message #7108] |
Mon, 31 January 2000 00:00   |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
"Liam E. Gumley" wrote:
> uq9j wrote:
>
>> I'm trying to export the contents of an IDL graphics window to a
>> postscript file. This is the IDL code I've been using so far in a
>> subroutine:
>>
>> set_plot,'PS'
>>
>> device, /color, file='file.ps'
>>
>> tv,image ;the variable image contains the pixel raster to store
>>
>> device, /close
>>
>> A postscript file is generated, however, the page is empty.
>> What is wrong? Who can help me?
>
> When TV is used to display an image on the Postscript device, you must
> use the XSIZE and YSIZE keywords to specify the image size.
>
> However I think you'll find it much easier to grab my IMDISP program
> from
> http://cimss.ssec.wisc.edu/~gumley/imdisp.html
>
> and try the following:
>
> entry_device = !d.name
> set_plot, 'PS'
> device, /color, bits=8, file='image.ps'
> imdisp, image
> device, /close
>
> Note the use of the BITS keyword. I think you'll find IMDISP much easier
> to use in graphics windows as well, e.g.
>
> set_plot, entry_device
> imdisp, image
>
> Cheers,
> Liam.
> http://cimss.ssec.wisc.edu/~gumley
As David correctly points out, if you don't see an image, it probably
wasn't byte-scaled correctly. Fortunately, IMDISP automatically byte scales
the image.
One more thing: If your graphics display is running in 8-bit mode, then
make sure you load the appropriate color table *after* you switch to
Postscript mode. In 8-bit mode, the size of the color table might be 175.
So if you load the grayscale color table, it is loaded with 175 levels. In
Postscript mode, the color table size is always 256, so you need to re-load
the color table: Immediately before the TV (or IMDISP) command is the best
place to do it:
table = 0
entry_device = !d.name
set_plot, 'PS'
device, /color, bits=8, file='image.ps'
loadct, table
imdisp, image
device, /close
set_plot, entry_device
If you are running IDL in 24-bit mode, then you don't have to worry,
because the color table size is always 256, no matter which graphics device
is selected.
Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
|
|
|
Re: Postscript Output [message #18735 is a reply to message #7108] |
Mon, 31 January 2000 00:00   |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Ingo (ingo.meisel@stud.uni-karlsruhe.de) writes:
> I'm trying to export the contents of an IDL graphics window to a
> postscript file. This is the IDL code I've been using so far in a
> subroutine:
>
> set_plot,'PS'
>
> device, /color, file='file.ps'
>
> tv,image ;the variable image contains the pixel raster to store
>
> device, /close
>
> A postscript file is generated, however, the page is empty.
> What is wrong? Who can help me?
The page is empty!? I would have expected lousy output,
given the way you have configured the PostScript device,
but I wouldn't have expected the page to be empty.
I'm going to guess your image data isn't scaled into
256 values. Try something like this:
thisDevice = !D.Name
Set_Plot, 'PS'
Device, Color=1, Bits_per_Pixel=8, File='image.ps'
TV, BytScl(image)
Device, /Close_File
Set_Plot, thisDevice
You might also want to have a look at the Producing Perfect
PostScript Output section of my IDL Programming Tips
page for a number of other PostScript tips.
http://www.dfanning.com/documents/tips.html#PostScript
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: postscript output [message #76833 is a reply to message #7108] |
Wed, 06 July 2011 08:58  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> Use it like this:
>
> IDL> str = 'This is lambda symbol: ' + Greek(lambda)
Well, of course, this should be:
IDL> str = 'This is lambda symbol: ' + Greek("lambda")
Or, if you want a capital lambda symbol:
IDL> str = 'This is lambda symbol: ' + Greek("Lambda")
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
|
|
|