API

raccoon.ccf Module

Functions

compute_wstd(x, e)

Compute weighted standard deviation.

computebisector(x, y, xerr[, n])

Compute bisector and its errors.

computebisector_bis(x, y[, ybotmin_percent, ...])

Compute bisector inverse slope (BIS).

computebisector_biserr(x, y, xerr[, n, ...])

Compute bisector, bisector inverse slope (BIS) and their errors.

computeccf(w, f, c, wm, fm, rv[, ron, forig])

Wrapper for the fortran functions ccflibfort.computeccf, ccflibfort.computeccferr, computeccferrfluxorig.

computerverr(rv, ccf, ccferr[, returnall])

Compute RV error from CCF profile.

determine_fitrng(fitrng, rv, ccf[, imin, verb])

Determine which points of the CCF use for the fit.

fitgaussian(x, y)

Gaussian G(x)=shift+amp*e^(-(x-cen)^2/(2*wid^2))

fitgaussianfortran(rv, ccf, fitrng[, ...])

Fit a Gaussian function to the CCF and return the best fit parameters.

infits_ccfall(filin)

Read CCF data from files created with outfits_ccfall.

listmask_default()

Default masks.

outdat_ccf(filout, rv, ccf)

Save single CCF data in text file.

outdat_ccfparTS(filout, data[, cols, sep, ...])

Save CCF parameters TS in text file.

outfits_ccfall(rv, ccfsum, ccfparsum, ccf, ...)

Save CCF data in a FITS file.

plot_ccf(rv, ccf[, ccfpar, title])

plot_ccf_bisector()

plot_ccf_fit(rv, ccf, ccfpar[, title, fitpar])

plot_ccf_fit_diff(rv, ccf, ccfpar[, title, ...])

plot_ccf_fit_line(rv, ccf, ccfpar[, title, ...])

plot_ccfo_lines(rv, ccfo[, lisord, ...])

Plot order CCFs as given, no normalisation or offset.

plot_ccfo_lines_map(rv, ccfo, ccfsum, ccferrsum)

3-panel plot with CCFsum, CCFo lines, CCFo map, one below each other.

plot_ccfo_map(rv, ccfo[, lisord, cb, cmap, ...])

Plot map of order CCFs as given, no normalisation or offset.

plot_ccfparbasic_servalrvc(data[, ...])

Plot CCF parameters TS (parameter vs BJD).

plot_ccfparbasic_servalrvc_separated(data[, ...])

Plot CCF parameters TS (parameter vs BJD).

plot_ccfrv(data[, title, stats])

stats : {'std', None}

plot_ccfrv_servalrvc(data[, shiftserval, ...])

stats : {'std', None}

plot_ccfrv_servalrvc_diff(data[, ...])

stats : {'std', None}

plot_lisccf_lines_map(rv, lisccf, lisccferr, ...)

2-panel plot with list of CCF (coadded CCFs from different observations) lines color-coded as a function of time, and CCF map with time on y-axis and color-coded on CCF value, one below each other.

printstats(stats, ax, data[, err, x, y, ha, ...])

stats : list

selectfilphoenixf(spt[, dirin])

  • lte02900-5.00-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.fits

selectmask_carmenesgto(filmask, spt, vsini)

vsini selection not implemented!! Parameters ---------- filmask : str Mask-selection file, contaiing the information of the masks to be used. Columns: 0) object used to make the mask objmask 1) spectral type of objmask 2) vsini of objmask 3) path to mask file.

selectmask_default(maskid, inst)

Select mask from default available.

selecttell_default(inst)

showmask_default()

List avalilable masks

sumccf(rv, ccf, ords)

Sum CCFs of different orders.

raccoon.fitsutils Module

Functions

add_list_to_header(datain, headerin)

Uses astropy HEADER.extend.

list_to_header(datain)

datain : list or tuple of tuples

read_header(filin[, ext])

Read FITS header.

read_header_keywords(filin, kws[, notfound, ...])

Read keywords in kws from FITS header.

read_header_keywords_lisobs(lisobs, kws[, ...])

Read keywords in kws from FITS header for the observations in lisobs.

raccoon.peakutils Module

Functions

b_overlap_a(a, b[, alab, blab, verb])

Check if there is any value in b inside the range of the values in a.

find_abspeak_list(w, f, wlines[, ...])

Find the minimum peaks in the spectrum w, f closest to the wavelength positions in the list wlines.

find_abspeak_list_echelle(w, f, wlines[, ...])

find_abspeaks(f[, method])

Find minima and maxima of spectrum f.

find_abspeaks_echelle(f[, method, ords_use])

fit_gaussian_peak(w, f[, amp_hint, ...])

Fit a single Gaussian to a spectrum line.

fit_gaussian_spec(w, f, imin, imax1, imax2)

Fit len(imin) peaks in the spectrum w, f.

gaussian(x[, amp, cen, wid, shift])

Gaussian function: G(x) = shift + amp * e**(-(x-cen)**2 / (2*wid**2))

gaussian_contrasterr(amp, shift[, amperr, ...])

gaussian_fwhm([wid])

gaussian_fwhmerr([wid, widerr])

gaussian_minmax([shift, amp])

idxmin_custom(f)

Find all minima in spectrum.

idxminends_custom(f, imin)

Find "ends of the minima" in spectrum f, i.e. maxima at each side of the minimum.

min_find_maxabs(y[, imin])

Find the absolute maxima at each side of the minimum in y.

min_find_maxclosest(y[, imin])

Find the maxima closest the minimum in y, one at each side.

raccoon.pyutils Module

Functions

get_basename(s)

Remove path and extension of string s to get the "basename".

get_distro()

Get OS name.

isfloat(x)

Return True if can convert x to float, return False otherwise.

isfloatnum(x)

Check if x is a "valid" float, i.e. a real number, not a nan or inf.

make_dir(d)

Create directory d if it does not exist.

save_command_current(dirout, command[, filout])

Save current command. Usually: dirout = args.dirout command = sys.argv.

save_command_current_hist_args(dirout, ...)

Uses save_command_current, save_command_history, save_commandlineargs. Usually: dirout = args.dirout command = sys.argv args = args.

save_command_history(dirout, command[, filout])

Save current command in commands history. Usually: dirout = args.dirout command = sys.argv.

save_commandlineargs(dirout, args[, filout])

Save current command line arguments. Usually: dirout = args.dirout args = args.

Classes

CustomFormatter(prog[, indent_increment, ...])

Custom formatter class for argparse to be able to show default values of options and keep formatting of description and epilog text

raccoon.spectrographutils Module

Tools to work with data from different spectrographs: CARMENES, HARPS, HARPN. Uses functions from harpsutils and carmenesutils.

Functions

fitsccf_fluxes_read(filin, inst)

fitsccf_read_ccf(filin, inst)

fitsccf_rvgrid_read(filin, inst[, ext, ext1])

fitsred_read(filin, inst[, carmnirdiv, ...])

Parameters:

header_airmass_lisobs(lisobs, inst[, name, ...])

header_bjd_lisobs(lisobs, inst[, name, ...])

Get the BJD from the header of the observations in lisobs.

header_exptime_lisobs(lisobs, inst[, name, ...])

header_ron_lisobs(lisobs, inst[, name, ...])

Get the RON from the header of the observations in lisobs.

header_rvcorrection_lisobs(lisobs, inst[, ...])

Get RV correction from header: BERV and drift.

header_snr_lisobs(lisobs, inst[, name, ...])

Get the SNR from the header of the orders ords for the observations in lisobs.

inst_nord(inst[, carmnirsplit, notfound, verb])

Get number of orders for instrument inst.

inst_oref(inst[, carmnirsplit, notfound, verb])

Get reference order for instrument inst.

inst_rvpixmed(inst[, notfound, verb])

Get the median delta RV per pixel for instrument inst.

inst_spix(inst[, notfound, verb])

Get sampling [pix/SE] for instrument inst.

read_spec_model(filtpl, tpltype)

Read spectrum model.

serval_header_rvcorrection_lisobs(lisobs, inst)

Parameters:

raccoon.telluricutils Module

Telluric utils

Telluric mask file format: - Columns: (0) wavelength [A], (1) “flux”. - Every region (line or set of lines) that should be blocked because it is affected by tellurics is represented by 0110 in the flux column.

Functions

broaden_mask(w, f, dv)

Broaden mask by a velocity dv [m/s].

broaden_wlimits(w1, w2, dv)

Same as broaden_mask, but takes as input the wavelength limits of each mask line, instead of the wavelength and flux (0110).

interp_mask_inverse(w, f[, kind])

Interpolation function of the telluric mask inverted to be used to mask telluric regions in the data.

is_there_overlap_wlimits(w1, w2)

Check if there is overlap between 2 consecutive telluric regions.

join_overlap_wlimits(w1, w2)

Join consecutive telluric regions if there is overlap.

join_overlap_wlimits_once(w1, w2)

Join consecutive telluric regions if there is overlap.

mask2wlimits(w, f)

Get wavelength limits of the telluric lines masked. If a line is given by: wa 0 wb 1 wc 1 wd 0 then get wb as the first limit (store it in w1) and wc as the second limit (store it in w2).

plot_mask(w, f[, ax, fscale, zorder, xlab, ...])

read_mask(filin)

wlimits2mask(w1, w2[, dw])

raccoon.harpsutils Module

Functions

drs_airmass_lisobs(lisobs[, notfound, ext])

drs_berv(filin, inst[, notfound, ext, ...])

Parameters:

drs_berv_lisobs(lisobs, inst[, notfound, ...])

Parameters:

drs_bervdrift(filin, inst[, notfound, ext, ...])

Parameters:

drs_bjd(filin, inst[, notfound, ext, ...])

Parameters:

drs_bjd_lisobs(lisobs, inst[, notfound, ...])

Parameters:

drs_blazefile(filin, inst[, notfound, ext, ...])

Parameters:

drs_blazefile_lisobs(lisobs, inst[, ...])

Parameters:

drs_ccf_read(filin)

drs_ccfparams_lisobs(lisobs, inst[, ...])

Get basic CCF parameters from header of BIS (or CCF) FITS files.

drs_ccfrvgrid_read(filin[, ext])

NAXIS1 length of data axis 1 [161 HARPS] CRVAL1 value of ref pixel CTYPE1 Pixel coordinate system [km/s] CDELT1 CCF steps [km/s]

drs_drift_lisobs(lisobs, inst[, notfound, ext])

Parameters:

drs_e2ds_inst(filin[, outfail, ext])

Try to get the instrument (HARPS or HARPS-N) from the header keywords.

drs_e2ds_int_kwinst(filin[, outfail, ext])

Get the instrument name ('harpn' or 'harps') and the corresponding header keyword start ('HIERARCH TNG ' or 'HIERARCH ESO ').

drs_e2dsred_read(filin[, readblaze, ...])

Read e2ds reduced spectrum flux and wavelength, and optionally the blaze.

drs_e2dsred_readw(filin[, inst, npix, ext])

drs_exptime(filin[, notfound, ext, outfmt])

drs_exptime_lisobs(lisobs[, notfound, ext])

drs_fitsred_read(filin[, ext])

Read an e2ds or a blaze reduced spectrum FITS (i.e. spectrum flux).

drs_ron(filin, inst[, notfound, ext, outfmt])

Parameters:

drs_ron_lisobs(lisobs, inst[, notfound, ext])

Parameters:

drs_rvcorrection(filin, inst[, notfound, ext])

Parameters:

drs_rvcorrection_lisobs(lisobs, inst[, ...])

Parameters:

drs_seeingambi_end_lisobs(lisobs, inst[, ...])

Parameters:

drs_seeingambi_lisobs(lisobs, inst[, ...])

Parameters:

drs_seeingambi_start_lisobs(lisobs, inst[, ...])

Parameters:

drs_snr(filin[, ords, notfound, ext])

Get the SNR of the orders in ords (e.g. from keyword 'HIERARCH ESO DRS SPE EXT SN55').

drs_snr_lisobs(lisobs[, ords, notfound, ext])

Get the SNR of the orders in ords (e.g. from keyword ''HIERARCH ESO DRS SPE EXT SN55') for the observations in lisobs.

headerkwinst(inst[, outfail])

Get the corresponding start of the header keywords depending on the instrument: - for HARPS, the keywords start with 'HIERARCH ESO...' - for HARPS-N, the keywords start with 'HIERARCH TNG...' If fail, return outfail, which by default is NaN.

pix2wave(x, coeff)

Convert pixel to wavelength using the coefficients from the e2ds header, for a single echelle order.

pix2wave_echelle(x, coeff)

wpolycoeff(filin[, inst, ext])

From e2ds header get the polynomial coefficients necessary to transform from pixels to wavelength.