Skip to content

Commit

Permalink
Merge pull request #560 from HEXRD/visualize-invalid-peaks
Browse files Browse the repository at this point in the history
Ensure each invalid peak has a unique value
  • Loading branch information
psavery authored Oct 3, 2023
2 parents 7170521 + 412fad1 commit 4bb01a1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hexrd/instrument/hedm_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -1782,6 +1782,7 @@ def pull_spots(self, plane_data, grain_params,
# LOOP OVER PANELS
# =====================================================================
iRefl = 0
next_invalid_peak_id = -100
compl = []
output = dict.fromkeys(self.detectors)
for detector_id, panel in self.detectors.items():
Expand Down Expand Up @@ -1935,7 +1936,7 @@ def pull_spots(self, plane_data, grain_params,
else:
# initialize spot data parameters
# !!! maybe change these to nan to not fuck up writer
peak_id = -999
peak_id = next_invalid_peak_id
sum_int = np.nan
max_int = np.nan
meas_angs = np.nan*np.ones(3)
Expand Down Expand Up @@ -2051,6 +2052,12 @@ def pull_spots(self, plane_data, grain_params,
else:
patch_data = patch_data_raw
pass # end contains_signal

if peak_id < 0:
# The peak is invalid.
# Decrement the next invalid peak ID.
next_invalid_peak_id -= 1

# write output
if filename is not None:
if output_format.lower() == 'text':
Expand Down

0 comments on commit 4bb01a1

Please sign in to comment.