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

Home » Public Forums » archive » Anyone can explain this?
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
Anyone can explain this? [message #64197] Sun, 07 December 2008 12:40 Go to next message
xiao zhang is currently offline  xiao zhang
Messages: 81
Registered: June 2008
Member
Hi ~ guys. I have a question about the contour command. When I call
it like this:

r=[136,119,102,085,068,051,034,017,000,000,000,000,000,$

000,000,000,000,000,000,007,015,023,031,038,046,054,062,086, 110,134,158,182,$

206,230,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,$
255,255,255,255,255,255,255,255,255,255,255]

g=[136,119,102,085,068,051,034,017,000,000,000,000,000,$

000,000,000,000,000,000,028,056,084,112,140,168,196,224,227, 231,235,239,243,$

247,251,255,250,245,240,235,230,225,220,215,210,200,190,170, 156,130,104,078,052,026,$
000,000,000,000,000,000,000,000,000,000,000]
;
b=[136,119,102,085,068,051,034,017,000,000,020,050,080,$

109,120,145,182,218,255,223,191,159,127,095,063,031,000,000, 000,000,000,000,$

000,000,000,000,000,000,000,000,000,000,000,000,000,000,000, 000,000,000,000,000,000,$
000,031,050,080,100,125,150,170,191,223,255]


cn = r + 256L * ( g + 256L * b)

window,xsize=xs,ysize=ys+100,retain = 2

map_set,/grid, /continents,/CYLINDRICAL,limit=[-34.3842,min
(lon),-31.6985,max(lon)],$
color=64,/noborder,ymargin=[15,5]

map_grid, color=64
map_continents,/countries, /coasts, color=64

contour,inits,color=64,title='Sensible heat flux', /device,/
NOERASE,xrange=[0,76],$
/xstyle,xTICKINTERVAL=73,xTICKNAME=[lon1(0),lon1(3)],$
yrange=[0,74],/ystyle,yTICKINTERVAL=73,yTICKNAME=[lat1(3),la t1(0)],
$
C_COLORS=cn,/cell_FILL,nLEVELS=48,ymargin=[15,5]

Contour, inits, Color=63,/Overplot,nLEVELS=30


It always starts fill the contour from the first color no matter what
value i change in the C_COLORS=cn key word. (For example. change it
to C_COLORS=cn+15 or C_COLORS=cn +35)


But when I do it like this:

cn1= cn (15:63)

map_set,/grid, /continents,/CYLINDRICAL,limit=[-34.3842,min
(lon),-31.6985,max(lon)],$
color=64,/noborder,ymargin=[15,5]

map_grid, color=64
map_continents,/countries, /coasts, color=64

contour,inits,color=64,title='Sensible heat flux', /device,/
NOERASE,xrange=[0,76],$
/xstyle,xTICKINTERVAL=73,xTICKNAME=[lon1(0),lon1(3)],$
yrange=[0,74],/ystyle,yTICKINTERVAL=73,yTICKNAME=[lat1(3),la t1(0)],
$
C_COLORS=cn1,/cell_FILL,nLEVELS=48,ymargin=[15,5]

Contour, inits, Color=63,/Overplot,nLEVELS=30


It shows me the right color and I can change the color in the contour
command, Why is that? Any one got ideas?

Thanks
Re: Anyone can explain this? [message #64260 is a reply to message #64197] Wed, 10 December 2008 10:11 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
xiao writes:

> Thank you David, you reply so fast :)

Just part of the premium service. :-)

> Yeap, they are in latitude and longitude units.
> The interesting thing is that if I take off the NOERASE in CONTOUR, it
> did not show the plot, but when i reset the map coordinates, it
> works. :)

Well, let's just hope we both mean the same thing
by "works". :-)

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Anyone can explain this? [message #64261 is a reply to message #64197] Wed, 10 December 2008 09:56 Go to previous message
xiao zhang is currently offline  xiao zhang
Messages: 81
Registered: June 2008
Member
On Dec 10, 11:40 am, David Fanning <n...@dfanning.com> wrote:
> xiao writes:
>> Sorry, David, But i have another question, I suddenly realized that my
>> map did not show the continent line. The continent line was erased by
>> the contour . But if I put the map_grid and map_continents after the
>> contour, it showed me the error :
>> -Current ploting device must have mapping coordinates..
>> I think i have used the overplot and noerase key word in contour
>> command. But it still does not shown.....
>
> I think the (unneeded) NOERASE keyword in the CONTOUR command
> is causing a different set of data coordinates to be established
> by the CONTOUR command. You want the data coordinates to be set
> by the MAP_SET command. You can either re-issue the MAP_SET command
> after you issue the CONTOUR command (to re-establish) the map data
> coordinates, or you can take the NOERASE off the CONTOUR command.
> I would try the latter first.
>
> Is the data you are trying to contour in latitude and longitude units?
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thank you David, you reply so fast :)
Yeap, they are in latitude and longitude units.
The interesting thing is that if I take off the NOERASE in CONTOUR, it
did not show the plot, but when i reset the map coordinates, it
works. :)
Re: Anyone can explain this? [message #64262 is a reply to message #64197] Wed, 10 December 2008 09:40 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
xiao writes:

> Sorry, David, But i have another question, I suddenly realized that my
> map did not show the continent line. The continent line was erased by
> the contour . But if I put the map_grid and map_continents after the
> contour, it showed me the error :
> -Current ploting device must have mapping coordinates..
> I think i have used the overplot and noerase key word in contour
> command. But it still does not shown.....

I think the (unneeded) NOERASE keyword in the CONTOUR command
is causing a different set of data coordinates to be established
by the CONTOUR command. You want the data coordinates to be set
by the MAP_SET command. You can either re-issue the MAP_SET command
after you issue the CONTOUR command (to re-establish) the map data
coordinates, or you can take the NOERASE off the CONTOUR command.
I would try the latter first.

Is the data you are trying to contour in latitude and longitude units?

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Anyone can explain this?
Next Topic: GENERIC XML READER

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

Current Time: Wed Oct 08 19:55:02 PDT 2025

Total time taken to generate the page: 0.00442 seconds