diff --git a/ETA.py b/ETA.py index 2489dff..33b747a 100644 --- a/ETA.py +++ b/ETA.py @@ -330,10 +330,28 @@ fall = np.array( [ ) for consecutive in fall ] ).astype( int ) -temp = np.convolve( results[ : , 10000 ] , np.ones( 50 ) , 'same' ) +mask = np.zeros_like( data ) +mask[ + calibrations[ 'top' ][ 'y' ][ 'min' ] : calibrations[ 'top' ][ 'y' ][ 'max' ], + calibrations[ 'top' ][ 'x' ][ 'min' ] : calibrations[ 'top' ][ 'x' ][ 'max' ] +] = -1 +mask[ + calibrations[ 'down' ][ 'y' ][ 'min' ] : calibrations[ 'down' ][ 'y' ][ 'max' ], + calibrations[ 'down' ][ 'x' ][ 'min' ] : calibrations[ 'down' ][ 'x' ][ 'max' ] +] = -1 +mask[ + calibrations[ 'top' ][ 'y' ][ 'max' ] : calibrations[ 'down' ][ 'y' ][ 'min' ], + border[ 'x' ][ 'min' ] : border[ 'x' ][ 'max' ] +] = 1 +plt.imshow( data ) +plt.imshow( mask , alpha = 0.5 ) +plt.show() + +temp = results[ : , 10000 ].copy() for i in range( len( fall ) - 1 ): temp[ fall[ i ] : fall[ i + 1 ] ] = np.mean( temp[ fall[ i ] : fall[ i + 1 ] ] ) +plt.plot( results[ : , 10000 ] , label = 'raw' ) plt.plot( temp , label = 'flat' ) plt.legend() plt.show()