Add bias substraction

This commit is contained in:
linarphy 2023-06-26 11:37:38 +02:00
parent 5fa0b434dc
commit 5dc16bbe09
No known key found for this signature in database
GPG key ID: 3D4AAAC3AD16E79C

29
ETA.py
View file

@ -580,6 +580,33 @@ else:
wavelength = np.arange( size_y ) wavelength = np.arange( size_y )
if verbose: if verbose:
print( 'starting bias substraction' )
bias = {
'top': np.mean(
data[
calibrations[ 'top' ][ 'y' ][ 'min' ] - 100 :
calibrations[ 'top' ][ 'y' ][ 'min' ] ,
calibrations[ 'top' ][ 'x' ][ 'min' ] :
calibrations[ 'top' ][ 'x' ][ 'max' ]
] ,
axis = 0,
),
'down': np.mean(
data[
calibrations[ 'down' ][ 'y' ][ 'max' ] :
calibrations[ 'down' ][ 'y' ][ 'max' ] + 100,
calibrations[ 'down' ][ 'x' ][ 'min' ] :
calibrations[ 'down' ][ 'x' ][ 'max' ]
] ,
axis = 0,
),
}
mean_bias = np.mean( [ bias[ 'top' ] , bias[ 'down' ] ] , axis = 0 )
if verbose:
print( 'bias substraction finished' )
print( 'starting to flatten the ETA' ) print( 'starting to flatten the ETA' )
list_ = np.convolve( list_ = np.convolve(
@ -590,7 +617,7 @@ list_ = np.convolve(
border[ 'x' ][ 'min' ] : border[ 'x' ][ 'max' ] border[ 'x' ][ 'min' ] : border[ 'x' ][ 'max' ]
] , ] ,
axis = 1, axis = 1,
), ) - mean_bias,
) , ) ,
np.ones( 50 ), np.ones( 50 ),
'same' , 'same' ,