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

Home » Public Forums » archive » Overlay Point Source Data on a Map -- http://www.idlcoyote.com/map_tips/ptsource.html
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
Overlay Point Source Data on a Map -- http://www.idlcoyote.com/map_tips/ptsource.html [message #90661] Fri, 20 March 2015 18:50 Go to next message
Xiao Yu is currently offline  Xiao Yu
Messages: 2
Registered: March 2015
Junior Member
Hello, all

My name is Xiao Yu. And I am a new IDL programmer.

I have similar case from Dr.David W. Fanning's website:
http://www.idlcoyote.com/map_tips/ptsource.html

I want to output my window display to a postscript file. However, the IDL always show me a error message as following:
% TVRD: Unable to read from current device: PS.

Data could be download at the end of web link http://www.idlcoyote.com/map_tips/ptsource.html as 'ptsource_carbon.sav'
This is main code that will shows display window:
PRO PointSourceOverlay

; Obtain the data: lat, lon, soilc.
Restore, File='ptsource_carbon.sav'

; Set up color model, open window.
cgSetColorState, 0, Current=currentState
cgDisplay, 600, 400, /Free, Title='Point Source Overlay on Map'

; Set up the soil carbon colors.
soil_colors = ['purple', 'dodger blue', 'dark green', 'lime green', $
'green yellow', 'yellow', 'hot pink', 'crimson']
TVLCT, cgColor(soil_colors, /Triple), 1
soilc_colors = BytScl(soilc, Top=7) + 1B

; Set up the map projecton data space.
cgErase
cgMap_Set, /Cylindrical, /NoBorder, /NoErase, $
Limit=[-60, -180, 90, 180], Position=[0.1, 0.1, 0.8, 0.9]

; Create a land mask.
cgMap_Continents, Color='black', /Fill
mask = TVRD()

; Plot only those points that are over "land".
dc = Convert_Coord(lon, lat, /Data, /To_Device)
indices = Where(mask[dc[0,*],dc[1,*]] EQ 0)
symbol = cgSymCat(15)
PlotS, lon[indices ], lat[indices ], PSym=symbol, $
Color=soilc_colors[indices ], SymSize=0.5

; Pretty everything up.
cgMap_Continents, Color='charcoal'
cgMap_Grid, /Box, Color='charcoal'
cgColorbar, /Vertical, Position=[0.87, 0.1, 0.9, 0.9], Bottom=1, NColors=8, $
Divisions=8, Minor=0, YTicklen=1, Range=[0,Max(soilc)], AnnotateColor='charcoal', $
/Right, Title='Ton/ha', Format='(F5.3)'

; Switch back to color model in effect before we changed it.
cgSetColorState, currentState

END


Thanks in advance,

Xiao
Re: Overlay Point Source Data on a Map -- http://www.idlcoyote.com/map_tips/ptsource.html [message #90662 is a reply to message #90661] Fri, 20 March 2015 19:07 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Xiao Yu writes:

> My name is Xiao Yu. And I am a new IDL programmer.
>
> I have similar case from Dr.David W. Fanning's website:
> http://www.idlcoyote.com/map_tips/ptsource.html
>
> I want to output my window display to a postscript file. However, the IDL always show me a error message as following:
> % TVRD: Unable to read from current device: PS.
>
> Data could be download at the end of web link http://www.idlcoyote.com/map_tips/ptsource.html as 'ptsource_carbon.sav'

Download the code that you find here:

http://idlcoyote.com/gallery/index.html#POINTSOURCE

That will show you how to do this in PostScript.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Overlay Point Source Data on a Map -- http://www.idlcoyote.com/map_tips/ptsource.html [message #90669 is a reply to message #90662] Sun, 22 March 2015 19:54 Go to previous message
Xiao Yu is currently offline  Xiao Yu
Messages: 2
Registered: March 2015
Junior Member
Dr.Fanning, Thanks a lot!!!
Xiao


On Friday, March 20, 2015 at 9:07:05 PM UTC-5, David Fanning wrote:
> Xiao Yu writes:
>
>> My name is Xiao Yu. And I am a new IDL programmer.
>>
>> I have similar case from Dr.David W. Fanning's website:
>> http://www.idlcoyote.com/map_tips/ptsource.html
>>
>> I want to output my window display to a postscript file. However, the IDL always show me a error message as following:
>> % TVRD: Unable to read from current device: PS.
>>
>> Data could be download at the end of web link http://www.idlcoyote.com/map_tips/ptsource.html as 'ptsource_carbon.sav'
>
> Download the code that you find here:
>
> http://idlcoyote.com/gallery/index.html#POINTSOURCE
>
> That will show you how to do this in PostScript.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to make $100,000 in 20-90 days
Next Topic: Help with data gaps and interpolation

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

Current Time: Wed Oct 08 07:14:12 PDT 2025

Total time taken to generate the page: 0.00648 seconds