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

Home » Public Forums » archive » Variable Pixel Spacing for Images in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Variable Pixel Spacing for Images in IDL [message #86722 is a reply to message #86718] Fri, 29 November 2013 09:14 Go to previous messageGo to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le vendredi 29 novembre 2013 17:43:21 UTC+1, David Fanning a écrit :
> 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.")


The IMAGE function does work with X and Y as 2D arrays. Try:

im = image(dist(200,100), rebin(findgen(200),200,100), rebin((findgen(1,100)),200,100), AXIS_STYLE=2)

It works in this case, because re-gridding is not needed and then not used.
But the automatic re-gridding is far from optimal (due to present limitations in IDL's internal gridding software). It is usually very slow and can even crash your IDL session.
Hope that this will be fixed in IDL 8.3 !
alx.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Barplot using Coyote, the colors keep changing, why?
Next Topic: Log system ??

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

Current Time: Wed Oct 08 17:05:48 PDT 2025

Total time taken to generate the page: 0.00453 seconds