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

N = 1
observations = []
def solve(d):
    return {'longitude_reference': d['x']+d['ax']*(d['k']-d['rk']), 'latitude_reference': d['y']+d['ay']*(d['k']-d['rk']), 'spectral_coordinate': d['rv']+d['dv']*(d['k']-d['rk']), 'spectral_width': abs(d['dv'])*d['thick'], 'lower_edge': d['rv']+d['dv']*(d['k']-d['rk']), 'upper_edge': d['rv']+d['dv']*(d['k']-d['rk'])+abs(d['dv'])*d['thick']/2}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 116, 'spectral_width': 8, 'lower_edge': 112.0, 'upper_edge': 120.0}), ({'k': 7, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 116, 'spectral_width': 8, 'lower_edge': 112.0, 'upper_edge': 120.0}), ({'k': 3, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 100, 'spectral_width': 8, 'lower_edge': 96.0, 'upper_edge': 104.0}), ({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 92, 'spectral_width': 4, 'lower_edge': 90.0, 'upper_edge': 94.0}), ({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 116, 'spectral_width': 4, 'lower_edge': 114.0, 'upper_edge': 118.0}), ({'k': 7, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -6, 'latitude_reference': 60, 'spectral_coordinate': 132, 'spectral_width': 8, 'lower_edge': 128.0, 'upper_edge': 136.0})], 2: [({'k': 8, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 20, 'latitude_reference': 5, 'spectral_coordinate': 120, 'spectral_width': 8, 'lower_edge': 116.0, 'upper_edge': 124.0}), ({'k': 8, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 120, 'spectral_width': 8, 'lower_edge': 116.0, 'upper_edge': 124.0}), ({'k': 4, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 12, 'latitude_reference': 17, 'spectral_coordinate': 104, 'spectral_width': 8, 'lower_edge': 100.0, 'upper_edge': 108.0}), ({'k': 8, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 20, 'latitude_reference': 5, 'spectral_coordinate': 90, 'spectral_width': 4, 'lower_edge': 88.0, 'upper_edge': 92.0}), ({'k': 8, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 20, 'latitude_reference': 5, 'spectral_coordinate': 120, 'spectral_width': 4, 'lower_edge': 118.0, 'upper_edge': 122.0}), ({'k': 8, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -8, 'latitude_reference': 65, 'spectral_coordinate': 136, 'spectral_width': 8, 'lower_edge': 132.0, 'upper_edge': 140.0})], 3: [({'k': 9, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 22, 'latitude_reference': 2, 'spectral_coordinate': 124, 'spectral_width': 8, 'lower_edge': 120.0, 'upper_edge': 128.0}), ({'k': 9, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 124, 'spectral_width': 8, 'lower_edge': 120.0, 'upper_edge': 128.0}), ({'k': 5, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 14, 'latitude_reference': 14, 'spectral_coordinate': 108, 'spectral_width': 8, 'lower_edge': 104.0, 'upper_edge': 112.0}), ({'k': 9, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 22, 'latitude_reference': 2, 'spectral_coordinate': 88, 'spectral_width': 4, 'lower_edge': 86.0, 'upper_edge': 90.0}), ({'k': 9, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 22, 'latitude_reference': 2, 'spectral_coordinate': 124, 'spectral_width': 4, 'lower_edge': 122.0, 'upper_edge': 126.0}), ({'k': 9, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -10, 'latitude_reference': 70, 'spectral_coordinate': 140, 'spectral_width': 8, 'lower_edge': 136.0, 'upper_edge': 144.0})], 4: [({'k': 10, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 24, 'latitude_reference': -1, 'spectral_coordinate': 128, 'spectral_width': 8, 'lower_edge': 124.0, 'upper_edge': 132.0}), ({'k': 10, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 128, 'spectral_width': 8, 'lower_edge': 124.0, 'upper_edge': 132.0}), ({'k': 6, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 16, 'latitude_reference': 11, 'spectral_coordinate': 112, 'spectral_width': 8, 'lower_edge': 108.0, 'upper_edge': 116.0}), ({'k': 10, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 24, 'latitude_reference': -1, 'spectral_coordinate': 86, 'spectral_width': 4, 'lower_edge': 84.0, 'upper_edge': 88.0}), ({'k': 10, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 24, 'latitude_reference': -1, 'spectral_coordinate': 128, 'spectral_width': 4, 'lower_edge': 126.0, 'upper_edge': 130.0}), ({'k': 10, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -12, 'latitude_reference': 75, 'spectral_coordinate': 144, 'spectral_width': 8, 'lower_edge': 140.0, 'upper_edge': 148.0})], 5: [({'k': 11, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 26, 'latitude_reference': -4, 'spectral_coordinate': 132, 'spectral_width': 8, 'lower_edge': 128.0, 'upper_edge': 136.0}), ({'k': 11, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 132, 'spectral_width': 8, 'lower_edge': 128.0, 'upper_edge': 136.0}), ({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 116, 'spectral_width': 8, 'lower_edge': 112.0, 'upper_edge': 120.0}), ({'k': 11, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 26, 'latitude_reference': -4, 'spectral_coordinate': 84, 'spectral_width': 4, 'lower_edge': 82.0, 'upper_edge': 86.0}), ({'k': 11, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 26, 'latitude_reference': -4, 'spectral_coordinate': 132, 'spectral_width': 4, 'lower_edge': 130.0, 'upper_edge': 134.0}), ({'k': 11, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -14, 'latitude_reference': 80, 'spectral_coordinate': 148, 'spectral_width': 8, 'lower_edge': 144.0, 'upper_edge': 152.0})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

evaluation_group: astro-cube-axis-slice

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

N = 1
observations = []
def solve(d):
    return {'longitude_reference': d['x']+d['ax']*(d['k']-d['rk']), 'latitude_reference': d['y']+d['ay']*(d['k']-d['rk']), 'spectral_coordinate': d['rv']+d['dv']*(d['k']-d['rk']), 'spectral_width': abs(d['dv'])*d['thick'], 'lower_edge': d['rv']+d['dv']*(d['k']-d['rk'])-d['dv']*d['thick']/2, 'upper_edge': d['rv']+d['dv']*(d['k']-d['rk'])+abs(d['dv'])*d['thick']/2}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 116, 'spectral_width': 8, 'lower_edge': 112.0, 'upper_edge': 120.0}), ({'k': 7, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 116, 'spectral_width': 8, 'lower_edge': 112.0, 'upper_edge': 120.0}), ({'k': 3, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 100, 'spectral_width': 8, 'lower_edge': 96.0, 'upper_edge': 104.0}), ({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 92, 'spectral_width': 4, 'lower_edge': 90.0, 'upper_edge': 94.0}), ({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 116, 'spectral_width': 4, 'lower_edge': 114.0, 'upper_edge': 118.0}), ({'k': 7, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -6, 'latitude_reference': 60, 'spectral_coordinate': 132, 'spectral_width': 8, 'lower_edge': 128.0, 'upper_edge': 136.0})], 2: [({'k': 8, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 20, 'latitude_reference': 5, 'spectral_coordinate': 120, 'spectral_width': 8, 'lower_edge': 116.0, 'upper_edge': 124.0}), ({'k': 8, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 120, 'spectral_width': 8, 'lower_edge': 116.0, 'upper_edge': 124.0}), ({'k': 4, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 12, 'latitude_reference': 17, 'spectral_coordinate': 104, 'spectral_width': 8, 'lower_edge': 100.0, 'upper_edge': 108.0}), ({'k': 8, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 20, 'latitude_reference': 5, 'spectral_coordinate': 90, 'spectral_width': 4, 'lower_edge': 88.0, 'upper_edge': 92.0}), ({'k': 8, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 20, 'latitude_reference': 5, 'spectral_coordinate': 120, 'spectral_width': 4, 'lower_edge': 118.0, 'upper_edge': 122.0}), ({'k': 8, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -8, 'latitude_reference': 65, 'spectral_coordinate': 136, 'spectral_width': 8, 'lower_edge': 132.0, 'upper_edge': 140.0})], 3: [({'k': 9, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 22, 'latitude_reference': 2, 'spectral_coordinate': 124, 'spectral_width': 8, 'lower_edge': 120.0, 'upper_edge': 128.0}), ({'k': 9, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 124, 'spectral_width': 8, 'lower_edge': 120.0, 'upper_edge': 128.0}), ({'k': 5, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 14, 'latitude_reference': 14, 'spectral_coordinate': 108, 'spectral_width': 8, 'lower_edge': 104.0, 'upper_edge': 112.0}), ({'k': 9, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 22, 'latitude_reference': 2, 'spectral_coordinate': 88, 'spectral_width': 4, 'lower_edge': 86.0, 'upper_edge': 90.0}), ({'k': 9, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 22, 'latitude_reference': 2, 'spectral_coordinate': 124, 'spectral_width': 4, 'lower_edge': 122.0, 'upper_edge': 126.0}), ({'k': 9, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -10, 'latitude_reference': 70, 'spectral_coordinate': 140, 'spectral_width': 8, 'lower_edge': 136.0, 'upper_edge': 144.0})], 4: [({'k': 10, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 24, 'latitude_reference': -1, 'spectral_coordinate': 128, 'spectral_width': 8, 'lower_edge': 124.0, 'upper_edge': 132.0}), ({'k': 10, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 128, 'spectral_width': 8, 'lower_edge': 124.0, 'upper_edge': 132.0}), ({'k': 6, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 16, 'latitude_reference': 11, 'spectral_coordinate': 112, 'spectral_width': 8, 'lower_edge': 108.0, 'upper_edge': 116.0}), ({'k': 10, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 24, 'latitude_reference': -1, 'spectral_coordinate': 86, 'spectral_width': 4, 'lower_edge': 84.0, 'upper_edge': 88.0}), ({'k': 10, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 24, 'latitude_reference': -1, 'spectral_coordinate': 128, 'spectral_width': 4, 'lower_edge': 126.0, 'upper_edge': 130.0}), ({'k': 10, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -12, 'latitude_reference': 75, 'spectral_coordinate': 144, 'spectral_width': 8, 'lower_edge': 140.0, 'upper_edge': 148.0})], 5: [({'k': 11, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 26, 'latitude_reference': -4, 'spectral_coordinate': 132, 'spectral_width': 8, 'lower_edge': 128.0, 'upper_edge': 136.0}), ({'k': 11, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 132, 'spectral_width': 8, 'lower_edge': 128.0, 'upper_edge': 136.0}), ({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 116, 'spectral_width': 8, 'lower_edge': 112.0, 'upper_edge': 120.0}), ({'k': 11, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 26, 'latitude_reference': -4, 'spectral_coordinate': 84, 'spectral_width': 4, 'lower_edge': 82.0, 'upper_edge': 86.0}), ({'k': 11, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 26, 'latitude_reference': -4, 'spectral_coordinate': 132, 'spectral_width': 4, 'lower_edge': 130.0, 'upper_edge': 134.0}), ({'k': 11, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -14, 'latitude_reference': 80, 'spectral_coordinate': 148, 'spectral_width': 8, 'lower_edge': 144.0, 'upper_edge': 152.0})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect lower edge while other fields remain valid.

A linear cube has two retained celestial axes and a sliced spectral pixel k with reference rk. Cross-axis CD coefficients ax,ay shift celestial reference values. Spectral world coordinate is rv+dv*(k-rk). Slice thickness is specified in spectral pixels. Output fields are defined by: longitude_reference = d['x']+d['ax']*(d['k']-d['rk']); latitude_reference = d['y']+d['ay']*(d['k']-d['rk']); spectral_coordinate = d['rv']+d['dv']*(d['k']-d['rk']); spectral_width = abs(d['dv'])*d['thick']; lower_edge = d['rv']+d['dv']*(d['k']-d['rk'])-abs(d['dv'])*d['thick']/2; upper_edge = d['rv']+d['dv']*(d['k']-d['rk'])+abs(d['dv'])*d['thick']/2

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'longitude_reference': d['x']+d['ax']*(d['k']-d['rk']), 'latitude_reference': d['y']+d['ay']*(d['k']-d['rk']), 'spectral_coordinate': d['rv']+d['dv']*(d['k']-d['rk']), 'spectral_width': abs(d['dv'])*d['thick'], 'lower_edge': d['rv']+d['dv']*(d['k']-d['rk'])-abs(d['dv'])*d['thick']/2, 'upper_edge': d['rv']+d['dv']*(d['k']-d['rk'])+abs(d['dv'])*d['thick']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 116, 'spectral_width': 8, 'lower_edge': 112.0, 'upper_edge': 120.0}), ({'k': 7, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 116, 'spectral_width': 8, 'lower_edge': 112.0, 'upper_edge': 120.0}), ({'k': 3, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 100, 'spectral_width': 8, 'lower_edge': 96.0, 'upper_edge': 104.0}), ({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 92, 'spectral_width': 4, 'lower_edge': 90.0, 'upper_edge': 94.0}), ({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 116, 'spectral_width': 4, 'lower_edge': 114.0, 'upper_edge': 118.0}), ({'k': 7, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -6, 'latitude_reference': 60, 'spectral_coordinate': 132, 'spectral_width': 8, 'lower_edge': 128.0, 'upper_edge': 136.0})], 2: [({'k': 8, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 20, 'latitude_reference': 5, 'spectral_coordinate': 120, 'spectral_width': 8, 'lower_edge': 116.0, 'upper_edge': 124.0}), ({'k': 8, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 120, 'spectral_width': 8, 'lower_edge': 116.0, 'upper_edge': 124.0}), ({'k': 4, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 12, 'latitude_reference': 17, 'spectral_coordinate': 104, 'spectral_width': 8, 'lower_edge': 100.0, 'upper_edge': 108.0}), ({'k': 8, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 20, 'latitude_reference': 5, 'spectral_coordinate': 90, 'spectral_width': 4, 'lower_edge': 88.0, 'upper_edge': 92.0}), ({'k': 8, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 20, 'latitude_reference': 5, 'spectral_coordinate': 120, 'spectral_width': 4, 'lower_edge': 118.0, 'upper_edge': 122.0}), ({'k': 8, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -8, 'latitude_reference': 65, 'spectral_coordinate': 136, 'spectral_width': 8, 'lower_edge': 132.0, 'upper_edge': 140.0})], 3: [({'k': 9, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 22, 'latitude_reference': 2, 'spectral_coordinate': 124, 'spectral_width': 8, 'lower_edge': 120.0, 'upper_edge': 128.0}), ({'k': 9, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 124, 'spectral_width': 8, 'lower_edge': 120.0, 'upper_edge': 128.0}), ({'k': 5, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 14, 'latitude_reference': 14, 'spectral_coordinate': 108, 'spectral_width': 8, 'lower_edge': 104.0, 'upper_edge': 112.0}), ({'k': 9, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 22, 'latitude_reference': 2, 'spectral_coordinate': 88, 'spectral_width': 4, 'lower_edge': 86.0, 'upper_edge': 90.0}), ({'k': 9, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 22, 'latitude_reference': 2, 'spectral_coordinate': 124, 'spectral_width': 4, 'lower_edge': 122.0, 'upper_edge': 126.0}), ({'k': 9, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -10, 'latitude_reference': 70, 'spectral_coordinate': 140, 'spectral_width': 8, 'lower_edge': 136.0, 'upper_edge': 144.0})], 4: [({'k': 10, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 24, 'latitude_reference': -1, 'spectral_coordinate': 128, 'spectral_width': 8, 'lower_edge': 124.0, 'upper_edge': 132.0}), ({'k': 10, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 128, 'spectral_width': 8, 'lower_edge': 124.0, 'upper_edge': 132.0}), ({'k': 6, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 16, 'latitude_reference': 11, 'spectral_coordinate': 112, 'spectral_width': 8, 'lower_edge': 108.0, 'upper_edge': 116.0}), ({'k': 10, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 24, 'latitude_reference': -1, 'spectral_coordinate': 86, 'spectral_width': 4, 'lower_edge': 84.0, 'upper_edge': 88.0}), ({'k': 10, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 24, 'latitude_reference': -1, 'spectral_coordinate': 128, 'spectral_width': 4, 'lower_edge': 126.0, 'upper_edge': 130.0}), ({'k': 10, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -12, 'latitude_reference': 75, 'spectral_coordinate': 144, 'spectral_width': 8, 'lower_edge': 140.0, 'upper_edge': 148.0})], 5: [({'k': 11, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 26, 'latitude_reference': -4, 'spectral_coordinate': 132, 'spectral_width': 8, 'lower_edge': 128.0, 'upper_edge': 136.0}), ({'k': 11, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 132, 'spectral_width': 8, 'lower_edge': 128.0, 'upper_edge': 136.0}), ({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 116, 'spectral_width': 8, 'lower_edge': 112.0, 'upper_edge': 120.0}), ({'k': 11, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 26, 'latitude_reference': -4, 'spectral_coordinate': 84, 'spectral_width': 4, 'lower_edge': 82.0, 'upper_edge': 86.0}), ({'k': 11, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 26, 'latitude_reference': -4, 'spectral_coordinate': 132, 'spectral_width': 4, 'lower_edge': 130.0, 'upper_edge': 134.0}), ({'k': 11, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -14, 'latitude_reference': 80, 'spectral_coordinate': 148, 'spectral_width': 8, 'lower_edge': 144.0, 'upper_edge': 152.0})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

evaluation_group: astro-cube-axis-slice

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

N = 1
observations = []
def solve(d):
    return {'longitude_reference': d['x']+d['ax']*(d['k']-d['rk']), 'latitude_reference': d['y']+d['ay']*(d['k']-d['rk']), 'spectral_coordinate': d['rv']+d['dv']*(d['k']-d['rk']), 'spectral_width': abs(d['dv'])*d['thick'], 'lower_edge': d['rv']+d['dv']*(d['k']-d['rk'])-abs(d['dv'])*d['thick']/2, 'upper_edge': d['rv']+d['dv']*(d['k']-d['rk'])+abs(d['dv'])/2}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 116, 'spectral_width': 8, 'lower_edge': 112.0, 'upper_edge': 120.0}), ({'k': 7, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 116, 'spectral_width': 8, 'lower_edge': 112.0, 'upper_edge': 120.0}), ({'k': 3, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 100, 'spectral_width': 8, 'lower_edge': 96.0, 'upper_edge': 104.0}), ({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 92, 'spectral_width': 4, 'lower_edge': 90.0, 'upper_edge': 94.0}), ({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 116, 'spectral_width': 4, 'lower_edge': 114.0, 'upper_edge': 118.0}), ({'k': 7, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -6, 'latitude_reference': 60, 'spectral_coordinate': 132, 'spectral_width': 8, 'lower_edge': 128.0, 'upper_edge': 136.0})], 2: [({'k': 8, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 20, 'latitude_reference': 5, 'spectral_coordinate': 120, 'spectral_width': 8, 'lower_edge': 116.0, 'upper_edge': 124.0}), ({'k': 8, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 120, 'spectral_width': 8, 'lower_edge': 116.0, 'upper_edge': 124.0}), ({'k': 4, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 12, 'latitude_reference': 17, 'spectral_coordinate': 104, 'spectral_width': 8, 'lower_edge': 100.0, 'upper_edge': 108.0}), ({'k': 8, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 20, 'latitude_reference': 5, 'spectral_coordinate': 90, 'spectral_width': 4, 'lower_edge': 88.0, 'upper_edge': 92.0}), ({'k': 8, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 20, 'latitude_reference': 5, 'spectral_coordinate': 120, 'spectral_width': 4, 'lower_edge': 118.0, 'upper_edge': 122.0}), ({'k': 8, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -8, 'latitude_reference': 65, 'spectral_coordinate': 136, 'spectral_width': 8, 'lower_edge': 132.0, 'upper_edge': 140.0})], 3: [({'k': 9, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 22, 'latitude_reference': 2, 'spectral_coordinate': 124, 'spectral_width': 8, 'lower_edge': 120.0, 'upper_edge': 128.0}), ({'k': 9, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 124, 'spectral_width': 8, 'lower_edge': 120.0, 'upper_edge': 128.0}), ({'k': 5, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 14, 'latitude_reference': 14, 'spectral_coordinate': 108, 'spectral_width': 8, 'lower_edge': 104.0, 'upper_edge': 112.0}), ({'k': 9, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 22, 'latitude_reference': 2, 'spectral_coordinate': 88, 'spectral_width': 4, 'lower_edge': 86.0, 'upper_edge': 90.0}), ({'k': 9, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 22, 'latitude_reference': 2, 'spectral_coordinate': 124, 'spectral_width': 4, 'lower_edge': 122.0, 'upper_edge': 126.0}), ({'k': 9, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -10, 'latitude_reference': 70, 'spectral_coordinate': 140, 'spectral_width': 8, 'lower_edge': 136.0, 'upper_edge': 144.0})], 4: [({'k': 10, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 24, 'latitude_reference': -1, 'spectral_coordinate': 128, 'spectral_width': 8, 'lower_edge': 124.0, 'upper_edge': 132.0}), ({'k': 10, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 128, 'spectral_width': 8, 'lower_edge': 124.0, 'upper_edge': 132.0}), ({'k': 6, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 16, 'latitude_reference': 11, 'spectral_coordinate': 112, 'spectral_width': 8, 'lower_edge': 108.0, 'upper_edge': 116.0}), ({'k': 10, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 24, 'latitude_reference': -1, 'spectral_coordinate': 86, 'spectral_width': 4, 'lower_edge': 84.0, 'upper_edge': 88.0}), ({'k': 10, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 24, 'latitude_reference': -1, 'spectral_coordinate': 128, 'spectral_width': 4, 'lower_edge': 126.0, 'upper_edge': 130.0}), ({'k': 10, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -12, 'latitude_reference': 75, 'spectral_coordinate': 144, 'spectral_width': 8, 'lower_edge': 140.0, 'upper_edge': 148.0})], 5: [({'k': 11, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 26, 'latitude_reference': -4, 'spectral_coordinate': 132, 'spectral_width': 8, 'lower_edge': 128.0, 'upper_edge': 136.0}), ({'k': 11, 'rk': 3, 'ax': 0, 'ay': 0, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 10, 'latitude_reference': 20, 'spectral_coordinate': 132, 'spectral_width': 8, 'lower_edge': 128.0, 'upper_edge': 136.0}), ({'k': 7, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': 18, 'latitude_reference': 8, 'spectral_coordinate': 116, 'spectral_width': 8, 'lower_edge': 112.0, 'upper_edge': 120.0}), ({'k': 11, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': -2, 'thick': 2}, {'longitude_reference': 26, 'latitude_reference': -4, 'spectral_coordinate': 84, 'spectral_width': 4, 'lower_edge': 82.0, 'upper_edge': 86.0}), ({'k': 11, 'rk': 3, 'ax': 2, 'ay': -3, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 1}, {'longitude_reference': 26, 'latitude_reference': -4, 'spectral_coordinate': 132, 'spectral_width': 4, 'lower_edge': 130.0, 'upper_edge': 134.0}), ({'k': 11, 'rk': -1, 'ax': -2, 'ay': 5, 'x': 10, 'y': 20, 'rv': 100, 'dv': 4, 'thick': 2}, {'longitude_reference': -14, 'latitude_reference': 80, 'spectral_coordinate': 148, 'spectral_width': 8, 'lower_edge': 144.0, 'upper_edge': 152.0})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect upper edge while other fields remain valid.

A linear cube has two retained celestial axes and a sliced spectral pixel k with reference rk. Cross-axis CD coefficients ax,ay shift celestial reference values. Spectral world coordinate is rv+dv*(k-rk). Slice thickness is specified in spectral pixels. Output fields are defined by: longitude_reference = d['x']+d['ax']*(d['k']-d['rk']); latitude_reference = d['y']+d['ay']*(d['k']-d['rk']); spectral_coordinate = d['rv']+d['dv']*(d['k']-d['rk']); spectral_width = abs(d['dv'])*d['thick']; lower_edge = d['rv']+d['dv']*(d['k']-d['rk'])-abs(d['dv'])*d['thick']/2; upper_edge = d['rv']+d['dv']*(d['k']-d['rk'])+abs(d['dv'])*d['thick']/2

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'a_science_column': d['x'], 'b_detector_column': d['a']+d['gap']+d['b']+1-d['x'], 'science_row': d['y']-d['parallel'], 'b_first_pixel': d['a']+d['gap']+1, 'mosaic_extent': d['a']+d['gap']+d['b'], 'science_rows': d['rows']-d['parallel']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 23, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 1, 'y': 1, 'rows': 20}, {'a_science_column': -1, 'b_detector_column': 25, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 9}, {'a_science_column': 1, 'b_detector_column': 11, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 8, 'y': 20, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 18, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 2: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 22, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 2, 'y': 1, 'rows': 20}, {'a_science_column': 0, 'b_detector_column': 24, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 9}, {'a_science_column': 2, 'b_detector_column': 10, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 9, 'y': 20, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 17, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 3: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 21, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 18, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 1, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 9}, {'a_science_column': 3, 'b_detector_column': 9, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 10, 'y': 20, 'rows': 20}, {'a_science_column': 8, 'b_detector_column': 16, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 4: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 20, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 17, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 1, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 9}, {'a_science_column': 4, 'b_detector_column': 8, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 11, 'y': 20, 'rows': 20}, {'a_science_column': 9, 'b_detector_column': 15, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 5: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 19, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 16, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 1, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 9}, {'a_science_column': 5, 'b_detector_column': 7, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 12, 'y': 20, 'rows': 20}, {'a_science_column': 10, 'b_detector_column': 14, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})]}
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-detector-mosaic-sections

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

N = 1
observations = []
def solve(d):
    return {'a_science_column': d['x']-d['parallel'], 'b_detector_column': d['a']+d['gap']+d['b']+1-d['x'], 'science_row': d['y']-d['parallel'], 'b_first_pixel': d['a']+d['gap']+1, 'mosaic_extent': d['a']+d['gap']+d['b'], 'science_rows': d['rows']-d['parallel']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 23, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 1, 'y': 1, 'rows': 20}, {'a_science_column': -1, 'b_detector_column': 25, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 9}, {'a_science_column': 1, 'b_detector_column': 11, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 8, 'y': 20, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 18, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 2: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 22, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 2, 'y': 1, 'rows': 20}, {'a_science_column': 0, 'b_detector_column': 24, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 9}, {'a_science_column': 2, 'b_detector_column': 10, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 9, 'y': 20, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 17, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 3: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 21, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 18, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 1, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 9}, {'a_science_column': 3, 'b_detector_column': 9, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 10, 'y': 20, 'rows': 20}, {'a_science_column': 8, 'b_detector_column': 16, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 4: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 20, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 17, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 1, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 9}, {'a_science_column': 4, 'b_detector_column': 8, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 11, 'y': 20, 'rows': 20}, {'a_science_column': 9, 'b_detector_column': 15, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 5: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 19, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 16, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 1, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 9}, {'a_science_column': 5, 'b_detector_column': 7, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 12, 'y': 20, 'rows': 20}, {'a_science_column': 10, 'b_detector_column': 14, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})]}
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 a science column while other fields remain valid.

Two readout amplifiers cover a focal plane with overscan removed. Amplifier B is physically reversed. Detector labels are one-based; chip gap has no samples. Serial overscan is measured in columns and parallel overscan in rows. Output fields are defined by: a_science_column = d['x']-d['serial']; b_detector_column = d['a']+d['gap']+d['b']+1-d['x']; science_row = d['y']-d['parallel']; b_first_pixel = d['a']+d['gap']+1; mosaic_extent = d['a']+d['gap']+d['b']; science_rows = d['rows']-d['parallel']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'a_science_column': d['x']-d['serial'], 'b_detector_column': d['a']+d['gap']+d['x'], 'science_row': d['y']-d['parallel'], 'b_first_pixel': d['a']+d['gap']+1, 'mosaic_extent': d['a']+d['gap']+d['b'], 'science_rows': d['rows']-d['parallel']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 23, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 1, 'y': 1, 'rows': 20}, {'a_science_column': -1, 'b_detector_column': 25, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 9}, {'a_science_column': 1, 'b_detector_column': 11, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 8, 'y': 20, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 18, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 2: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 22, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 2, 'y': 1, 'rows': 20}, {'a_science_column': 0, 'b_detector_column': 24, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 9}, {'a_science_column': 2, 'b_detector_column': 10, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 9, 'y': 20, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 17, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 3: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 21, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 18, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 1, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 9}, {'a_science_column': 3, 'b_detector_column': 9, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 10, 'y': 20, 'rows': 20}, {'a_science_column': 8, 'b_detector_column': 16, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 4: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 20, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 17, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 1, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 9}, {'a_science_column': 4, 'b_detector_column': 8, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 11, 'y': 20, 'rows': 20}, {'a_science_column': 9, 'b_detector_column': 15, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 5: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 19, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 16, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 1, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 9}, {'a_science_column': 5, 'b_detector_column': 7, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 12, 'y': 20, 'rows': 20}, {'a_science_column': 10, 'b_detector_column': 14, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})]}
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-detector-mosaic-sections

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

N = 1
observations = []
def solve(d):
    return {'a_science_column': d['x']-d['serial'], 'b_detector_column': d['a']+d['b']+1-d['x'], 'science_row': d['y']-d['parallel'], 'b_first_pixel': d['a']+d['gap']+1, 'mosaic_extent': d['a']+d['gap']+d['b'], 'science_rows': d['rows']-d['parallel']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 23, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 1, 'y': 1, 'rows': 20}, {'a_science_column': -1, 'b_detector_column': 25, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 9}, {'a_science_column': 1, 'b_detector_column': 11, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 8, 'y': 20, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 18, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 2: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 22, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 2, 'y': 1, 'rows': 20}, {'a_science_column': 0, 'b_detector_column': 24, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 9}, {'a_science_column': 2, 'b_detector_column': 10, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 9, 'y': 20, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 17, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 3: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 21, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 18, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 1, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 9}, {'a_science_column': 3, 'b_detector_column': 9, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 10, 'y': 20, 'rows': 20}, {'a_science_column': 8, 'b_detector_column': 16, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 4: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 20, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 17, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 1, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 9}, {'a_science_column': 4, 'b_detector_column': 8, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 11, 'y': 20, 'rows': 20}, {'a_science_column': 9, 'b_detector_column': 15, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 5: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 19, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 16, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 1, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 9}, {'a_science_column': 5, 'b_detector_column': 7, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 12, 'y': 20, 'rows': 20}, {'a_science_column': 10, 'b_detector_column': 14, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})]}
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 b detector column while other fields remain valid.

Two readout amplifiers cover a focal plane with overscan removed. Amplifier B is physically reversed. Detector labels are one-based; chip gap has no samples. Serial overscan is measured in columns and parallel overscan in rows. Output fields are defined by: a_science_column = d['x']-d['serial']; b_detector_column = d['a']+d['gap']+d['b']+1-d['x']; science_row = d['y']-d['parallel']; b_first_pixel = d['a']+d['gap']+1; mosaic_extent = d['a']+d['gap']+d['b']; science_rows = d['rows']-d['parallel']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'a_science_column': d['x']-d['serial'], 'b_detector_column': d['a']+d['gap']+d['b']+1-d['x'], 'science_row': d['y']-d['serial'], 'b_first_pixel': d['a']+d['gap']+1, 'mosaic_extent': d['a']+d['gap']+d['b'], 'science_rows': d['rows']-d['parallel']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 23, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 1, 'y': 1, 'rows': 20}, {'a_science_column': -1, 'b_detector_column': 25, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 9}, {'a_science_column': 1, 'b_detector_column': 11, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 8, 'y': 20, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 18, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 2: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 22, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 2, 'y': 1, 'rows': 20}, {'a_science_column': 0, 'b_detector_column': 24, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 9}, {'a_science_column': 2, 'b_detector_column': 10, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 9, 'y': 20, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 17, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 3: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 21, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 18, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 1, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 9}, {'a_science_column': 3, 'b_detector_column': 9, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 10, 'y': 20, 'rows': 20}, {'a_science_column': 8, 'b_detector_column': 16, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 4: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 20, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 17, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 1, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 9}, {'a_science_column': 4, 'b_detector_column': 8, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 11, 'y': 20, 'rows': 20}, {'a_science_column': 9, 'b_detector_column': 15, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 5: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 19, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 16, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 1, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 9}, {'a_science_column': 5, 'b_detector_column': 7, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 12, 'y': 20, 'rows': 20}, {'a_science_column': 10, 'b_detector_column': 14, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})]}
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-detector-mosaic-sections

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

N = 1
observations = []
def solve(d):
    return {'a_science_column': d['x']-d['serial'], 'b_detector_column': d['a']+d['gap']+d['b']+1-d['x'], 'science_row': d['y']+d['parallel'], 'b_first_pixel': d['a']+d['gap']+1, 'mosaic_extent': d['a']+d['gap']+d['b'], 'science_rows': d['rows']-d['parallel']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 23, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 1, 'y': 1, 'rows': 20}, {'a_science_column': -1, 'b_detector_column': 25, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 9}, {'a_science_column': 1, 'b_detector_column': 11, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 8, 'y': 20, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 18, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 2: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 22, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 2, 'y': 1, 'rows': 20}, {'a_science_column': 0, 'b_detector_column': 24, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 9}, {'a_science_column': 2, 'b_detector_column': 10, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 9, 'y': 20, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 17, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 3: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 21, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 18, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 1, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 9}, {'a_science_column': 3, 'b_detector_column': 9, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 10, 'y': 20, 'rows': 20}, {'a_science_column': 8, 'b_detector_column': 16, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 4: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 20, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 17, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 1, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 9}, {'a_science_column': 4, 'b_detector_column': 8, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 11, 'y': 20, 'rows': 20}, {'a_science_column': 9, 'b_detector_column': 15, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 5: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 19, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 16, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 1, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 9}, {'a_science_column': 5, 'b_detector_column': 7, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 12, 'y': 20, 'rows': 20}, {'a_science_column': 10, 'b_detector_column': 14, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})]}
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 science row while other fields remain valid.

Two readout amplifiers cover a focal plane with overscan removed. Amplifier B is physically reversed. Detector labels are one-based; chip gap has no samples. Serial overscan is measured in columns and parallel overscan in rows. Output fields are defined by: a_science_column = d['x']-d['serial']; b_detector_column = d['a']+d['gap']+d['b']+1-d['x']; science_row = d['y']-d['parallel']; b_first_pixel = d['a']+d['gap']+1; mosaic_extent = d['a']+d['gap']+d['b']; science_rows = d['rows']-d['parallel']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'a_science_column': d['x']-d['serial'], 'b_detector_column': d['a']+d['gap']+d['b']+1-d['x'], 'science_row': d['y']-d['parallel'], 'b_first_pixel': d['a']+1, 'mosaic_extent': d['a']+d['gap']+d['b'], 'science_rows': d['rows']-d['parallel']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 23, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 1, 'y': 1, 'rows': 20}, {'a_science_column': -1, 'b_detector_column': 25, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 9}, {'a_science_column': 1, 'b_detector_column': 11, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 8, 'y': 20, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 18, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 2: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 22, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 2, 'y': 1, 'rows': 20}, {'a_science_column': 0, 'b_detector_column': 24, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 9}, {'a_science_column': 2, 'b_detector_column': 10, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 9, 'y': 20, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 17, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 3: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 21, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 18, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 1, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 9}, {'a_science_column': 3, 'b_detector_column': 9, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 10, 'y': 20, 'rows': 20}, {'a_science_column': 8, 'b_detector_column': 16, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 4: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 20, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 17, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 1, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 9}, {'a_science_column': 4, 'b_detector_column': 8, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 11, 'y': 20, 'rows': 20}, {'a_science_column': 9, 'b_detector_column': 15, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 5: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 19, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 16, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 1, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 9}, {'a_science_column': 5, 'b_detector_column': 7, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 12, 'y': 20, 'rows': 20}, {'a_science_column': 10, 'b_detector_column': 14, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})]}
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-detector-mosaic-sections

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

N = 1
observations = []
def solve(d):
    return {'a_science_column': d['x']-d['serial'], 'b_detector_column': d['a']+d['gap']+d['b']+1-d['x'], 'science_row': d['y']-d['parallel'], 'b_first_pixel': d['a']+d['gap'], 'mosaic_extent': d['a']+d['gap']+d['b'], 'science_rows': d['rows']-d['parallel']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 23, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 1, 'y': 1, 'rows': 20}, {'a_science_column': -1, 'b_detector_column': 25, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 7, 'rows': 9}, {'a_science_column': 1, 'b_detector_column': 11, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 8, 'y': 20, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 18, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 2: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 22, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 2, 'y': 1, 'rows': 20}, {'a_science_column': 0, 'b_detector_column': 24, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 7, 'rows': 9}, {'a_science_column': 2, 'b_detector_column': 10, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 9, 'y': 20, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 17, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 3: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 21, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 18, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 3, 'y': 1, 'rows': 20}, {'a_science_column': 1, 'b_detector_column': 23, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 7, 'rows': 9}, {'a_science_column': 3, 'b_detector_column': 9, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 10, 'y': 20, 'rows': 20}, {'a_science_column': 8, 'b_detector_column': 16, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 4: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 20, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 6, 'b_detector_column': 20, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 20}, {'a_science_column': 4, 'b_detector_column': 17, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 4, 'y': 1, 'rows': 20}, {'a_science_column': 2, 'b_detector_column': 22, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 6, 'y': 7, 'rows': 9}, {'a_science_column': 4, 'b_detector_column': 8, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 11, 'y': 20, 'rows': 20}, {'a_science_column': 9, 'b_detector_column': 15, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})], 5: [({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 19, 'science_row': 3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 0, 'parallel': 0, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 7, 'b_detector_column': 19, 'science_row': 7, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 20}), ({'a': 12, 'b': 10, 'gap': 0, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 20}, {'a_science_column': 5, 'b_detector_column': 16, 'science_row': 3, 'b_first_pixel': 13, 'mosaic_extent': 22, 'science_rows': 16}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 5, 'y': 1, 'rows': 20}, {'a_science_column': 3, 'b_detector_column': 21, 'science_row': -3, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16}), ({'a': 4, 'b': 6, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 7, 'y': 7, 'rows': 9}, {'a_science_column': 5, 'b_detector_column': 7, 'science_row': 3, 'b_first_pixel': 8, 'mosaic_extent': 13, 'science_rows': 5}), ({'a': 12, 'b': 10, 'gap': 3, 'serial': 2, 'parallel': 4, 'x': 12, 'y': 20, 'rows': 20}, {'a_science_column': 10, 'b_detector_column': 14, 'science_row': 16, 'b_first_pixel': 16, 'mosaic_extent': 25, 'science_rows': 16})]}
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 b first pixel while other fields remain valid.

Two readout amplifiers cover a focal plane with overscan removed. Amplifier B is physically reversed. Detector labels are one-based; chip gap has no samples. Serial overscan is measured in columns and parallel overscan in rows. Output fields are defined by: a_science_column = d['x']-d['serial']; b_detector_column = d['a']+d['gap']+d['b']+1-d['x']; science_row = d['y']-d['parallel']; b_first_pixel = d['a']+d['gap']+1; mosaic_extent = d['a']+d['gap']+d['b']; science_rows = d['rows']-d['parallel']

split: open-access