Re: warp_tri() [message #54896] |
Thu, 19 July 2007 09:06 |
greg.addr
Messages: 160 Registered: May 2007
|
Senior Member |
|
|
On Jul 18, 4:37 pm, David Fanning <n...@dfanning.com> wrote:
> greg.a...@googlemail.com writes:
>> I've written some code to warp an image into a map projection using
>> warp_tri(). This works fine, but the area outside the warped image is
>> left filled with some uniform value that I can't track down:
>
>> res=warp_tri(xo,yo,x,y,im,output_size=viewport)
>
>> IDL> print,min(res),max(res)
>> 0.218271 0.723637
>
>> IDL> print,res[0,0],res[430,620]
>> 0.541057 0.541057
>
>> I suppose it's coming from the INTERPOLATE function. I'd like to set
>> it to some special value (say, zero) so that I can mask it out. I
>> tried modifying the interpolate line in the warp_tri() code to use
>> MISSING=0. but that didn't make any difference. Has anyone any
>> suggestion?
>
> WARP_TRI is only about 10 lines long and is nothing more than
> a wrapper for TRIANGULATE and TRIGRID. I think I would just
> use those two routines directly if I wanted better control.
> In particular, I would investigate the MISSING keyword for
> TRIGRID.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Thanks, David - that did it. The TRIGRID 'missing' had to be set to an
out-of-range value, and the INTERPOLATE 'missing' to the special
value.
x=TRIGRID(xo,yo,xi,tr, gs, b, missing=-1)
y=TRIGRID(xo,yo,yi,tr, gs, b, missing=-1)
return, INTERPOLATE(im_in,x,y,missing=-1.)
many greetings,
Greg
|
|
|
Re: warp_tri() [message #54926 is a reply to message #54896] |
Wed, 18 July 2007 07:37  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
greg.addr@googlemail.com writes:
> I've written some code to warp an image into a map projection using
> warp_tri(). This works fine, but the area outside the warped image is
> left filled with some uniform value that I can't track down:
>
> res=warp_tri(xo,yo,x,y,im,output_size=viewport)
>
> IDL> print,min(res),max(res)
> 0.218271 0.723637
>
> IDL> print,res[0,0],res[430,620]
> 0.541057 0.541057
>
> I suppose it's coming from the INTERPOLATE function. I'd like to set
> it to some special value (say, zero) so that I can mask it out. I
> tried modifying the interpolate line in the warp_tri() code to use
> MISSING=0. but that didn't make any difference. Has anyone any
> suggestion?
WARP_TRI is only about 10 lines long and is nothing more than
a wrapper for TRIANGULATE and TRIGRID. I think I would just
use those two routines directly if I wanted better control.
In particular, I would investigate the MISSING keyword for
TRIGRID.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|