start of the removal of artefact
This commit is contained in:
parent
1455b60101
commit
3dc1223306
1 changed files with 55 additions and 0 deletions
55
ETA.py
55
ETA.py
|
@ -595,6 +595,61 @@ else:
|
||||||
wavelength = np.arange( size_y )
|
wavelength = np.arange( size_y )
|
||||||
|
|
||||||
if verbose:
|
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' )
|
print( 'starting bias substraction' )
|
||||||
|
|
||||||
bias = {
|
bias = {
|
||||||
|
|
Loading…
Reference in a new issue