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

Home » Public Forums » archive » Having trouble with code for data to image.
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: Having trouble with code for data to image. [message #64094 is a reply to message #63985] Wed, 26 November 2008 17:15 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mbweller@gmail.com writes:

> These are the last two questions, I swear ;) , I'm just incredibly
> productive right now and want to get it out of the way before the
> holiday weekend.

Oh, dear. I saw this coming. I'm trying to get out of Dodge, too. :-)

Basically, you are going to position the image with the POSITION
keyword to MAP_SET (and TVIMAGE). What is going to complicate
things for both of us is how to leave space for the color bar,
while still maintaining a square aspect ratio for the image plot.
I had to get the ol' Radio Shack calculator out.

Here you go.

PRO CircleImage, POSTSCRIPT=ps
image = Scale_Vector(Dist(200), 0, 0.1648)
CTLoad, 4, /Brewer, NCOLORS=254
TVLCT, FSC_Color('ivory', /TRIPLE), 255
IF Keyword_Set(ps) THEN BEGIN
thisDevice = !D.Name
keywords = PSConfig(XSIZE=6.0, YSIZE=6.75, /INCHES, $
XOFFSET=1.25, YOFFSET=2.125, CANCEL=cancelled)
IF cancelled THEN RETURN
thisFont = !P.FONT
Set_Plot, 'PS'
Device, _EXTRA=keywords
ENDIF ELSE BEGIN
Window, XSIZE=400, YSIZE=450, /FREE
Erase, Color=FSC_Color('ivory')
ENDELSE
Map_Set, /Orthographic, 0, -90, $
POSITION=[0.125, 0.089, 0.925, 0.8], /NOERASE
warp = Map_Image(BytScl(image, TOP=254), xs, ys, COMPRESS=1, $
LATMIN=-90, LATMAX=90, LONMIN=-180, LONMAX=0, $
MISSING=255)
TVIMAGE, warp, POSITION=[0.125, 0.089, 0.925, 0.8], /AXES, $
XRANGE=[-180, 0], YRANGE=[-90,90], ACOLOR='Charcoal'
CTLoad, 4, /Brewer, NCOLORS=254
COLORBAR, NCOLORS=254, RANGE=[Min(image), Max(image)], $
DIVISIONS=5, FORMAT='(F0.3)', /TOP, $
POSITION=[0.125, 0.83, 0.925, 0.88], $
ANNOTATECOLOR='charcoal', $
XTICKLEN=1.0, XMINOR=1
IF Keyword_Set(ps) THEN BEGIN
Device, /CLOSE_FILE
Set_Plot, thisDevice
!P.Font = thisFont
ENDIF
END

> And finally,
> I'm trying to save the image. I've used:
> write_jpeg,'EXTENSIONAL STRAIN general.jpeg', tvrd()
> but is saves it gray scale and I have tried saving it as a postscript:
> SET_PLOT, 'PS'
> DEVICE, FILENAME=3D'estrain.ps'
> PLOT, image_e
> $ lpr estrain.ps
> and it gives my what appears to be a histogram analysis and the
> spheroid from which it came.

Do this instead:

void = TVRead(/JPEG, Filename=,'EXTENSIONAL STRAIN general.jpeg')

> I need the highest quality color image possible (It'll be on a poster
> and the image will be around a ft in size.)

Set the POSTSCRIPT keyword if you want to draw this in Postscript:

IDL> CircleImage, /POSTSCRIPT

Otherwise, to see it on your display:

IDL> CircleImage

--
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.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Memory allocation problem
Next Topic: Re: inverse gradient

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

Current Time: Sat Oct 11 11:55:57 PDT 2025

Total time taken to generate the page: 0.26707 seconds