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.