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

N = 1
observations = []
def solve(d):
    return {'reference': d['L']+1-d['r'], 'pixel': d['L']+1-d['p'], 'increment': -d['step'], 'quadratic': d['q'], 'velocity_increment': d['vel'], 'interval': [d['L']+1-d['hi'],d['L']+1-d['lo']]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 20, 'r': 6, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 15, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 1, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': 1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 6, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 15, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 6, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 15, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 20, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 6, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 7, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 2: [({'L': 20, 'r': 7, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 14, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 2, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': 0, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 7, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 14, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 7, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 14, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 21, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 0, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 7, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 6, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 3: [({'L': 20, 'r': 8, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 13, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 3, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': -1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 8, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 13, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 8, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 13, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 22, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': -1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 8, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 5, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 4: [({'L': 20, 'r': 9, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 12, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 4, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': -2, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 9, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 12, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 9, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 12, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 23, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': -2, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 9, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 4, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 5: [({'L': 20, 'r': 10, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 11, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 5, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': -3, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 10, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 11, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 10, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 11, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 24, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': -3, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 10, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 3, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})]}
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-spectral-axis-reversal

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

N = 1
observations = []
def solve(d):
    return {'reference': d['L']+1-d['r'], 'pixel': d['L']+1-d['p'], 'increment': -d['step'], 'quadratic': d['q'], 'velocity_increment': -d['step'], 'interval': [d['L']+1-d['hi'],d['L']+1-d['lo']]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 20, 'r': 6, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 15, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 1, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': 1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 6, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 15, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 6, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 15, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 20, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 6, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 7, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 2: [({'L': 20, 'r': 7, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 14, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 2, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': 0, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 7, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 14, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 7, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 14, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 21, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 0, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 7, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 6, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 3: [({'L': 20, 'r': 8, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 13, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 3, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': -1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 8, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 13, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 8, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 13, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 22, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': -1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 8, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 5, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 4: [({'L': 20, 'r': 9, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 12, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 4, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': -2, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 9, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 12, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 9, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 12, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 23, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': -2, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 9, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 4, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 5: [({'L': 20, 'r': 10, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 11, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 5, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': -3, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 10, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 11, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 10, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 11, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 24, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': -3, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 10, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 3, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})]}
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 velocity increment while other fields remain valid.

Reverse a finite spectral pixel axis of length L using one-based pixel labels. Reference pixel, edge pixel coordinates, dispersion coefficients, and velocity-increment metadata must describe the same physical samples. Quadratic coefficient is unchanged under reversal about the reference. Output fields are defined by: reference = d['L']+1-d['r']; pixel = d['L']+1-d['p']; increment = -d['step']; quadratic = d['q']; velocity_increment = -d['vel']; interval = [d['L']+1-d['hi'],d['L']+1-d['lo']]

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'reference': d['L']+1-d['r'], 'pixel': d['L']+1-d['p'], 'increment': -d['step'], 'quadratic': d['q'], 'velocity_increment': -d['vel'], 'interval': [d['L']+1-d['lo'],d['L']+1-d['hi']]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 20, 'r': 6, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 15, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 1, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': 1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 6, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 15, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 6, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 15, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 20, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 6, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 7, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 2: [({'L': 20, 'r': 7, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 14, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 2, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': 0, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 7, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 14, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 7, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 14, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 21, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 0, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 7, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 6, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 3: [({'L': 20, 'r': 8, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 13, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 3, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': -1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 8, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 13, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 8, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 13, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 22, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': -1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 8, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 5, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 4: [({'L': 20, 'r': 9, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 12, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 4, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': -2, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 9, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 12, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 9, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 12, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 23, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': -2, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 9, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 4, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 5: [({'L': 20, 'r': 10, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 11, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 5, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': -3, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 10, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 11, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 10, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 11, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 24, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': -3, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 10, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 3, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})]}
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-spectral-axis-reversal

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

N = 1
observations = []
def solve(d):
    return {'reference': d['L']+1-d['r'], 'pixel': d['L']+1-d['p'], 'increment': -d['step'], 'quadratic': d['q'], 'velocity_increment': -d['vel'], 'interval': [d['L']-d['hi'],d['L']-d['lo']]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 20, 'r': 6, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 15, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 1, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': 1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 6, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 15, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 6, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 15, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 20, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 6, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 7, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 2: [({'L': 20, 'r': 7, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 14, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 2, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': 0, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 7, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 14, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 7, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 14, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 21, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 0, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 7, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 6, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 3: [({'L': 20, 'r': 8, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 13, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 3, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': -1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 8, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 13, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 8, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 13, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 22, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': -1, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 8, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 5, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 4: [({'L': 20, 'r': 9, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 12, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 4, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': -2, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 9, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 12, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 9, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 12, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 23, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': -2, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 9, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 4, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})], 5: [({'L': 20, 'r': 10, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 11, 'pixel': 18, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 1, 'r': 5, 'p': 1, 'step': 2, 'q': 3, 'vel': 5, 'lo': 1, 'hi': 1}, {'reference': -3, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [1, 1]}), ({'L': 20, 'r': 10, 'p': 3, 'step': -3, 'q': 3, 'vel': -7, 'lo': 2, 'hi': 9}, {'reference': 11, 'pixel': 18, 'increment': 3, 'quadratic': 3, 'velocity_increment': 7, 'interval': [12, 19]}), ({'L': 20, 'r': 10, 'p': 3, 'step': 2, 'q': 0, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': 11, 'pixel': 18, 'increment': -2, 'quadratic': 0, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 20, 'r': 24, 'p': 20, 'step': 2, 'q': 3, 'vel': 5, 'lo': 2, 'hi': 9}, {'reference': -3, 'pixel': 1, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [12, 19]}), ({'L': 12, 'r': 10, 'p': 3, 'step': 2, 'q': 3, 'vel': 5, 'lo': 3, 'hi': 4}, {'reference': 3, 'pixel': 10, 'increment': -2, 'quadratic': 3, 'velocity_increment': -5, 'interval': [9, 10]})]}
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 interval while other fields remain valid.

Reverse a finite spectral pixel axis of length L using one-based pixel labels. Reference pixel, edge pixel coordinates, dispersion coefficients, and velocity-increment metadata must describe the same physical samples. Quadratic coefficient is unchanged under reversal about the reference. Output fields are defined by: reference = d['L']+1-d['r']; pixel = d['L']+1-d['p']; increment = -d['step']; quadratic = d['q']; velocity_increment = -d['vel']; interval = [d['L']+1-d['hi'],d['L']+1-d['lo']]

split: open-access


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

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

evaluation_group: astro-cube-axis-slice

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

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

prompt:
The adapter reports an incorrect longitude reference while other fields remain valid.

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

split: open-access


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

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

evaluation_group: astro-cube-axis-slice

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

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

prompt:
The adapter reports an incorrect latitude reference while other fields remain valid.

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

split: open-access


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

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

evaluation_group: astro-cube-axis-slice

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

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

prompt:
The adapter reports an incorrect spectral coordinate while other fields remain valid.

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

split: open-access


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

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

evaluation_group: astro-cube-axis-slice

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

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

prompt:
The adapter reports an incorrect spectral width while other fields remain valid.

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

split: open-access