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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['L0']+d['b']*(d['p']-d['r']), 'next_wavelength': d['L0']*d['b']**(d['p']+1-d['r']), 'redshifted_pixel': d['p']+d['k'], 'rest_pixel': d['p']-d['k'], 'coarse_ratio': d['b']**d['s'], 'channel_width': d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 2, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 8, 'next_wavelength': 16, 'redshifted_pixel': 4, 'rest_pixel': 0, 'coarse_ratio': 4, 'channel_width': 8}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 3, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 72, 'next_wavelength': 216, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 9, 'channel_width': 144}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 2, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 3, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 16})], 2: [({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 3, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 5, 'rest_pixel': 1, 'coarse_ratio': 4, 'channel_width': 16}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 3, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 216, 'next_wavelength': 648, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 9, 'channel_width': 432}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 2, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 32})], 3: [({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 3, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 648, 'next_wavelength': 1944, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 9, 'channel_width': 1296}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 2, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 64})], 4: [({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 3, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 1944, 'next_wavelength': 5832, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 9, 'channel_width': 3888}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 2, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 128})], 5: [({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 8, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 3, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 5832, 'next_wavelength': 17496, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 9, 'channel_width': 11664}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 2, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 9, 'coarse_ratio': 4, 'channel_width': 256})]}
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-logarithmic-spectral-index

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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['L0']*d['b']**d['p'], 'next_wavelength': d['L0']*d['b']**(d['p']+1-d['r']), 'redshifted_pixel': d['p']+d['k'], 'rest_pixel': d['p']-d['k'], 'coarse_ratio': d['b']**d['s'], 'channel_width': d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 2, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 8, 'next_wavelength': 16, 'redshifted_pixel': 4, 'rest_pixel': 0, 'coarse_ratio': 4, 'channel_width': 8}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 3, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 72, 'next_wavelength': 216, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 9, 'channel_width': 144}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 2, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 3, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 16})], 2: [({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 3, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 5, 'rest_pixel': 1, 'coarse_ratio': 4, 'channel_width': 16}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 3, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 216, 'next_wavelength': 648, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 9, 'channel_width': 432}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 2, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 32})], 3: [({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 3, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 648, 'next_wavelength': 1944, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 9, 'channel_width': 1296}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 2, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 64})], 4: [({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 3, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 1944, 'next_wavelength': 5832, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 9, 'channel_width': 3888}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 2, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 128})], 5: [({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 8, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 3, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 5832, 'next_wavelength': 17496, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 9, 'channel_width': 11664}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 2, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 9, 'coarse_ratio': 4, 'channel_width': 256})]}
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 discrete logarithmic spectrum uses lambda(p)=L0*b**(p-r), b a positive integer >=2 and integer p,r. Redshift by a grid factor b**k is an additive pixel shift k. Coarse bin stride s changes the multiplicative channel ratio. Output fields are defined by: wavelength = d['L0']*d['b']**(d['p']-d['r']); next_wavelength = d['L0']*d['b']**(d['p']+1-d['r']); redshifted_pixel = d['p']+d['k']; rest_pixel = d['p']-d['k']; coarse_ratio = d['b']**d['s']; channel_width = d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['L0']*d['b']**(d['p']-d['r']), 'next_wavelength': d['L0']*d['b']**(d['p']-d['r'])+d['b'], 'redshifted_pixel': d['p']+d['k'], 'rest_pixel': d['p']-d['k'], 'coarse_ratio': d['b']**d['s'], 'channel_width': d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 2, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 8, 'next_wavelength': 16, 'redshifted_pixel': 4, 'rest_pixel': 0, 'coarse_ratio': 4, 'channel_width': 8}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 3, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 72, 'next_wavelength': 216, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 9, 'channel_width': 144}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 2, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 3, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 16})], 2: [({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 3, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 5, 'rest_pixel': 1, 'coarse_ratio': 4, 'channel_width': 16}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 3, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 216, 'next_wavelength': 648, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 9, 'channel_width': 432}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 2, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 32})], 3: [({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 3, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 648, 'next_wavelength': 1944, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 9, 'channel_width': 1296}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 2, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 64})], 4: [({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 3, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 1944, 'next_wavelength': 5832, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 9, 'channel_width': 3888}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 2, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 128})], 5: [({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 8, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 3, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 5832, 'next_wavelength': 17496, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 9, 'channel_width': 11664}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 2, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 9, 'coarse_ratio': 4, 'channel_width': 256})]}
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-logarithmic-spectral-index

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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['L0']*d['b']**(d['p']-d['r']), 'next_wavelength': d['L0']*d['b']**(d['p']-d['r'])+1, 'redshifted_pixel': d['p']+d['k'], 'rest_pixel': d['p']-d['k'], 'coarse_ratio': d['b']**d['s'], 'channel_width': d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 2, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 8, 'next_wavelength': 16, 'redshifted_pixel': 4, 'rest_pixel': 0, 'coarse_ratio': 4, 'channel_width': 8}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 3, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 72, 'next_wavelength': 216, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 9, 'channel_width': 144}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 2, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 3, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 16})], 2: [({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 3, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 5, 'rest_pixel': 1, 'coarse_ratio': 4, 'channel_width': 16}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 3, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 216, 'next_wavelength': 648, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 9, 'channel_width': 432}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 2, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 32})], 3: [({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 3, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 648, 'next_wavelength': 1944, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 9, 'channel_width': 1296}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 2, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 64})], 4: [({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 3, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 1944, 'next_wavelength': 5832, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 9, 'channel_width': 3888}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 2, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 128})], 5: [({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 8, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 3, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 5832, 'next_wavelength': 17496, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 9, 'channel_width': 11664}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 2, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 9, 'coarse_ratio': 4, 'channel_width': 256})]}
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 next wavelength while other fields remain valid.

A discrete logarithmic spectrum uses lambda(p)=L0*b**(p-r), b a positive integer >=2 and integer p,r. Redshift by a grid factor b**k is an additive pixel shift k. Coarse bin stride s changes the multiplicative channel ratio. Output fields are defined by: wavelength = d['L0']*d['b']**(d['p']-d['r']); next_wavelength = d['L0']*d['b']**(d['p']+1-d['r']); redshifted_pixel = d['p']+d['k']; rest_pixel = d['p']-d['k']; coarse_ratio = d['b']**d['s']; channel_width = d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['L0']*d['b']**(d['p']-d['r']), 'next_wavelength': d['L0']*d['b']**(d['p']+1-d['r']), 'redshifted_pixel': d['p']*d['b']**d['k'], 'rest_pixel': d['p']-d['k'], 'coarse_ratio': d['b']**d['s'], 'channel_width': d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 2, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 8, 'next_wavelength': 16, 'redshifted_pixel': 4, 'rest_pixel': 0, 'coarse_ratio': 4, 'channel_width': 8}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 3, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 72, 'next_wavelength': 216, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 9, 'channel_width': 144}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 2, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 3, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 16})], 2: [({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 3, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 5, 'rest_pixel': 1, 'coarse_ratio': 4, 'channel_width': 16}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 3, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 216, 'next_wavelength': 648, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 9, 'channel_width': 432}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 2, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 32})], 3: [({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 3, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 648, 'next_wavelength': 1944, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 9, 'channel_width': 1296}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 2, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 64})], 4: [({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 3, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 1944, 'next_wavelength': 5832, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 9, 'channel_width': 3888}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 2, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 128})], 5: [({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 8, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 3, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 5832, 'next_wavelength': 17496, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 9, 'channel_width': 11664}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 2, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 9, 'coarse_ratio': 4, 'channel_width': 256})]}
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-logarithmic-spectral-index

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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['L0']*d['b']**(d['p']-d['r']), 'next_wavelength': d['L0']*d['b']**(d['p']+1-d['r']), 'redshifted_pixel': d['p']-d['k'], 'rest_pixel': d['p']-d['k'], 'coarse_ratio': d['b']**d['s'], 'channel_width': d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 2, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 8, 'next_wavelength': 16, 'redshifted_pixel': 4, 'rest_pixel': 0, 'coarse_ratio': 4, 'channel_width': 8}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 3, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 72, 'next_wavelength': 216, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 9, 'channel_width': 144}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 2, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 3, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 16})], 2: [({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 3, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 5, 'rest_pixel': 1, 'coarse_ratio': 4, 'channel_width': 16}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 3, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 216, 'next_wavelength': 648, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 9, 'channel_width': 432}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 2, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 32})], 3: [({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 3, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 648, 'next_wavelength': 1944, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 9, 'channel_width': 1296}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 2, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 64})], 4: [({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 3, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 1944, 'next_wavelength': 5832, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 9, 'channel_width': 3888}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 2, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 128})], 5: [({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 8, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 3, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 5832, 'next_wavelength': 17496, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 9, 'channel_width': 11664}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 2, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 9, 'coarse_ratio': 4, 'channel_width': 256})]}
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 redshifted pixel while other fields remain valid.

A discrete logarithmic spectrum uses lambda(p)=L0*b**(p-r), b a positive integer >=2 and integer p,r. Redshift by a grid factor b**k is an additive pixel shift k. Coarse bin stride s changes the multiplicative channel ratio. Output fields are defined by: wavelength = d['L0']*d['b']**(d['p']-d['r']); next_wavelength = d['L0']*d['b']**(d['p']+1-d['r']); redshifted_pixel = d['p']+d['k']; rest_pixel = d['p']-d['k']; coarse_ratio = d['b']**d['s']; channel_width = d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['L0']*d['b']**(d['p']-d['r']), 'next_wavelength': d['L0']*d['b']**(d['p']+1-d['r']), 'redshifted_pixel': d['p']+d['k'], 'rest_pixel': d['p']+d['k'], 'coarse_ratio': d['b']**d['s'], 'channel_width': d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 2, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 8, 'next_wavelength': 16, 'redshifted_pixel': 4, 'rest_pixel': 0, 'coarse_ratio': 4, 'channel_width': 8}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 3, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 72, 'next_wavelength': 216, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 9, 'channel_width': 144}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 2, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 3, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 16})], 2: [({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 3, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 5, 'rest_pixel': 1, 'coarse_ratio': 4, 'channel_width': 16}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 3, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 216, 'next_wavelength': 648, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 9, 'channel_width': 432}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 2, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 32})], 3: [({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 3, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 648, 'next_wavelength': 1944, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 9, 'channel_width': 1296}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 2, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 64})], 4: [({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 3, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 1944, 'next_wavelength': 5832, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 9, 'channel_width': 3888}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 2, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 128})], 5: [({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 8, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 3, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 5832, 'next_wavelength': 17496, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 9, 'channel_width': 11664}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 2, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 9, 'coarse_ratio': 4, 'channel_width': 256})]}
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-logarithmic-spectral-index

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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['L0']*d['b']**(d['p']-d['r']), 'next_wavelength': d['L0']*d['b']**(d['p']+1-d['r']), 'redshifted_pixel': d['p']+d['k'], 'rest_pixel': d['p']/d['b']**d['k'], 'coarse_ratio': d['b']**d['s'], 'channel_width': d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 2, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 8, 'next_wavelength': 16, 'redshifted_pixel': 4, 'rest_pixel': 0, 'coarse_ratio': 4, 'channel_width': 8}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 3, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 72, 'next_wavelength': 216, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 9, 'channel_width': 144}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 2, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 3, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 16})], 2: [({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 3, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 5, 'rest_pixel': 1, 'coarse_ratio': 4, 'channel_width': 16}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 3, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 216, 'next_wavelength': 648, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 9, 'channel_width': 432}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 2, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 32})], 3: [({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 3, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 648, 'next_wavelength': 1944, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 9, 'channel_width': 1296}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 2, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 64})], 4: [({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 3, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 1944, 'next_wavelength': 5832, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 9, 'channel_width': 3888}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 2, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 128})], 5: [({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 8, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 3, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 5832, 'next_wavelength': 17496, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 9, 'channel_width': 11664}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 2, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 9, 'coarse_ratio': 4, 'channel_width': 256})]}
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 rest pixel while other fields remain valid.

A discrete logarithmic spectrum uses lambda(p)=L0*b**(p-r), b a positive integer >=2 and integer p,r. Redshift by a grid factor b**k is an additive pixel shift k. Coarse bin stride s changes the multiplicative channel ratio. Output fields are defined by: wavelength = d['L0']*d['b']**(d['p']-d['r']); next_wavelength = d['L0']*d['b']**(d['p']+1-d['r']); redshifted_pixel = d['p']+d['k']; rest_pixel = d['p']-d['k']; coarse_ratio = d['b']**d['s']; channel_width = d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['L0']*d['b']**(d['p']-d['r']), 'next_wavelength': d['L0']*d['b']**(d['p']+1-d['r']), 'redshifted_pixel': d['p']+d['k'], 'rest_pixel': d['p']-d['k'], 'coarse_ratio': d['b']*d['s'], 'channel_width': d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 2, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 8, 'next_wavelength': 16, 'redshifted_pixel': 4, 'rest_pixel': 0, 'coarse_ratio': 4, 'channel_width': 8}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 3, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 72, 'next_wavelength': 216, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 9, 'channel_width': 144}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 2, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 3, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 16})], 2: [({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 3, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 5, 'rest_pixel': 1, 'coarse_ratio': 4, 'channel_width': 16}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 3, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 216, 'next_wavelength': 648, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 9, 'channel_width': 432}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 2, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 32})], 3: [({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 3, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 648, 'next_wavelength': 1944, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 9, 'channel_width': 1296}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 2, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 64})], 4: [({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 3, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 1944, 'next_wavelength': 5832, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 9, 'channel_width': 3888}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 2, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 128})], 5: [({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 8, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 3, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 5832, 'next_wavelength': 17496, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 9, 'channel_width': 11664}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 2, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 9, 'coarse_ratio': 4, 'channel_width': 256})]}
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-logarithmic-spectral-index

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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['L0']*d['b']**(d['p']-d['r']), 'next_wavelength': d['L0']*d['b']**(d['p']+1-d['r']), 'redshifted_pixel': d['p']+d['k'], 'rest_pixel': d['p']-d['k'], 'coarse_ratio': d['b'], 'channel_width': d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 2, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 8, 'next_wavelength': 16, 'redshifted_pixel': 4, 'rest_pixel': 0, 'coarse_ratio': 4, 'channel_width': 8}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 3, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 72, 'next_wavelength': 216, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 9, 'channel_width': 144}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 2, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 3, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 16})], 2: [({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 3, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 5, 'rest_pixel': 1, 'coarse_ratio': 4, 'channel_width': 16}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 3, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 216, 'next_wavelength': 648, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 9, 'channel_width': 432}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 2, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 32})], 3: [({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 3, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 648, 'next_wavelength': 1944, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 9, 'channel_width': 1296}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 2, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 64})], 4: [({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 3, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 1944, 'next_wavelength': 5832, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 9, 'channel_width': 3888}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 2, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 128})], 5: [({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 8, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 3, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 5832, 'next_wavelength': 17496, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 9, 'channel_width': 11664}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 2, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 9, 'coarse_ratio': 4, 'channel_width': 256})]}
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 coarse ratio while other fields remain valid.

A discrete logarithmic spectrum uses lambda(p)=L0*b**(p-r), b a positive integer >=2 and integer p,r. Redshift by a grid factor b**k is an additive pixel shift k. Coarse bin stride s changes the multiplicative channel ratio. Output fields are defined by: wavelength = d['L0']*d['b']**(d['p']-d['r']); next_wavelength = d['L0']*d['b']**(d['p']+1-d['r']); redshifted_pixel = d['p']+d['k']; rest_pixel = d['p']-d['k']; coarse_ratio = d['b']**d['s']; channel_width = d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['L0']*d['b']**(d['p']-d['r']), 'next_wavelength': d['L0']*d['b']**(d['p']+1-d['r']), 'redshifted_pixel': d['p']+d['k'], 'rest_pixel': d['p']-d['k'], 'coarse_ratio': d['b']**d['s'], 'channel_width': d['L0']*(d['b']-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 2, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 8, 'next_wavelength': 16, 'redshifted_pixel': 4, 'rest_pixel': 0, 'coarse_ratio': 4, 'channel_width': 8}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 3, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 72, 'next_wavelength': 216, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 9, 'channel_width': 144}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 2, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 3, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 16})], 2: [({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 3, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 5, 'rest_pixel': 1, 'coarse_ratio': 4, 'channel_width': 16}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 3, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 216, 'next_wavelength': 648, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 9, 'channel_width': 432}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 2, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 32})], 3: [({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 3, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 648, 'next_wavelength': 1944, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 9, 'channel_width': 1296}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 2, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 64})], 4: [({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 3, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 1944, 'next_wavelength': 5832, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 9, 'channel_width': 3888}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 2, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 128})], 5: [({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 8, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 3, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 5832, 'next_wavelength': 17496, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 9, 'channel_width': 11664}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 2, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 9, 'coarse_ratio': 4, 'channel_width': 256})]}
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-logarithmic-spectral-index

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

N = 1
observations = []
def solve(d):
    return {'wavelength': d['L0']*d['b']**(d['p']-d['r']), 'next_wavelength': d['L0']*d['b']**(d['p']+1-d['r']), 'redshifted_pixel': d['p']+d['k'], 'rest_pixel': d['p']-d['k'], 'coarse_ratio': d['b']**d['s'], 'channel_width': d['b']-1}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 2, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 8, 'next_wavelength': 16, 'redshifted_pixel': 4, 'rest_pixel': 0, 'coarse_ratio': 4, 'channel_width': 8}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 3, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 72, 'next_wavelength': 216, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 9, 'channel_width': 144}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 2, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 3, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 16})], 2: [({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 3, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 16, 'next_wavelength': 32, 'redshifted_pixel': 5, 'rest_pixel': 1, 'coarse_ratio': 4, 'channel_width': 16}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 3, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 216, 'next_wavelength': 648, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 9, 'channel_width': 432}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 2, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 4, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 32})], 3: [({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 4, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 32, 'next_wavelength': 64, 'redshifted_pixel': 6, 'rest_pixel': 2, 'coarse_ratio': 4, 'channel_width': 32}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 3, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 648, 'next_wavelength': 1944, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 9, 'channel_width': 1296}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 2, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 5, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 64})], 4: [({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 5, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 64, 'next_wavelength': 128, 'redshifted_pixel': 7, 'rest_pixel': 3, 'coarse_ratio': 4, 'channel_width': 64}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 7, 'coarse_ratio': 4, 'channel_width': 256}), ({'L0': 8, 'b': 3, 'p': 7, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 1944, 'next_wavelength': 5832, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 9, 'channel_width': 3888}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 9, 'rest_pixel': 5, 'coarse_ratio': 2, 'channel_width': 256}), ({'L0': 8, 'b': 2, 'p': 7, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 6, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 128})], 5: [({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 6, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 128, 'next_wavelength': 256, 'redshifted_pixel': 8, 'rest_pixel': 4, 'coarse_ratio': 4, 'channel_width': 128}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 0, 's': 2}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 8, 'rest_pixel': 8, 'coarse_ratio': 4, 'channel_width': 512}), ({'L0': 8, 'b': 3, 'p': 8, 'r': 2, 'k': 2, 's': 2}, {'wavelength': 5832, 'next_wavelength': 17496, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 9, 'channel_width': 11664}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 2, 'k': 2, 's': 1}, {'wavelength': 512, 'next_wavelength': 1024, 'redshifted_pixel': 10, 'rest_pixel': 6, 'coarse_ratio': 2, 'channel_width': 512}), ({'L0': 8, 'b': 2, 'p': 8, 'r': 3, 'k': -1, 's': 2}, {'wavelength': 256, 'next_wavelength': 512, 'redshifted_pixel': 7, 'rest_pixel': 9, 'coarse_ratio': 4, 'channel_width': 256})]}
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.

A discrete logarithmic spectrum uses lambda(p)=L0*b**(p-r), b a positive integer >=2 and integer p,r. Redshift by a grid factor b**k is an additive pixel shift k. Coarse bin stride s changes the multiplicative channel ratio. Output fields are defined by: wavelength = d['L0']*d['b']**(d['p']-d['r']); next_wavelength = d['L0']*d['b']**(d['p']+1-d['r']); redshifted_pixel = d['p']+d['k']; rest_pixel = d['p']-d['k']; coarse_ratio = d['b']**d['s']; channel_width = d['L0']*d['b']**(d['p']-d['r'])*(d['b']-1)

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'vacuum_wavelength': d['L']*d['b']/d['a'], 'air_wavelength': d['L']*d['b']/d['a'], 'vacuum_width': d['width']*d['a']/d['b'], 'vacuum_density': d['F']*d['b']/d['a'], 'vacuum_frequency': d['c']*d['b']/(d['L']*d['a']), 'line_displacement': d['L']*(d['a']-d['b'])/d['b']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 10, 'a': 3, 'b': 2, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 15.0, 'air_wavelength': 6.666666666666667, 'vacuum_width': 6.0, 'vacuum_density': 4.0, 'vacuum_frequency': 8.0, 'line_displacement': 5.0}), ({'L': 10, 'a': 1, 'b': 1, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 10.0, 'air_wavelength': 10.0, 'vacuum_width': 4.0, 'vacuum_density': 6.0, 'vacuum_frequency': 12.0, 'line_displacement': 0.0}), ({'L': 10, 'a': 3, 'b': 2, 'width': 0, 'F': 6, 'c': 120}, {'vacuum_wavelength': 15.0, 'air_wavelength': 6.666666666666667, 'vacuum_width': 0.0, 'vacuum_density': 4.0, 'vacuum_frequency': 8.0, 'line_displacement': 5.0}), ({'L': 10, 'a': 3, 'b': 2, 'width': 4, 'F': 0, 'c': 120}, {'vacuum_wavelength': 15.0, 'air_wavelength': 6.666666666666667, 'vacuum_width': 6.0, 'vacuum_density': 0.0, 'vacuum_frequency': 8.0, 'line_displacement': 5.0}), ({'L': 10, 'a': 4, 'b': 3, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 13.333333333333334, 'air_wavelength': 7.5, 'vacuum_width': 5.333333333333333, 'vacuum_density': 4.5, 'vacuum_frequency': 9.0, 'line_displacement': 3.3333333333333335}), ({'L': 10, 'a': 3, 'b': 2, 'width': 4, 'F': -2, 'c': 120}, {'vacuum_wavelength': 15.0, 'air_wavelength': 6.666666666666667, 'vacuum_width': 6.0, 'vacuum_density': -1.3333333333333333, 'vacuum_frequency': 8.0, 'line_displacement': 5.0})], 2: [({'L': 11, 'a': 3, 'b': 2, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 16.5, 'air_wavelength': 7.333333333333333, 'vacuum_width': 6.0, 'vacuum_density': 4.0, 'vacuum_frequency': 7.2727272727272725, 'line_displacement': 5.5}), ({'L': 11, 'a': 1, 'b': 1, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 11.0, 'air_wavelength': 11.0, 'vacuum_width': 4.0, 'vacuum_density': 6.0, 'vacuum_frequency': 10.909090909090908, 'line_displacement': 0.0}), ({'L': 11, 'a': 3, 'b': 2, 'width': 0, 'F': 6, 'c': 120}, {'vacuum_wavelength': 16.5, 'air_wavelength': 7.333333333333333, 'vacuum_width': 0.0, 'vacuum_density': 4.0, 'vacuum_frequency': 7.2727272727272725, 'line_displacement': 5.5}), ({'L': 11, 'a': 3, 'b': 2, 'width': 4, 'F': 0, 'c': 120}, {'vacuum_wavelength': 16.5, 'air_wavelength': 7.333333333333333, 'vacuum_width': 6.0, 'vacuum_density': 0.0, 'vacuum_frequency': 7.2727272727272725, 'line_displacement': 5.5}), ({'L': 11, 'a': 4, 'b': 3, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 14.666666666666666, 'air_wavelength': 8.25, 'vacuum_width': 5.333333333333333, 'vacuum_density': 4.5, 'vacuum_frequency': 8.181818181818182, 'line_displacement': 3.6666666666666665}), ({'L': 11, 'a': 3, 'b': 2, 'width': 4, 'F': -2, 'c': 120}, {'vacuum_wavelength': 16.5, 'air_wavelength': 7.333333333333333, 'vacuum_width': 6.0, 'vacuum_density': -1.3333333333333333, 'vacuum_frequency': 7.2727272727272725, 'line_displacement': 5.5})], 3: [({'L': 12, 'a': 3, 'b': 2, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 18.0, 'air_wavelength': 8.0, 'vacuum_width': 6.0, 'vacuum_density': 4.0, 'vacuum_frequency': 6.666666666666667, 'line_displacement': 6.0}), ({'L': 12, 'a': 1, 'b': 1, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 12.0, 'air_wavelength': 12.0, 'vacuum_width': 4.0, 'vacuum_density': 6.0, 'vacuum_frequency': 10.0, 'line_displacement': 0.0}), ({'L': 12, 'a': 3, 'b': 2, 'width': 0, 'F': 6, 'c': 120}, {'vacuum_wavelength': 18.0, 'air_wavelength': 8.0, 'vacuum_width': 0.0, 'vacuum_density': 4.0, 'vacuum_frequency': 6.666666666666667, 'line_displacement': 6.0}), ({'L': 12, 'a': 3, 'b': 2, 'width': 4, 'F': 0, 'c': 120}, {'vacuum_wavelength': 18.0, 'air_wavelength': 8.0, 'vacuum_width': 6.0, 'vacuum_density': 0.0, 'vacuum_frequency': 6.666666666666667, 'line_displacement': 6.0}), ({'L': 12, 'a': 4, 'b': 3, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 16.0, 'air_wavelength': 9.0, 'vacuum_width': 5.333333333333333, 'vacuum_density': 4.5, 'vacuum_frequency': 7.5, 'line_displacement': 4.0}), ({'L': 12, 'a': 3, 'b': 2, 'width': 4, 'F': -2, 'c': 120}, {'vacuum_wavelength': 18.0, 'air_wavelength': 8.0, 'vacuum_width': 6.0, 'vacuum_density': -1.3333333333333333, 'vacuum_frequency': 6.666666666666667, 'line_displacement': 6.0})], 4: [({'L': 13, 'a': 3, 'b': 2, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 19.5, 'air_wavelength': 8.666666666666666, 'vacuum_width': 6.0, 'vacuum_density': 4.0, 'vacuum_frequency': 6.153846153846154, 'line_displacement': 6.5}), ({'L': 13, 'a': 1, 'b': 1, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 13.0, 'air_wavelength': 13.0, 'vacuum_width': 4.0, 'vacuum_density': 6.0, 'vacuum_frequency': 9.23076923076923, 'line_displacement': 0.0}), ({'L': 13, 'a': 3, 'b': 2, 'width': 0, 'F': 6, 'c': 120}, {'vacuum_wavelength': 19.5, 'air_wavelength': 8.666666666666666, 'vacuum_width': 0.0, 'vacuum_density': 4.0, 'vacuum_frequency': 6.153846153846154, 'line_displacement': 6.5}), ({'L': 13, 'a': 3, 'b': 2, 'width': 4, 'F': 0, 'c': 120}, {'vacuum_wavelength': 19.5, 'air_wavelength': 8.666666666666666, 'vacuum_width': 6.0, 'vacuum_density': 0.0, 'vacuum_frequency': 6.153846153846154, 'line_displacement': 6.5}), ({'L': 13, 'a': 4, 'b': 3, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 17.333333333333332, 'air_wavelength': 9.75, 'vacuum_width': 5.333333333333333, 'vacuum_density': 4.5, 'vacuum_frequency': 6.923076923076923, 'line_displacement': 4.333333333333333}), ({'L': 13, 'a': 3, 'b': 2, 'width': 4, 'F': -2, 'c': 120}, {'vacuum_wavelength': 19.5, 'air_wavelength': 8.666666666666666, 'vacuum_width': 6.0, 'vacuum_density': -1.3333333333333333, 'vacuum_frequency': 6.153846153846154, 'line_displacement': 6.5})], 5: [({'L': 14, 'a': 3, 'b': 2, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 21.0, 'air_wavelength': 9.333333333333334, 'vacuum_width': 6.0, 'vacuum_density': 4.0, 'vacuum_frequency': 5.714285714285714, 'line_displacement': 7.0}), ({'L': 14, 'a': 1, 'b': 1, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 14.0, 'air_wavelength': 14.0, 'vacuum_width': 4.0, 'vacuum_density': 6.0, 'vacuum_frequency': 8.571428571428571, 'line_displacement': 0.0}), ({'L': 14, 'a': 3, 'b': 2, 'width': 0, 'F': 6, 'c': 120}, {'vacuum_wavelength': 21.0, 'air_wavelength': 9.333333333333334, 'vacuum_width': 0.0, 'vacuum_density': 4.0, 'vacuum_frequency': 5.714285714285714, 'line_displacement': 7.0}), ({'L': 14, 'a': 3, 'b': 2, 'width': 4, 'F': 0, 'c': 120}, {'vacuum_wavelength': 21.0, 'air_wavelength': 9.333333333333334, 'vacuum_width': 6.0, 'vacuum_density': 0.0, 'vacuum_frequency': 5.714285714285714, 'line_displacement': 7.0}), ({'L': 14, 'a': 4, 'b': 3, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 18.666666666666668, 'air_wavelength': 10.5, 'vacuum_width': 5.333333333333333, 'vacuum_density': 4.5, 'vacuum_frequency': 6.428571428571429, 'line_displacement': 4.666666666666667}), ({'L': 14, 'a': 3, 'b': 2, 'width': 4, 'F': -2, 'c': 120}, {'vacuum_wavelength': 21.0, 'air_wavelength': 9.333333333333334, 'vacuum_width': 6.0, 'vacuum_density': -1.3333333333333333, 'vacuum_frequency': 5.714285714285714, 'line_displacement': 7.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-air-vacuum-line-coordinate

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

N = 1
observations = []
def solve(d):
    return {'vacuum_wavelength': d['L']+d['a']/d['b'], 'air_wavelength': d['L']*d['b']/d['a'], 'vacuum_width': d['width']*d['a']/d['b'], 'vacuum_density': d['F']*d['b']/d['a'], 'vacuum_frequency': d['c']*d['b']/(d['L']*d['a']), 'line_displacement': d['L']*(d['a']-d['b'])/d['b']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 10, 'a': 3, 'b': 2, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 15.0, 'air_wavelength': 6.666666666666667, 'vacuum_width': 6.0, 'vacuum_density': 4.0, 'vacuum_frequency': 8.0, 'line_displacement': 5.0}), ({'L': 10, 'a': 1, 'b': 1, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 10.0, 'air_wavelength': 10.0, 'vacuum_width': 4.0, 'vacuum_density': 6.0, 'vacuum_frequency': 12.0, 'line_displacement': 0.0}), ({'L': 10, 'a': 3, 'b': 2, 'width': 0, 'F': 6, 'c': 120}, {'vacuum_wavelength': 15.0, 'air_wavelength': 6.666666666666667, 'vacuum_width': 0.0, 'vacuum_density': 4.0, 'vacuum_frequency': 8.0, 'line_displacement': 5.0}), ({'L': 10, 'a': 3, 'b': 2, 'width': 4, 'F': 0, 'c': 120}, {'vacuum_wavelength': 15.0, 'air_wavelength': 6.666666666666667, 'vacuum_width': 6.0, 'vacuum_density': 0.0, 'vacuum_frequency': 8.0, 'line_displacement': 5.0}), ({'L': 10, 'a': 4, 'b': 3, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 13.333333333333334, 'air_wavelength': 7.5, 'vacuum_width': 5.333333333333333, 'vacuum_density': 4.5, 'vacuum_frequency': 9.0, 'line_displacement': 3.3333333333333335}), ({'L': 10, 'a': 3, 'b': 2, 'width': 4, 'F': -2, 'c': 120}, {'vacuum_wavelength': 15.0, 'air_wavelength': 6.666666666666667, 'vacuum_width': 6.0, 'vacuum_density': -1.3333333333333333, 'vacuum_frequency': 8.0, 'line_displacement': 5.0})], 2: [({'L': 11, 'a': 3, 'b': 2, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 16.5, 'air_wavelength': 7.333333333333333, 'vacuum_width': 6.0, 'vacuum_density': 4.0, 'vacuum_frequency': 7.2727272727272725, 'line_displacement': 5.5}), ({'L': 11, 'a': 1, 'b': 1, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 11.0, 'air_wavelength': 11.0, 'vacuum_width': 4.0, 'vacuum_density': 6.0, 'vacuum_frequency': 10.909090909090908, 'line_displacement': 0.0}), ({'L': 11, 'a': 3, 'b': 2, 'width': 0, 'F': 6, 'c': 120}, {'vacuum_wavelength': 16.5, 'air_wavelength': 7.333333333333333, 'vacuum_width': 0.0, 'vacuum_density': 4.0, 'vacuum_frequency': 7.2727272727272725, 'line_displacement': 5.5}), ({'L': 11, 'a': 3, 'b': 2, 'width': 4, 'F': 0, 'c': 120}, {'vacuum_wavelength': 16.5, 'air_wavelength': 7.333333333333333, 'vacuum_width': 6.0, 'vacuum_density': 0.0, 'vacuum_frequency': 7.2727272727272725, 'line_displacement': 5.5}), ({'L': 11, 'a': 4, 'b': 3, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 14.666666666666666, 'air_wavelength': 8.25, 'vacuum_width': 5.333333333333333, 'vacuum_density': 4.5, 'vacuum_frequency': 8.181818181818182, 'line_displacement': 3.6666666666666665}), ({'L': 11, 'a': 3, 'b': 2, 'width': 4, 'F': -2, 'c': 120}, {'vacuum_wavelength': 16.5, 'air_wavelength': 7.333333333333333, 'vacuum_width': 6.0, 'vacuum_density': -1.3333333333333333, 'vacuum_frequency': 7.2727272727272725, 'line_displacement': 5.5})], 3: [({'L': 12, 'a': 3, 'b': 2, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 18.0, 'air_wavelength': 8.0, 'vacuum_width': 6.0, 'vacuum_density': 4.0, 'vacuum_frequency': 6.666666666666667, 'line_displacement': 6.0}), ({'L': 12, 'a': 1, 'b': 1, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 12.0, 'air_wavelength': 12.0, 'vacuum_width': 4.0, 'vacuum_density': 6.0, 'vacuum_frequency': 10.0, 'line_displacement': 0.0}), ({'L': 12, 'a': 3, 'b': 2, 'width': 0, 'F': 6, 'c': 120}, {'vacuum_wavelength': 18.0, 'air_wavelength': 8.0, 'vacuum_width': 0.0, 'vacuum_density': 4.0, 'vacuum_frequency': 6.666666666666667, 'line_displacement': 6.0}), ({'L': 12, 'a': 3, 'b': 2, 'width': 4, 'F': 0, 'c': 120}, {'vacuum_wavelength': 18.0, 'air_wavelength': 8.0, 'vacuum_width': 6.0, 'vacuum_density': 0.0, 'vacuum_frequency': 6.666666666666667, 'line_displacement': 6.0}), ({'L': 12, 'a': 4, 'b': 3, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 16.0, 'air_wavelength': 9.0, 'vacuum_width': 5.333333333333333, 'vacuum_density': 4.5, 'vacuum_frequency': 7.5, 'line_displacement': 4.0}), ({'L': 12, 'a': 3, 'b': 2, 'width': 4, 'F': -2, 'c': 120}, {'vacuum_wavelength': 18.0, 'air_wavelength': 8.0, 'vacuum_width': 6.0, 'vacuum_density': -1.3333333333333333, 'vacuum_frequency': 6.666666666666667, 'line_displacement': 6.0})], 4: [({'L': 13, 'a': 3, 'b': 2, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 19.5, 'air_wavelength': 8.666666666666666, 'vacuum_width': 6.0, 'vacuum_density': 4.0, 'vacuum_frequency': 6.153846153846154, 'line_displacement': 6.5}), ({'L': 13, 'a': 1, 'b': 1, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 13.0, 'air_wavelength': 13.0, 'vacuum_width': 4.0, 'vacuum_density': 6.0, 'vacuum_frequency': 9.23076923076923, 'line_displacement': 0.0}), ({'L': 13, 'a': 3, 'b': 2, 'width': 0, 'F': 6, 'c': 120}, {'vacuum_wavelength': 19.5, 'air_wavelength': 8.666666666666666, 'vacuum_width': 0.0, 'vacuum_density': 4.0, 'vacuum_frequency': 6.153846153846154, 'line_displacement': 6.5}), ({'L': 13, 'a': 3, 'b': 2, 'width': 4, 'F': 0, 'c': 120}, {'vacuum_wavelength': 19.5, 'air_wavelength': 8.666666666666666, 'vacuum_width': 6.0, 'vacuum_density': 0.0, 'vacuum_frequency': 6.153846153846154, 'line_displacement': 6.5}), ({'L': 13, 'a': 4, 'b': 3, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 17.333333333333332, 'air_wavelength': 9.75, 'vacuum_width': 5.333333333333333, 'vacuum_density': 4.5, 'vacuum_frequency': 6.923076923076923, 'line_displacement': 4.333333333333333}), ({'L': 13, 'a': 3, 'b': 2, 'width': 4, 'F': -2, 'c': 120}, {'vacuum_wavelength': 19.5, 'air_wavelength': 8.666666666666666, 'vacuum_width': 6.0, 'vacuum_density': -1.3333333333333333, 'vacuum_frequency': 6.153846153846154, 'line_displacement': 6.5})], 5: [({'L': 14, 'a': 3, 'b': 2, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 21.0, 'air_wavelength': 9.333333333333334, 'vacuum_width': 6.0, 'vacuum_density': 4.0, 'vacuum_frequency': 5.714285714285714, 'line_displacement': 7.0}), ({'L': 14, 'a': 1, 'b': 1, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 14.0, 'air_wavelength': 14.0, 'vacuum_width': 4.0, 'vacuum_density': 6.0, 'vacuum_frequency': 8.571428571428571, 'line_displacement': 0.0}), ({'L': 14, 'a': 3, 'b': 2, 'width': 0, 'F': 6, 'c': 120}, {'vacuum_wavelength': 21.0, 'air_wavelength': 9.333333333333334, 'vacuum_width': 0.0, 'vacuum_density': 4.0, 'vacuum_frequency': 5.714285714285714, 'line_displacement': 7.0}), ({'L': 14, 'a': 3, 'b': 2, 'width': 4, 'F': 0, 'c': 120}, {'vacuum_wavelength': 21.0, 'air_wavelength': 9.333333333333334, 'vacuum_width': 6.0, 'vacuum_density': 0.0, 'vacuum_frequency': 5.714285714285714, 'line_displacement': 7.0}), ({'L': 14, 'a': 4, 'b': 3, 'width': 4, 'F': 6, 'c': 120}, {'vacuum_wavelength': 18.666666666666668, 'air_wavelength': 10.5, 'vacuum_width': 5.333333333333333, 'vacuum_density': 4.5, 'vacuum_frequency': 6.428571428571429, 'line_displacement': 4.666666666666667}), ({'L': 14, 'a': 3, 'b': 2, 'width': 4, 'F': -2, 'c': 120}, {'vacuum_wavelength': 21.0, 'air_wavelength': 9.333333333333334, 'vacuum_width': 6.0, 'vacuum_density': -1.3333333333333333, 'vacuum_frequency': 5.714285714285714, 'line_displacement': 7.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 vacuum wavelength while other fields remain valid.

The supplied index n=a/b is a positive rational greater than zero. This finite constant-index adapter maps air wavelength to vacuum by multiplication n. Frequency belongs to vacuum wavelength; flux densities change inversely with wavelength-bin Jacobian. It does not model dispersion of refractive index. Output fields are defined by: vacuum_wavelength = d['L']*d['a']/d['b']; air_wavelength = d['L']*d['b']/d['a']; vacuum_width = d['width']*d['a']/d['b']; vacuum_density = d['F']*d['b']/d['a']; vacuum_frequency = d['c']*d['b']/(d['L']*d['a']); line_displacement = d['L']*(d['a']-d['b'])/d['b']

split: open-access