Broadcast curve_fit across other dimensions #3249
-
Hello, I have some incredibly large datasets over which I need to apply curve fitting. I am able to use scipp.scipy.optimize.curve_fit to perform curve fitting on a single 1D DataArray, but need to iterate this over 2048*2048 pixels (eventually other dimensions as well). Sure, I can naively dump this into a for loop, but this kinda defeats the purpose of using Scipp in the first place. My current solution is to use scipp.compat.to_xarray, perform the curve fitting in xarray, then convert back. In doing so, I lose units, strong typing, and variances, which is managable but unfortunate. I am wondering if there are plans to implement broadcasting of curve_fit? This is not a deal breaker for me, I still love everything about Scipp and will continue to use it for most things, but it would be incredible to be able to do this all in Scipp. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Can you clarify which of these you are trying to achieve?
|
Beta Was this translation helpful? Give feedback.
-
We have just released Scipp 23.12.0, which adds scipp.curve_fit. This works similar to |
Beta Was this translation helpful? Give feedback.
We have just released Scipp 23.12.0, which adds scipp.curve_fit. This works similar to
xarray.DataArray.curvefit
. @TheFermiSea please give it a try if you can, any feedback (including potential UX or performance issues) is welcome!