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

N = 1
observations = []
def solve(d):
    return {'trace_offset': d['y']-d['t0']-d['t1']*d['x'], 'blaze_coordinate': d['x']-d['bx'], 'order_wavelength': d['k']/d['m'], 'lower_aperture': d['t0']+d['t1']*d['x']-d['h'], 'upper_aperture': d['t0']+d['h'], 'neighbor_trace': d['t0']+d['t1']*d['x']+d['pitch']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 11, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 120.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -1, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': -3, 'upper_aperture': 1, 'neighbor_trace': 4}), ({'x': 4, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 18})], 2: [({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 13, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 120.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 0, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': -4, 'upper_aperture': 0, 'neighbor_trace': 3}), ({'x': 5, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -5, 'blaze_coordinate': 7, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 20})], 3: [({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 15, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 120.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 1, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': -5, 'upper_aperture': -1, 'neighbor_trace': 2}), ({'x': 6, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -7, 'blaze_coordinate': 8, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 22})], 4: [({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 17, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 120.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 2, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': -6, 'upper_aperture': -2, 'neighbor_trace': 1}), ({'x': 7, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -9, 'blaze_coordinate': 9, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 24})], 5: [({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 19, 'upper_aperture': 19, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 120.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': -7, 'upper_aperture': -3, 'neighbor_trace': 0}), ({'x': 8, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -11, 'blaze_coordinate': 10, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 26})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

evaluation_group: astro-echelle-order-coordinate

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

N = 1
observations = []
def solve(d):
    return {'trace_offset': d['y']-d['t0']-d['t1']*d['x'], 'blaze_coordinate': d['x']-d['bx'], 'order_wavelength': d['k']/d['m'], 'lower_aperture': d['t0']+d['t1']*d['x']-d['h'], 'upper_aperture': d['t0']+d['t1']*d['x']+2*d['h'], 'neighbor_trace': d['t0']+d['t1']*d['x']+d['pitch']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 11, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 120.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -1, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': -3, 'upper_aperture': 1, 'neighbor_trace': 4}), ({'x': 4, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 18})], 2: [({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 13, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 120.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 0, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': -4, 'upper_aperture': 0, 'neighbor_trace': 3}), ({'x': 5, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -5, 'blaze_coordinate': 7, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 20})], 3: [({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 15, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 120.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 1, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': -5, 'upper_aperture': -1, 'neighbor_trace': 2}), ({'x': 6, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -7, 'blaze_coordinate': 8, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 22})], 4: [({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 17, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 120.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 2, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': -6, 'upper_aperture': -2, 'neighbor_trace': 1}), ({'x': 7, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -9, 'blaze_coordinate': 9, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 24})], 5: [({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 19, 'upper_aperture': 19, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 120.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': -7, 'upper_aperture': -3, 'neighbor_trace': 0}), ({'x': 8, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -11, 'blaze_coordinate': 10, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 26})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'trace_offset': d['y']-d['t0']-d['t1']*d['x'], 'blaze_coordinate': d['x']-d['bx'], 'order_wavelength': d['k']/d['m'], 'lower_aperture': d['t0']+d['t1']*d['x']-d['h'], 'upper_aperture': d['t0']+d['t1']*d['x']+d['h'], 'neighbor_trace': d['t0']+d['t1']*d['x']+d['m']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 11, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 120.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -1, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': -3, 'upper_aperture': 1, 'neighbor_trace': 4}), ({'x': 4, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 18})], 2: [({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 13, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 120.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 0, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': -4, 'upper_aperture': 0, 'neighbor_trace': 3}), ({'x': 5, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -5, 'blaze_coordinate': 7, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 20})], 3: [({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 15, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 120.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 1, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': -5, 'upper_aperture': -1, 'neighbor_trace': 2}), ({'x': 6, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -7, 'blaze_coordinate': 8, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 22})], 4: [({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 17, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 120.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 2, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': -6, 'upper_aperture': -2, 'neighbor_trace': 1}), ({'x': 7, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -9, 'blaze_coordinate': 9, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 24})], 5: [({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 19, 'upper_aperture': 19, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 120.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': -7, 'upper_aperture': -3, 'neighbor_trace': 0}), ({'x': 8, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -11, 'blaze_coordinate': 10, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 26})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

evaluation_group: astro-echelle-order-coordinate

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

N = 1
observations = []
def solve(d):
    return {'trace_offset': d['y']-d['t0']-d['t1']*d['x'], 'blaze_coordinate': d['x']-d['bx'], 'order_wavelength': d['k']/d['m'], 'lower_aperture': d['t0']+d['t1']*d['x']-d['h'], 'upper_aperture': d['t0']+d['t1']*d['x']+d['h'], 'neighbor_trace': d['t0']+d['t1']*d['x']+d['pitch']*d['m']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 11, 'neighbor_trace': 16}), ({'x': 4, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -3, 'blaze_coordinate': 2, 'order_wavelength': 120.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 16}), ({'x': 4, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -1, 'blaze_coordinate': 2, 'order_wavelength': 40.0, 'lower_aperture': -3, 'upper_aperture': 1, 'neighbor_trace': 4}), ({'x': 4, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 9, 'upper_aperture': 13, 'neighbor_trace': 18})], 2: [({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 13, 'neighbor_trace': 18}), ({'x': 5, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -5, 'blaze_coordinate': 3, 'order_wavelength': 120.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 18}), ({'x': 5, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 0, 'blaze_coordinate': 3, 'order_wavelength': 40.0, 'lower_aperture': -4, 'upper_aperture': 0, 'neighbor_trace': 3}), ({'x': 5, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -5, 'blaze_coordinate': 7, 'order_wavelength': 40.0, 'lower_aperture': 11, 'upper_aperture': 15, 'neighbor_trace': 20})], 3: [({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 15, 'neighbor_trace': 20}), ({'x': 6, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -7, 'blaze_coordinate': 4, 'order_wavelength': 120.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 20}), ({'x': 6, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 1, 'blaze_coordinate': 4, 'order_wavelength': 40.0, 'lower_aperture': -5, 'upper_aperture': -1, 'neighbor_trace': 2}), ({'x': 6, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -7, 'blaze_coordinate': 8, 'order_wavelength': 40.0, 'lower_aperture': 13, 'upper_aperture': 17, 'neighbor_trace': 22})], 4: [({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 17, 'neighbor_trace': 22}), ({'x': 7, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -9, 'blaze_coordinate': 5, 'order_wavelength': 120.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 22}), ({'x': 7, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 2, 'blaze_coordinate': 5, 'order_wavelength': 40.0, 'lower_aperture': -6, 'upper_aperture': -2, 'neighbor_trace': 1}), ({'x': 7, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -9, 'blaze_coordinate': 9, 'order_wavelength': 40.0, 'lower_aperture': 15, 'upper_aperture': 19, 'neighbor_trace': 24})], 5: [({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 0, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 5, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 1, 'upper_aperture': 5, 'neighbor_trace': 8}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 0, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': 19, 'upper_aperture': 19, 'neighbor_trace': 24}), ({'x': 8, 'y': 8, 'bx': 2, 't0': 3, 't1': 2, 'k': 120, 'm': 1, 'h': 2, 'pitch': 5}, {'trace_offset': -11, 'blaze_coordinate': 6, 'order_wavelength': 120.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 24}), ({'x': 8, 'y': -2, 'bx': 2, 't0': 3, 't1': -1, 'k': 120, 'm': 3, 'h': 2, 'pitch': 5}, {'trace_offset': 3, 'blaze_coordinate': 6, 'order_wavelength': 40.0, 'lower_aperture': -7, 'upper_aperture': -3, 'neighbor_trace': 0}), ({'x': 8, 'y': 8, 'bx': -2, 't0': 3, 't1': 2, 'k': 120, 'm': 3, 'h': 2, 'pitch': 7}, {'trace_offset': -11, 'blaze_coordinate': 10, 'order_wavelength': 40.0, 'lower_aperture': 17, 'upper_aperture': 21, 'neighbor_trace': 26})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect neighbor trace while other fields remain valid.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'intensity': (d['xx']+d['yy'])/2, 'linear_q': d['xx']-d['yy'], 'linear_u': 2*d['re'], 'circular_v': -2*d['im'], 'swapped_q': d['yy']-d['xx'], 'swapped_v': 2*d['im']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'xx': 8, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 11, 'linear_q': 5, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -5, 'swapped_v': 8}), ({'xx': 3, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 6, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 11, 'linear_q': 5, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -5, 'swapped_v': 0}), ({'xx': 1, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': -11, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 11, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 11, 'linear_q': 5, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -5, 'swapped_v': -6}), ({'xx': 0, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 0, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8})], 2: [({'xx': 9, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 12, 'linear_q': 6, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -6, 'swapped_v': 8}), ({'xx': 4, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 7, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 12, 'linear_q': 6, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -6, 'swapped_v': 0}), ({'xx': 2, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': -10, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 10, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 12, 'linear_q': 6, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -6, 'swapped_v': -6}), ({'xx': 1, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 1, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8})], 3: [({'xx': 10, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': 7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -7, 'swapped_v': 8}), ({'xx': 5, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 8, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 13, 'linear_q': 7, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -7, 'swapped_v': 0}), ({'xx': 3, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': -9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 9, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 13, 'linear_q': 7, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -7, 'swapped_v': -6}), ({'xx': 2, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 2, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8})], 4: [({'xx': 11, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': 8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -8, 'swapped_v': 8}), ({'xx': 6, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 9, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 14, 'linear_q': 8, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -8, 'swapped_v': 0}), ({'xx': 4, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 16, 'linear_q': -8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 8, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 14, 'linear_q': 8, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -8, 'swapped_v': -6}), ({'xx': 3, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 3, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8})], 5: [({'xx': 12, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': 9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -9, 'swapped_v': 8}), ({'xx': 7, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 10, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 15, 'linear_q': 9, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -9, 'swapped_v': 0}), ({'xx': 5, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 17, 'linear_q': -7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 7, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 15, 'linear_q': 9, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -9, 'swapped_v': -6}), ({'xx': 4, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 4, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8})]}
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-stokes-linear-basis

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

N = 1
observations = []
def solve(d):
    return {'intensity': d['xx'], 'linear_q': d['xx']-d['yy'], 'linear_u': 2*d['re'], 'circular_v': -2*d['im'], 'swapped_q': d['yy']-d['xx'], 'swapped_v': 2*d['im']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'xx': 8, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 11, 'linear_q': 5, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -5, 'swapped_v': 8}), ({'xx': 3, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 6, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 11, 'linear_q': 5, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -5, 'swapped_v': 0}), ({'xx': 1, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': -11, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 11, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 11, 'linear_q': 5, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -5, 'swapped_v': -6}), ({'xx': 0, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 0, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8})], 2: [({'xx': 9, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 12, 'linear_q': 6, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -6, 'swapped_v': 8}), ({'xx': 4, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 7, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 12, 'linear_q': 6, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -6, 'swapped_v': 0}), ({'xx': 2, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': -10, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 10, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 12, 'linear_q': 6, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -6, 'swapped_v': -6}), ({'xx': 1, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 1, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8})], 3: [({'xx': 10, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': 7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -7, 'swapped_v': 8}), ({'xx': 5, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 8, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 13, 'linear_q': 7, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -7, 'swapped_v': 0}), ({'xx': 3, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': -9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 9, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 13, 'linear_q': 7, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -7, 'swapped_v': -6}), ({'xx': 2, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 2, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8})], 4: [({'xx': 11, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': 8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -8, 'swapped_v': 8}), ({'xx': 6, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 9, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 14, 'linear_q': 8, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -8, 'swapped_v': 0}), ({'xx': 4, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 16, 'linear_q': -8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 8, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 14, 'linear_q': 8, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -8, 'swapped_v': -6}), ({'xx': 3, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 3, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8})], 5: [({'xx': 12, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': 9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -9, 'swapped_v': 8}), ({'xx': 7, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 10, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 15, 'linear_q': 9, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -9, 'swapped_v': 0}), ({'xx': 5, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 17, 'linear_q': -7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 7, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 15, 'linear_q': 9, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -9, 'swapped_v': -6}), ({'xx': 4, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 4, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8})]}
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 intensity while other fields remain valid.

Two real linear-feed correlations XX,YY and real/imaginary XY define stipulated Stokes I=XX+YY,Q=XX-YY,U=2re,V=-2im. Reversing feed labels negates Q and V, leaves I and U unchanged. Output rotated fields model only that feed swap. Output fields are defined by: intensity = d['xx']+d['yy']; linear_q = d['xx']-d['yy']; linear_u = 2*d['re']; circular_v = -2*d['im']; swapped_q = d['yy']-d['xx']; swapped_v = 2*d['im']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'intensity': d['xx']+d['yy'], 'linear_q': d['yy']-d['xx'], 'linear_u': 2*d['re'], 'circular_v': -2*d['im'], 'swapped_q': d['yy']-d['xx'], 'swapped_v': 2*d['im']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'xx': 8, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 11, 'linear_q': 5, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -5, 'swapped_v': 8}), ({'xx': 3, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 6, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 11, 'linear_q': 5, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -5, 'swapped_v': 0}), ({'xx': 1, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': -11, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 11, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 11, 'linear_q': 5, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -5, 'swapped_v': -6}), ({'xx': 0, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 0, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8})], 2: [({'xx': 9, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 12, 'linear_q': 6, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -6, 'swapped_v': 8}), ({'xx': 4, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 7, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 12, 'linear_q': 6, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -6, 'swapped_v': 0}), ({'xx': 2, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': -10, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 10, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 12, 'linear_q': 6, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -6, 'swapped_v': -6}), ({'xx': 1, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 1, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8})], 3: [({'xx': 10, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': 7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -7, 'swapped_v': 8}), ({'xx': 5, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 8, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 13, 'linear_q': 7, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -7, 'swapped_v': 0}), ({'xx': 3, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': -9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 9, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 13, 'linear_q': 7, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -7, 'swapped_v': -6}), ({'xx': 2, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 2, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8})], 4: [({'xx': 11, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': 8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -8, 'swapped_v': 8}), ({'xx': 6, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 9, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 14, 'linear_q': 8, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -8, 'swapped_v': 0}), ({'xx': 4, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 16, 'linear_q': -8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 8, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 14, 'linear_q': 8, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -8, 'swapped_v': -6}), ({'xx': 3, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 3, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8})], 5: [({'xx': 12, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': 9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -9, 'swapped_v': 8}), ({'xx': 7, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 10, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 15, 'linear_q': 9, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -9, 'swapped_v': 0}), ({'xx': 5, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 17, 'linear_q': -7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 7, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 15, 'linear_q': 9, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -9, 'swapped_v': -6}), ({'xx': 4, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 4, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8})]}
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-stokes-linear-basis

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

N = 1
observations = []
def solve(d):
    return {'intensity': d['xx']+d['yy'], 'linear_q': abs(d['xx']-d['yy']), 'linear_u': 2*d['re'], 'circular_v': -2*d['im'], 'swapped_q': d['yy']-d['xx'], 'swapped_v': 2*d['im']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'xx': 8, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 11, 'linear_q': 5, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -5, 'swapped_v': 8}), ({'xx': 3, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 6, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 11, 'linear_q': 5, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -5, 'swapped_v': 0}), ({'xx': 1, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': -11, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 11, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 11, 'linear_q': 5, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -5, 'swapped_v': -6}), ({'xx': 0, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 0, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8})], 2: [({'xx': 9, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 12, 'linear_q': 6, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -6, 'swapped_v': 8}), ({'xx': 4, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 7, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 12, 'linear_q': 6, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -6, 'swapped_v': 0}), ({'xx': 2, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': -10, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 10, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 12, 'linear_q': 6, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -6, 'swapped_v': -6}), ({'xx': 1, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 1, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8})], 3: [({'xx': 10, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': 7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -7, 'swapped_v': 8}), ({'xx': 5, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 8, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 13, 'linear_q': 7, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -7, 'swapped_v': 0}), ({'xx': 3, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': -9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 9, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 13, 'linear_q': 7, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -7, 'swapped_v': -6}), ({'xx': 2, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 2, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8})], 4: [({'xx': 11, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': 8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -8, 'swapped_v': 8}), ({'xx': 6, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 9, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 14, 'linear_q': 8, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -8, 'swapped_v': 0}), ({'xx': 4, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 16, 'linear_q': -8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 8, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 14, 'linear_q': 8, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -8, 'swapped_v': -6}), ({'xx': 3, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 3, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8})], 5: [({'xx': 12, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': 9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -9, 'swapped_v': 8}), ({'xx': 7, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 10, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 15, 'linear_q': 9, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -9, 'swapped_v': 0}), ({'xx': 5, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 17, 'linear_q': -7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 7, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 15, 'linear_q': 9, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -9, 'swapped_v': -6}), ({'xx': 4, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 4, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8})]}
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 linear q while other fields remain valid.

Two real linear-feed correlations XX,YY and real/imaginary XY define stipulated Stokes I=XX+YY,Q=XX-YY,U=2re,V=-2im. Reversing feed labels negates Q and V, leaves I and U unchanged. Output rotated fields model only that feed swap. Output fields are defined by: intensity = d['xx']+d['yy']; linear_q = d['xx']-d['yy']; linear_u = 2*d['re']; circular_v = -2*d['im']; swapped_q = d['yy']-d['xx']; swapped_v = 2*d['im']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'intensity': d['xx']+d['yy'], 'linear_q': d['xx']-d['yy'], 'linear_u': d['re'], 'circular_v': -2*d['im'], 'swapped_q': d['yy']-d['xx'], 'swapped_v': 2*d['im']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'xx': 8, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 11, 'linear_q': 5, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -5, 'swapped_v': 8}), ({'xx': 3, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 6, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 11, 'linear_q': 5, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -5, 'swapped_v': 0}), ({'xx': 1, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': -11, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 11, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 11, 'linear_q': 5, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -5, 'swapped_v': -6}), ({'xx': 0, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 0, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8})], 2: [({'xx': 9, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 12, 'linear_q': 6, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -6, 'swapped_v': 8}), ({'xx': 4, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 7, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 12, 'linear_q': 6, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -6, 'swapped_v': 0}), ({'xx': 2, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': -10, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 10, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 12, 'linear_q': 6, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -6, 'swapped_v': -6}), ({'xx': 1, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 1, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8})], 3: [({'xx': 10, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': 7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -7, 'swapped_v': 8}), ({'xx': 5, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 8, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 13, 'linear_q': 7, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -7, 'swapped_v': 0}), ({'xx': 3, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': -9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 9, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 13, 'linear_q': 7, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -7, 'swapped_v': -6}), ({'xx': 2, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 2, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8})], 4: [({'xx': 11, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': 8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -8, 'swapped_v': 8}), ({'xx': 6, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 9, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 14, 'linear_q': 8, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -8, 'swapped_v': 0}), ({'xx': 4, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 16, 'linear_q': -8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 8, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 14, 'linear_q': 8, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -8, 'swapped_v': -6}), ({'xx': 3, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 3, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8})], 5: [({'xx': 12, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': 9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -9, 'swapped_v': 8}), ({'xx': 7, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 10, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 15, 'linear_q': 9, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -9, 'swapped_v': 0}), ({'xx': 5, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 17, 'linear_q': -7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 7, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 15, 'linear_q': 9, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -9, 'swapped_v': -6}), ({'xx': 4, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 4, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8})]}
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-stokes-linear-basis

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

N = 1
observations = []
def solve(d):
    return {'intensity': d['xx']+d['yy'], 'linear_q': d['xx']-d['yy'], 'linear_u': 2*d['im'], 'circular_v': -2*d['im'], 'swapped_q': d['yy']-d['xx'], 'swapped_v': 2*d['im']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'xx': 8, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 11, 'linear_q': 5, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -5, 'swapped_v': 8}), ({'xx': 3, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 6, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 11, 'linear_q': 5, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -5, 'swapped_v': 0}), ({'xx': 1, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': -11, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 11, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 11, 'linear_q': 5, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -5, 'swapped_v': -6}), ({'xx': 0, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 0, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8})], 2: [({'xx': 9, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 12, 'linear_q': 6, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -6, 'swapped_v': 8}), ({'xx': 4, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 7, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 12, 'linear_q': 6, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -6, 'swapped_v': 0}), ({'xx': 2, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': -10, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 10, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 12, 'linear_q': 6, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -6, 'swapped_v': -6}), ({'xx': 1, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 1, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8})], 3: [({'xx': 10, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': 7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -7, 'swapped_v': 8}), ({'xx': 5, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 8, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 13, 'linear_q': 7, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -7, 'swapped_v': 0}), ({'xx': 3, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': -9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 9, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 13, 'linear_q': 7, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -7, 'swapped_v': -6}), ({'xx': 2, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 2, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8})], 4: [({'xx': 11, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': 8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -8, 'swapped_v': 8}), ({'xx': 6, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 9, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 14, 'linear_q': 8, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -8, 'swapped_v': 0}), ({'xx': 4, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 16, 'linear_q': -8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 8, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 14, 'linear_q': 8, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -8, 'swapped_v': -6}), ({'xx': 3, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 3, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8})], 5: [({'xx': 12, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': 9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -9, 'swapped_v': 8}), ({'xx': 7, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 10, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 15, 'linear_q': 9, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -9, 'swapped_v': 0}), ({'xx': 5, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 17, 'linear_q': -7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 7, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 15, 'linear_q': 9, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -9, 'swapped_v': -6}), ({'xx': 4, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 4, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8})]}
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 linear u while other fields remain valid.

Two real linear-feed correlations XX,YY and real/imaginary XY define stipulated Stokes I=XX+YY,Q=XX-YY,U=2re,V=-2im. Reversing feed labels negates Q and V, leaves I and U unchanged. Output rotated fields model only that feed swap. Output fields are defined by: intensity = d['xx']+d['yy']; linear_q = d['xx']-d['yy']; linear_u = 2*d['re']; circular_v = -2*d['im']; swapped_q = d['yy']-d['xx']; swapped_v = 2*d['im']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'intensity': d['xx']+d['yy'], 'linear_q': d['xx']-d['yy'], 'linear_u': 2*d['re'], 'circular_v': 2*d['im'], 'swapped_q': d['yy']-d['xx'], 'swapped_v': 2*d['im']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'xx': 8, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 11, 'linear_q': 5, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -5, 'swapped_v': 8}), ({'xx': 3, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 6, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 11, 'linear_q': 5, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -5, 'swapped_v': 0}), ({'xx': 1, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': -11, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 11, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 11, 'linear_q': 5, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -5, 'swapped_v': -6}), ({'xx': 0, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 0, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8})], 2: [({'xx': 9, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 12, 'linear_q': 6, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -6, 'swapped_v': 8}), ({'xx': 4, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 7, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 12, 'linear_q': 6, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -6, 'swapped_v': 0}), ({'xx': 2, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': -10, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 10, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 12, 'linear_q': 6, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -6, 'swapped_v': -6}), ({'xx': 1, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 1, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8})], 3: [({'xx': 10, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': 7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -7, 'swapped_v': 8}), ({'xx': 5, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 8, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 13, 'linear_q': 7, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -7, 'swapped_v': 0}), ({'xx': 3, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': -9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 9, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 13, 'linear_q': 7, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -7, 'swapped_v': -6}), ({'xx': 2, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 2, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8})], 4: [({'xx': 11, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': 8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -8, 'swapped_v': 8}), ({'xx': 6, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 9, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 14, 'linear_q': 8, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -8, 'swapped_v': 0}), ({'xx': 4, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 16, 'linear_q': -8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 8, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 14, 'linear_q': 8, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -8, 'swapped_v': -6}), ({'xx': 3, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 3, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8})], 5: [({'xx': 12, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': 9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -9, 'swapped_v': 8}), ({'xx': 7, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 10, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 15, 'linear_q': 9, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -9, 'swapped_v': 0}), ({'xx': 5, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 17, 'linear_q': -7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 7, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 15, 'linear_q': 9, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -9, 'swapped_v': -6}), ({'xx': 4, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 4, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8})]}
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-stokes-linear-basis

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

N = 1
observations = []
def solve(d):
    return {'intensity': d['xx']+d['yy'], 'linear_q': d['xx']-d['yy'], 'linear_u': 2*d['re'], 'circular_v': -d['im'], 'swapped_q': d['yy']-d['xx'], 'swapped_v': 2*d['im']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'xx': 8, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 11, 'linear_q': 5, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -5, 'swapped_v': 8}), ({'xx': 3, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 6, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 11, 'linear_q': 5, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -5, 'swapped_v': 0}), ({'xx': 1, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': -11, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 11, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 11, 'linear_q': 5, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -5, 'swapped_v': -6}), ({'xx': 0, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 0, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8})], 2: [({'xx': 9, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 12, 'linear_q': 6, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -6, 'swapped_v': 8}), ({'xx': 4, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 7, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 12, 'linear_q': 6, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -6, 'swapped_v': 0}), ({'xx': 2, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': -10, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 10, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 12, 'linear_q': 6, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -6, 'swapped_v': -6}), ({'xx': 1, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 1, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8})], 3: [({'xx': 10, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': 7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -7, 'swapped_v': 8}), ({'xx': 5, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 8, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 13, 'linear_q': 7, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -7, 'swapped_v': 0}), ({'xx': 3, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': -9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 9, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 13, 'linear_q': 7, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -7, 'swapped_v': -6}), ({'xx': 2, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 2, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8})], 4: [({'xx': 11, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': 8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -8, 'swapped_v': 8}), ({'xx': 6, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 9, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 14, 'linear_q': 8, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -8, 'swapped_v': 0}), ({'xx': 4, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 16, 'linear_q': -8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 8, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 14, 'linear_q': 8, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -8, 'swapped_v': -6}), ({'xx': 3, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 3, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8})], 5: [({'xx': 12, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': 9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -9, 'swapped_v': 8}), ({'xx': 7, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 10, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 15, 'linear_q': 9, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -9, 'swapped_v': 0}), ({'xx': 5, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 17, 'linear_q': -7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 7, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 15, 'linear_q': 9, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -9, 'swapped_v': -6}), ({'xx': 4, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 4, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8})]}
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 circular v while other fields remain valid.

Two real linear-feed correlations XX,YY and real/imaginary XY define stipulated Stokes I=XX+YY,Q=XX-YY,U=2re,V=-2im. Reversing feed labels negates Q and V, leaves I and U unchanged. Output rotated fields model only that feed swap. Output fields are defined by: intensity = d['xx']+d['yy']; linear_q = d['xx']-d['yy']; linear_u = 2*d['re']; circular_v = -2*d['im']; swapped_q = d['yy']-d['xx']; swapped_v = 2*d['im']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'intensity': d['xx']+d['yy'], 'linear_q': d['xx']-d['yy'], 'linear_u': 2*d['re'], 'circular_v': -2*d['im'], 'swapped_q': d['xx']-d['yy'], 'swapped_v': 2*d['im']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'xx': 8, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 11, 'linear_q': 5, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -5, 'swapped_v': 8}), ({'xx': 3, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 6, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 11, 'linear_q': 5, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -5, 'swapped_v': 0}), ({'xx': 1, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': -11, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 11, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 11, 'linear_q': 5, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -5, 'swapped_v': -6}), ({'xx': 0, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 0, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8})], 2: [({'xx': 9, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 12, 'linear_q': 6, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -6, 'swapped_v': 8}), ({'xx': 4, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 7, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 12, 'linear_q': 6, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -6, 'swapped_v': 0}), ({'xx': 2, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': -10, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 10, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 12, 'linear_q': 6, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -6, 'swapped_v': -6}), ({'xx': 1, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 1, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8})], 3: [({'xx': 10, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': 7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -7, 'swapped_v': 8}), ({'xx': 5, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 8, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 13, 'linear_q': 7, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -7, 'swapped_v': 0}), ({'xx': 3, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': -9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 9, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 13, 'linear_q': 7, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -7, 'swapped_v': -6}), ({'xx': 2, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 2, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8})], 4: [({'xx': 11, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': 8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -8, 'swapped_v': 8}), ({'xx': 6, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 9, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 14, 'linear_q': 8, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -8, 'swapped_v': 0}), ({'xx': 4, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 16, 'linear_q': -8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 8, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 14, 'linear_q': 8, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -8, 'swapped_v': -6}), ({'xx': 3, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 3, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8})], 5: [({'xx': 12, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': 9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -9, 'swapped_v': 8}), ({'xx': 7, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 10, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 15, 'linear_q': 9, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -9, 'swapped_v': 0}), ({'xx': 5, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 17, 'linear_q': -7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 7, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 15, 'linear_q': 9, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -9, 'swapped_v': -6}), ({'xx': 4, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 4, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8})]}
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-stokes-linear-basis

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

N = 1
observations = []
def solve(d):
    return {'intensity': d['xx']+d['yy'], 'linear_q': d['xx']-d['yy'], 'linear_u': 2*d['re'], 'circular_v': -2*d['im'], 'swapped_q': d['yy']+d['xx'], 'swapped_v': 2*d['im']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'xx': 8, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 11, 'linear_q': 5, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -5, 'swapped_v': 8}), ({'xx': 3, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 6, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 11, 'linear_q': 5, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -5, 'swapped_v': 0}), ({'xx': 1, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': -11, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 11, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 11, 'linear_q': 5, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -5, 'swapped_v': -6}), ({'xx': 0, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 0, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8})], 2: [({'xx': 9, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 12, 'linear_q': 6, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -6, 'swapped_v': 8}), ({'xx': 4, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 7, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 12, 'linear_q': 6, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -6, 'swapped_v': 0}), ({'xx': 2, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': -10, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 10, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 12, 'linear_q': 6, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -6, 'swapped_v': -6}), ({'xx': 1, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 1, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8})], 3: [({'xx': 10, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': 7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -7, 'swapped_v': 8}), ({'xx': 5, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 8, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 13, 'linear_q': 7, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -7, 'swapped_v': 0}), ({'xx': 3, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': -9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 9, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 13, 'linear_q': 7, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -7, 'swapped_v': -6}), ({'xx': 2, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 2, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8})], 4: [({'xx': 11, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': 8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -8, 'swapped_v': 8}), ({'xx': 6, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 9, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 14, 'linear_q': 8, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -8, 'swapped_v': 0}), ({'xx': 4, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 16, 'linear_q': -8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 8, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 14, 'linear_q': 8, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -8, 'swapped_v': -6}), ({'xx': 3, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 3, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8})], 5: [({'xx': 12, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': 9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -9, 'swapped_v': 8}), ({'xx': 7, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 10, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 15, 'linear_q': 9, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -9, 'swapped_v': 0}), ({'xx': 5, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 17, 'linear_q': -7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 7, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 15, 'linear_q': 9, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -9, 'swapped_v': -6}), ({'xx': 4, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 4, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8})]}
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 swapped q while other fields remain valid.

Two real linear-feed correlations XX,YY and real/imaginary XY define stipulated Stokes I=XX+YY,Q=XX-YY,U=2re,V=-2im. Reversing feed labels negates Q and V, leaves I and U unchanged. Output rotated fields model only that feed swap. Output fields are defined by: intensity = d['xx']+d['yy']; linear_q = d['xx']-d['yy']; linear_u = 2*d['re']; circular_v = -2*d['im']; swapped_q = d['yy']-d['xx']; swapped_v = 2*d['im']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'intensity': d['xx']+d['yy'], 'linear_q': d['xx']-d['yy'], 'linear_u': 2*d['re'], 'circular_v': -2*d['im'], 'swapped_q': d['yy']-d['xx'], 'swapped_v': -2*d['im']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'xx': 8, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 11, 'linear_q': 5, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -5, 'swapped_v': 8}), ({'xx': 3, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 6, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 11, 'linear_q': 5, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -5, 'swapped_v': 0}), ({'xx': 1, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': -11, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 11, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 11, 'linear_q': 5, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -5, 'swapped_v': -6}), ({'xx': 0, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 0, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8})], 2: [({'xx': 9, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 12, 'linear_q': 6, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -6, 'swapped_v': 8}), ({'xx': 4, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 7, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 12, 'linear_q': 6, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -6, 'swapped_v': 0}), ({'xx': 2, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': -10, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 10, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 12, 'linear_q': 6, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -6, 'swapped_v': -6}), ({'xx': 1, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 1, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8})], 3: [({'xx': 10, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': 7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -7, 'swapped_v': 8}), ({'xx': 5, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 8, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 13, 'linear_q': 7, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -7, 'swapped_v': 0}), ({'xx': 3, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': -9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 9, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 13, 'linear_q': 7, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -7, 'swapped_v': -6}), ({'xx': 2, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 2, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8})], 4: [({'xx': 11, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': 8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -8, 'swapped_v': 8}), ({'xx': 6, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 9, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 14, 'linear_q': 8, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -8, 'swapped_v': 0}), ({'xx': 4, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 16, 'linear_q': -8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 8, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 14, 'linear_q': 8, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -8, 'swapped_v': -6}), ({'xx': 3, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 3, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8})], 5: [({'xx': 12, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': 9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -9, 'swapped_v': 8}), ({'xx': 7, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 10, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 15, 'linear_q': 9, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -9, 'swapped_v': 0}), ({'xx': 5, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 17, 'linear_q': -7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 7, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 15, 'linear_q': 9, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -9, 'swapped_v': -6}), ({'xx': 4, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 4, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8})]}
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-stokes-linear-basis

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

N = 1
observations = []
def solve(d):
    return {'intensity': d['xx']+d['yy'], 'linear_q': d['xx']-d['yy'], 'linear_u': 2*d['re'], 'circular_v': -2*d['im'], 'swapped_q': d['yy']-d['xx'], 'swapped_v': 2*d['re']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'xx': 8, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 11, 'linear_q': 5, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -5, 'swapped_v': 8}), ({'xx': 3, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 6, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 11, 'linear_q': 5, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -5, 'swapped_v': 0}), ({'xx': 1, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': -11, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 11, 'swapped_v': 8}), ({'xx': 8, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 11, 'linear_q': 5, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -5, 'swapped_v': -6}), ({'xx': 0, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 0, 'linear_q': 0, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 0, 'swapped_v': 8})], 2: [({'xx': 9, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 12, 'linear_q': 6, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -6, 'swapped_v': 8}), ({'xx': 4, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 7, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 12, 'linear_q': 6, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -6, 'swapped_v': 0}), ({'xx': 2, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': -10, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 10, 'swapped_v': 8}), ({'xx': 9, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 12, 'linear_q': 6, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -6, 'swapped_v': -6}), ({'xx': 1, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 1, 'linear_q': 1, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -1, 'swapped_v': 8})], 3: [({'xx': 10, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 13, 'linear_q': 7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -7, 'swapped_v': 8}), ({'xx': 5, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 8, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 13, 'linear_q': 7, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -7, 'swapped_v': 0}), ({'xx': 3, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': -9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 9, 'swapped_v': 8}), ({'xx': 10, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 13, 'linear_q': 7, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -7, 'swapped_v': -6}), ({'xx': 2, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 2, 'linear_q': 2, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -2, 'swapped_v': 8})], 4: [({'xx': 11, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 14, 'linear_q': 8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -8, 'swapped_v': 8}), ({'xx': 6, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 9, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 14, 'linear_q': 8, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -8, 'swapped_v': 0}), ({'xx': 4, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 16, 'linear_q': -8, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 8, 'swapped_v': 8}), ({'xx': 11, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 14, 'linear_q': 8, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -8, 'swapped_v': -6}), ({'xx': 3, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 3, 'linear_q': 3, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -3, 'swapped_v': 8})], 5: [({'xx': 12, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 15, 'linear_q': 9, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -9, 'swapped_v': 8}), ({'xx': 7, 'yy': 3, 're': 2, 'im': 4}, {'intensity': 10, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': 0, 'im': 0}, {'intensity': 15, 'linear_q': 9, 'linear_u': 0, 'circular_v': 0, 'swapped_q': -9, 'swapped_v': 0}), ({'xx': 5, 'yy': 12, 're': 2, 'im': 4}, {'intensity': 17, 'linear_q': -7, 'linear_u': 4, 'circular_v': -8, 'swapped_q': 7, 'swapped_v': 8}), ({'xx': 12, 'yy': 3, 're': -2, 'im': -3}, {'intensity': 15, 'linear_q': 9, 'linear_u': -4, 'circular_v': 6, 'swapped_q': -9, 'swapped_v': -6}), ({'xx': 4, 'yy': 0, 're': 2, 'im': 4}, {'intensity': 4, 'linear_q': 4, 'linear_u': 4, 'circular_v': -8, 'swapped_q': -4, 'swapped_v': 8})]}
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 swapped v while other fields remain valid.

Two real linear-feed correlations XX,YY and real/imaginary XY define stipulated Stokes I=XX+YY,Q=XX-YY,U=2re,V=-2im. Reversing feed labels negates Q and V, leaves I and U unchanged. Output rotated fields model only that feed swap. Output fields are defined by: intensity = d['xx']+d['yy']; linear_q = d['xx']-d['yy']; linear_u = 2*d['re']; circular_v = -2*d['im']; swapped_q = d['yy']-d['xx']; swapped_v = 2*d['im']

split: open-access