watson.watson.Watson

class watson.watson.Watson(object_dir, output_dir)

Bases: object

Provides transiting candidate vetting information like centroids and spaceship motion, momentum dumps, neighbours curves inspection and more to give a deeper insight on the quality of the candidate signal.

__init__(object_dir, output_dir)

Methods

__init__(object_dir, output_dir)

compute_centroids_for_tpf(ra, dec, lc_data, ...)

compute_optical_ghost_data(tpf, aperture, ...)

compute_phased_values_and_fill_plot(id, axs, ...)

Phase-folds the input light curve and plots it centered in the given epoch @param id: the candidate name @param axs: the plot axis to be drawn @param lc: the lightkurve object containing the data @param period: the period for the phase-folding @param epoch: the epoch to center the fold @param depth: the transit depth @param duration: the transit duration @param range: the range to be used from the midtransit time in half-duration units.

compute_pixels_curves(tpf)

compute_snr(time, flux, duration, period, epoch)

compute_snr_folded(folded_time, folded_flux, ...)

compute_tpf_diff_image(tpf, period, epoch, ...)

get_transit_model(duration, t0, start_end, ...)

initialize_lc_and_tpfs(id, lc_file, ...[, ...])

light_centroid(snr_map, pixel_values_i, ...)

normalize_lc_data(lc_data)

plot_all_folded_cadences(file_dir, ...[, cpus])

plot_folded_curve(file_dir, id, lc, period, ...)

Plots the phase-folded curve of the candidate for period, 2 * period and period / 2.

plot_folded_tpf(fold_tpf_input)

plot_folded_tpfs(file_dir, mission_prefix, ...)

plot_nb_stars(file_dir, mission, id, lc, ...)

plot_pixels(tpf[, ax, periodogram, ...])

plot_single_transit(single_transit_process_input)

Plots the single transit info: single transit focused curve, drift and background plots, small vs used aperture photometry and tpf flux values around the transit.

plot_tpf(tpf, sector, aperture, dir)

plot_transits_statistics(data_dir, id, ...)

report(id, ra, dec, t0, period, duration, ...)

vetting(id, period, t0, duration, depth, sectors)

Launches the whole vetting procedure that ends up with a validation report :param id: the target star id :param period: the period of the candidate in days :param t0: the epoch in days :param duration: the duration of the transit of the candidate in minutes :param depth: the depth of the transit of the candidate in ppts :param sectors: sectors/quarters/campaigns to be used :param rp_rstar: Rp / Rstar :param a_rstar: Semi-major axis / Rstar :param cpus: number of cpus to be used :param cadence: the cadence to be used to download data, in seconds :param lc_file: the file containing the curve :param lc_data_file: the file containing the raw curve and the motion, centroids and quality flags :param tpfs_dir: the directory containing the tpf files :param apertures_file: the file containing the map of sectors->apertures :param create_fov_plots: whether to generate Field Of View plots.

vetting_field_of_view(indir, mission, tic, ...)

Runs TPFPlotter to get field of view data.

vetting_field_of_view_single(fov_process_input)

Plots FOV for one sector data.

vetting_with_data(candidate_df, star, ...[, ...])

Same than vetting but receiving a candidate dataframe and a star dataframe with one row each.

static compute_phased_values_and_fill_plot(id, axs, lc, period, epoch, depth, duration, rp_rstar, a_rstar, range=5, bins=None, bin_err_mode='flux_err')

Phase-folds the input light curve and plots it centered in the given epoch @param id: the candidate name @param axs: the plot axis to be drawn @param lc: the lightkurve object containing the data @param period: the period for the phase-folding @param epoch: the epoch to center the fold @param depth: the transit depth @param duration: the transit duration @param range: the range to be used from the midtransit time in half-duration units. @param bins: the number of bins @params bin_err_mode: either ‘bin’ or ‘flux_err’ for flux_err std. @return: the drawn axis and the computed bins

static plot_folded_curve(file_dir, id, lc, period, epoch, duration, depth, rp_rstar, a_rstar)

Plots the phase-folded curve of the candidate for period, 2 * period and period / 2. @param file_dir: the directory to store the plot @param id: the target id @param period: the transit period @param epoch: the transit epoch @param duration: the transit duration @param depth: the transit depth

static plot_single_transit(single_transit_process_input)

Plots the single transit info: single transit focused curve, drift and background plots, small vs used aperture photometry and tpf flux values around the transit. @param single_transit_process_input: wrapper class to provide pickable inputs for multiprocessing

vetting(id, period, t0, duration, depth, sectors, rp_rstar=None, a_rstar=None, cpus=None, cadence=None, lc_file=None, lc_data_file=None, tpfs_dir=None, apertures_file=None, create_fov_plots=False, cadence_fov=None, ra=None, dec=None, transits_list=None, v=None, j=None, h=None, k=None, clean=True, transits_mask=None)

Launches the whole vetting procedure that ends up with a validation report :param id: the target star id :param period: the period of the candidate in days :param t0: the epoch in days :param duration: the duration of the transit of the candidate in minutes :param depth: the depth of the transit of the candidate in ppts :param sectors: sectors/quarters/campaigns to be used :param rp_rstar: Rp / Rstar :param a_rstar: Semi-major axis / Rstar :param cpus: number of cpus to be used :param cadence: the cadence to be used to download data, in seconds :param lc_file: the file containing the curve :param lc_data_file: the file containing the raw curve and the motion, centroids and quality flags :param tpfs_dir: the directory containing the tpf files :param apertures_file: the file containing the map of sectors->apertures :param create_fov_plots: whether to generate Field Of View plots. :param cadence_fov: the cadence to use to download fov_plots :param ra: the RA to use to download fov_plots :param dec: the DEC to use to download fov_plots :param transits_list: a list of dictionaries with shape: {‘t0’: value, ‘depth’: value, ‘depth_err’: value} :param v: star V magnitude :param j: star J magnitude :param h: star H magnitude :param k: star K magnitude :param clean: whether to clean all the pngs created for the final pdfs :param transits_mask: array with shape [{P:period, T0:t0, D:d}, …] to use for transits masking before vetting

static vetting_field_of_view(indir, mission, tic, cadence, ra, dec, sectors, source, apertures, cpus=1)

Runs TPFPlotter to get field of view data. :param indir: the data source directory :param mission: the mission of the target :param tic: the target id :param cadence: the exposure time between measurements in seconds :param ra: the right ascension of the target :param dec: the declination of the target :param sectors: the sectors where the target was observed :param source: the source where the aperture was generated [tpf, tesscut] :param apertures: a dict mapping sectors to boolean apertures :param cpus: cores to be used :return: the directory where resulting data is stored

static vetting_field_of_view_single(fov_process_input)

Plots FOV for one sector data. To be called by a multiprocessing queue. :param fov_process_input: wrapper for the sector data

vetting_with_data(candidate_df, star, transits_df, cpus, create_fov_plots=False, cadence_fov=None, transits_mask=None)

Same than vetting but receiving a candidate dataframe and a star dataframe with one row each. :param candidate_df: the candidate dataframe containing id, period, t0, transits and sectors data. :param star: the star dataframe with the star info. :param transits_df: a dataframe containing the transits information with columns ‘t0’, ‘depth’ and ‘depth_err’ :param cpus: the number of cpus to be used. :param create_fov_plots: whether to generate Field Of View plots. :param cadence_fov: the cadence to use to download fov_plots :param transits_mask: array with shape [{P:period, T0:t0, D:d}, …] to use for transits masking before vetting