Update result data to decrease size

This commit is contained in:
linarphy 2023-06-01 11:56:42 +02:00
parent 587a509f3e
commit edb79cfb57
No known key found for this signature in database
GPG key ID: 3D4AAAC3AD16E79C

10
ETA.py
View file

@ -605,14 +605,18 @@ fall = np.array( [
) for consecutive in fall if len( consecutive ) > 20 # the value might change ) for consecutive in fall if len( consecutive ) > 20 # the value might change
] ).astype( int ) ] ).astype( int )
stairs = np.zeros( ( len( fall ) - 1 , size_x ) ) stairs = np.zeros( ( len( fall ) , size_x , 2 ) )
for x in range( size_x ): for x in range( size_x ):
stairs[ : fall[0] , x ] = 0 # TODO: put the mean stairs[ : fall[0] , x ] = 0 # TODO: put the mean
for i in range( len( fall ) - 1 ): for i in range( len( fall ) - 1 ):
stairs[ i , x ] = np.mean( data[ stairs[ i , x ] = [
np.mean( data[
calibrations[ 'top' ][ 'y' ][ 'max' ] + fall[ i ] : calibrations[ 'top' ][ 'y' ][ 'max' ] + fall[ i + 1 ], calibrations[ 'top' ][ 'y' ][ 'max' ] + fall[ i ] : calibrations[ 'top' ][ 'y' ][ 'max' ] + fall[ i + 1 ],
border[ 'x' ][ 'min' ] + x border[ 'x' ][ 'min' ] + x
] ) ] ),
fall[i]
]
stairs[ -1 , x ] = [ 0 , fall[ - 1 ] ]
if verbose: if verbose:
print( 'ETA flattened' ) print( 'ETA flattened' )