Re: Variable Pixel Spacing for Images in IDL [message #86718 is a reply to message #86717] |
Fri, 29 November 2013 08:43   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Robert Seigel writes:
> Thank you for the replies.
>
> Alx,
>
> As I have tried in the past, I am unable to use two-dimensional arrays for X and Y in the IMAGE function. Using your [Alex] example:
>
> IDL> p = image(rgbData,rebin(xaxis,xcount,zcount),rebin(reform(yaxis, 1,zcount),xcount,zcount),/buffer, $
> IDL> axis_style=2)
> % IMAGE: X must be a vector.
>
> I am not sure why IMAGE does not accept X and Y as 2d arrays. However, your second suggestion worked well with one slight modification to the interpolate call [indgen(xcount) rather than xaxis]:
>
> regYaxis = (zcoords[-1] - zcoords[0])*findgen(zcount)/(zcount -1)
> data = interpolate(data, indgen(xcount), interpol(findgen(zcount), zcoords, regYaxis), /GRID)
>
> But, I cannot interpolate these data because they are flags and interpolation between them results in incorrect classification at many locations. The values in the array are one of [-4,-3,-2,-1,0,1,2,3,4], so e.g. when a 4 is next to a 0 the interpolation often creates a false classification.
>
> David,
>
> This routine is exactly what I was looking for!
Oh, damn! Another blow struck for direct graphics. We may never be able
to get rid of these things. ;-)
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.")
|
|
|