start of the removal of artefact

This commit is contained in:
linarphy 2023-07-19 15:49:14 +02:00
parent 1455b60101
commit 3dc1223306
No known key found for this signature in database
GPG key ID: 3D4AAAC3AD16E79C

55
ETA.py
View file

@ -595,6 +595,61 @@ else:
wavelength = np.arange( size_y )
if verbose:
print( 'starting to remove artefact from intensity curve' )
"""
remove artefact
"""
list_ = np.convolve(
np.gradient(
np.mean(
data[
calibrations[ 'top' ][ 'y' ][ 'max' ] : calibrations[ 'down' ][ 'y' ][ 'min' ],
border[ 'x' ][ 'min' ] : border[ 'x' ][ 'max' ]
] ,
axis = 1,
),
) ,
np.ones( 50 ),
'same' ,
)
first_stripe = np.argmax( list_ )
range_ = range(
calibrations[ 'top' ][ 'y' ][ 'max' ] + first_stripe,
calibrations[ 'down' ][ 'y' ][ 'max' ]
)
for line in range_:
abciss = range(
border[ 'x' ][ 'min' ],
border[ 'x' ][ 'max' ],
)
list_ = data[
line ,
border[ 'x' ][ 'min' ] : border[ 'x' ][ 'max' ]
]
polyfit_ = np.polyfit(
abciss,
list_ ,
8 ,
)
import matplotlib.pyplot as plt
plt.plot(
abciss,
list_ ,
)
plt.plot(
abciss,
np.polyval(
polyfit_,
abciss ,
) ,
)
plt.show()
if verbose:
print( 'artefact removed from intensity curve' )
print( 'starting bias substraction' )
bias = {