Skip to content

Commit

Permalink
Fix lightcurve axis limits for forced fits (#257)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Stewart <[email protected]>
  • Loading branch information
ddobie and ajstewart authored Apr 12, 2021
1 parent 249a678 commit 104041d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions vasttools/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,18 @@ def plot_lightcurve(self, sigma_thresh=5, figsize=(8, 4),
label=label)

if yaxis_start == "0":
max_y = np.nanmax(
detections[flux_col].tolist() +
(sigma_thresh * upper_lims[err_value_col]).tolist()
)
if use_forced_for_limits or self.pipeline:
max_y = np.nanmax(
detections[flux_col].tolist() +
upper_lims[value_col].tolist()
)
elif use_forced_for_all:
max_y = np.nanmax(detections[flux_col].tolist())
else:
max_y = np.nanmax(
detections[flux_col].tolist() +
(sigma_thresh * upper_lims[err_value_col]).tolist()
)
ax.set_ylim(
bottom=0,
top=max_y * 1.1
Expand Down

0 comments on commit 104041d

Please sign in to comment.