Add bias substraction
This commit is contained in:
parent
5fa0b434dc
commit
5dc16bbe09
1 changed files with 28 additions and 1 deletions
29
ETA.py
29
ETA.py
|
@ -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' ,
|
||||||
|
|
Loading…
Reference in a new issue