Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure each invalid peak has a unique value #560

Merged
merged 1 commit into from
Oct 3, 2023
Merged
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
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
Loading