I'm working with some data trying to create a 2D polynomial fit just like IRAF's surfit
(see here). I have 16 data points distributed in a grid pattern (i.e. pixel values at 16 different x- and y-coordinates) that need to be fitted to produce a 1024x1024 array. I've tried a bunch of different methods, starting with things like astropy.modeling
or scipy.interpolate
, but nothing gives quite the right result compared to IRAF's surfit
. I imagine it's because I'm only using 16 data points, but that's all I have! The result should look something like this:
But what I'm getting looks more like this:
If you have any suggestions for how best to accomplish this task, I would very much appreciate your input! Thank you.