I have image data for a flash of light where a few of the pixels have reached 255 at the centre of the flash. What would be the best way to go about fitting a 2D gaussian to the data that isn't at 255 in order to model what the hypothetical pixel value of the pixels would be.
I have been playing around with astropy.convolution, and the interpolate_replace_nans function, but this always returns values below 255 rather than the expected value of above 255.
The surface plot of the data clearly follows a single gaussian shape, with the top cut off; is there a simple way to work out the parameters of the gaussian to reconstruct what the values should be?

If you mask out the pixels that are saturated, you can then fit a 2D Gaussian model to the data.
The masking can be as simple as not passing the bad data to the fitter, since the fitter expects to receive x,y coordinates and a corresponding z value.
(the convolution approach is not correct here; it can never return a value larger than was in the original data)