Skip to content
Open
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
14 changes: 13 additions & 1 deletion AA_stat/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,19 @@ def preprocess_spectrum(reader, spec_id, kwargs, acc=0.01):
# logger.debug('Returning cached spectrum %s', spec_id)
return spectrum
# logger.debug('Preprocessing new spectrum %s', spec_id)
original = reader[spec_id]
try:
original = reader[spec_id]
except KeyError:
import re
match = re.search(r"scan=(\d+)", str(spec_id))
if match:
scan_num = match.group(1)
try:
original = reader[f"scan={scan_num}"]
except KeyError:
original = reader[scan_num]
Comment thread
levitsky marked this conversation as resolved.
else:
raise
maxpeaks = kwargs.get('maxpeaks', 100)
dynrange = kwargs.get('dynrange', 1000)

Expand Down