Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions transitleastsquares/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def lowest_residuals_in_this_duration(
ootr,
summed_edge_effect_correction,
chosen_transit_row,
datapoints,
constant_residual,
T0_fit_margin,
):

# if nothing is fit, we fit a straight line: signal=1. Then, at dy=1,
# the squared sum of residuals equals the number of datapoints
summed_residual_in_rows = datapoints
# if nothing is fit, we fit a straight line: signal=1.
# this gives a chi2 of value constant_residual
summed_residual_in_rows = constant_residual
best_row = 0
best_depth = 0

Expand Down Expand Up @@ -158,6 +158,7 @@ def search_period(
skipped_all = True
best_row = 0 # shortest and shallowest transit
best_depth = 0
constant_residual = numpy.sum((flux - 1)**2/dy**2)

for duration in durations:
chosen_transit_row = 0
Expand All @@ -176,7 +177,7 @@ def search_period(
),
summed_edge_effect_correction=this_edge_effect_correction,
chosen_transit_row=chosen_transit_row,
datapoints=len(flux),
constant_residual=constant_residual,
T0_fit_margin=T0_fit_margin,
)

Expand Down
4 changes: 2 additions & 2 deletions transitleastsquares/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
TLS_VERSIONING = "1.32"
TLS_DATE = "5 Apr 2024"
TLS_VERSIONING = "1.33"
TLS_DATE = "19 Aug 2024"