From 98efc87ee49f673eb490593507baa69fe4b6c570 Mon Sep 17 00:00:00 2001 From: linarphy Date: Tue, 18 Jul 2023 15:10:30 +0200 Subject: [PATCH] Remove display --- spectrum.py | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/spectrum.py b/spectrum.py index e2b8589..c52e29c 100755 --- a/spectrum.py +++ b/spectrum.py @@ -12,8 +12,8 @@ import pathlib from scipy.ndimage import rotate from astropy.io import fits -cache , filename , output , calibration , intensity_calibration -, verbose , no_cache = None , None , None , None , None , False, False +cache , filename , output , calibration = None , None , None , None +intensity_calibration , verbose , no_cache = None , False, False if len( sys.argv ) < 2: raise Exception( 'spectrum.py: type \'spectrum.py -h\' for more information' ) @@ -75,7 +75,7 @@ while i < len( argv ): \nParse a naroo spectrum fits' ) exit() elif arg == '--version': - print( '0.3' ) + print( '0.4' ) exit() elif arg == '--verbose': verbose = True @@ -110,8 +110,6 @@ if verbose: \n --verbose: True ( default to False)\ \n\ \n===========================================' ) -# TODO: check in advance file to check if exists or writeable - files = {} if calibration != None: files[ 'wavelength' ] = pathlib.Path( calibration ) @@ -126,7 +124,6 @@ for name , path in files.items(): if name in [ 'wavelength', 'intensity' , - 'spectrum' , ] and not path.is_file(): raise Exception( 'spectrum.py: could not open the ' + name + ' file' @@ -659,19 +656,11 @@ mean_bias = sp_convolve( axis = 0, ) , np.ones( - ( - 50, - ), + 50, ) , 'same', ) / 50 -plt.plot( bias[ 'top' ] , label = 'top' ) -plt.plot( bias[ 'down' ] , label = 'down' ) -plt.plot( mean_bias , label = 'mean' ) -plt.legend() -plt.show() - data[ : , spectrum[ 'x' ][ 'min' ] : spectrum[ 'x' ][ 'max' ] @@ -683,13 +672,6 @@ data[ if verbose: print( 'bias substraction finished' ) -ETA_bias = np.load( 'ETA_bias.npy' ) - -plt.plot( mean_bias , label = 'spectrum' ) -plt.plot( ETA_bias , label = 'ETA' ) -plt.legend() -plt.show() - mean_data = np.mean( data[ spectrum[ 'y' ][ 'min' ] : spectrum[ 'y' ][ 'max' ], spectrum[ 'x' ][ 'min' ] : spectrum[ 'x' ][ 'max' ]