ramjet.analysis.transit_fitter

Code for producing a transit fitting.

Module Contents

Classes

TransitFitter(tic_id, sectors=None) A class to fit a transit.
class TransitFitter(tic_id, sectors=None)[source]

A class to fit a transit.

__init__(self, tic_id, sectors=None)[source]

Initialize self. See help(type(self)) for accurate signature.

bokeh_application(self, bokeh_document)[source]
create_lightcurve_figure(self)[source]
create_folded_figured_based_on_clicks_in_unfolded_figure(self, unfolded_figure)[source]
create_mcmc_fit_figures(self, run_fitting_button)[source]
static plot_lightcurve_source(figure: Figure, data_source: ColumnDataSource, time_column_name: str = 'Time (BTJD)', flux_column_name: str = 'Relative flux', color_value_column_name: str = 'Time (BTJD)')[source]

Plots the lightcurve data source on the passed figure.

Parameters:
  • figure – The figure to plot to.
  • data_source – The data source containing the lightcurve data.
  • time_column_name – The name of the time column whose values will be used on the x axis.
  • flux_column_name – The name of the flux column whose values will be used on the y axis.
  • color_value_column_name – The name of the column whose values will be used to determine data point color.
stitch_fluxes_flux_errors_and_times_for_target_from_mast(self, tic_id: int, sectors: Union[int, List[int], None] = None)[source]

Downloads lightcurves from MAST for a given TIC ID and stitches them together.

Parameters:
  • tic_id – The target TIC ID.
  • sectors – The sectors to download and stitch together. Defaults to None which will download all available.
Returns:

The fluxes, flux errors, and times of the stitched lightcurves.

static calculate_epoch_and_period_from_approximate_event_times(event_times: List[float])[source]

Calculates the period and epoch of a signal given selected event times. The epoch is set to the first event chronologically.

Parameters:event_times – The times of the events.
Returns:The epoch and period.
static fold_times(times: np.ndarray, epoch: float, period: float)[source]

Folds an array of times based on an epoch and period.

Parameters:
  • times – The times to fold.
  • epoch – The epoch of the fold.
  • period – The period of the fold.
Returns:

The folded times.

static round_series_to_significant_figures(series: pd.Series, significant_figures: int)[source]

Rounds a series to a given number of significant figures.

Parameters:
  • series – The series to round.
  • significant_figures – The number of signficant figures to round to.
Returns:

The rounded series.

server