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

N = 1
observations = []
def solve(d):
    return {'coordinate': d['a']+d['b']*(d['p']-d['r'])+d['c']*(d['p']-d['r'])**2+d['e']*(d['p']-d['r'])**3, 'local_dispersion': d['b']+2*d['c']*(d['p']-d['r'])+3*d['e']*(d['p']-d['r'])**2, 'absolute_constant': d['a']-d['b']*d['r']+d['c']*d['r']**2-d['e']*d['r']**3, 'shifted_zero': d['a']+d['b']*d['s']+d['c']*d['s']**2+d['e']*d['s']**3, 'shifted_linear': d['b'], 'shifted_quadratic': d['c']+3*d['e']*d['s']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 220, 'local_dispersion': 74, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 220, 'local_dispersion': 74, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 108, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 3, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 100, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 7, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 200, 'local_dispersion': 69, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': 76, 'local_dispersion': -30, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 2: [({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 310, 'local_dispersion': 107, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 310, 'local_dispersion': 107, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 110, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 4, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 106, 'local_dispersion': 11, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 8, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 285, 'local_dispersion': 102, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': 35, 'local_dispersion': -53, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 3: [({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 436, 'local_dispersion': 146, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 436, 'local_dispersion': 146, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 112, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 5, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 124, 'local_dispersion': 26, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 9, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 406, 'local_dispersion': 141, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': -32, 'local_dispersion': -82, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 4: [({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 604, 'local_dispersion': 191, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 604, 'local_dispersion': 191, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 114, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 6, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 160, 'local_dispersion': 47, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 10, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 569, 'local_dispersion': 186, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': -131, 'local_dispersion': -117, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 5: [({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 820, 'local_dispersion': 242, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 820, 'local_dispersion': 242, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 116, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 220, 'local_dispersion': 74, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 11, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 780, 'local_dispersion': 237, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': -268, 'local_dispersion': -158, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})]}
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-linear-spectral-pixel-calibration

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

N = 1
observations = []
def solve(d):
    return {'coordinate': d['a']+d['b']*(d['p']-d['r'])+d['c']*(d['p']-d['r'])**2+d['e']*(d['p']-d['r'])**3, 'local_dispersion': d['b']+2*d['c']*(d['p']-d['r'])+3*d['e']*(d['p']-d['r'])**2, 'absolute_constant': d['a']-d['b']*d['r']+d['c']*d['r']**2-d['e']*d['r']**3, 'shifted_zero': d['a']+d['b']*d['s']+d['c']*d['s']**2+d['e']*d['s']**3, 'shifted_linear': d['b']+2*d['c']*d['s'], 'shifted_quadratic': d['c']+3*d['e']*d['s']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 220, 'local_dispersion': 74, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 220, 'local_dispersion': 74, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 108, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 3, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 100, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 7, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 200, 'local_dispersion': 69, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': 76, 'local_dispersion': -30, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 2: [({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 310, 'local_dispersion': 107, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 310, 'local_dispersion': 107, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 110, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 4, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 106, 'local_dispersion': 11, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 8, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 285, 'local_dispersion': 102, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': 35, 'local_dispersion': -53, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 3: [({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 436, 'local_dispersion': 146, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 436, 'local_dispersion': 146, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 112, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 5, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 124, 'local_dispersion': 26, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 9, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 406, 'local_dispersion': 141, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': -32, 'local_dispersion': -82, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 4: [({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 604, 'local_dispersion': 191, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 604, 'local_dispersion': 191, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 114, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 6, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 160, 'local_dispersion': 47, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 10, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 569, 'local_dispersion': 186, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': -131, 'local_dispersion': -117, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 5: [({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 820, 'local_dispersion': 242, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 820, 'local_dispersion': 242, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 116, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 220, 'local_dispersion': 74, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 11, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 780, 'local_dispersion': 237, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': -268, 'local_dispersion': -158, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect shifted linear while other fields remain valid.

Spectral coordinate is a reference-centered cubic in one-based pixel displacement t=p-r. Report coordinate, local derivative, reference-independent absolute constant, and the three coefficients after a shift of reference by s. This is a finite exact calibration polynomial, not a dispersion solution. Output fields are defined by: coordinate = d['a']+d['b']*(d['p']-d['r'])+d['c']*(d['p']-d['r'])**2+d['e']*(d['p']-d['r'])**3; local_dispersion = d['b']+2*d['c']*(d['p']-d['r'])+3*d['e']*(d['p']-d['r'])**2; absolute_constant = d['a']-d['b']*d['r']+d['c']*d['r']**2-d['e']*d['r']**3; shifted_zero = d['a']+d['b']*d['s']+d['c']*d['s']**2+d['e']*d['s']**3; shifted_linear = d['b']+2*d['c']*d['s']+3*d['e']*d['s']**2; shifted_quadratic = d['c']+3*d['e']*d['s']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'coordinate': d['a']+d['b']*(d['p']-d['r'])+d['c']*(d['p']-d['r'])**2+d['e']*(d['p']-d['r'])**3, 'local_dispersion': d['b']+2*d['c']*(d['p']-d['r'])+3*d['e']*(d['p']-d['r'])**2, 'absolute_constant': d['a']-d['b']*d['r']+d['c']*d['r']**2-d['e']*d['r']**3, 'shifted_zero': d['a']+d['b']*d['s']+d['c']*d['s']**2+d['e']*d['s']**3, 'shifted_linear': d['b']+2*d['c']*d['s']+3*d['e']*d['s']**2, 'shifted_quadratic': d['c']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 220, 'local_dispersion': 74, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 220, 'local_dispersion': 74, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 108, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 3, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 100, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 7, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 200, 'local_dispersion': 69, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': 76, 'local_dispersion': -30, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 2: [({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 310, 'local_dispersion': 107, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 310, 'local_dispersion': 107, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 110, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 4, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 106, 'local_dispersion': 11, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 8, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 285, 'local_dispersion': 102, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': 35, 'local_dispersion': -53, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 3: [({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 436, 'local_dispersion': 146, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 436, 'local_dispersion': 146, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 112, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 5, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 124, 'local_dispersion': 26, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 9, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 406, 'local_dispersion': 141, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': -32, 'local_dispersion': -82, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 4: [({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 604, 'local_dispersion': 191, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 604, 'local_dispersion': 191, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 114, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 6, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 160, 'local_dispersion': 47, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 10, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 569, 'local_dispersion': 186, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': -131, 'local_dispersion': -117, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 5: [({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 820, 'local_dispersion': 242, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 820, 'local_dispersion': 242, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 116, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 220, 'local_dispersion': 74, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 11, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 780, 'local_dispersion': 237, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': -268, 'local_dispersion': -158, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})]}
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-linear-spectral-pixel-calibration

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

N = 1
observations = []
def solve(d):
    return {'coordinate': d['a']+d['b']*(d['p']-d['r'])+d['c']*(d['p']-d['r'])**2+d['e']*(d['p']-d['r'])**3, 'local_dispersion': d['b']+2*d['c']*(d['p']-d['r'])+3*d['e']*(d['p']-d['r'])**2, 'absolute_constant': d['a']-d['b']*d['r']+d['c']*d['r']**2-d['e']*d['r']**3, 'shifted_zero': d['a']+d['b']*d['s']+d['c']*d['s']**2+d['e']*d['s']**3, 'shifted_linear': d['b']+2*d['c']*d['s']+3*d['e']*d['s']**2, 'shifted_quadratic': d['c']+d['e']*d['s']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 220, 'local_dispersion': 74, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 220, 'local_dispersion': 74, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 108, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 3, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 100, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 7, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 200, 'local_dispersion': 69, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': 76, 'local_dispersion': -30, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 2: [({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 310, 'local_dispersion': 107, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 310, 'local_dispersion': 107, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 110, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 4, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 106, 'local_dispersion': 11, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 8, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 285, 'local_dispersion': 102, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 8, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': 35, 'local_dispersion': -53, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 3: [({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 436, 'local_dispersion': 146, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 436, 'local_dispersion': 146, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 112, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 5, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 124, 'local_dispersion': 26, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 9, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 406, 'local_dispersion': 141, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 9, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': -32, 'local_dispersion': -82, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 4: [({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 604, 'local_dispersion': 191, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 604, 'local_dispersion': 191, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 114, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 6, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 160, 'local_dispersion': 47, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 10, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 569, 'local_dispersion': 186, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 10, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': -131, 'local_dispersion': -117, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})], 5: [({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 820, 'local_dispersion': 242, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 0}, {'coordinate': 820, 'local_dispersion': 242, 'absolute_constant': 94, 'shifted_zero': 100, 'shifted_linear': 2, 'shifted_quadratic': 3}), ({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 0, 'e': 0, 's': 2}, {'coordinate': 116, 'local_dispersion': 2, 'absolute_constant': 94, 'shifted_zero': 104, 'shifted_linear': 2, 'shifted_quadratic': 0}), ({'p': 7, 'r': 3, 'a': 100, 'b': 2, 'c': 3, 'e': 1, 's': 2}, {'coordinate': 220, 'local_dispersion': 74, 'absolute_constant': 94, 'shifted_zero': 124, 'shifted_linear': 26, 'shifted_quadratic': 9}), ({'p': 11, 'r': 3, 'a': 100, 'b': -3, 'c': 3, 'e': 1, 's': -2}, {'coordinate': 780, 'local_dispersion': 237, 'absolute_constant': 109, 'shifted_zero': 110, 'shifted_linear': -3, 'shifted_quadratic': -3}), ({'p': 11, 'r': 3, 'a': 100, 'b': 2, 'c': 2, 'e': -1, 's': 2}, {'coordinate': -268, 'local_dispersion': -158, 'absolute_constant': 139, 'shifted_zero': 104, 'shifted_linear': -2, 'shifted_quadratic': -4})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect shifted quadratic while other fields remain valid.

Spectral coordinate is a reference-centered cubic in one-based pixel displacement t=p-r. Report coordinate, local derivative, reference-independent absolute constant, and the three coefficients after a shift of reference by s. This is a finite exact calibration polynomial, not a dispersion solution. Output fields are defined by: coordinate = d['a']+d['b']*(d['p']-d['r'])+d['c']*(d['p']-d['r'])**2+d['e']*(d['p']-d['r'])**3; local_dispersion = d['b']+2*d['c']*(d['p']-d['r'])+3*d['e']*(d['p']-d['r'])**2; absolute_constant = d['a']-d['b']*d['r']+d['c']*d['r']**2-d['e']*d['r']**3; shifted_zero = d['a']+d['b']*d['s']+d['c']*d['s']**2+d['e']*d['s']**3; shifted_linear = d['b']+2*d['c']*d['s']+3*d['e']*d['s']**2; shifted_quadratic = d['c']+3*d['e']*d['s']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'rest_wavelength': d['obs']*d['f'], 'rest_bin_width': d['width']/d['f'], 'predicted_line': d['rest']*d['f'], 'rest_equivalent_width': d['ew']/d['f'], 'rest_density': d['density']*d['f'], 'bin_integral': d['density']*d['width']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 120.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 2: [({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 121.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 3: [({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 122.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.666666666666664, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 4: [({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 123.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 5: [({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 124.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 62.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})]}
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-redshift-wavelength-grid

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

N = 1
observations = []
def solve(d):
    return {'rest_wavelength': d['obs']/(d['f']+1), 'rest_bin_width': d['width']/d['f'], 'predicted_line': d['rest']*d['f'], 'rest_equivalent_width': d['ew']/d['f'], 'rest_density': d['density']*d['f'], 'bin_integral': d['density']*d['width']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 120.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 2: [({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 121.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 3: [({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 122.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.666666666666664, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 4: [({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 123.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 5: [({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 124.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 62.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})]}
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 wavelength while other fields remain valid.

For this catalog adapter, redshift factor f=1+z is provided as positive integer f. Rest wavelength, rest bin width, observed line wavelength, observed equivalent width, and wavelength density obey their explicitly stated f-scalings. No velocity convention is inferred. Output fields are defined by: rest_wavelength = d['obs']/d['f']; rest_bin_width = d['width']/d['f']; predicted_line = d['rest']*d['f']; rest_equivalent_width = d['ew']/d['f']; rest_density = d['density']*d['f']; bin_integral = d['density']*d['width']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'rest_wavelength': d['obs']/d['f'], 'rest_bin_width': d['width'], 'predicted_line': d['rest']*d['f'], 'rest_equivalent_width': d['ew']/d['f'], 'rest_density': d['density']*d['f'], 'bin_integral': d['density']*d['width']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 120.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 2: [({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 121.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 3: [({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 122.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.666666666666664, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 4: [({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 123.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 5: [({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 124.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 62.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})]}
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-redshift-wavelength-grid

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

N = 1
observations = []
def solve(d):
    return {'rest_wavelength': d['obs']/d['f'], 'rest_bin_width': d['width']*d['f'], 'predicted_line': d['rest']*d['f'], 'rest_equivalent_width': d['ew']/d['f'], 'rest_density': d['density']*d['f'], 'bin_integral': d['density']*d['width']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 120.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 2: [({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 121.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 3: [({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 122.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.666666666666664, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 4: [({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 123.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 5: [({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 124.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 62.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})]}
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 bin width while other fields remain valid.

For this catalog adapter, redshift factor f=1+z is provided as positive integer f. Rest wavelength, rest bin width, observed line wavelength, observed equivalent width, and wavelength density obey their explicitly stated f-scalings. No velocity convention is inferred. Output fields are defined by: rest_wavelength = d['obs']/d['f']; rest_bin_width = d['width']/d['f']; predicted_line = d['rest']*d['f']; rest_equivalent_width = d['ew']/d['f']; rest_density = d['density']*d['f']; bin_integral = d['density']*d['width']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'rest_wavelength': d['obs']/d['f'], 'rest_bin_width': d['width']/d['f'], 'predicted_line': d['rest']/d['f'], 'rest_equivalent_width': d['ew']/d['f'], 'rest_density': d['density']*d['f'], 'bin_integral': d['density']*d['width']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 120.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 2: [({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 121.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 3: [({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 122.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.666666666666664, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 4: [({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 123.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 5: [({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 124.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 62.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})]}
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-redshift-wavelength-grid

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

N = 1
observations = []
def solve(d):
    return {'rest_wavelength': d['obs']/d['f'], 'rest_bin_width': d['width']/d['f'], 'predicted_line': d['rest']*(d['f']-1), 'rest_equivalent_width': d['ew']/d['f'], 'rest_density': d['density']*d['f'], 'bin_integral': d['density']*d['width']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 120.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 2: [({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 121.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 3: [({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 122.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.666666666666664, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 4: [({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 123.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 5: [({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 124.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 62.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})]}
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 predicted line while other fields remain valid.

For this catalog adapter, redshift factor f=1+z is provided as positive integer f. Rest wavelength, rest bin width, observed line wavelength, observed equivalent width, and wavelength density obey their explicitly stated f-scalings. No velocity convention is inferred. Output fields are defined by: rest_wavelength = d['obs']/d['f']; rest_bin_width = d['width']/d['f']; predicted_line = d['rest']*d['f']; rest_equivalent_width = d['ew']/d['f']; rest_density = d['density']*d['f']; bin_integral = d['density']*d['width']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'rest_wavelength': d['obs']/d['f'], 'rest_bin_width': d['width']/d['f'], 'predicted_line': d['rest']*d['f'], 'rest_equivalent_width': d['ew'], 'rest_density': d['density']*d['f'], 'bin_integral': d['density']*d['width']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 120.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 2: [({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 121.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 3: [({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 122.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.666666666666664, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 4: [({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 123.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 5: [({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 124.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 62.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})]}
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-redshift-wavelength-grid

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

N = 1
observations = []
def solve(d):
    return {'rest_wavelength': d['obs']/d['f'], 'rest_bin_width': d['width']/d['f'], 'predicted_line': d['rest']*d['f'], 'rest_equivalent_width': d['ew']/d['f']**2, 'rest_density': d['density']*d['f'], 'bin_integral': d['density']*d['width']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 120.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 120, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 120, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 2: [({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 121.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 121, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 60.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 121, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 60.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 3: [({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 122.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 40.666666666666664, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 122, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 122, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 4: [({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 123.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.0, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 123, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 61.5, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 123, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 61.5, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})], 5: [({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 1, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 124.0, 'rest_bin_width': 8.0, 'predicted_line': 40, 'rest_equivalent_width': 6.0, 'rest_density': 3, 'bin_integral': 24}), ({'f': 3, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 3}, {'rest_wavelength': 41.333333333333336, 'rest_bin_width': 2.6666666666666665, 'predicted_line': 120, 'rest_equivalent_width': 2.0, 'rest_density': 9, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 40, 'ew': 0, 'flux': 0, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 80, 'rest_equivalent_width': 0.0, 'rest_density': 6, 'bin_integral': 24}), ({'f': 2, 'obs': 124, 'width': 2, 'rest': 40, 'ew': 6, 'flux': 10, 'density': 0}, {'rest_wavelength': 62.0, 'rest_bin_width': 1.0, 'predicted_line': 80, 'rest_equivalent_width': 3.0, 'rest_density': 0, 'bin_integral': 0}), ({'f': 2, 'obs': 124, 'width': 8, 'rest': 70, 'ew': -4, 'flux': 10, 'density': 3}, {'rest_wavelength': 62.0, 'rest_bin_width': 4.0, 'predicted_line': 140, 'rest_equivalent_width': -2.0, 'rest_density': 6, 'bin_integral': 24})]}
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 equivalent width while other fields remain valid.

For this catalog adapter, redshift factor f=1+z is provided as positive integer f. Rest wavelength, rest bin width, observed line wavelength, observed equivalent width, and wavelength density obey their explicitly stated f-scalings. No velocity convention is inferred. Output fields are defined by: rest_wavelength = d['obs']/d['f']; rest_bin_width = d['width']/d['f']; predicted_line = d['rest']*d['f']; rest_equivalent_width = d['ew']/d['f']; rest_density = d['density']*d['f']; bin_integral = d['density']*d['width']

split: open-access