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 
Return to the default flat view 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 previous 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
[Message index]
 
Read Message
Read Message
Read Message
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 13:32:56 PDT 2025

Total time taken to generate the page: 0.00741 seconds