First off, regarding the loop over points using PLOT(): D'oh!!
<headslap> I was caught in a brainfade loop due to trying to recreate
the DG code.
Based on David and Mark's (and Dick's!) suggestions, this is what I did,
but now using multiple orbits (793647 points):
-----%<----
map.Refresh, /Disable
t0 = SYSTIME(1)
p = PLOT(lon,lat,$
SYMBOL='circle', $
/SYM_FILLED, $
SYM_SIZE=0.2, $
RGB_TABLE=39, $
VERT_COLORS=colour, $
LINESTYLE=6, $
/OVERPLOT)
t1 = SYSTIME(1)
MESSAGE, 'Plot of '+STRTRIM(N_ELEMENTS(lon),2)+$
' datapoints took '+STRTRIM(t1-t0,2)+' seconds', $
/INFORMATIONAL
t0 = SYSTIME(1)
map.Refresh
t1 = SYSTIME(1)
MESSAGE, 'Refresh of map display took '+$
STRTRIM(t1-t0,2)+' seconds', $
/INFORMATIONAL
-----%<----
and this is what the various MESSAGE output tells me:
IDL> display_gsi_map,nnobs.depar_bc[2],nnmeta
% DISPLAY_GSI_MAP: Plot of 793647 datapoints took 1.0648339 seconds
% DISPLAY_GSI_MAP: Refresh of map display took 15.363068 seconds
If I do the following, commenting out all the map.refresh stuff:
-----%<----
; map.Refresh, /Disable
t0 = SYSTIME(1)
p = PLOT(lon,lat,$
SYMBOL='circle', $
/SYM_FILLED, $
SYM_SIZE=0.2, $
RGB_TABLE=39, $
VERT_COLORS=colour, $
LINESTYLE=6, $
/OVERPLOT)
t1 = SYSTIME(1)
MESSAGE, 'Plot of '+STRTRIM(N_ELEMENTS(lon),2)+$
' datapoints took '+STRTRIM(t1-t0,2)+' seconds', $
/INFORMATIONAL
; t0 = SYSTIME(1)
; map.Refresh
; t1 = SYSTIME(1)
; MESSAGE, 'Refresh of map display took '+$
; STRTRIM(t1-t0,2)+' seconds', $
; /INFORMATIONAL
-----%<----
I get the following:
IDL> display_gsi_map,nnobs.depar_bc[2],nnmeta
% DISPLAY_GSI_MAP: Plot of 793647 datapoints took 31.771896 seconds
So it takes twice as long if you just do a straight PLOT() without use
of the refresh method?
Why?
Additionally, if I switch to another virtual desktop (on my linux
system) when I switch back to the desktop that contains the map display,
it takes 15s (I timed it 3 times) for the graphic to redisplay (from
black) and for the IDL command line to become active again.
This may be more of a system question (e.g. load, memory, etc) but i'll
ask anyway: Why?
cheers,
paulv
p.s. Onto using COLORBAR! (cowering in corner in abject fear....)
On 04/30/13 14:17, Mark Piper wrote:
> On Tuesday, April 30, 2013 10:56:08 AM UTC-6, David Fanning wrote:
>>
>> My first thought would have been to try to plot all points at once, with
>> a single Plot() command, without the loop. Did you try that?
>>
>
> As David suggests, vectorization is the IDL Way! Here's an example:
>
> IDL> x = randomu(1, n)*360
> IDL> y = randomu(2, n)*180 - 90
> IDL> z = floor(randomu(3, n)*256)
> IDL> tic
> IDL> p = plot(x, y, rgb_table=27, vert_colors=z, linestyle='none', symbol='+')
> IDL> toc
> % Time elapsed: 0.54600000 seconds.
>
> mp
>
|