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

N = 1
observations = []
def solve(d):
    return {'signed_bin': d['k'] if d['k']<d['N']//2 else d['k']-d['N'], 'baseband_frequency': (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_frequency': d['j']*d['B']/d['N'], 'sky_frequency': d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_index': (d['k']+d['N']//2)%d['N'], 'channel_width': d['B']/d['N']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 104.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 100, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 100.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 100, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 92.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 98.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 96.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 101.0, 'shifted_index': 5, 'channel_width': 1.0})], 2: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 105.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 101, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 101.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 101, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 93.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 99.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 97.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 102.0, 'shifted_index': 5, 'channel_width': 1.0})], 3: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 106.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 102, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 102.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 102, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 94.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 100.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 98.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 103.0, 'shifted_index': 5, 'channel_width': 1.0})], 4: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 107.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 103, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 103.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 103, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 95.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 101.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 99.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 104.0, 'shifted_index': 5, 'channel_width': 1.0})], 5: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 108.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 104, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 104.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 104, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 96.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 102.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 100.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 105.0, 'shifted_index': 5, 'channel_width': 1.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-radio-fft-channel-labels

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

N = 1
observations = []
def solve(d):
    return {'signed_bin': d['k'] if d['k']<d['N']//2 else d['k']-d['N'], 'baseband_frequency': (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_frequency': (d['j']-(d['N']-1)/2)*d['B']/d['N'], 'sky_frequency': d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_index': (d['k']+d['N']//2)%d['N'], 'channel_width': d['B']/d['N']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 104.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 100, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 100.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 100, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 92.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 98.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 96.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 101.0, 'shifted_index': 5, 'channel_width': 1.0})], 2: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 105.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 101, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 101.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 101, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 93.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 99.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 97.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 102.0, 'shifted_index': 5, 'channel_width': 1.0})], 3: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 106.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 102, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 102.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 102, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 94.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 100.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 98.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 103.0, 'shifted_index': 5, 'channel_width': 1.0})], 4: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 107.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 103, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 103.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 103, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 95.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 101.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 99.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 104.0, 'shifted_index': 5, 'channel_width': 1.0})], 5: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 108.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 104, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 104.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 104, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 96.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 102.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 100.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 105.0, 'shifted_index': 5, 'channel_width': 1.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 shifted frequency while other fields remain valid.

An even-length complex radio spectrum has N channels and bandwidth B. Unshifted bin k has signed index k below N/2 and k-N otherwise, including negative Nyquist. After fftshift index j denotes j-N/2. Local oscillator L translates baseband to sky frequency. Output fields are defined by: signed_bin = d['k'] if d['k']<d['N']//2 else d['k']-d['N']; baseband_frequency = (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N']; shifted_frequency = (d['j']-d['N']//2)*d['B']/d['N']; sky_frequency = d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N']; shifted_index = (d['k']+d['N']//2)%d['N']; channel_width = d['B']/d['N']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'signed_bin': d['k'] if d['k']<d['N']//2 else d['k']-d['N'], 'baseband_frequency': (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_frequency': (d['j']-d['N']//2)*d['B']/d['N'], 'sky_frequency': d['L']+d['k']*d['B']/d['N'], 'shifted_index': (d['k']+d['N']//2)%d['N'], 'channel_width': d['B']/d['N']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 104.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 100, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 100.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 100, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 92.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 98.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 96.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 101.0, 'shifted_index': 5, 'channel_width': 1.0})], 2: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 105.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 101, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 101.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 101, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 93.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 99.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 97.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 102.0, 'shifted_index': 5, 'channel_width': 1.0})], 3: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 106.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 102, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 102.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 102, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 94.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 100.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 98.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 103.0, 'shifted_index': 5, 'channel_width': 1.0})], 4: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 107.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 103, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 103.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 103, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 95.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 101.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 99.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 104.0, 'shifted_index': 5, 'channel_width': 1.0})], 5: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 108.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 104, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 104.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 104, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 96.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 102.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 100.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 105.0, 'shifted_index': 5, 'channel_width': 1.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-radio-fft-channel-labels

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

N = 1
observations = []
def solve(d):
    return {'signed_bin': d['k'] if d['k']<d['N']//2 else d['k']-d['N'], 'baseband_frequency': (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_frequency': (d['j']-d['N']//2)*d['B']/d['N'], 'sky_frequency': (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_index': (d['k']+d['N']//2)%d['N'], 'channel_width': d['B']/d['N']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 104.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 100, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 100.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 100, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 92.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 98.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 96.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 101.0, 'shifted_index': 5, 'channel_width': 1.0})], 2: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 105.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 101, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 101.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 101, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 93.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 99.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 97.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 102.0, 'shifted_index': 5, 'channel_width': 1.0})], 3: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 106.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 102, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 102.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 102, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 94.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 100.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 98.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 103.0, 'shifted_index': 5, 'channel_width': 1.0})], 4: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 107.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 103, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 103.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 103, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 95.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 101.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 99.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 104.0, 'shifted_index': 5, 'channel_width': 1.0})], 5: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 108.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 104, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 104.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 104, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 96.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 102.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 100.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 105.0, 'shifted_index': 5, 'channel_width': 1.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 sky frequency while other fields remain valid.

An even-length complex radio spectrum has N channels and bandwidth B. Unshifted bin k has signed index k below N/2 and k-N otherwise, including negative Nyquist. After fftshift index j denotes j-N/2. Local oscillator L translates baseband to sky frequency. Output fields are defined by: signed_bin = d['k'] if d['k']<d['N']//2 else d['k']-d['N']; baseband_frequency = (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N']; shifted_frequency = (d['j']-d['N']//2)*d['B']/d['N']; sky_frequency = d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N']; shifted_index = (d['k']+d['N']//2)%d['N']; channel_width = d['B']/d['N']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'signed_bin': d['k'] if d['k']<d['N']//2 else d['k']-d['N'], 'baseband_frequency': (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_frequency': (d['j']-d['N']//2)*d['B']/d['N'], 'sky_frequency': d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_index': d['k']+d['N']//2, 'channel_width': d['B']/d['N']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 104.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 100, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 100.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 100, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 92.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 98.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 96.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 101.0, 'shifted_index': 5, 'channel_width': 1.0})], 2: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 105.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 101, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 101.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 101, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 93.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 99.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 97.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 102.0, 'shifted_index': 5, 'channel_width': 1.0})], 3: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 106.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 102, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 102.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 102, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 94.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 100.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 98.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 103.0, 'shifted_index': 5, 'channel_width': 1.0})], 4: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 107.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 103, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 103.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 103, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 95.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 101.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 99.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 104.0, 'shifted_index': 5, 'channel_width': 1.0})], 5: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 108.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 104, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 104.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 104, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 96.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 102.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 100.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 105.0, 'shifted_index': 5, 'channel_width': 1.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-radio-fft-channel-labels

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

N = 1
observations = []
def solve(d):
    return {'signed_bin': d['k'] if d['k']<d['N']//2 else d['k']-d['N'], 'baseband_frequency': (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_frequency': (d['j']-d['N']//2)*d['B']/d['N'], 'sky_frequency': d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_index': (d['k']+(d['N']-1)//2)%d['N'], 'channel_width': d['B']/d['N']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 104.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 100, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 100.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 100, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 92.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 98.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 96.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 101.0, 'shifted_index': 5, 'channel_width': 1.0})], 2: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 105.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 101, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 101.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 101, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 93.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 99.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 97.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 102.0, 'shifted_index': 5, 'channel_width': 1.0})], 3: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 106.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 102, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 102.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 102, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 94.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 100.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 98.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 103.0, 'shifted_index': 5, 'channel_width': 1.0})], 4: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 107.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 103, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 103.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 103, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 95.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 101.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 99.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 104.0, 'shifted_index': 5, 'channel_width': 1.0})], 5: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 108.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 104, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 104.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 104, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 96.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 102.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 100.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 105.0, 'shifted_index': 5, 'channel_width': 1.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 shifted index while other fields remain valid.

An even-length complex radio spectrum has N channels and bandwidth B. Unshifted bin k has signed index k below N/2 and k-N otherwise, including negative Nyquist. After fftshift index j denotes j-N/2. Local oscillator L translates baseband to sky frequency. Output fields are defined by: signed_bin = d['k'] if d['k']<d['N']//2 else d['k']-d['N']; baseband_frequency = (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N']; shifted_frequency = (d['j']-d['N']//2)*d['B']/d['N']; sky_frequency = d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N']; shifted_index = (d['k']+d['N']//2)%d['N']; channel_width = d['B']/d['N']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'signed_bin': d['k'] if d['k']<d['N']//2 else d['k']-d['N'], 'baseband_frequency': (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_frequency': (d['j']-d['N']//2)*d['B']/d['N'], 'sky_frequency': d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_index': (d['k']+d['N']//2)%d['N'], 'channel_width': d['B']/(d['N']-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 104.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 100, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 100.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 100, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 92.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 98.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 96.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 101.0, 'shifted_index': 5, 'channel_width': 1.0})], 2: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 105.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 101, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 101.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 101, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 93.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 99.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 97.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 102.0, 'shifted_index': 5, 'channel_width': 1.0})], 3: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 106.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 102, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 102.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 102, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 94.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 100.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 98.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 103.0, 'shifted_index': 5, 'channel_width': 1.0})], 4: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 107.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 103, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 103.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 103, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 95.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 101.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 99.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 104.0, 'shifted_index': 5, 'channel_width': 1.0})], 5: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 108.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 104, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 104.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 104, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 96.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 102.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 100.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 105.0, 'shifted_index': 5, 'channel_width': 1.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-radio-fft-channel-labels

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

N = 1
observations = []
def solve(d):
    return {'signed_bin': d['k'] if d['k']<d['N']//2 else d['k']-d['N'], 'baseband_frequency': (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_frequency': (d['j']-d['N']//2)*d['B']/d['N'], 'sky_frequency': d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_index': (d['k']+d['N']//2)%d['N'], 'channel_width': d['N']/d['B']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 104.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 100, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 100.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 100, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 92.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 98.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 96.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 101.0, 'shifted_index': 5, 'channel_width': 1.0})], 2: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 105.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 101, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 101.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 101, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 93.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 99.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 97.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 102.0, 'shifted_index': 5, 'channel_width': 1.0})], 3: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 106.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 102, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 102.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 102, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 94.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 100.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 98.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 103.0, 'shifted_index': 5, 'channel_width': 1.0})], 4: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 107.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 103, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 103.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 103, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 95.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 101.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 99.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 104.0, 'shifted_index': 5, 'channel_width': 1.0})], 5: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 108.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 104, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 104.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 104, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 96.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 102.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 100.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 105.0, 'shifted_index': 5, 'channel_width': 1.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 channel width while other fields remain valid.

An even-length complex radio spectrum has N channels and bandwidth B. Unshifted bin k has signed index k below N/2 and k-N otherwise, including negative Nyquist. After fftshift index j denotes j-N/2. Local oscillator L translates baseband to sky frequency. Output fields are defined by: signed_bin = d['k'] if d['k']<d['N']//2 else d['k']-d['N']; baseband_frequency = (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N']; shifted_frequency = (d['j']-d['N']//2)*d['B']/d['N']; sky_frequency = d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N']; shifted_index = (d['k']+d['N']//2)%d['N']; channel_width = d['B']/d['N']

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['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), '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 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['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']+d['k']), '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)

prompt:
The adapter reports an incorrect channel dispersion 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