Mention the related issues faced in remove_period_patterns.py

This commit is contained in:
Benjamin Loison 2024-05-23 09:05:34 +02:00
parent 7970c8d601
commit 40a88d25c7
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:zFT8axdEDSvIDHMfZkV1sPtnzI/6WpehbsK6V+XmaNo

View File

@ -30,6 +30,7 @@ def removePeriodicPatterns(fft1Part):
# This example is intended to demonstrate how astropy.convolve and
# scipy.convolve handle missing data, so we start by setting the brightest
# pixels to NaN to simulate a "saturated" data set
# See [Benjamin_Loison/astropy/issues/2](https://codeberg.org/Benjamin_Loison/astropy/issues/2).
height, width = fft1Part.shape
for x in range(width):
fft1Part[height // 2, x] = np.nan
@ -45,6 +46,7 @@ def removePeriodicPatterns(fft1Part):
kernel = Gaussian2DKernel(x_stddev = X_STDDEV)
# create a "fixed" image with NaNs replaced by interpolated values
# See [Benjamin_Loison/astropy/issues/1](https://codeberg.org/Benjamin_Loison/astropy/issues/1).
fixedImagePart = interpolate_replace_nans(fft1Part, kernel)
return fixedImagePart
@ -90,4 +92,4 @@ differenceBetweenBothImages = invOriginalFft1 - invFixedImage
# `np.log10(1 + abs(differenceBetweenBothImages))` does not seem more interesting.
axes[2].imshow(differenceBetweenBothImages)
plt.tight_layout()
plt.show()
plt.show()