broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'wavelength': 2*(d['T']+d['k']*d['d'])*d['q']/d['m'], 'channel_dispersion': 2*d['d']*d['q']/d['m'], 'adjacent_order_wavelength': 2*d['T']*d['q']/d['m']+1, 'free_spectral_interval': 2*d['T']*d['q']/d['m']-2*d['T']*d['q']/(d['m']+1), 'normal_incidence': 2*d['T']/d['m'], 'thickness_from_line': d['line']*d['m']/(2*d['q'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.0, 'free_spectral_interval': 12.0, 'normal_incidence': 60.0, 'thickness_from_line': 60.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 126.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.0, 'free_spectral_interval': 60.0, 'normal_incidence': 240.0, 'thickness_from_line': 30.0}), ({'T': 120, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.0, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.0, 'free_spectral_interval': 3.0, 'normal_incidence': 60.0, 'thickness_from_line': 240.0})], 2: [({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.4, 'free_spectral_interval': 12.100000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 60.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.75, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 127.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.5, 'free_spectral_interval': 60.5, 'normal_incidence': 242.0, 'thickness_from_line': 30.0}), ({'T': 121, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.125, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.1, 'free_spectral_interval': 3.0250000000000004, 'normal_incidence': 60.5, 'thickness_from_line': 240.0})], 3: [({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.8, 'free_spectral_interval': 12.200000000000003, 'normal_incidence': 61.0, 'thickness_from_line': 60.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.0, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 128.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.0, 'free_spectral_interval': 61.0, 'normal_incidence': 244.0, 'thickness_from_line': 30.0}), ({'T': 122, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.25, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.2, 'free_spectral_interval': 3.0500000000000007, 'normal_incidence': 61.0, 'thickness_from_line': 240.0})], 4: [({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.2, 'free_spectral_interval': 12.299999999999997, 'normal_incidence': 61.5, 'thickness_from_line': 60.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.25, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 129.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.5, 'free_spectral_interval': 61.5, 'normal_incidence': 246.0, 'thickness_from_line': 30.0}), ({'T': 123, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.375, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.3, 'free_spectral_interval': 3.0749999999999993, 'normal_incidence': 61.5, 'thickness_from_line': 240.0})], 5: [({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 65.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.6, 'free_spectral_interval': 12.399999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 60.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 31.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 130.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 62.0, 'free_spectral_interval': 62.0, 'normal_incidence': 248.0, 'thickness_from_line': 30.0}), ({'T': 124, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.5, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.4, 'free_spectral_interval': 3.0999999999999996, 'normal_incidence': 62.0, 'thickness_from_line': 240.0})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

evaluation_group: astro-fabry-perot-spectral-order

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'wavelength': 2*(d['T']+d['k']*d['d'])*d['q']/d['m'], 'channel_dispersion': 2*d['d']*d['q']/d['m'], 'adjacent_order_wavelength': 2*d['T']*d['q']/(d['m']-1) if d['m']>1 else None, 'free_spectral_interval': 2*d['T']*d['q']/d['m']-2*d['T']*d['q']/(d['m']+1), 'normal_incidence': 2*d['T']/d['m'], 'thickness_from_line': d['line']*d['m']/(2*d['q'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.0, 'free_spectral_interval': 12.0, 'normal_incidence': 60.0, 'thickness_from_line': 60.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 126.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.0, 'free_spectral_interval': 60.0, 'normal_incidence': 240.0, 'thickness_from_line': 30.0}), ({'T': 120, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.0, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.0, 'free_spectral_interval': 3.0, 'normal_incidence': 60.0, 'thickness_from_line': 240.0})], 2: [({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.4, 'free_spectral_interval': 12.100000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 60.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.75, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 127.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.5, 'free_spectral_interval': 60.5, 'normal_incidence': 242.0, 'thickness_from_line': 30.0}), ({'T': 121, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.125, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.1, 'free_spectral_interval': 3.0250000000000004, 'normal_incidence': 60.5, 'thickness_from_line': 240.0})], 3: [({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.8, 'free_spectral_interval': 12.200000000000003, 'normal_incidence': 61.0, 'thickness_from_line': 60.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.0, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 128.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.0, 'free_spectral_interval': 61.0, 'normal_incidence': 244.0, 'thickness_from_line': 30.0}), ({'T': 122, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.25, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.2, 'free_spectral_interval': 3.0500000000000007, 'normal_incidence': 61.0, 'thickness_from_line': 240.0})], 4: [({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.2, 'free_spectral_interval': 12.299999999999997, 'normal_incidence': 61.5, 'thickness_from_line': 60.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.25, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 129.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.5, 'free_spectral_interval': 61.5, 'normal_incidence': 246.0, 'thickness_from_line': 30.0}), ({'T': 123, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.375, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.3, 'free_spectral_interval': 3.0749999999999993, 'normal_incidence': 61.5, 'thickness_from_line': 240.0})], 5: [({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 65.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.6, 'free_spectral_interval': 12.399999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 60.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 31.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 130.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 62.0, 'free_spectral_interval': 62.0, 'normal_incidence': 248.0, 'thickness_from_line': 30.0}), ({'T': 124, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.5, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.4, 'free_spectral_interval': 3.0999999999999996, 'normal_incidence': 62.0, 'thickness_from_line': 240.0})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect adjacent order wavelength while other fields remain valid.

A reduced Fabry-Perot scan supplies optical thickness T, integer interference order m>0, cosine q of incidence angle, channel thickness step d, channel k, and separate calibration line wavelength line. Wavelength is 2*(T+k*d)*q/m. Interference order is a coordinate label, not the channel index. Output fields are defined by: wavelength = 2*(d['T']+d['k']*d['d'])*d['q']/d['m']; channel_dispersion = 2*d['d']*d['q']/d['m']; adjacent_order_wavelength = 2*d['T']*d['q']/(d['m']+1); free_spectral_interval = 2*d['T']*d['q']/d['m']-2*d['T']*d['q']/(d['m']+1); normal_incidence = 2*d['T']/d['m']; thickness_from_line = d['line']*d['m']/(2*d['q'])

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'wavelength': 2*(d['T']+d['k']*d['d'])*d['q']/d['m'], 'channel_dispersion': 2*d['d']*d['q']/d['m'], 'adjacent_order_wavelength': 2*d['T']*d['q']/(d['m']+1), 'free_spectral_interval': 2*d['T']*d['q']/d['m'], 'normal_incidence': 2*d['T']/d['m'], 'thickness_from_line': d['line']*d['m']/(2*d['q'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.0, 'free_spectral_interval': 12.0, 'normal_incidence': 60.0, 'thickness_from_line': 60.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 126.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.0, 'free_spectral_interval': 60.0, 'normal_incidence': 240.0, 'thickness_from_line': 30.0}), ({'T': 120, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.0, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.0, 'free_spectral_interval': 3.0, 'normal_incidence': 60.0, 'thickness_from_line': 240.0})], 2: [({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.4, 'free_spectral_interval': 12.100000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 60.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.75, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 127.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.5, 'free_spectral_interval': 60.5, 'normal_incidence': 242.0, 'thickness_from_line': 30.0}), ({'T': 121, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.125, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.1, 'free_spectral_interval': 3.0250000000000004, 'normal_incidence': 60.5, 'thickness_from_line': 240.0})], 3: [({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.8, 'free_spectral_interval': 12.200000000000003, 'normal_incidence': 61.0, 'thickness_from_line': 60.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.0, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 128.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.0, 'free_spectral_interval': 61.0, 'normal_incidence': 244.0, 'thickness_from_line': 30.0}), ({'T': 122, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.25, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.2, 'free_spectral_interval': 3.0500000000000007, 'normal_incidence': 61.0, 'thickness_from_line': 240.0})], 4: [({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.2, 'free_spectral_interval': 12.299999999999997, 'normal_incidence': 61.5, 'thickness_from_line': 60.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.25, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 129.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.5, 'free_spectral_interval': 61.5, 'normal_incidence': 246.0, 'thickness_from_line': 30.0}), ({'T': 123, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.375, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.3, 'free_spectral_interval': 3.0749999999999993, 'normal_incidence': 61.5, 'thickness_from_line': 240.0})], 5: [({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 65.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.6, 'free_spectral_interval': 12.399999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 60.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 31.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 130.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 62.0, 'free_spectral_interval': 62.0, 'normal_incidence': 248.0, 'thickness_from_line': 30.0}), ({'T': 124, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.5, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.4, 'free_spectral_interval': 3.0999999999999996, 'normal_incidence': 62.0, 'thickness_from_line': 240.0})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

evaluation_group: astro-fabry-perot-spectral-order

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'wavelength': 2*(d['T']+d['k']*d['d'])*d['q']/d['m'], 'channel_dispersion': 2*d['d']*d['q']/d['m'], 'adjacent_order_wavelength': 2*d['T']*d['q']/(d['m']+1), 'free_spectral_interval': 2*d['T']*d['q']/d['m']**2, 'normal_incidence': 2*d['T']/d['m'], 'thickness_from_line': d['line']*d['m']/(2*d['q'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.0, 'free_spectral_interval': 12.0, 'normal_incidence': 60.0, 'thickness_from_line': 60.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 126.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.0, 'free_spectral_interval': 60.0, 'normal_incidence': 240.0, 'thickness_from_line': 30.0}), ({'T': 120, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.0, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.0, 'free_spectral_interval': 3.0, 'normal_incidence': 60.0, 'thickness_from_line': 240.0})], 2: [({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.4, 'free_spectral_interval': 12.100000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 60.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.75, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 127.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.5, 'free_spectral_interval': 60.5, 'normal_incidence': 242.0, 'thickness_from_line': 30.0}), ({'T': 121, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.125, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.1, 'free_spectral_interval': 3.0250000000000004, 'normal_incidence': 60.5, 'thickness_from_line': 240.0})], 3: [({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.8, 'free_spectral_interval': 12.200000000000003, 'normal_incidence': 61.0, 'thickness_from_line': 60.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.0, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 128.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.0, 'free_spectral_interval': 61.0, 'normal_incidence': 244.0, 'thickness_from_line': 30.0}), ({'T': 122, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.25, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.2, 'free_spectral_interval': 3.0500000000000007, 'normal_incidence': 61.0, 'thickness_from_line': 240.0})], 4: [({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.2, 'free_spectral_interval': 12.299999999999997, 'normal_incidence': 61.5, 'thickness_from_line': 60.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.25, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 129.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.5, 'free_spectral_interval': 61.5, 'normal_incidence': 246.0, 'thickness_from_line': 30.0}), ({'T': 123, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.375, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.3, 'free_spectral_interval': 3.0749999999999993, 'normal_incidence': 61.5, 'thickness_from_line': 240.0})], 5: [({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 65.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.6, 'free_spectral_interval': 12.399999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 60.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 31.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 130.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 62.0, 'free_spectral_interval': 62.0, 'normal_incidence': 248.0, 'thickness_from_line': 30.0}), ({'T': 124, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.5, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.4, 'free_spectral_interval': 3.0999999999999996, 'normal_incidence': 62.0, 'thickness_from_line': 240.0})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect free spectral interval while other fields remain valid.

A reduced Fabry-Perot scan supplies optical thickness T, integer interference order m>0, cosine q of incidence angle, channel thickness step d, channel k, and separate calibration line wavelength line. Wavelength is 2*(T+k*d)*q/m. Interference order is a coordinate label, not the channel index. Output fields are defined by: wavelength = 2*(d['T']+d['k']*d['d'])*d['q']/d['m']; channel_dispersion = 2*d['d']*d['q']/d['m']; adjacent_order_wavelength = 2*d['T']*d['q']/(d['m']+1); free_spectral_interval = 2*d['T']*d['q']/d['m']-2*d['T']*d['q']/(d['m']+1); normal_incidence = 2*d['T']/d['m']; thickness_from_line = d['line']*d['m']/(2*d['q'])

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'wavelength': 2*(d['T']+d['k']*d['d'])*d['q']/d['m'], 'channel_dispersion': 2*d['d']*d['q']/d['m'], 'adjacent_order_wavelength': 2*d['T']*d['q']/(d['m']+1), 'free_spectral_interval': 2*d['T']*d['q']/d['m']-2*d['T']*d['q']/(d['m']+1), 'normal_incidence': 2*d['T']*d['q']/d['m'], 'thickness_from_line': d['line']*d['m']/(2*d['q'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.0, 'free_spectral_interval': 12.0, 'normal_incidence': 60.0, 'thickness_from_line': 60.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 126.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.0, 'free_spectral_interval': 60.0, 'normal_incidence': 240.0, 'thickness_from_line': 30.0}), ({'T': 120, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.0, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.0, 'free_spectral_interval': 3.0, 'normal_incidence': 60.0, 'thickness_from_line': 240.0})], 2: [({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.4, 'free_spectral_interval': 12.100000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 60.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.75, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 127.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.5, 'free_spectral_interval': 60.5, 'normal_incidence': 242.0, 'thickness_from_line': 30.0}), ({'T': 121, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.125, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.1, 'free_spectral_interval': 3.0250000000000004, 'normal_incidence': 60.5, 'thickness_from_line': 240.0})], 3: [({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.8, 'free_spectral_interval': 12.200000000000003, 'normal_incidence': 61.0, 'thickness_from_line': 60.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.0, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 128.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.0, 'free_spectral_interval': 61.0, 'normal_incidence': 244.0, 'thickness_from_line': 30.0}), ({'T': 122, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.25, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.2, 'free_spectral_interval': 3.0500000000000007, 'normal_incidence': 61.0, 'thickness_from_line': 240.0})], 4: [({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.2, 'free_spectral_interval': 12.299999999999997, 'normal_incidence': 61.5, 'thickness_from_line': 60.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.25, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 129.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.5, 'free_spectral_interval': 61.5, 'normal_incidence': 246.0, 'thickness_from_line': 30.0}), ({'T': 123, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.375, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.3, 'free_spectral_interval': 3.0749999999999993, 'normal_incidence': 61.5, 'thickness_from_line': 240.0})], 5: [({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 65.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.6, 'free_spectral_interval': 12.399999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 60.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 31.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 130.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 62.0, 'free_spectral_interval': 62.0, 'normal_incidence': 248.0, 'thickness_from_line': 30.0}), ({'T': 124, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.5, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.4, 'free_spectral_interval': 3.0999999999999996, 'normal_incidence': 62.0, 'thickness_from_line': 240.0})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

evaluation_group: astro-fabry-perot-spectral-order

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'wavelength': 2*(d['T']+d['k']*d['d'])*d['q']/d['m'], 'channel_dispersion': 2*d['d']*d['q']/d['m'], 'adjacent_order_wavelength': 2*d['T']*d['q']/(d['m']+1), 'free_spectral_interval': 2*d['T']*d['q']/d['m']-2*d['T']*d['q']/(d['m']+1), 'normal_incidence': 2*d['T']*d['q']**2/d['m'], 'thickness_from_line': d['line']*d['m']/(2*d['q'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.0, 'free_spectral_interval': 12.0, 'normal_incidence': 60.0, 'thickness_from_line': 60.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 126.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.0, 'free_spectral_interval': 60.0, 'normal_incidence': 240.0, 'thickness_from_line': 30.0}), ({'T': 120, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.0, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.0, 'free_spectral_interval': 3.0, 'normal_incidence': 60.0, 'thickness_from_line': 240.0})], 2: [({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.4, 'free_spectral_interval': 12.100000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 60.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.75, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 127.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.5, 'free_spectral_interval': 60.5, 'normal_incidence': 242.0, 'thickness_from_line': 30.0}), ({'T': 121, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.125, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.1, 'free_spectral_interval': 3.0250000000000004, 'normal_incidence': 60.5, 'thickness_from_line': 240.0})], 3: [({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.8, 'free_spectral_interval': 12.200000000000003, 'normal_incidence': 61.0, 'thickness_from_line': 60.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.0, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 128.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.0, 'free_spectral_interval': 61.0, 'normal_incidence': 244.0, 'thickness_from_line': 30.0}), ({'T': 122, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.25, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.2, 'free_spectral_interval': 3.0500000000000007, 'normal_incidence': 61.0, 'thickness_from_line': 240.0})], 4: [({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.2, 'free_spectral_interval': 12.299999999999997, 'normal_incidence': 61.5, 'thickness_from_line': 60.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.25, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 129.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.5, 'free_spectral_interval': 61.5, 'normal_incidence': 246.0, 'thickness_from_line': 30.0}), ({'T': 123, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.375, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.3, 'free_spectral_interval': 3.0749999999999993, 'normal_incidence': 61.5, 'thickness_from_line': 240.0})], 5: [({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 65.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.6, 'free_spectral_interval': 12.399999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 60.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 31.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 130.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 62.0, 'free_spectral_interval': 62.0, 'normal_incidence': 248.0, 'thickness_from_line': 30.0}), ({'T': 124, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.5, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.4, 'free_spectral_interval': 3.0999999999999996, 'normal_incidence': 62.0, 'thickness_from_line': 240.0})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect normal incidence while other fields remain valid.

A reduced Fabry-Perot scan supplies optical thickness T, integer interference order m>0, cosine q of incidence angle, channel thickness step d, channel k, and separate calibration line wavelength line. Wavelength is 2*(T+k*d)*q/m. Interference order is a coordinate label, not the channel index. Output fields are defined by: wavelength = 2*(d['T']+d['k']*d['d'])*d['q']/d['m']; channel_dispersion = 2*d['d']*d['q']/d['m']; adjacent_order_wavelength = 2*d['T']*d['q']/(d['m']+1); free_spectral_interval = 2*d['T']*d['q']/d['m']-2*d['T']*d['q']/(d['m']+1); normal_incidence = 2*d['T']/d['m']; thickness_from_line = d['line']*d['m']/(2*d['q'])

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'wavelength': 2*(d['T']+d['k']*d['d'])*d['q']/d['m'], 'channel_dispersion': 2*d['d']*d['q']/d['m'], 'adjacent_order_wavelength': 2*d['T']*d['q']/(d['m']+1), 'free_spectral_interval': 2*d['T']*d['q']/d['m']-2*d['T']*d['q']/(d['m']+1), 'normal_incidence': 2*d['T']/d['m'], 'thickness_from_line': d['line']*d['m']/2}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.0, 'free_spectral_interval': 12.0, 'normal_incidence': 60.0, 'thickness_from_line': 60.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 126.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.0, 'free_spectral_interval': 60.0, 'normal_incidence': 240.0, 'thickness_from_line': 30.0}), ({'T': 120, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.0, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.0, 'free_spectral_interval': 3.0, 'normal_incidence': 60.0, 'thickness_from_line': 240.0})], 2: [({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.4, 'free_spectral_interval': 12.100000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 60.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.75, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 127.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.5, 'free_spectral_interval': 60.5, 'normal_incidence': 242.0, 'thickness_from_line': 30.0}), ({'T': 121, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.125, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.1, 'free_spectral_interval': 3.0250000000000004, 'normal_incidence': 60.5, 'thickness_from_line': 240.0})], 3: [({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.8, 'free_spectral_interval': 12.200000000000003, 'normal_incidence': 61.0, 'thickness_from_line': 60.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.0, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 128.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.0, 'free_spectral_interval': 61.0, 'normal_incidence': 244.0, 'thickness_from_line': 30.0}), ({'T': 122, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.25, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.2, 'free_spectral_interval': 3.0500000000000007, 'normal_incidence': 61.0, 'thickness_from_line': 240.0})], 4: [({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.2, 'free_spectral_interval': 12.299999999999997, 'normal_incidence': 61.5, 'thickness_from_line': 60.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.25, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 129.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.5, 'free_spectral_interval': 61.5, 'normal_incidence': 246.0, 'thickness_from_line': 30.0}), ({'T': 123, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.375, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.3, 'free_spectral_interval': 3.0749999999999993, 'normal_incidence': 61.5, 'thickness_from_line': 240.0})], 5: [({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 65.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.6, 'free_spectral_interval': 12.399999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 60.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 31.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 130.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 62.0, 'free_spectral_interval': 62.0, 'normal_incidence': 248.0, 'thickness_from_line': 30.0}), ({'T': 124, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.5, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.4, 'free_spectral_interval': 3.0999999999999996, 'normal_incidence': 62.0, 'thickness_from_line': 240.0})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

evaluation_group: astro-fabry-perot-spectral-order

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'wavelength': 2*(d['T']+d['k']*d['d'])*d['q']/d['m'], 'channel_dispersion': 2*d['d']*d['q']/d['m'], 'adjacent_order_wavelength': 2*d['T']*d['q']/(d['m']+1), 'free_spectral_interval': 2*d['T']*d['q']/d['m']-2*d['T']*d['q']/(d['m']+1), 'normal_incidence': 2*d['T']/d['m'], 'thickness_from_line': d['line']/(2*d['q']*d['m'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.0, 'free_spectral_interval': 12.0, 'normal_incidence': 60.0, 'thickness_from_line': 60.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.0, 'free_spectral_interval': 6.0, 'normal_incidence': 60.0, 'thickness_from_line': 120.0}), ({'T': 120, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 126.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.0, 'free_spectral_interval': 60.0, 'normal_incidence': 240.0, 'thickness_from_line': 30.0}), ({'T': 120, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.0, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.0, 'free_spectral_interval': 3.0, 'normal_incidence': 60.0, 'thickness_from_line': 240.0})], 2: [({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 31.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 63.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.4, 'free_spectral_interval': 12.100000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 60.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 28.75, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.2, 'free_spectral_interval': 6.050000000000001, 'normal_incidence': 60.5, 'thickness_from_line': 120.0}), ({'T': 121, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 127.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 60.5, 'free_spectral_interval': 60.5, 'normal_incidence': 242.0, 'thickness_from_line': 30.0}), ({'T': 121, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.125, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.1, 'free_spectral_interval': 3.0250000000000004, 'normal_incidence': 60.5, 'thickness_from_line': 240.0})], 3: [({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 48.8, 'free_spectral_interval': 12.200000000000003, 'normal_incidence': 61.0, 'thickness_from_line': 60.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.0, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.4, 'free_spectral_interval': 6.100000000000001, 'normal_incidence': 61.0, 'thickness_from_line': 120.0}), ({'T': 122, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 128.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.0, 'free_spectral_interval': 61.0, 'normal_incidence': 244.0, 'thickness_from_line': 30.0}), ({'T': 122, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.25, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.2, 'free_spectral_interval': 3.0500000000000007, 'normal_incidence': 61.0, 'thickness_from_line': 240.0})], 4: [({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.25, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 64.5, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.2, 'free_spectral_interval': 12.299999999999997, 'normal_incidence': 61.5, 'thickness_from_line': 60.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 30.75, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.25, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.6, 'free_spectral_interval': 6.149999999999999, 'normal_incidence': 61.5, 'thickness_from_line': 120.0}), ({'T': 123, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 129.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 61.5, 'free_spectral_interval': 61.5, 'normal_incidence': 246.0, 'thickness_from_line': 30.0}), ({'T': 123, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.375, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.3, 'free_spectral_interval': 3.0749999999999993, 'normal_incidence': 61.5, 'thickness_from_line': 240.0})], 5: [({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 32.5, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 1, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 65.0, 'channel_dispersion': 1.0, 'adjacent_order_wavelength': 49.6, 'free_spectral_interval': 12.399999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 60.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': 2, 'k': 0, 'line': 30}, {'wavelength': 31.0, 'channel_dispersion': 0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 4, 'q': 0.5, 'd': -2, 'k': 3, 'line': 30}, {'wavelength': 29.5, 'channel_dispersion': -0.5, 'adjacent_order_wavelength': 24.8, 'free_spectral_interval': 6.199999999999999, 'normal_incidence': 62.0, 'thickness_from_line': 120.0}), ({'T': 124, 'm': 1, 'q': 0.5, 'd': 2, 'k': 3, 'line': 30}, {'wavelength': 130.0, 'channel_dispersion': 2.0, 'adjacent_order_wavelength': 62.0, 'free_spectral_interval': 62.0, 'normal_incidence': 248.0, 'thickness_from_line': 30.0}), ({'T': 124, 'm': 4, 'q': 0.25, 'd': 0, 'k': 3, 'line': 30}, {'wavelength': 15.5, 'channel_dispersion': 0.0, 'adjacent_order_wavelength': 12.4, 'free_spectral_interval': 3.0999999999999996, 'normal_incidence': 62.0, 'thickness_from_line': 240.0})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect thickness from line while other fields remain valid.

A reduced Fabry-Perot scan supplies optical thickness T, integer interference order m>0, cosine q of incidence angle, channel thickness step d, channel k, and separate calibration line wavelength line. Wavelength is 2*(T+k*d)*q/m. Interference order is a coordinate label, not the channel index. Output fields are defined by: wavelength = 2*(d['T']+d['k']*d['d'])*d['q']/d['m']; channel_dispersion = 2*d['d']*d['q']/d['m']; adjacent_order_wavelength = 2*d['T']*d['q']/(d['m']+1); free_spectral_interval = 2*d['T']*d['q']/d['m']-2*d['T']*d['q']/(d['m']+1); normal_incidence = 2*d['T']/d['m']; thickness_from_line = d['line']*d['m']/(2*d['q'])

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'mode_frequency': d['m']*d['r'], 'retained_mode': d['b']+d['k']*d['s'], 'retained_frequency': d['o']+(d['b']+d['k']*d['s'])*d['r'], 'line_spacing': d['s']*d['r'], 'mode_wavelength': d['c']/(d['o']+d['m']*d['r']), 'first_retained_frequency': d['o']+d['b']*d['r']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 7, 'retained_frequency': 73, 'line_spacing': 10, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 2, 'retained_frequency': 23, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 15, 'retained_frequency': 153, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 3}), ({'o': 3, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 13, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 9.23076923076923, 'first_retained_frequency': 23}), ({'o': 3, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 23, 'retained_mode': 12, 'retained_frequency': 63, 'line_spacing': 10, 'mode_wavelength': 5.217391304347826, 'first_retained_frequency': 13})], 2: [({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 7, 'retained_frequency': 74, 'line_spacing': 10, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 2, 'retained_frequency': 24, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 15, 'retained_frequency': 154, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 4}), ({'o': 4, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 14, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 8.571428571428571, 'first_retained_frequency': 24}), ({'o': 4, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 24, 'retained_mode': 12, 'retained_frequency': 64, 'line_spacing': 10, 'mode_wavelength': 5.0, 'first_retained_frequency': 14})], 3: [({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 7, 'retained_frequency': 75, 'line_spacing': 10, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 2, 'retained_frequency': 25, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 15, 'retained_frequency': 155, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 5}), ({'o': 5, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 15, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 8.0, 'first_retained_frequency': 25}), ({'o': 5, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 25, 'retained_mode': 12, 'retained_frequency': 65, 'line_spacing': 10, 'mode_wavelength': 4.8, 'first_retained_frequency': 15})], 4: [({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 7, 'retained_frequency': 76, 'line_spacing': 10, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 2, 'retained_frequency': 26, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 15, 'retained_frequency': 156, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 6}), ({'o': 6, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 16, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 7.5, 'first_retained_frequency': 26}), ({'o': 6, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 26, 'retained_mode': 12, 'retained_frequency': 66, 'line_spacing': 10, 'mode_wavelength': 4.615384615384615, 'first_retained_frequency': 16})], 5: [({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 7, 'retained_frequency': 77, 'line_spacing': 10, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 2, 'retained_frequency': 27, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 15, 'retained_frequency': 157, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 7}), ({'o': 7, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 17, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 7.0588235294117645, 'first_retained_frequency': 27}), ({'o': 7, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 27, 'retained_mode': 12, 'retained_frequency': 67, 'line_spacing': 10, 'mode_wavelength': 4.444444444444445, 'first_retained_frequency': 17})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

evaluation_group: astro-astro-frequency-comb-coordinate

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'mode_frequency': (d['o']+d['m'])*d['r'], 'retained_mode': d['b']+d['k']*d['s'], 'retained_frequency': d['o']+(d['b']+d['k']*d['s'])*d['r'], 'line_spacing': d['s']*d['r'], 'mode_wavelength': d['c']/(d['o']+d['m']*d['r']), 'first_retained_frequency': d['o']+d['b']*d['r']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 7, 'retained_frequency': 73, 'line_spacing': 10, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 2, 'retained_frequency': 23, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 23}), ({'o': 3, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 43, 'retained_mode': 15, 'retained_frequency': 153, 'line_spacing': 30, 'mode_wavelength': 2.7906976744186047, 'first_retained_frequency': 3}), ({'o': 3, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 13, 'retained_mode': 17, 'retained_frequency': 173, 'line_spacing': 30, 'mode_wavelength': 9.23076923076923, 'first_retained_frequency': 23}), ({'o': 3, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 23, 'retained_mode': 12, 'retained_frequency': 63, 'line_spacing': 10, 'mode_wavelength': 5.217391304347826, 'first_retained_frequency': 13})], 2: [({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 7, 'retained_frequency': 74, 'line_spacing': 10, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 2, 'retained_frequency': 24, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 24}), ({'o': 4, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 44, 'retained_mode': 15, 'retained_frequency': 154, 'line_spacing': 30, 'mode_wavelength': 2.727272727272727, 'first_retained_frequency': 4}), ({'o': 4, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 14, 'retained_mode': 17, 'retained_frequency': 174, 'line_spacing': 30, 'mode_wavelength': 8.571428571428571, 'first_retained_frequency': 24}), ({'o': 4, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 24, 'retained_mode': 12, 'retained_frequency': 64, 'line_spacing': 10, 'mode_wavelength': 5.0, 'first_retained_frequency': 14})], 3: [({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 7, 'retained_frequency': 75, 'line_spacing': 10, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 2, 'retained_frequency': 25, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 25}), ({'o': 5, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 45, 'retained_mode': 15, 'retained_frequency': 155, 'line_spacing': 30, 'mode_wavelength': 2.6666666666666665, 'first_retained_frequency': 5}), ({'o': 5, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 15, 'retained_mode': 17, 'retained_frequency': 175, 'line_spacing': 30, 'mode_wavelength': 8.0, 'first_retained_frequency': 25}), ({'o': 5, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 25, 'retained_mode': 12, 'retained_frequency': 65, 'line_spacing': 10, 'mode_wavelength': 4.8, 'first_retained_frequency': 15})], 4: [({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 7, 'retained_frequency': 76, 'line_spacing': 10, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 2, 'retained_frequency': 26, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 26}), ({'o': 6, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 46, 'retained_mode': 15, 'retained_frequency': 156, 'line_spacing': 30, 'mode_wavelength': 2.608695652173913, 'first_retained_frequency': 6}), ({'o': 6, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 16, 'retained_mode': 17, 'retained_frequency': 176, 'line_spacing': 30, 'mode_wavelength': 7.5, 'first_retained_frequency': 26}), ({'o': 6, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 26, 'retained_mode': 12, 'retained_frequency': 66, 'line_spacing': 10, 'mode_wavelength': 4.615384615384615, 'first_retained_frequency': 16})], 5: [({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 1, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 7, 'retained_frequency': 77, 'line_spacing': 10, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 2, 'k': 0, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 2, 'retained_frequency': 27, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 27}), ({'o': 7, 'r': 10, 'm': 4, 's': 3, 'b': 0, 'k': 5, 'c': 120}, {'mode_frequency': 47, 'retained_mode': 15, 'retained_frequency': 157, 'line_spacing': 30, 'mode_wavelength': 2.5531914893617023, 'first_retained_frequency': 7}), ({'o': 7, 'r': 10, 'm': 1, 's': 3, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 17, 'retained_mode': 17, 'retained_frequency': 177, 'line_spacing': 30, 'mode_wavelength': 7.0588235294117645, 'first_retained_frequency': 27}), ({'o': 7, 'r': 5, 'm': 4, 's': 2, 'b': 2, 'k': 5, 'c': 120}, {'mode_frequency': 27, 'retained_mode': 12, 'retained_frequency': 67, 'line_spacing': 10, 'mode_wavelength': 4.444444444444445, 'first_retained_frequency': 17})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect mode frequency while other fields remain valid.

An astronomical calibration comb has carrier-envelope offset o, repetition frequency r>0, integer mode m, and filter stride s with first retained mode b. Frequencies f=o+m*r. Detector channel k in the filtered comb corresponds to mode b+k*s; c is a supplied speed constant. Output fields are defined by: mode_frequency = d['o']+d['m']*d['r']; retained_mode = d['b']+d['k']*d['s']; retained_frequency = d['o']+(d['b']+d['k']*d['s'])*d['r']; line_spacing = d['s']*d['r']; mode_wavelength = d['c']/(d['o']+d['m']*d['r']); first_retained_frequency = d['o']+d['b']*d['r']

split: open-access