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

Home » Public Forums » archive » Re: Surface fitting image with missing data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Surface fitting image with missing data [message #61804] Thu, 31 July 2008 01:27 Go to next message
werner.hupfer is currently offline  werner.hupfer
Messages: 1
Registered: July 2008
Junior Member
On 31 Jul., 02:12, jradavenp...@gmail.com wrote:
> Hey all;
>
> I have a 2-D array (essentially an image) with dimensions [n,m]
>
> There is a large chunk in a corner of the image with no data. All
> pixels have values greater than 1, except within this chunk, which =
> 0.
>
> SFIT fits these as valid points and tips my surface (a plane) towards
> this corner! I thought I would be terribly clever by doing the
> following:
>
> result = sfit( finite(image/(image gt 0)),1,/max_degree)
>
> alas, SFIT isnt playing ball and makes a whole array of /NaN...
>
> Thoughts? Is there a version of SFIT (or something similar) with a /
> NaN keyword? A more clever way to fit a simple surface to an image
> with missing data? Thanks folks
>
>  - Jim

Hello Jim

I can highly recommend the library from Craig Markwardt. I use
mpfitfun for 2D fitting. Among one of the many useful features is the
ability to do curvefit on data points set to NaN!!!!

http://cow.physics.wisc.edu/~craigm/idl/idl.html

Cheers
Werner
Re: Surface fitting image with missing data [message #61902 is a reply to message #61804] Sun, 03 August 2008 21:52 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
werner.hupfer@googlemail.com writes:


> On 31 Jul., 02:12, jradavenp...@gmail.com wrote:
>> Hey all;
>>
>> I have a 2-D array (essentially an image) with dimensions [n,m]
>>
>> There is a large chunk in a corner of the image with no data. All
>> pixels have values greater than 1, except within this chunk, which =
>> 0.
...
>
> I can highly recommend the library from Craig Markwardt. I use
> mpfitfun for 2D fitting. Among one of the many useful features is the
> ability to do curvefit on data points set to NaN!!!!
>
> http://cow.physics.wisc.edu/~craigm/idl/idl.html

Thanks for the plug!

Actually MPFIT doesn't accept NaNs but probably should. Even so, you
can set the WEIGHTS to zero for your missing data (or equivalently,
the ERRORs to a very large number).

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: problem with online help IDL v7.0
Next Topic: Re: Piecewise curve fitting in idl

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

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

Total time taken to generate the page: 0.00668 seconds