Skip to content

MultiLocalize

Bases: object

__init__(loc_object_list)

Initialize a collection of Localize objects.

Parameters:

Name Type Description Default
loc_object_list list[Localize]

List of Localize objects corresponding to different quarters or sectors. Objects with no valid TCEs are excluded.

required

Raises:

Type Description
ValueError

If no Localize objects contain valid TCEs.

fit_to_quarters(which_tce=None, initial_location=None)

Fit a joint PRF model to the transit depth maps across observations.

Parameters:

Name Type Description Default
which_tce int

Index of the TCE in self.tces to fit.

None
initial_location tuple of float

Initial guess for the sky position as (ra, dec). If None, the position is initialized using ra_bonus and dec_bonus if provided, otherwise ra_targ and dec_targ.

None

Returns:

Name Type Description
result MinimizerResult

Full fit result object.

fit_metrics dict

Dictionary containing the fitted sky position and its 1-sigma uncertainties. Contains "centerra", "sigmara", "centerdec", and "sigmadec".

Raises:

Type Description
KeyError

If the requested TCE is not present in any observation.

ValueError

If the PRF fit fails or the requested TCE cannot be fit.

RuntimeError

If an unexpected error occurs during the PRF fit.

get_quarters_offset(fit_metrics)

Calculate the angular offset between the fitted and reference positions.

Parameters:

Name Type Description Default
fit_metrics dict

Dictionary containing the fitted sky position and its 1-sigma uncertainties. Required keys are 'centerra', 'centerdec', 'sigmara', and 'sigmadec'.

required

Returns:

Name Type Description
nsigma float

Offset between the fitted and reference positions in units of the propagated 1-sigma uncertainty.

dist float

Angular separation between the fitted and reference positions in degrees.

sigma_dist float

1-sigma uncertainty on the angular separation in degrees.

mah_dist float

Mahalanobis distance between the fitted and reference positions.

Raises:

Type Description
KeyError

If a required key is missing from fit_metrics.

plot_multi_quarter(fit_metrics, which_tce, savefig=False, save_directory='.')

Generate a localization plot combining fits from multiple observations.

Parameters:

Name Type Description Default
fit_metrics dict

Dictionary containing the joint fitted sky position and its 1-sigma uncertainties. Required keys are 'centerra', 'centerdec', 'sigmara', and 'sigmadec'.

required
which_tce int

Index of the TCE to visualize.

required
savefig bool

If True, save the figure to disk (default False).

False
save_directory str

Directory where the figure will be saved (default '.').

'.'

Raises:

Type Description
KeyError

If which_tce is not present in an observation.

ValueError

If a per-observation PRF fit fails.

RuntimeError

If an unexpected error occurs during a per-observation fit.