问题是让我的所有波长峰值都适应高斯,以便尽可能精确地进行介质调整
我的问题是如何自动对所有峰进行高斯调整,而不必手动指定峰的坐标
为此,我实现了最亮峰的高斯调整,但我想将其推广到以下峰。随后,高斯调整将使我能够获得足够精细的多项式调整,以错开波长上的像素
import itertools
records = []
for key, group in itertools.groupby(filters, lambda x: x['dimensionName']):
groups = list(group)
rec = {'dimensionName':key}
# assuming there are no duplicates of the operator
rec['operator'] = min([x['operator'] for x in groups])
# the `sum` expression reduces the list of lists of expressions it is slow but readable. For production, revisit
rec['expressions'] = sum([x['expressions'] for x in groups],[])
records.append(rec)
print(records)
# [{'dimensionName': 'ga:pagePath',
# 'operator': 'PARTIAL',
# 'expressions': ['substring1', 'substring2']}]