X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 11 Dec 2020 07:53 PM by  Mike Wong
GAUSS2DFIT (bug + solution)
 0 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Mike Wong



New Member


Posts:2
New Member


--
11 Dec 2020 07:53 PM
     
    GAUSS2DFIT with the /NEGATIVE option is supposed to fit a gaussian "valley" instead of "peak."
    i came across intermittent cases where the function seemed to give a good fit in terms of parameter
    values, except that the output parameter A[1] was positive instead of negative. also, the return
    value had a positive gaussian peak instead of a negative gaussian valley.

    i have not thoroughly tested this, but adding this line of code seems to fix it:

    a[1] *= keyword_set(neg) ? -1 : 1

    this should be placed on line 263, just before the comment "If there's a tilt".






    this is for IDL Version 8.5.1, Mac OS X (darwin x86_64 m64).
    please disregard if you are using a later version where this has already been fixed.
    You are not authorized to post a reply.