diff --git a/ETA.py b/ETA.py index 5342ec5..231e250 100755 --- a/ETA.py +++ b/ETA.py @@ -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 = {