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'], 'rest_equivalent_width': d['ew']/d['f'], 'rest_density': d['density'], '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 density 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']/d['f']}
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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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']*d['f']}
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 bin integral 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 {'trace_offset': d['y']-d['t0'], 'blaze_coordinate': d['x']-d['bx'], 'order_wavelength': d['k']/d['m'], 'lower_aperture': d['t0']+d['t1']*d['x']-d['h'], 'upper_aperture': d['t0']+d['t1']*d['x']+d['h'], 'neighbor_trace': d['t0']+d['t1']*d['x']+d['pitch']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 11, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 120.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -1, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': -3, 'upper_aperture': 1, 'neighbor_trace': 4}), ({'x': 4, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 18})], 2: [({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 13, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 120.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 0, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': -4, 'upper_aperture': 0, 'neighbor_trace': 3}), ({'x': 5, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -5, 'blaze_coordinate': 7, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 20})], 3: [({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 15, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 120.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 1, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': -5, 'upper_aperture': -1, 'neighbor_trace': 2}), ({'x': 6, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -7, 'blaze_coordinate': 8, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 22})], 4: [({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 17, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 120.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 2, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': -6, 'upper_aperture': -2, 'neighbor_trace': 1}), ({'x': 7, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -9, 'blaze_coordinate': 9, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 24})], 5: [({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 19, 'upper_aperture': 19, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 120.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': -7, 'upper_aperture': -3, 'neighbor_trace': 0}), ({'x': 8, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -11, 'blaze_coordinate': 10, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 26})]}
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-echelle-order-coordinate

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

N = 1
observations = []
def solve(d):
    return {'trace_offset': d['y']-d['t0']-d['t1']*d['y'], 'blaze_coordinate': d['x']-d['bx'], 'order_wavelength': d['k']/d['m'], 'lower_aperture': d['t0']+d['t1']*d['x']-d['h'], 'upper_aperture': d['t0']+d['t1']*d['x']+d['h'], 'neighbor_trace': d['t0']+d['t1']*d['x']+d['pitch']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 11, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 120.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -1, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': -3, 'upper_aperture': 1, 'neighbor_trace': 4}), ({'x': 4, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 18})], 2: [({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 13, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 120.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 0, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': -4, 'upper_aperture': 0, 'neighbor_trace': 3}), ({'x': 5, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -5, 'blaze_coordinate': 7, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 20})], 3: [({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 15, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 120.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 1, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': -5, 'upper_aperture': -1, 'neighbor_trace': 2}), ({'x': 6, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -7, 'blaze_coordinate': 8, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 22})], 4: [({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 17, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 120.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 2, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': -6, 'upper_aperture': -2, 'neighbor_trace': 1}), ({'x': 7, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -9, 'blaze_coordinate': 9, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 24})], 5: [({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 19, 'upper_aperture': 19, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 120.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': -7, 'upper_aperture': -3, 'neighbor_trace': 0}), ({'x': 8, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -11, 'blaze_coordinate': 10, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 26})]}
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 trace offset while other fields remain valid.

A reduced echelle extractor uses detector x along dispersion and y across orders. The blaze coordinate is centered on bx, trace is t0+t1*x, order-normalized wavelength is k/m, and rectangular extraction bounds use half-height h about that trace. Orders m are positive. Output fields are defined by: trace_offset = d['y']-d['t0']-d['t1']*d['x']; blaze_coordinate = d['x']-d['bx']; order_wavelength = d['k']/d['m']; lower_aperture = d['t0']+d['t1']*d['x']-d['h']; upper_aperture = d['t0']+d['t1']*d['x']+d['h']; neighbor_trace = d['t0']+d['t1']*d['x']+d['pitch']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'trace_offset': d['y']-d['t0']-d['t1']*d['x'], 'blaze_coordinate': d['x'], 'order_wavelength': d['k']/d['m'], 'lower_aperture': d['t0']+d['t1']*d['x']-d['h'], 'upper_aperture': d['t0']+d['t1']*d['x']+d['h'], 'neighbor_trace': d['t0']+d['t1']*d['x']+d['pitch']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 11, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 120.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -1, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': -3, 'upper_aperture': 1, 'neighbor_trace': 4}), ({'x': 4, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 18})], 2: [({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 13, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 120.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 0, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': -4, 'upper_aperture': 0, 'neighbor_trace': 3}), ({'x': 5, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -5, 'blaze_coordinate': 7, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 20})], 3: [({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 15, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 120.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 1, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': -5, 'upper_aperture': -1, 'neighbor_trace': 2}), ({'x': 6, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -7, 'blaze_coordinate': 8, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 22})], 4: [({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 17, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 120.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 2, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': -6, 'upper_aperture': -2, 'neighbor_trace': 1}), ({'x': 7, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -9, 'blaze_coordinate': 9, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 24})], 5: [({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 19, 'upper_aperture': 19, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 120.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': -7, 'upper_aperture': -3, 'neighbor_trace': 0}), ({'x': 8, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -11, 'blaze_coordinate': 10, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 26})]}
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-echelle-order-coordinate

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

N = 1
observations = []
def solve(d):
    return {'trace_offset': d['y']-d['t0']-d['t1']*d['x'], 'blaze_coordinate': d['x']+d['bx'], 'order_wavelength': d['k']/d['m'], 'lower_aperture': d['t0']+d['t1']*d['x']-d['h'], 'upper_aperture': d['t0']+d['t1']*d['x']+d['h'], 'neighbor_trace': d['t0']+d['t1']*d['x']+d['pitch']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 11, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 120.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -1, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': -3, 'upper_aperture': 1, 'neighbor_trace': 4}), ({'x': 4, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 18})], 2: [({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 13, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 120.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 0, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': -4, 'upper_aperture': 0, 'neighbor_trace': 3}), ({'x': 5, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -5, 'blaze_coordinate': 7, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 20})], 3: [({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 15, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 120.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 1, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': -5, 'upper_aperture': -1, 'neighbor_trace': 2}), ({'x': 6, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -7, 'blaze_coordinate': 8, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 22})], 4: [({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 17, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 120.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 2, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': -6, 'upper_aperture': -2, 'neighbor_trace': 1}), ({'x': 7, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -9, 'blaze_coordinate': 9, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 24})], 5: [({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 19, 'upper_aperture': 19, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 120.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': -7, 'upper_aperture': -3, 'neighbor_trace': 0}), ({'x': 8, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -11, 'blaze_coordinate': 10, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 26})]}
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 blaze coordinate while other fields remain valid.

A reduced echelle extractor uses detector x along dispersion and y across orders. The blaze coordinate is centered on bx, trace is t0+t1*x, order-normalized wavelength is k/m, and rectangular extraction bounds use half-height h about that trace. Orders m are positive. Output fields are defined by: trace_offset = d['y']-d['t0']-d['t1']*d['x']; blaze_coordinate = d['x']-d['bx']; order_wavelength = d['k']/d['m']; lower_aperture = d['t0']+d['t1']*d['x']-d['h']; upper_aperture = d['t0']+d['t1']*d['x']+d['h']; neighbor_trace = d['t0']+d['t1']*d['x']+d['pitch']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'trace_offset': d['y']-d['t0']-d['t1']*d['x'], 'blaze_coordinate': d['x']-d['bx'], 'order_wavelength': d['k']*d['m'], 'lower_aperture': d['t0']+d['t1']*d['x']-d['h'], 'upper_aperture': d['t0']+d['t1']*d['x']+d['h'], 'neighbor_trace': d['t0']+d['t1']*d['x']+d['pitch']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 11, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 120.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -1, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': -3, 'upper_aperture': 1, 'neighbor_trace': 4}), ({'x': 4, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 18})], 2: [({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 13, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 120.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 0, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': -4, 'upper_aperture': 0, 'neighbor_trace': 3}), ({'x': 5, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -5, 'blaze_coordinate': 7, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 20})], 3: [({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 15, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 120.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 1, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': -5, 'upper_aperture': -1, 'neighbor_trace': 2}), ({'x': 6, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -7, 'blaze_coordinate': 8, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 22})], 4: [({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 17, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 120.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 2, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': -6, 'upper_aperture': -2, 'neighbor_trace': 1}), ({'x': 7, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -9, 'blaze_coordinate': 9, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 24})], 5: [({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 19, 'upper_aperture': 19, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 120.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': -7, 'upper_aperture': -3, 'neighbor_trace': 0}), ({'x': 8, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -11, 'blaze_coordinate': 10, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 26})]}
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-echelle-order-coordinate

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

N = 1
observations = []
def solve(d):
    return {'trace_offset': d['y']-d['t0']-d['t1']*d['x'], 'blaze_coordinate': d['x']-d['bx'], 'order_wavelength': d['k']/(d['m']+1), 'lower_aperture': d['t0']+d['t1']*d['x']-d['h'], 'upper_aperture': d['t0']+d['t1']*d['x']+d['h'], 'neighbor_trace': d['t0']+d['t1']*d['x']+d['pitch']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 11, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 120.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -1, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': -3, 'upper_aperture': 1, 'neighbor_trace': 4}), ({'x': 4, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 18})], 2: [({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 13, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 120.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 0, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': -4, 'upper_aperture': 0, 'neighbor_trace': 3}), ({'x': 5, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -5, 'blaze_coordinate': 7, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 20})], 3: [({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 15, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 120.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 1, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': -5, 'upper_aperture': -1, 'neighbor_trace': 2}), ({'x': 6, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -7, 'blaze_coordinate': 8, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 22})], 4: [({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 17, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 120.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 2, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': -6, 'upper_aperture': -2, 'neighbor_trace': 1}), ({'x': 7, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -9, 'blaze_coordinate': 9, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 24})], 5: [({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 19, 'upper_aperture': 19, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 120.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': -7, 'upper_aperture': -3, 'neighbor_trace': 0}), ({'x': 8, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -11, 'blaze_coordinate': 10, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 26})]}
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 order wavelength while other fields remain valid.

A reduced echelle extractor uses detector x along dispersion and y across orders. The blaze coordinate is centered on bx, trace is t0+t1*x, order-normalized wavelength is k/m, and rectangular extraction bounds use half-height h about that trace. Orders m are positive. Output fields are defined by: trace_offset = d['y']-d['t0']-d['t1']*d['x']; blaze_coordinate = d['x']-d['bx']; order_wavelength = d['k']/d['m']; lower_aperture = d['t0']+d['t1']*d['x']-d['h']; upper_aperture = d['t0']+d['t1']*d['x']+d['h']; neighbor_trace = d['t0']+d['t1']*d['x']+d['pitch']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'trace_offset': d['y']-d['t0']-d['t1']*d['x'], 'blaze_coordinate': d['x']-d['bx'], 'order_wavelength': d['k']/d['m'], 'lower_aperture': d['t0']-d['h'], 'upper_aperture': d['t0']+d['t1']*d['x']+d['h'], 'neighbor_trace': d['t0']+d['t1']*d['x']+d['pitch']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 11, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 120.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -1, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': -3, 'upper_aperture': 1, 'neighbor_trace': 4}), ({'x': 4, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 18})], 2: [({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 13, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 120.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 0, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': -4, 'upper_aperture': 0, 'neighbor_trace': 3}), ({'x': 5, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -5, 'blaze_coordinate': 7, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 20})], 3: [({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 15, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 120.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 1, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': -5, 'upper_aperture': -1, 'neighbor_trace': 2}), ({'x': 6, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -7, 'blaze_coordinate': 8, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 22})], 4: [({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 17, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 120.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 2, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': -6, 'upper_aperture': -2, 'neighbor_trace': 1}), ({'x': 7, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -9, 'blaze_coordinate': 9, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 24})], 5: [({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 19, 'upper_aperture': 19, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 120.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': -7, 'upper_aperture': -3, 'neighbor_trace': 0}), ({'x': 8, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -11, 'blaze_coordinate': 10, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 26})]}
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-echelle-order-coordinate

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

N = 1
observations = []
def solve(d):
    return {'trace_offset': d['y']-d['t0']-d['t1']*d['x'], 'blaze_coordinate': d['x']-d['bx'], 'order_wavelength': d['k']/d['m'], 'lower_aperture': d['t0']+d['t1']*d['x']-d['h']/2, 'upper_aperture': d['t0']+d['t1']*d['x']+d['h'], 'neighbor_trace': d['t0']+d['t1']*d['x']+d['pitch']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 11, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 120.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -1, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': -3, 'upper_aperture': 1, 'neighbor_trace': 4}), ({'x': 4, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 18})], 2: [({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 13, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 120.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 0, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': -4, 'upper_aperture': 0, 'neighbor_trace': 3}), ({'x': 5, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -5, 'blaze_coordinate': 7, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 20})], 3: [({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 15, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 120.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 1, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': -5, 'upper_aperture': -1, 'neighbor_trace': 2}), ({'x': 6, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -7, 'blaze_coordinate': 8, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 22})], 4: [({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 17, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 120.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 2, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': -6, 'upper_aperture': -2, 'neighbor_trace': 1}), ({'x': 7, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -9, 'blaze_coordinate': 9, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 24})], 5: [({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 19, 'upper_aperture': 19, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 120.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': -7, 'upper_aperture': -3, 'neighbor_trace': 0}), ({'x': 8, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -11, 'blaze_coordinate': 10, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 26})]}
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 lower aperture while other fields remain valid.

A reduced echelle extractor uses detector x along dispersion and y across orders. The blaze coordinate is centered on bx, trace is t0+t1*x, order-normalized wavelength is k/m, and rectangular extraction bounds use half-height h about that trace. Orders m are positive. Output fields are defined by: trace_offset = d['y']-d['t0']-d['t1']*d['x']; blaze_coordinate = d['x']-d['bx']; order_wavelength = d['k']/d['m']; lower_aperture = d['t0']+d['t1']*d['x']-d['h']; upper_aperture = d['t0']+d['t1']*d['x']+d['h']; neighbor_trace = d['t0']+d['t1']*d['x']+d['pitch']

split: open-access