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

N = 1
observations = []
def solve(d):
    return {'sky_frequency': d['L']+d['s']*d['I'], 'sky_increment': d['d'], 'image_frequency': d['L']-d['s']*d['I'], 'second_conversion': d['L']+d['s']*(d['I']+d['m']), 'rest_offset': d['L']+d['s']*d['I']-d['R'], 'inverse_if': d['s']*(d['R']-d['L'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 110, 'sky_increment': 2, 'image_frequency': 90, 'second_conversion': 113, 'rest_offset': -10, 'inverse_if': 20}), ({'L': 100, 'I': 0, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 100, 'sky_increment': -2, 'image_frequency': 100, 'second_conversion': 97, 'rest_offset': -20, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': 2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 90, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 200, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 190, 'sky_increment': -2, 'image_frequency': 210, 'second_conversion': 187, 'rest_offset': -60, 'inverse_if': -50})], 2: [({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 111, 'sky_increment': 2, 'image_frequency': 89, 'second_conversion': 114, 'rest_offset': -9, 'inverse_if': 20}), ({'L': 100, 'I': 1, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 99, 'sky_increment': -2, 'image_frequency': 101, 'second_conversion': 96, 'rest_offset': -21, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': 2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 89, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 200, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 189, 'sky_increment': -2, 'image_frequency': 211, 'second_conversion': 186, 'rest_offset': -61, 'inverse_if': -50})], 3: [({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 112, 'sky_increment': 2, 'image_frequency': 88, 'second_conversion': 115, 'rest_offset': -8, 'inverse_if': 20}), ({'L': 100, 'I': 2, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 98, 'sky_increment': -2, 'image_frequency': 102, 'second_conversion': 95, 'rest_offset': -22, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': 2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 88, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 200, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 188, 'sky_increment': -2, 'image_frequency': 212, 'second_conversion': 185, 'rest_offset': -62, 'inverse_if': -50})], 4: [({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 113, 'sky_increment': 2, 'image_frequency': 87, 'second_conversion': 116, 'rest_offset': -7, 'inverse_if': 20}), ({'L': 100, 'I': 3, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 97, 'sky_increment': -2, 'image_frequency': 103, 'second_conversion': 94, 'rest_offset': -23, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': 2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 87, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 200, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 187, 'sky_increment': -2, 'image_frequency': 213, 'second_conversion': 184, 'rest_offset': -63, 'inverse_if': -50})], 5: [({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 114, 'sky_increment': 2, 'image_frequency': 86, 'second_conversion': 117, 'rest_offset': -6, 'inverse_if': 20}), ({'L': 100, 'I': 4, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 96, 'sky_increment': -2, 'image_frequency': 104, 'second_conversion': 93, 'rest_offset': -24, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': 2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 86, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 200, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 186, 'sky_increment': -2, 'image_frequency': 214, 'second_conversion': 183, 'rest_offset': -64, 'inverse_if': -50})]}
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-heterodyne-sideband-coordinate

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

N = 1
observations = []
def solve(d):
    return {'sky_frequency': d['L']+d['s']*d['I'], 'sky_increment': abs(d['d']), 'image_frequency': d['L']-d['s']*d['I'], 'second_conversion': d['L']+d['s']*(d['I']+d['m']), 'rest_offset': d['L']+d['s']*d['I']-d['R'], 'inverse_if': d['s']*(d['R']-d['L'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 110, 'sky_increment': 2, 'image_frequency': 90, 'second_conversion': 113, 'rest_offset': -10, 'inverse_if': 20}), ({'L': 100, 'I': 0, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 100, 'sky_increment': -2, 'image_frequency': 100, 'second_conversion': 97, 'rest_offset': -20, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': 2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 90, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 200, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 190, 'sky_increment': -2, 'image_frequency': 210, 'second_conversion': 187, 'rest_offset': -60, 'inverse_if': -50})], 2: [({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 111, 'sky_increment': 2, 'image_frequency': 89, 'second_conversion': 114, 'rest_offset': -9, 'inverse_if': 20}), ({'L': 100, 'I': 1, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 99, 'sky_increment': -2, 'image_frequency': 101, 'second_conversion': 96, 'rest_offset': -21, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': 2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 89, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 200, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 189, 'sky_increment': -2, 'image_frequency': 211, 'second_conversion': 186, 'rest_offset': -61, 'inverse_if': -50})], 3: [({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 112, 'sky_increment': 2, 'image_frequency': 88, 'second_conversion': 115, 'rest_offset': -8, 'inverse_if': 20}), ({'L': 100, 'I': 2, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 98, 'sky_increment': -2, 'image_frequency': 102, 'second_conversion': 95, 'rest_offset': -22, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': 2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 88, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 200, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 188, 'sky_increment': -2, 'image_frequency': 212, 'second_conversion': 185, 'rest_offset': -62, 'inverse_if': -50})], 4: [({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 113, 'sky_increment': 2, 'image_frequency': 87, 'second_conversion': 116, 'rest_offset': -7, 'inverse_if': 20}), ({'L': 100, 'I': 3, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 97, 'sky_increment': -2, 'image_frequency': 103, 'second_conversion': 94, 'rest_offset': -23, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': 2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 87, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 200, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 187, 'sky_increment': -2, 'image_frequency': 213, 'second_conversion': 184, 'rest_offset': -63, 'inverse_if': -50})], 5: [({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 114, 'sky_increment': 2, 'image_frequency': 86, 'second_conversion': 117, 'rest_offset': -6, 'inverse_if': 20}), ({'L': 100, 'I': 4, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 96, 'sky_increment': -2, 'image_frequency': 104, 'second_conversion': 93, 'rest_offset': -24, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': 2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 86, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 200, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 186, 'sky_increment': -2, 'image_frequency': 214, 'second_conversion': 183, 'rest_offset': -64, 'inverse_if': -50})]}
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 sky increment while other fields remain valid.

A radio receiver provides positive local oscillator L, intermediate frequency I, signed IF channel step d, sideband s equal +1 or -1, second mixer offset m, and source rest frequency R. Sky frequency is L+s*I; image sideband is L-s*I. This is exact mixer bookkeeping only. Output fields are defined by: sky_frequency = d['L']+d['s']*d['I']; sky_increment = d['s']*d['d']; image_frequency = d['L']-d['s']*d['I']; second_conversion = d['L']+d['s']*(d['I']+d['m']); rest_offset = d['L']+d['s']*d['I']-d['R']; inverse_if = d['s']*(d['R']-d['L'])

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'sky_frequency': d['L']+d['s']*d['I'], 'sky_increment': d['s']*d['d'], 'image_frequency': d['L']+d['s']*d['I'], 'second_conversion': d['L']+d['s']*(d['I']+d['m']), 'rest_offset': d['L']+d['s']*d['I']-d['R'], 'inverse_if': d['s']*(d['R']-d['L'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 110, 'sky_increment': 2, 'image_frequency': 90, 'second_conversion': 113, 'rest_offset': -10, 'inverse_if': 20}), ({'L': 100, 'I': 0, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 100, 'sky_increment': -2, 'image_frequency': 100, 'second_conversion': 97, 'rest_offset': -20, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': 2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 90, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 200, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 190, 'sky_increment': -2, 'image_frequency': 210, 'second_conversion': 187, 'rest_offset': -60, 'inverse_if': -50})], 2: [({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 111, 'sky_increment': 2, 'image_frequency': 89, 'second_conversion': 114, 'rest_offset': -9, 'inverse_if': 20}), ({'L': 100, 'I': 1, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 99, 'sky_increment': -2, 'image_frequency': 101, 'second_conversion': 96, 'rest_offset': -21, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': 2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 89, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 200, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 189, 'sky_increment': -2, 'image_frequency': 211, 'second_conversion': 186, 'rest_offset': -61, 'inverse_if': -50})], 3: [({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 112, 'sky_increment': 2, 'image_frequency': 88, 'second_conversion': 115, 'rest_offset': -8, 'inverse_if': 20}), ({'L': 100, 'I': 2, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 98, 'sky_increment': -2, 'image_frequency': 102, 'second_conversion': 95, 'rest_offset': -22, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': 2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 88, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 200, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 188, 'sky_increment': -2, 'image_frequency': 212, 'second_conversion': 185, 'rest_offset': -62, 'inverse_if': -50})], 4: [({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 113, 'sky_increment': 2, 'image_frequency': 87, 'second_conversion': 116, 'rest_offset': -7, 'inverse_if': 20}), ({'L': 100, 'I': 3, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 97, 'sky_increment': -2, 'image_frequency': 103, 'second_conversion': 94, 'rest_offset': -23, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': 2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 87, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 200, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 187, 'sky_increment': -2, 'image_frequency': 213, 'second_conversion': 184, 'rest_offset': -63, 'inverse_if': -50})], 5: [({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 114, 'sky_increment': 2, 'image_frequency': 86, 'second_conversion': 117, 'rest_offset': -6, 'inverse_if': 20}), ({'L': 100, 'I': 4, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 96, 'sky_increment': -2, 'image_frequency': 104, 'second_conversion': 93, 'rest_offset': -24, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': 2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 86, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 200, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 186, 'sky_increment': -2, 'image_frequency': 214, 'second_conversion': 183, 'rest_offset': -64, 'inverse_if': -50})]}
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-heterodyne-sideband-coordinate

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

N = 1
observations = []
def solve(d):
    return {'sky_frequency': d['L']+d['s']*d['I'], 'sky_increment': d['s']*d['d'], 'image_frequency': 2*d['L']+d['s']*d['I'], 'second_conversion': d['L']+d['s']*(d['I']+d['m']), 'rest_offset': d['L']+d['s']*d['I']-d['R'], 'inverse_if': d['s']*(d['R']-d['L'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 110, 'sky_increment': 2, 'image_frequency': 90, 'second_conversion': 113, 'rest_offset': -10, 'inverse_if': 20}), ({'L': 100, 'I': 0, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 100, 'sky_increment': -2, 'image_frequency': 100, 'second_conversion': 97, 'rest_offset': -20, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': 2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 90, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 200, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 190, 'sky_increment': -2, 'image_frequency': 210, 'second_conversion': 187, 'rest_offset': -60, 'inverse_if': -50})], 2: [({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 111, 'sky_increment': 2, 'image_frequency': 89, 'second_conversion': 114, 'rest_offset': -9, 'inverse_if': 20}), ({'L': 100, 'I': 1, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 99, 'sky_increment': -2, 'image_frequency': 101, 'second_conversion': 96, 'rest_offset': -21, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': 2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 89, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 200, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 189, 'sky_increment': -2, 'image_frequency': 211, 'second_conversion': 186, 'rest_offset': -61, 'inverse_if': -50})], 3: [({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 112, 'sky_increment': 2, 'image_frequency': 88, 'second_conversion': 115, 'rest_offset': -8, 'inverse_if': 20}), ({'L': 100, 'I': 2, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 98, 'sky_increment': -2, 'image_frequency': 102, 'second_conversion': 95, 'rest_offset': -22, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': 2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 88, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 200, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 188, 'sky_increment': -2, 'image_frequency': 212, 'second_conversion': 185, 'rest_offset': -62, 'inverse_if': -50})], 4: [({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 113, 'sky_increment': 2, 'image_frequency': 87, 'second_conversion': 116, 'rest_offset': -7, 'inverse_if': 20}), ({'L': 100, 'I': 3, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 97, 'sky_increment': -2, 'image_frequency': 103, 'second_conversion': 94, 'rest_offset': -23, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': 2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 87, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 200, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 187, 'sky_increment': -2, 'image_frequency': 213, 'second_conversion': 184, 'rest_offset': -63, 'inverse_if': -50})], 5: [({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 114, 'sky_increment': 2, 'image_frequency': 86, 'second_conversion': 117, 'rest_offset': -6, 'inverse_if': 20}), ({'L': 100, 'I': 4, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 96, 'sky_increment': -2, 'image_frequency': 104, 'second_conversion': 93, 'rest_offset': -24, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': 2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 86, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 200, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 186, 'sky_increment': -2, 'image_frequency': 214, 'second_conversion': 183, 'rest_offset': -64, 'inverse_if': -50})]}
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 image frequency while other fields remain valid.

A radio receiver provides positive local oscillator L, intermediate frequency I, signed IF channel step d, sideband s equal +1 or -1, second mixer offset m, and source rest frequency R. Sky frequency is L+s*I; image sideband is L-s*I. This is exact mixer bookkeeping only. Output fields are defined by: sky_frequency = d['L']+d['s']*d['I']; sky_increment = d['s']*d['d']; image_frequency = d['L']-d['s']*d['I']; second_conversion = d['L']+d['s']*(d['I']+d['m']); rest_offset = d['L']+d['s']*d['I']-d['R']; inverse_if = d['s']*(d['R']-d['L'])

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'sky_frequency': d['L']+d['s']*d['I'], 'sky_increment': d['s']*d['d'], 'image_frequency': d['L']-d['s']*d['I'], 'second_conversion': d['L']+d['s']*d['I']+d['m'], 'rest_offset': d['L']+d['s']*d['I']-d['R'], 'inverse_if': d['s']*(d['R']-d['L'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 110, 'sky_increment': 2, 'image_frequency': 90, 'second_conversion': 113, 'rest_offset': -10, 'inverse_if': 20}), ({'L': 100, 'I': 0, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 100, 'sky_increment': -2, 'image_frequency': 100, 'second_conversion': 97, 'rest_offset': -20, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': 2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 90, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 200, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 190, 'sky_increment': -2, 'image_frequency': 210, 'second_conversion': 187, 'rest_offset': -60, 'inverse_if': -50})], 2: [({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 111, 'sky_increment': 2, 'image_frequency': 89, 'second_conversion': 114, 'rest_offset': -9, 'inverse_if': 20}), ({'L': 100, 'I': 1, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 99, 'sky_increment': -2, 'image_frequency': 101, 'second_conversion': 96, 'rest_offset': -21, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': 2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 89, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 200, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 189, 'sky_increment': -2, 'image_frequency': 211, 'second_conversion': 186, 'rest_offset': -61, 'inverse_if': -50})], 3: [({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 112, 'sky_increment': 2, 'image_frequency': 88, 'second_conversion': 115, 'rest_offset': -8, 'inverse_if': 20}), ({'L': 100, 'I': 2, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 98, 'sky_increment': -2, 'image_frequency': 102, 'second_conversion': 95, 'rest_offset': -22, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': 2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 88, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 200, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 188, 'sky_increment': -2, 'image_frequency': 212, 'second_conversion': 185, 'rest_offset': -62, 'inverse_if': -50})], 4: [({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 113, 'sky_increment': 2, 'image_frequency': 87, 'second_conversion': 116, 'rest_offset': -7, 'inverse_if': 20}), ({'L': 100, 'I': 3, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 97, 'sky_increment': -2, 'image_frequency': 103, 'second_conversion': 94, 'rest_offset': -23, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': 2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 87, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 200, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 187, 'sky_increment': -2, 'image_frequency': 213, 'second_conversion': 184, 'rest_offset': -63, 'inverse_if': -50})], 5: [({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 114, 'sky_increment': 2, 'image_frequency': 86, 'second_conversion': 117, 'rest_offset': -6, 'inverse_if': 20}), ({'L': 100, 'I': 4, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 96, 'sky_increment': -2, 'image_frequency': 104, 'second_conversion': 93, 'rest_offset': -24, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': 2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 86, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 200, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 186, 'sky_increment': -2, 'image_frequency': 214, 'second_conversion': 183, 'rest_offset': -64, 'inverse_if': -50})]}
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-heterodyne-sideband-coordinate

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

N = 1
observations = []
def solve(d):
    return {'sky_frequency': d['L']+d['s']*d['I'], 'sky_increment': d['s']*d['d'], 'image_frequency': d['L']-d['s']*d['I'], 'second_conversion': d['L']+d['s']*(d['I']-d['m']), 'rest_offset': d['L']+d['s']*d['I']-d['R'], 'inverse_if': d['s']*(d['R']-d['L'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 110, 'sky_increment': 2, 'image_frequency': 90, 'second_conversion': 113, 'rest_offset': -10, 'inverse_if': 20}), ({'L': 100, 'I': 0, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 100, 'sky_increment': -2, 'image_frequency': 100, 'second_conversion': 97, 'rest_offset': -20, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': 2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 90, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 200, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 190, 'sky_increment': -2, 'image_frequency': 210, 'second_conversion': 187, 'rest_offset': -60, 'inverse_if': -50})], 2: [({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 111, 'sky_increment': 2, 'image_frequency': 89, 'second_conversion': 114, 'rest_offset': -9, 'inverse_if': 20}), ({'L': 100, 'I': 1, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 99, 'sky_increment': -2, 'image_frequency': 101, 'second_conversion': 96, 'rest_offset': -21, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': 2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 89, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 200, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 189, 'sky_increment': -2, 'image_frequency': 211, 'second_conversion': 186, 'rest_offset': -61, 'inverse_if': -50})], 3: [({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 112, 'sky_increment': 2, 'image_frequency': 88, 'second_conversion': 115, 'rest_offset': -8, 'inverse_if': 20}), ({'L': 100, 'I': 2, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 98, 'sky_increment': -2, 'image_frequency': 102, 'second_conversion': 95, 'rest_offset': -22, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': 2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 88, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 200, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 188, 'sky_increment': -2, 'image_frequency': 212, 'second_conversion': 185, 'rest_offset': -62, 'inverse_if': -50})], 4: [({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 113, 'sky_increment': 2, 'image_frequency': 87, 'second_conversion': 116, 'rest_offset': -7, 'inverse_if': 20}), ({'L': 100, 'I': 3, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 97, 'sky_increment': -2, 'image_frequency': 103, 'second_conversion': 94, 'rest_offset': -23, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': 2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 87, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 200, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 187, 'sky_increment': -2, 'image_frequency': 213, 'second_conversion': 184, 'rest_offset': -63, 'inverse_if': -50})], 5: [({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 114, 'sky_increment': 2, 'image_frequency': 86, 'second_conversion': 117, 'rest_offset': -6, 'inverse_if': 20}), ({'L': 100, 'I': 4, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 96, 'sky_increment': -2, 'image_frequency': 104, 'second_conversion': 93, 'rest_offset': -24, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': 2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 86, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 200, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 186, 'sky_increment': -2, 'image_frequency': 214, 'second_conversion': 183, 'rest_offset': -64, 'inverse_if': -50})]}
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 second conversion while other fields remain valid.

A radio receiver provides positive local oscillator L, intermediate frequency I, signed IF channel step d, sideband s equal +1 or -1, second mixer offset m, and source rest frequency R. Sky frequency is L+s*I; image sideband is L-s*I. This is exact mixer bookkeeping only. Output fields are defined by: sky_frequency = d['L']+d['s']*d['I']; sky_increment = d['s']*d['d']; image_frequency = d['L']-d['s']*d['I']; second_conversion = d['L']+d['s']*(d['I']+d['m']); rest_offset = d['L']+d['s']*d['I']-d['R']; inverse_if = d['s']*(d['R']-d['L'])

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'sky_frequency': d['L']+d['s']*d['I'], 'sky_increment': d['s']*d['d'], 'image_frequency': d['L']-d['s']*d['I'], 'second_conversion': d['L']+d['s']*(d['I']+d['m']), 'rest_offset': d['I']-d['R'], 'inverse_if': d['s']*(d['R']-d['L'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 110, 'sky_increment': 2, 'image_frequency': 90, 'second_conversion': 113, 'rest_offset': -10, 'inverse_if': 20}), ({'L': 100, 'I': 0, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 100, 'sky_increment': -2, 'image_frequency': 100, 'second_conversion': 97, 'rest_offset': -20, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': 2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 90, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 200, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 190, 'sky_increment': -2, 'image_frequency': 210, 'second_conversion': 187, 'rest_offset': -60, 'inverse_if': -50})], 2: [({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 111, 'sky_increment': 2, 'image_frequency': 89, 'second_conversion': 114, 'rest_offset': -9, 'inverse_if': 20}), ({'L': 100, 'I': 1, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 99, 'sky_increment': -2, 'image_frequency': 101, 'second_conversion': 96, 'rest_offset': -21, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': 2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 89, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 200, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 189, 'sky_increment': -2, 'image_frequency': 211, 'second_conversion': 186, 'rest_offset': -61, 'inverse_if': -50})], 3: [({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 112, 'sky_increment': 2, 'image_frequency': 88, 'second_conversion': 115, 'rest_offset': -8, 'inverse_if': 20}), ({'L': 100, 'I': 2, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 98, 'sky_increment': -2, 'image_frequency': 102, 'second_conversion': 95, 'rest_offset': -22, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': 2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 88, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 200, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 188, 'sky_increment': -2, 'image_frequency': 212, 'second_conversion': 185, 'rest_offset': -62, 'inverse_if': -50})], 4: [({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 113, 'sky_increment': 2, 'image_frequency': 87, 'second_conversion': 116, 'rest_offset': -7, 'inverse_if': 20}), ({'L': 100, 'I': 3, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 97, 'sky_increment': -2, 'image_frequency': 103, 'second_conversion': 94, 'rest_offset': -23, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': 2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 87, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 200, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 187, 'sky_increment': -2, 'image_frequency': 213, 'second_conversion': 184, 'rest_offset': -63, 'inverse_if': -50})], 5: [({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 114, 'sky_increment': 2, 'image_frequency': 86, 'second_conversion': 117, 'rest_offset': -6, 'inverse_if': 20}), ({'L': 100, 'I': 4, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 96, 'sky_increment': -2, 'image_frequency': 104, 'second_conversion': 93, 'rest_offset': -24, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': 2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 86, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 200, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 186, 'sky_increment': -2, 'image_frequency': 214, 'second_conversion': 183, 'rest_offset': -64, 'inverse_if': -50})]}
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-heterodyne-sideband-coordinate

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

N = 1
observations = []
def solve(d):
    return {'sky_frequency': d['L']+d['s']*d['I'], 'sky_increment': d['s']*d['d'], 'image_frequency': d['L']-d['s']*d['I'], 'second_conversion': d['L']+d['s']*(d['I']+d['m']), 'rest_offset': d['R']-d['L']-d['s']*d['I'], 'inverse_if': d['s']*(d['R']-d['L'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 110, 'sky_increment': 2, 'image_frequency': 90, 'second_conversion': 113, 'rest_offset': -10, 'inverse_if': 20}), ({'L': 100, 'I': 0, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 100, 'sky_increment': -2, 'image_frequency': 100, 'second_conversion': 97, 'rest_offset': -20, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': 2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 90, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 200, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 190, 'sky_increment': -2, 'image_frequency': 210, 'second_conversion': 187, 'rest_offset': -60, 'inverse_if': -50})], 2: [({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 111, 'sky_increment': 2, 'image_frequency': 89, 'second_conversion': 114, 'rest_offset': -9, 'inverse_if': 20}), ({'L': 100, 'I': 1, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 99, 'sky_increment': -2, 'image_frequency': 101, 'second_conversion': 96, 'rest_offset': -21, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': 2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 89, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 200, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 189, 'sky_increment': -2, 'image_frequency': 211, 'second_conversion': 186, 'rest_offset': -61, 'inverse_if': -50})], 3: [({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 112, 'sky_increment': 2, 'image_frequency': 88, 'second_conversion': 115, 'rest_offset': -8, 'inverse_if': 20}), ({'L': 100, 'I': 2, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 98, 'sky_increment': -2, 'image_frequency': 102, 'second_conversion': 95, 'rest_offset': -22, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': 2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 88, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 200, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 188, 'sky_increment': -2, 'image_frequency': 212, 'second_conversion': 185, 'rest_offset': -62, 'inverse_if': -50})], 4: [({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 113, 'sky_increment': 2, 'image_frequency': 87, 'second_conversion': 116, 'rest_offset': -7, 'inverse_if': 20}), ({'L': 100, 'I': 3, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 97, 'sky_increment': -2, 'image_frequency': 103, 'second_conversion': 94, 'rest_offset': -23, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': 2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 87, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 200, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 187, 'sky_increment': -2, 'image_frequency': 213, 'second_conversion': 184, 'rest_offset': -63, 'inverse_if': -50})], 5: [({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 114, 'sky_increment': 2, 'image_frequency': 86, 'second_conversion': 117, 'rest_offset': -6, 'inverse_if': 20}), ({'L': 100, 'I': 4, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 96, 'sky_increment': -2, 'image_frequency': 104, 'second_conversion': 93, 'rest_offset': -24, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': 2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 86, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 200, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 186, 'sky_increment': -2, 'image_frequency': 214, 'second_conversion': 183, 'rest_offset': -64, 'inverse_if': -50})]}
for i, (record, expected) in enumerate(fixtures[N]):
    check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The adapter reports an incorrect rest offset while other fields remain valid.

A radio receiver provides positive local oscillator L, intermediate frequency I, signed IF channel step d, sideband s equal +1 or -1, second mixer offset m, and source rest frequency R. Sky frequency is L+s*I; image sideband is L-s*I. This is exact mixer bookkeeping only. Output fields are defined by: sky_frequency = d['L']+d['s']*d['I']; sky_increment = d['s']*d['d']; image_frequency = d['L']-d['s']*d['I']; second_conversion = d['L']+d['s']*(d['I']+d['m']); rest_offset = d['L']+d['s']*d['I']-d['R']; inverse_if = d['s']*(d['R']-d['L'])

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'sky_frequency': d['L']+d['s']*d['I'], 'sky_increment': d['s']*d['d'], 'image_frequency': d['L']-d['s']*d['I'], 'second_conversion': d['L']+d['s']*(d['I']+d['m']), 'rest_offset': d['L']+d['s']*d['I']-d['R'], 'inverse_if': d['R']-d['L']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 110, 'sky_increment': 2, 'image_frequency': 90, 'second_conversion': 113, 'rest_offset': -10, 'inverse_if': 20}), ({'L': 100, 'I': 0, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 100, 'sky_increment': -2, 'image_frequency': 100, 'second_conversion': 97, 'rest_offset': -20, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': 2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 90, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 200, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 190, 'sky_increment': -2, 'image_frequency': 210, 'second_conversion': 187, 'rest_offset': -60, 'inverse_if': -50})], 2: [({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 111, 'sky_increment': 2, 'image_frequency': 89, 'second_conversion': 114, 'rest_offset': -9, 'inverse_if': 20}), ({'L': 100, 'I': 1, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 99, 'sky_increment': -2, 'image_frequency': 101, 'second_conversion': 96, 'rest_offset': -21, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': 2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 89, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 200, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 189, 'sky_increment': -2, 'image_frequency': 211, 'second_conversion': 186, 'rest_offset': -61, 'inverse_if': -50})], 3: [({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 112, 'sky_increment': 2, 'image_frequency': 88, 'second_conversion': 115, 'rest_offset': -8, 'inverse_if': 20}), ({'L': 100, 'I': 2, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 98, 'sky_increment': -2, 'image_frequency': 102, 'second_conversion': 95, 'rest_offset': -22, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': 2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 88, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 200, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 188, 'sky_increment': -2, 'image_frequency': 212, 'second_conversion': 185, 'rest_offset': -62, 'inverse_if': -50})], 4: [({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 113, 'sky_increment': 2, 'image_frequency': 87, 'second_conversion': 116, 'rest_offset': -7, 'inverse_if': 20}), ({'L': 100, 'I': 3, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 97, 'sky_increment': -2, 'image_frequency': 103, 'second_conversion': 94, 'rest_offset': -23, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': 2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 87, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 200, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 187, 'sky_increment': -2, 'image_frequency': 213, 'second_conversion': 184, 'rest_offset': -63, 'inverse_if': -50})], 5: [({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 114, 'sky_increment': 2, 'image_frequency': 86, 'second_conversion': 117, 'rest_offset': -6, 'inverse_if': 20}), ({'L': 100, 'I': 4, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 96, 'sky_increment': -2, 'image_frequency': 104, 'second_conversion': 93, 'rest_offset': -24, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': 2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 86, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 200, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 186, 'sky_increment': -2, 'image_frequency': 214, 'second_conversion': 183, 'rest_offset': -64, 'inverse_if': -50})]}
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-heterodyne-sideband-coordinate

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

N = 1
observations = []
def solve(d):
    return {'sky_frequency': d['L']+d['s']*d['I'], 'sky_increment': d['s']*d['d'], 'image_frequency': d['L']-d['s']*d['I'], 'second_conversion': d['L']+d['s']*(d['I']+d['m']), 'rest_offset': d['L']+d['s']*d['I']-d['R'], 'inverse_if': d['s']*(d['R']+d['L'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 110, 'sky_increment': 2, 'image_frequency': 90, 'second_conversion': 113, 'rest_offset': -10, 'inverse_if': 20}), ({'L': 100, 'I': 0, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 100, 'sky_increment': -2, 'image_frequency': 100, 'second_conversion': 97, 'rest_offset': -20, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 90, 'sky_increment': 2, 'image_frequency': 110, 'second_conversion': 87, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 100, 'I': 10, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 90, 'sky_increment': -2, 'image_frequency': 110, 'second_conversion': 90, 'rest_offset': -30, 'inverse_if': -20}), ({'L': 200, 'I': 10, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 190, 'sky_increment': -2, 'image_frequency': 210, 'second_conversion': 187, 'rest_offset': -60, 'inverse_if': -50})], 2: [({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 111, 'sky_increment': 2, 'image_frequency': 89, 'second_conversion': 114, 'rest_offset': -9, 'inverse_if': 20}), ({'L': 100, 'I': 1, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 99, 'sky_increment': -2, 'image_frequency': 101, 'second_conversion': 96, 'rest_offset': -21, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 89, 'sky_increment': 2, 'image_frequency': 111, 'second_conversion': 86, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 100, 'I': 11, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 89, 'sky_increment': -2, 'image_frequency': 111, 'second_conversion': 89, 'rest_offset': -31, 'inverse_if': -20}), ({'L': 200, 'I': 11, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 189, 'sky_increment': -2, 'image_frequency': 211, 'second_conversion': 186, 'rest_offset': -61, 'inverse_if': -50})], 3: [({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 112, 'sky_increment': 2, 'image_frequency': 88, 'second_conversion': 115, 'rest_offset': -8, 'inverse_if': 20}), ({'L': 100, 'I': 2, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 98, 'sky_increment': -2, 'image_frequency': 102, 'second_conversion': 95, 'rest_offset': -22, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 88, 'sky_increment': 2, 'image_frequency': 112, 'second_conversion': 85, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 100, 'I': 12, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 88, 'sky_increment': -2, 'image_frequency': 112, 'second_conversion': 88, 'rest_offset': -32, 'inverse_if': -20}), ({'L': 200, 'I': 12, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 188, 'sky_increment': -2, 'image_frequency': 212, 'second_conversion': 185, 'rest_offset': -62, 'inverse_if': -50})], 4: [({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 113, 'sky_increment': 2, 'image_frequency': 87, 'second_conversion': 116, 'rest_offset': -7, 'inverse_if': 20}), ({'L': 100, 'I': 3, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 97, 'sky_increment': -2, 'image_frequency': 103, 'second_conversion': 94, 'rest_offset': -23, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 87, 'sky_increment': 2, 'image_frequency': 113, 'second_conversion': 84, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 100, 'I': 13, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 87, 'sky_increment': -2, 'image_frequency': 113, 'second_conversion': 87, 'rest_offset': -33, 'inverse_if': -20}), ({'L': 200, 'I': 13, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 187, 'sky_increment': -2, 'image_frequency': 213, 'second_conversion': 184, 'rest_offset': -63, 'inverse_if': -50})], 5: [({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': 1, 'm': 3, 'R': 120}, {'sky_frequency': 114, 'sky_increment': 2, 'image_frequency': 86, 'second_conversion': 117, 'rest_offset': -6, 'inverse_if': 20}), ({'L': 100, 'I': 4, 'd': 2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 96, 'sky_increment': -2, 'image_frequency': 104, 'second_conversion': 93, 'rest_offset': -24, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': -2, 's': -1, 'm': 3, 'R': 120}, {'sky_frequency': 86, 'sky_increment': 2, 'image_frequency': 114, 'second_conversion': 83, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 100, 'I': 14, 'd': 2, 's': -1, 'm': 0, 'R': 120}, {'sky_frequency': 86, 'sky_increment': -2, 'image_frequency': 114, 'second_conversion': 86, 'rest_offset': -34, 'inverse_if': -20}), ({'L': 200, 'I': 14, 'd': 2, 's': -1, 'm': 3, 'R': 250}, {'sky_frequency': 186, 'sky_increment': -2, 'image_frequency': 214, 'second_conversion': 183, 'rest_offset': -64, 'inverse_if': -50})]}
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 inverse if while other fields remain valid.

A radio receiver provides positive local oscillator L, intermediate frequency I, signed IF channel step d, sideband s equal +1 or -1, second mixer offset m, and source rest frequency R. Sky frequency is L+s*I; image sideband is L-s*I. This is exact mixer bookkeeping only. Output fields are defined by: sky_frequency = d['L']+d['s']*d['I']; sky_increment = d['s']*d['d']; image_frequency = d['L']-d['s']*d['I']; second_conversion = d['L']+d['s']*(d['I']+d['m']); rest_offset = d['L']+d['s']*d['I']-d['R']; inverse_if = d['s']*(d['R']-d['L'])

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'signed_bin': d['k'], 'baseband_frequency': (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_frequency': (d['j']-d['N']//2)*d['B']/d['N'], 'sky_frequency': d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_index': (d['k']+d['N']//2)%d['N'], 'channel_width': d['B']/d['N']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 104.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 100, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 100.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 100, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 92.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 98.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 96.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 101.0, 'shifted_index': 5, 'channel_width': 1.0})], 2: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 105.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 101, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 101.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 101, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 93.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 99.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 97.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 102.0, 'shifted_index': 5, 'channel_width': 1.0})], 3: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 106.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 102, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 102.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 102, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 94.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 100.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 98.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 103.0, 'shifted_index': 5, 'channel_width': 1.0})], 4: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 107.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 103, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 103.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 103, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 95.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 101.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 99.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 104.0, 'shifted_index': 5, 'channel_width': 1.0})], 5: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 108.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 104, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 104.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 104, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 96.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 102.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 100.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 105.0, 'shifted_index': 5, 'channel_width': 1.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-radio-fft-channel-labels

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

N = 1
observations = []
def solve(d):
    return {'signed_bin': d['k'] if d['k']<=d['N']//2 else d['k']-d['N'], 'baseband_frequency': (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_frequency': (d['j']-d['N']//2)*d['B']/d['N'], 'sky_frequency': d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_index': (d['k']+d['N']//2)%d['N'], 'channel_width': d['B']/d['N']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 104.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 100, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 100.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 100, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 92.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 98.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 96.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 101.0, 'shifted_index': 5, 'channel_width': 1.0})], 2: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 105.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 101, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 101.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 101, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 93.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 99.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 97.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 102.0, 'shifted_index': 5, 'channel_width': 1.0})], 3: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 106.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 102, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 102.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 102, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 94.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 100.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 98.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 103.0, 'shifted_index': 5, 'channel_width': 1.0})], 4: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 107.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 103, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 103.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 103, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 95.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 101.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 99.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 104.0, 'shifted_index': 5, 'channel_width': 1.0})], 5: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 108.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 104, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 104.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 104, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 96.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 102.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 100.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 105.0, 'shifted_index': 5, 'channel_width': 1.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 signed bin while other fields remain valid.

An even-length complex radio spectrum has N channels and bandwidth B. Unshifted bin k has signed index k below N/2 and k-N otherwise, including negative Nyquist. After fftshift index j denotes j-N/2. Local oscillator L translates baseband to sky frequency. Output fields are defined by: signed_bin = d['k'] if d['k']<d['N']//2 else d['k']-d['N']; baseband_frequency = (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N']; shifted_frequency = (d['j']-d['N']//2)*d['B']/d['N']; sky_frequency = d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N']; shifted_index = (d['k']+d['N']//2)%d['N']; channel_width = d['B']/d['N']

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'signed_bin': d['k'] if d['k']<d['N']//2 else d['k']-d['N'], 'baseband_frequency': (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/(d['N']-1), 'shifted_frequency': (d['j']-d['N']//2)*d['B']/d['N'], 'sky_frequency': d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_index': (d['k']+d['N']//2)%d['N'], 'channel_width': d['B']/d['N']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 104.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 100, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 100.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 100, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 92.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 98.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 96.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 101.0, 'shifted_index': 5, 'channel_width': 1.0})], 2: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 105.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 101, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 101.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 101, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 93.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 99.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 97.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 102.0, 'shifted_index': 5, 'channel_width': 1.0})], 3: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 106.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 102, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 102.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 102, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 94.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 100.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 98.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 103.0, 'shifted_index': 5, 'channel_width': 1.0})], 4: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 107.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 103, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 103.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 103, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 95.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 101.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 99.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 104.0, 'shifted_index': 5, 'channel_width': 1.0})], 5: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 108.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 104, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 104.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 104, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 96.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 102.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 100.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 105.0, 'shifted_index': 5, 'channel_width': 1.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-radio-fft-channel-labels

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

N = 1
observations = []
def solve(d):
    return {'signed_bin': d['k'] if d['k']<d['N']//2 else d['k']-d['N'], 'baseband_frequency': d['k']*d['B']/d['N'], 'shifted_frequency': (d['j']-d['N']//2)*d['B']/d['N'], 'sky_frequency': d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N'], 'shifted_index': (d['k']+d['N']//2)%d['N'], 'channel_width': d['B']/d['N']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 104.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 100, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 100.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 100, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 92.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 98.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 100, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 96.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 100, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 101.0, 'shifted_index': 5, 'channel_width': 1.0})], 2: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 105.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 101, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 101.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 101, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 93.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 99.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 101, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 97.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 101, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 102.0, 'shifted_index': 5, 'channel_width': 1.0})], 3: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 106.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 102, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 102.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 102, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 94.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 100.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 102, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 98.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 102, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 103.0, 'shifted_index': 5, 'channel_width': 1.0})], 4: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 107.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 103, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 103.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 103, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 95.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 101.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 103, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 99.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 103, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 104.0, 'shifted_index': 5, 'channel_width': 1.0})], 5: [({'N': 8, 'B': 16, 'k': 2, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 2, 'baseband_frequency': 4.0, 'shifted_frequency': -6.0, 'sky_frequency': 108.0, 'shifted_index': 6, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 0, 'j': 4, 'L': 104, 'offset': 0}, {'signed_bin': 0, 'baseband_frequency': 0.0, 'shifted_frequency': 0.0, 'sky_frequency': 104.0, 'shifted_index': 4, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 4, 'j': 0, 'L': 104, 'offset': 0}, {'signed_bin': -4, 'baseband_frequency': -8.0, 'shifted_frequency': -8.0, 'sky_frequency': 96.0, 'shifted_index': 0, 'channel_width': 2.0}), ({'N': 8, 'B': 16, 'k': 7, 'j': 7, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -2.0, 'shifted_frequency': 6.0, 'sky_frequency': 102.0, 'shifted_index': 3, 'channel_width': 2.0}), ({'N': 4, 'B': 16, 'k': 3, 'j': 3, 'L': 104, 'offset': 0}, {'signed_bin': -1, 'baseband_frequency': -4.0, 'shifted_frequency': 4.0, 'sky_frequency': 100.0, 'shifted_index': 1, 'channel_width': 4.0}), ({'N': 8, 'B': 8, 'k': 1, 'j': 1, 'L': 104, 'offset': 0}, {'signed_bin': 1, 'baseband_frequency': 1.0, 'shifted_frequency': -3.0, 'sky_frequency': 105.0, 'shifted_index': 5, 'channel_width': 1.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 baseband frequency while other fields remain valid.

An even-length complex radio spectrum has N channels and bandwidth B. Unshifted bin k has signed index k below N/2 and k-N otherwise, including negative Nyquist. After fftshift index j denotes j-N/2. Local oscillator L translates baseband to sky frequency. Output fields are defined by: signed_bin = d['k'] if d['k']<d['N']//2 else d['k']-d['N']; baseband_frequency = (d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N']; shifted_frequency = (d['j']-d['N']//2)*d['B']/d['N']; sky_frequency = d['L']+(d['k'] if d['k']<d['N']//2 else d['k']-d['N'])*d['B']/d['N']; shifted_index = (d['k']+d['N']//2)%d['N']; channel_width = d['B']/d['N']

split: open-access