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
This commit is contained in:
linarphy 2023-05-16 11:16:37 +02:00
parent 6a423e528a
commit 484a75ac0f
No known key found for this signature in database
GPG key ID: 3D4AAAC3AD16E79C

20
ETA.py
View file

@ -330,10 +330,28 @@ fall = np.array( [
) for consecutive in fall ) for consecutive in fall
] ).astype( int ) ] ).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 ): for i in range( len( fall ) - 1 ):
temp[ fall[ i ] : fall[ i + 1 ] ] = np.mean( temp[ fall[ i ] : fall[ i + 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.plot( temp , label = 'flat' )
plt.legend() plt.legend()
plt.show() plt.show()