From 484a75ac0f8d4d5e37e299604ca4ecfd22aea773 Mon Sep 17 00:00:00 2001 From: linarphy Date: Tue, 16 May 2023 11:16:37 +0200 Subject: [PATCH] Update visualization - Add imshow to have a better view of what works and what does not - Update plot to get "true" intensity by deleting convolution --- ETA.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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()