spec_time_series#
- class spec_time_series[source]#
Bases:
object
Attributes
Note: attributes inherited from parent classes are not shown here, if any
Directory containing the RASSINE reduced data include the ending WORKSPACE/
Name of the star
Directory containing the data under processing, parent of the WORKSPACE/ folder
Path to the SIMBAD database
Path to the MASK_CCF folder
Path to the Material folder
Instrument used for the measurements
If a planet has been injected
Full width half maximum of the CCF
If info_reduction has been loaded, modification time of the loaded file
Table of relations between outputs produced at different stages of the pipeline
Table with elements having a spectral wavelength dimension
Information about the star
Methods
Produce error on the continuum by interpolating the error flux value at anchor points
Produce flux errors on the pickles files defined as the ron plus square root of flux
- rtype:
- rtype:
- rtype:
Import all the RASSINE dictionnaries in a list
Import a pickle file of a spectrum to get fast common information shared by all spectra
- rtype:
- rtype:
Produce a tableXY spectrum by specifying its index number
Suppress spectra under fixed treshold in SNR
Suppress spectra according to time
- rtype:
- rtype:
Produce the activity proxy time-series.
Add the step kw for the dico chain, if chain is set to True numbered the full chain
Produce a summary table with the RASSINE files of the specified directory
Produce a berv summary
Compute the CCF of a spectrum, reference to use always the same continuum (matching_anchors highest SNR).
Define the color template used in the weighting of the lines for the CCF.
Display the time-series spectra with proxies and its correlation
Produce a brute mask to flag lines crossing pixels according to min-max shift
Brutal suppression of flux value with variance to high (final solution)
Supress flux value outside k-sigma mad clipping
Correction of the stitching/ghost on the spectrum by PCA fitting
Suppress flux value outside k-sigma mad clipping
Display the time-series spectra with proxies and its correlation
Suppress interferency pattern produced by a material of a certain width by making a Fourier filtering.
Compute the secular drift and correction the fluxes to cancel the drift
- rtype:
Display the time-series spectra with proxies and its correlation
Display the time-series spectra with proxies and its correlation
Cut the spectrum time-series borders to reach the specified wavelength limits (included)
- rtype:
Compute the flux constant which allow to preserve the bolometric integrated flux
Return the berv value for a given jdb date
- rtype:
- rtype:
Display the time-series spectra with proxies and its correlation
- rtype:
Produce a median master by masking region of the spectrum
Add some observationnal information in the RASSINE files and produce a summary table
Plot all the RASSINE spectra in the same plot
Creation of the stitching mask on the spectrum
Correction of the stitching/ghost on the spectrum by PCA fitting
- rtype:
Reads information about the star from the SIMBAD table and populates the Stellar_info_ pickle
Suppress outlier spectra
Plot all the RASSINE spectra in the same plot
period in days, T0 transits center in jdb - 2'400'000, duration in hours
List of members of spec_time_series
- yarara_correct_activity(sub_dico='matching_telluric', wave_min=3900.0, wave_max=4400.0, smooth_corr=5, reference='median', proxy_corr=['CaII'])#
Display the time-series spectra with proxies and its correlation
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
continuum (The continuum to select (either linear or cubic)) –
wave_min (Minimum x axis limit) –
wave_max (Maximum x axis limit) –
zoom (int-type, to improve the resolution of the 2D plot) –
int-type (smooth_map =) –
convolution (smooth the 2D plot by gaussian 2D) –
curve (smooth_corr = smooth thecoefficient ofcorrelation) –
reference ('median', 'snr' or 'master' to select the reference normalised spectrum usedin the difference) –
proxy_corr (keyword of the first proxies from RASSINE dictionnary to use in the correlation) –
proxy_detrending (Degree of the polynomial fit to detrend the proxy) –
cmap (cmap of the 2D plot) –
dwin (window correction increase by dwin to slightly correct above around the peak of correlation) –
- Return type:
- continuum_error()#
Produce error on the continuum by interpolating the error flux value at anchor points
- dace_statistic(substract_model=False, ymin=None, ymax=None, return_ylim=False)#
- flux_error(ron=11)#
Produce flux errors on the pickles files defined as the ron plus square root of flux
- Parameters:
ron – Read-out-Noise value of the reading detector errors
- Return type:
- import_dace_sts(substract_model=False)#
- scale_cmap()#
- snr_statistic(version=1)#
- suppress_low_snr_spectra(suppress=False)#
Suppress spectra under fixed treshold in SNR
- Parameters:
suppress (
bool
) – True/False to delete of simply hide the files
- yarara_berv_summary(sub_dico='matching_diff', dbin_berv=0.3, nb_plot=3, telluric_fwhm=3.5)#
Produce a berv summary
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
continuum (The continuum to select (either linear or cubic)) –
telluric_tresh (Treshold used to cover the position of the contaminated wavelength) –
wave_min (The minimum xlim axis) –
wave_max (The maximum xlim axis) –
- yarara_check_fwhm(delta_window=5)#
- yarara_check_rv_sys()#
- yarara_color_template(sub_dico='matching_anchors', continuum='linear')#
Define the color template used in the weighting of the lines for the CCF. The color is defined as the matching_anchors continuum of the best SNR spectra. The product is saved in the Material file.
- yarara_correct_secular_acc(update_rv=False)#
Compute the secular drift and correction the fluxes to cancel the drift
- Parameters:
update_rv (True/False to update the flux value in order to cancel the secular drift) –
- yarara_flux_constant()#
Compute the flux constant which allow to preserve the bolometric integrated flux
- yarara_get_first_wave()#
- yarara_map_1d_to_2d(instrument)#
- yarara_simbad_query(starname=None)#
Reads information about the star from the SIMBAD table and populates the Stellar_info_ pickle
- Return type:
- yarara_suppress_doubtful_spectra(suppress=False)#
Suppress outlier spectra
- Parameters:
suppress – Whether to hide or remove the file. Defaults to False.
- yarara_transit_def(period=100000.0, T0=55000.0, duration=2.0, auto=False)#
period in days, T0 transits center in jdb - 2’400’000, duration in hours
- yarara_ccf(mask, mask_name, sub_dico='matching_diff', ccf_name=None, ratio=False, reference=True, weighted=True, plot=False, save=True, save_ccf_profile=False, normalisation='left', del_outside_max=False, ccf_oversampling=1, rv_range=None, rv_borders=None, delta_window=5, rv_sys_='parameters_or_zero', rv_shift_='zeros', speed_up=True, force_brute=False, squared=True, p_noise=1 / np.inf, substract_map=[], add_map=[])#
Compute the CCF of a spectrum, reference to use always the same continuum (matching_anchors highest SNR). Display_ccf to plot all the individual CCF. Plot to plot the FWHM, contrast and RV.
mask: if was used previously as None, use sts.read_ccf_mask(sts.mask_harps) and set mask_name to sts.mask_harps
- Parameters:
sub_dico (
str
) – The sub_dictionary used to select the continuummask (
ndarray
[Any
,dtype
[float64
]]) – The line mask used to cross correlate with the spectrum (mask should be located in MASK_CCF otherwise KITCAT dico)threshold_telluric – Maximum telluric contamination to keep a stellar line in the mask
reference (
Union
[bool
,Literal
[‘norm’],Literal
[‘master_snr’]]) – True/False or ‘norm’, True use the matching anchors of reference, False use the continuum of each spectrum, norm use the continuum normalised spectrum (not )plot (
bool
) – True/False to plot the RV time-seriesdisplay_ccf – display all the ccf subproduct
save (
bool
) – True/False to save the informations iun summary tablenormalisation (
Union
[Literal
[‘left’],Literal
[‘slope’]]) – ‘left’ or ‘slope’. if left normalise the CCF by the most left value, otherwise fit a line between the two highest pointmaximam (del_outside) – True/False to delete the CCF outside the two bump in personal mask
speed_up (
bool
) – remove region from the CCF not crossed by a line in the mask to speed up the codeforce_brute (
bool
) – force to remove the region excluded by the brute maskrv_sys – km/s
rv_shift – if nd_array, in m/s
mask_name (
str
) – Name used to save the mask in ANAL
- Return type:
- yarara_ccf_save(mask, sub_dico)#
- yarara_get_berv_value(time_value, Draw=False, new=True, light_graphic=False, save_fig=True)#
Return the berv value for a given jdb date
- yarara_correct_borders_pxl(pixels_to_reject=[2, 4095], min_shift=-30, max_shift=30)#
Produce a brute mask to flag lines crossing pixels according to min-max shift
- Parameters:
pixels_to_reject (List of pixels) –
min_shift (min shist value in km/s) –
max_shift (max shist value in km/s) –
- Return type:
- yarara_correct_frog(sub_dico='matching_diff', correction='stitching', wave_min=3800.0, wave_max=3975.0, wave_min_train=3700.0, wave_max_train=6000.0, complete_analysis=False, reference='median', equal_weight=True, nb_pca_comp=10, pca_comp_kept_=None, rcorr_min=0.0, threshold_contam=0.5, algo_pca='empca')#
Correction of the stitching/ghost on the spectrum by PCA fitting
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
continuum (The continuum to select (either linear or cubic)) –
reference ('median', 'snr' or 'master' to select the reference normalised spectrum used in the difference) –
extended (extension of the cluster size) –
- Return type:
- yarara_correct_pattern(sub_dico='matching_diff', wave_min=6000.0, wave_max=6100.0, reference='median', width_range=(0.1, 20.0), correct_blue=True, correct_red=True, jdb_range=None)#
Suppress interferency pattern produced by a material of a certain width by making a Fourier filtering. Width_min is the minimum width possible for the material in mm.
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
wave_min (Minimum x axis limit for the plot) –
wave_max (Maximum x axis limit for the plot) –
reference ('median', 'snr' or 'master' to select the reference normalised spectrum usedin the difference) –
width_min (minimum width in mm above which to search for a peak in Fourier space) –
correct_blue (enable correction of the blue detector for HARPS) –
correct_red (enable correction of the red detector for HARPS) –
- Return type:
- yarara_produce_mask_contam(frog_file)#
Creation of the stitching mask on the spectrum
- Parameters:
frog_file (files containing the wavelength of the stitching) –
- Return type:
- yarara_produce_mask_frog(frog_file)#
Correction of the stitching/ghost on the spectrum by PCA fitting
- Params:
sub_dico: The sub_dictionnary used to select the continuum frog_file: files containing the wavelength of the stitching
- Return type:
- import_ccf()#
- yarara_add_ccf_entry(kw, default_value=1)#
- import_dico_chain(last_dico)#
- yarara_add_step_dico(sub_dico, step, sub_dico_used, chain=False)#
Add the step kw for the dico chain, if chain is set to True numbered the full chain
- Return type:
- import_sts_flux(load=['flux', 'flux_err', 'matching_diff'], num=None)#
- yarara_obs_info(df)#
Add some observationnal information in the RASSINE files and produce a summary table
- Parameters:
kw (list-like with format [keyword,array]) –
- Return type:
- import_rassine_output(return_name=False, kw1=None, kw2=None)#
Import all the RASSINE dictionnaries in a list
- Parameters:
return_name (True/False to also return the filenames) –
- Return type:
- Returns:
Return the list containing all thedictionnary
- import_spectrum(num=0)#
Import a pickle file of a spectrum to get fast common information shared by all spectra
- spectrum(num=0, sub_dico='matching_diff', norm=False, planet=False, color_correction=False)#
Produce a tableXY spectrum by specifying its index number
- yarara_get_bin_length()#
- yarara_star_info(Rv_sys=None, simbad_name=None, magB=None, magV=None, magR=None, BV=None, VR=None, sp_type=None, Mstar=None, Rstar=None, Vsini=None, Vmicro=None, Teff=None, log_g=None, FeH=None, Prot=None, Fwhm=None, Contrast=None, CCF_delta=None, Pmag=None, stellar_template=None, Contam_BERV=None)#
- yarara_analyse_summary(rm_old=False)#
Produce a summary table with the RASSINE files of the specified directory
- Return type:
- suppress_time_RV(liste)#
- suppress_time_spectra(mask, suppress=False, name_ext='temp')#
Suppress spectra according to time
- yarara_correct_brute(sub_dico='matching_mad', reference='median', win_roll=1000, min_length=5, percent_removed=10, k_sigma=2, extended=10, borders_pxl=False)#
Brutal suppression of flux value with variance to high (final solution)
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
continuum (The continuum to select (either linear or cubic)) –
reference ('median', 'snr' or 'master' to select the reference normalised spectrum used in the difference) –
win_roll (window size of the rolling algorithm) –
min_length (minimum cluster length to be flagged) –
k_sigma (k_sigma of the rolling mad clipping) –
extended (extension of the cluster size) –
low (lowest cmap value) –
high (highest cmap value) –
cmap (cmap of the 2D plot) –
- Return type:
- yarara_correct_cosmics(sub_dico='matching_diff', k_sigma=3, bypass_warning=True)#
Supress flux value outside k-sigma mad clipping
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
continuum (The continuum to select (either linear or cubic)) –
- Return type:
- yarara_correct_mad(sub_dico='matching_diff', k_sigma=2, k_mad=2, n_iter=1, ext='0')#
Suppress flux value outside k-sigma mad clipping
# SUPRESS VARIATION RELATIF TO MEDIAN-MAD SPECTRUM (OUTLIERS CORRECTION + ECCENTRIC PLANET)
- yarara_correct_smooth(sub_dico='matching_diff', reference='median', wave_min=4200.0, wave_max=4300.0, window_ang=5.0)#
- Return type:
- yarara_comp_all(sub_dico1='matching_cosmics', sub_dico2='matching_mad', analysis='h2o_1')#
- yarara_plot_all(sub_dico='matching_diff', wave_min=4400.0, wave_max=4500.0, plot_median=False, berv_keys='none', cmap='brg', color='CaII', relatif=False, new=True, substract_map=[], p_noise=1 / np.inf)#
Plot all the RASSINE spectra in the same plot
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
continuum (The continuum to select (either linear or cubic)) –
wave_min (The minimum xlim axis) –
wave_max (The maximum xlim axis) –
plot_median (True/False, Plot the median of the spectrum) –
berv_keys (The berv keyword from RASSINE dictionnary to remove the berv from the spectra (berv in kms)) –
planet (True/False to use the flux containing the injected planet or not) –
- yarara_activity_index(sub_dico='matching_diff', plot=True, debug=False, calib_std=0, optimize=False, p_noise=1 / np.inf, save_kw=True)#
Produce the activity proxy time-series. Need to cancel the RV systemic of the star
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
continuum (The continuum to select (either linear or cubic)) –
rv (The RV of the star system) –
plot (True/False, Plot the proxies time-series) –
debug (True/False, Plot the intermediate graphicwith the spectrum and area extraction for the proxies) –
ron (read-out-noise error injected by reading pixels) –
calib_std (std error due to flat-field photon noise (5.34e-4 or 10.00e-4 Cretignier+20)) –
- Return type:
- yarara_map(sub_dico='matching_diff', planet=False, unit=1.0, wave_min=4000.0, wave_max=4300.0, index='index', ratio=False, reference='median', new=True, plot=True, substract_map=[], add_map=[], correction_factor=True, p_noise=1 / np.inf)#
Display the time-series spectra with proxies and its correlation
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
continuum (The continuum to select (either linear or cubic)) –
wave_min (Minimum x axis limit) –
wave_max (Maximum x axis limit) –
index ('index' or 'time' if 'time', display the time-series with blank color if no spectra at specific time (need roughly equidistant time-series spectra)) –
zoom (int-type, to improve the resolution of the 2D plot) –
int-type (smooth_map =) –
convolution (smooth the 2D plot by gaussian 2D) –
reference ('median', 'snr' or 'master' to select the reference normalised spectrum usedin the difference) –
rv_shift (keyword column to use to shift spectra, m/s speed) –
cmap (cmap of the 2D plot) –
low_cmap (vmin cmap colorbar) –
high_cmap (vmax cmap colorbar) –
- Return type:
- yarara_retropropagation_correction(correction_map='matching_smooth', sub_dico='matching_cosmics')#
- Return type:
- yarara_telluric(sub_dico='matching_anchors', suppress_broad=True, delta_window=5, telluric_tag='telluric', weighted=False, reference=True, ratio=False, normalisation='slope', ccf_oversampling=3)#
Plot all the RASSINE spectra in the same plot
- Parameters:
mask_name –
The telluric tag used to find a mask to cross correlate with the spectrum
Mask should be located in MASK_CCF and have the filename mask_telluric_TELLURICTAG.txt
sub_dico (The sub_dictionnary used to select the continuum) –
continuum (The continuum to select (either linear or cubic)) –
reference (True/False or 'norm', True use the matching anchors of reference, False use the continuum of each spectrum, norm use the continuum normalised spectrum (not )) –
display_ccf (display all the ccf) –
normalisation ('left' or 'slope'. if left normalise the CCF by the most left value, otherwise fit a line between the two highest point) –
planet (True/False to use the flux containing the injected planet or not) –
- Return type:
- yarara_correct_telluric_proxy(sub_dico='matching_fourier', sub_dico_output='telluric', wave_min=5700.0, wave_max=5900.0, reference='master', smooth_corr=1, proxies_corr=['h2o_depth', 'h2o_fwhm'], proxies_detrending_=None, wave_min_correction_=4400.0, wave_max_correction_=None, min_r_corr_=0.40, sigma_ext=2)#
Display the time-series spectra with proxies and its correlation
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
continuum (The continuum to select (either linear or cubic)) –
wave_min (Minimum x axis limit) –
wave_max (Maximum x axis limit) –
zoom (int-type, to improve the resolution of the 2D plot) –
int-type (smooth_map =) –
convolution (smooth the 2D plot by gaussian 2D) –
reference ('median', 'snr' or 'master' to select the reference normalised spectrum usedin the difference) –
proxy1_corr (keyword of the first proxies from RASSINE dictionnary to use in the correlation) –
proxy1_detrending (Degree of the polynomial fit to detrend the proxy) –
proxy2_corr (keyword of the second proxies from RASSINE dictionnary to use in the correlation) –
proxy2_detrending (Degree of the polynomial fit to detrend the proxy) –
cmap (cmap of the 2D plot) –
min_wave_correction (wavelength limit above which to correct) –
min_r_corr (minimum correlation coefficient of one of the two proxies to consider a line as telluric) –
dwin (window correction increase by dwin to slightly correct above around the peak of correlation) –
positive_coeff (The correction can only be absorption line profile moving and no positive) –
- Return type:
- yarara_correct_telluric_gradient(sub_dico_detection='matching_fourier', sub_dico_correction='matching_oxygen', wave_min_train=4200.0, wave_max_train=5000.0, wave_min_correction=4400, wave_max_correction=6600, smooth_map=1, reference='master', inst_resolution=110000, equal_weight=True, nb_pca_comp=20, nb_pca_comp_kept=None, nb_pca_max_kept=5, calib_std=1e-3)#
Display the time-series spectra with proxies and its correlation
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
continuum (The continuum to select (either linear or cubic)) –
wave_min (Minimum x axis limit) –
wave_max (Maximum x axis limit) –
int-type (smooth_map =) –
convolution (smooth the 2D plot by gaussian 2D) –
cmap (cmap of the 2D plot) –
low_cmap (vmin cmap colorbar) –
high_cmap (vmax cmap colorbar) –
- Return type:
- yarara_correct_oxygen(sub_dico='matching_telluric', reference='master', wave_min=5760.0, wave_max=5850.0, oxygene_bands=[[5787.0, 5835.0], [6275.0, 6340.0], [6800.0, 6950.0]])#
Display the time-series spectra with proxies and its correlation
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
wave_min (Minimum x axis limit) –
wave_max (Maximum x axis limit) –
int-type (smooth_map =) –
convolution (smooth the 2D plot by gaussian 2D) –
- Return type:
- yarara_cut_spectrum(wave_min=None, wave_max=None)#
Cut the spectrum time-series borders to reach the specified wavelength limits (included)
There is no way to cancel this step ! Use it wisely.
- Return type:
- yarara_add_map(flux_init, map_name, correction_factor=False)#
- yarara_substract_map(flux_init, map_name, correction_factor=False)#
- yarara_map_all(wave_min=None, wave_max=None, index='index', reference='median')#
- yarara_median_master(*, sub_dico='matching_diff', method='mean', suppress_telluric=True, shift_spectrum=False, telluric_tresh=0.001, wave_min=5750.0, wave_max=5900.0, jdb_range=[-100000, 100000, 1])#
Produce a median master by masking region of the spectrum
- Parameters:
sub_dico (The sub_dictionnary used to select the continuum) –
telluric_tresh (Treshold used to cover the position of the contaminated wavelength) –
wave_min (The minimum xlim axis) –
wave_max (The maximum xlim axis) –
- Return type:
- yarara_poissonian_noise(noise_wanted=1 / 100, wave_ref=None, flat_snr=True, seed=9)#
- __init__(directory, starname, instrument, simbad_folder, mask_ccf_folder, material_folder)[source]#
Creates a spec_time_series instance
- Params:
directory: Directory containing the RASSINE reduced data include the ending WORKSPACE/ starname: Name of the star instrument: Name of the instrument (> 5 letters possible) simbad_folder: Path to the SIMBAD folder mask_ccf_folder: Path to the mask_ccf folder material_folder: Path to the material folder