Skip to content

Commit

Permalink
bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kbwestfall committed Oct 26, 2023
1 parent 750af01 commit 0b18d19
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pypeit/edgetrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3944,9 +3944,6 @@ def sync(self, rebuild_pca=True, debug=False):
# Allow the edges to be synced, even if a fit hasn't been done yet
trace_cen = self.edge_cen if self.edge_fit is None else self.edge_fit

# Instantiate the traces to add
trace_add = np.zeros((self.nspec, np.sum(add_edge)), dtype=float)

# If there was only one edge, just add the other one
if side.size == 2:
msgs.warn('Only one edge traced. Ignoring center_mode and adding edge at the '
Expand All @@ -3961,6 +3958,7 @@ def sync(self, rebuild_pca=True, debug=False):
offset = self.par['det_buffer'] - np.amin(trace_cen[:,0]) if add_edge[0] \
else self.nspat - np.amax(trace_cen[:,0]) - self.par['det_buffer']
# Construct the trace to add and insert it
trace_add = np.zeros((self.nspec, np.sum(add_edge)), dtype=float)
trace_add[:,0] = trace_cen[:,0] + offset
self.insert_traces(side[add_edge], trace_add, loc=add_indx[add_edge], mode='sync')
return True
Expand All @@ -3972,6 +3970,9 @@ def sync(self, rebuild_pca=True, debug=False):
while i < maxiter:
msgs.info(f'Beginning syncing iteration : {i+1} (of at most {maxiter})')

# Get the traces
trace_cen = self.edge_cen if self.edge_fit is None else self.edge_fit

# Find the edges to add, what side they're on, and where to insert
# them into the existing trace array. This is done again, in case
# we're going through another iteration
Expand Down Expand Up @@ -5218,7 +5219,7 @@ def order_refine_free_format(self, reference_row, combined_order_tol=1.8, debug=

# If nothing is missing, return
if not np.any(order_missing):
return None, None
return None, None, None

# QA Plot
ofile = None if debug else self.qa_path / 'PNGs' \
Expand Down

0 comments on commit 0b18d19

Please sign in to comment.