Remove display
This commit is contained in:
parent
7579a3dde1
commit
98efc87ee4
1 changed files with 4 additions and 22 deletions
24
spectrum.py
24
spectrum.py
|
@ -12,8 +12,8 @@ import pathlib
|
||||||
from scipy.ndimage import rotate
|
from scipy.ndimage import rotate
|
||||||
from astropy.io import fits
|
from astropy.io import fits
|
||||||
|
|
||||||
cache , filename , output , calibration , intensity_calibration
|
cache , filename , output , calibration = None , None , None , None
|
||||||
, verbose , no_cache = None , None , None , None , None , False, False
|
intensity_calibration , verbose , no_cache = None , False, False
|
||||||
if len( sys.argv ) < 2:
|
if len( sys.argv ) < 2:
|
||||||
raise Exception( 'spectrum.py: type \'spectrum.py -h\' for more information' )
|
raise Exception( 'spectrum.py: type \'spectrum.py -h\' for more information' )
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ while i < len( argv ):
|
||||||
\nParse a naroo spectrum fits' )
|
\nParse a naroo spectrum fits' )
|
||||||
exit()
|
exit()
|
||||||
elif arg == '--version':
|
elif arg == '--version':
|
||||||
print( '0.3' )
|
print( '0.4' )
|
||||||
exit()
|
exit()
|
||||||
elif arg == '--verbose':
|
elif arg == '--verbose':
|
||||||
verbose = True
|
verbose = True
|
||||||
|
@ -110,8 +110,6 @@ if verbose:
|
||||||
\n --verbose: True ( default to False)\
|
\n --verbose: True ( default to False)\
|
||||||
\n\
|
\n\
|
||||||
\n===========================================' )
|
\n===========================================' )
|
||||||
# TODO: check in advance file to check if exists or writeable
|
|
||||||
|
|
||||||
files = {}
|
files = {}
|
||||||
if calibration != None:
|
if calibration != None:
|
||||||
files[ 'wavelength' ] = pathlib.Path( calibration )
|
files[ 'wavelength' ] = pathlib.Path( calibration )
|
||||||
|
@ -126,7 +124,6 @@ for name , path in files.items():
|
||||||
if name in [
|
if name in [
|
||||||
'wavelength',
|
'wavelength',
|
||||||
'intensity' ,
|
'intensity' ,
|
||||||
'spectrum' ,
|
|
||||||
] and not path.is_file():
|
] and not path.is_file():
|
||||||
raise Exception(
|
raise Exception(
|
||||||
'spectrum.py: could not open the ' + name + ' file'
|
'spectrum.py: could not open the ' + name + ' file'
|
||||||
|
@ -659,19 +656,11 @@ mean_bias = sp_convolve(
|
||||||
axis = 0,
|
axis = 0,
|
||||||
) ,
|
) ,
|
||||||
np.ones(
|
np.ones(
|
||||||
(
|
|
||||||
50,
|
50,
|
||||||
) ,
|
) ,
|
||||||
) ,
|
|
||||||
'same',
|
'same',
|
||||||
) / 50
|
) / 50
|
||||||
|
|
||||||
plt.plot( bias[ 'top' ] , label = 'top' )
|
|
||||||
plt.plot( bias[ 'down' ] , label = 'down' )
|
|
||||||
plt.plot( mean_bias , label = 'mean' )
|
|
||||||
plt.legend()
|
|
||||||
plt.show()
|
|
||||||
|
|
||||||
data[
|
data[
|
||||||
: ,
|
: ,
|
||||||
spectrum[ 'x' ][ 'min' ] : spectrum[ 'x' ][ 'max' ]
|
spectrum[ 'x' ][ 'min' ] : spectrum[ 'x' ][ 'max' ]
|
||||||
|
@ -683,13 +672,6 @@ data[
|
||||||
if verbose:
|
if verbose:
|
||||||
print( 'bias substraction finished' )
|
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[
|
mean_data = np.mean( data[
|
||||||
spectrum[ 'y' ][ 'min' ] : spectrum[ 'y' ][ 'max' ],
|
spectrum[ 'y' ][ 'min' ] : spectrum[ 'y' ][ 'max' ],
|
||||||
spectrum[ 'x' ][ 'min' ] : spectrum[ 'x' ][ 'max' ]
|
spectrum[ 'x' ][ 'min' ] : spectrum[ 'x' ][ 'max' ]
|
||||||
|
|
Loading…
Reference in a new issue