CONTOUR and automatic gridding of irregularly spaced data [message #85023] |
Mon, 24 June 2013 06:10  |
Karlo Janos
Messages: 31 Registered: July 2008
|
Member |
|
|
Hi all,
IDL 8.2.3 provides automatic gridding of irregularly spaced data with
the CONTOUR function. Great, I thought in hope to get rid of my CONTOUR
plots in direct graphics.
But when I use a CONTOUR function plot combined with a 'Mollweide' MAP
projection and CENTER_LONGITUDE=nonzero_value the automatic gridding
yields a gap between the -180 and +180 degrees longitudes.
The gap exists even though I have used GRID_UNITS='degrees' which should
cause the use of the SPHERE keyword as it is stated in the documentation
of the CONTOUR function.
The only way to avoid this is manually invoking the gridding routines.
Did I do something wrong?
Or can someone confirm this behaviour?
Thanks and regards
Karlo
|
|
|
|
Re: CONTOUR and automatic gridding of irregularly spaced data [message #85034 is a reply to message #85024] |
Tue, 25 June 2013 00:12   |
Karlo Janos
Messages: 31 Registered: July 2008
|
Member |
|
|
> Let's just say you are not the first to be thrown upon the shoals of
> disappointment. ;-)
>
> Cheers,
>
> David
>
> P.S. What's wrong with gridding the data yourself? God knows, if you do,
> it is one less thing to go wrong.
>
Thanks for your encouraging reply. ;-)
Well, what I _really_ want is a cell filled CONTOUR plot of the coloured
Voronoi cells which result from the (manual or automatic) gridding.
Apparently I have failed to use QHULL properly.
The following code avoids the gap between -180° and +180°:
rresult = SPH_SCAT( lons, lats, data, BOUNDS=[-180., -90., 180., 90.],
GS=[360./N_lons, 180./N_lats] )
cc = CONTOUR( rresult $
, DINDGEN(N_lons+1)/N_lons*360-180 $
, DINDGEN(N_lats+1)/N_lats*180-90 $
, /FILL $
, GRID_UNITS=2 $
)
But the grid is spaced equally in longitudes and latitudes. It is not a
real plot of the Voronoi cells based on the data coordinates.
Can you suggest an approach?
Thanks and regards
Karlo
|
|
|
|
Re: CONTOUR and automatic gridding of irregularly spaced data [message #85037 is a reply to message #85036] |
Tue, 25 June 2013 06:24  |
Karlo Janos
Messages: 31 Registered: July 2008
|
Member |
|
|
> ... to just replicate the first latitude column as the last column in
> both the latitude and data arrays.
> This gives the direct graphics contour fill algorithm the information it
> needs to close the contours over the gap. It also allows you to maintain
> the irregular cell spacing of the original data.
If I understand you correctly, that might work provided that I already
have columns of longitude data, i.e. equally or non-equally spaced
coordinates (but lying on the same longitude!).
This is not, what I meant by "irregular gridding". My data points are
scattered and have all different latitude and longitude values.
The automatic gridding of the old CONTOUR procedure in combination with
the "/IRREGULAR" keyword does what I need. The question now is what is
different between the CONTOUR procedure and the CONTOUR function?
Thanks and regards
Karlo
|
|
|