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 |
None
|
initial_location
|
tuple of float
|
Initial guess for the sky position as |
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 |
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 |
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 |
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 |
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 |
ValueError
|
If a per-observation PRF fit fails. |
RuntimeError
|
If an unexpected error occurs during a per-observation fit. |