FA-54866 / Astronomical coordinate conventions / Open access
Detector cutout reference: Parent inclusive detector endpoint is translated using padded height · case 01
The adapter reports an incorrect parent last y while other fields remain valid.
ROOT CAUSE
Parent inclusive detector endpoint is translated using padded height. Faulty expression: d['sy']+d['h']-1
VERIFIED REPAIR
Preserve the declared model convention at this site: d['sy']+d['h']
Unsuccessful approach: A partial convention repair still uses d['sy']+d['h']+d['hy']
Case contract
A one-based FITS-like detector cutout has zero-based start sx,sy, explicit halo hx,hy, and unchanged plate scale. CRPIX belongs to the padded cutout; valid bounds exclude halo. Data section uses inclusive pixel endpoints. Output fields are defined by: crpix_x = d['rx']-d['sx']+d['hx']; crpix_y = d['ry']-d['sy']+d['hy']; science_first_x = d['hx']+1; science_last_x = d['hx']+d['w']; parent_first_y = d['sy']+1; parent_last_y = d['sy']+d['h']
Why this case matters
Catalog, detector, sky-coordinate, and spectroscopy adapters must preserve the association between numeric coordinates and their declared reference conventions.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'crpix_x': d['rx']-d['sx']+d['hx'], 'crpix_y': d['ry']-d['sy']+d['hy'], 'science_first_x': d['hx']+1, 'science_last_x': d['hx']+d['w'], 'parent_first_y': d['sy']+1, 'parent_last_y': d['sy']+d['h']-1}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'rx': 12, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 10, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 12, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 14, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 12, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 8, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 12, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 16, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 12, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 10, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 12, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 7, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})], 2: [({'rx': 13, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 11, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 13, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 15, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 13, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 9, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 13, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 17, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 13, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 11, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 13, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 8, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})], 3: [({'rx': 14, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 12, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 14, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 16, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 14, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 10, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 14, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 18, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 14, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 12, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 14, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 9, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})], 4: [({'rx': 15, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 13, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 15, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 17, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 15, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 11, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 15, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 19, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 15, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 13, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 15, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 10, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})], 5: [({'rx': 16, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 14, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 16, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 18, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 16, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 12, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 16, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 20, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 16, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 14, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 16, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 11, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})]}
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| astronomical fixture 0 | {'crpix_x': 10, 'crpix_y': 15, 'parent_first_y': 8, 'parent_last_y': 36, 'science_first_x': 3, 'science_last_x': 22} | {'crpix_x': 10, 'crpix_y': 15, 'parent_first_y': 8, 'parent_last_y': 37, 'science_first_x': 3, 'science_last_x': 22} | Failed |
| astronomical fixture 1 | {'crpix_x': 14, 'crpix_y': 22, 'parent_first_y': 1, 'parent_last_y': 29, 'science_first_x': 3, 'science_last_x': 22} | {'crpix_x': 14, 'crpix_y': 22, 'parent_first_y': 1, 'parent_last_y': 30, 'science_first_x': 3, 'science_last_x': 22} | Failed |
| astronomical fixture 2 | {'crpix_x': 8, 'crpix_y': 12, 'parent_first_y': 8, 'parent_last_y': 36, 'science_first_x': 1, 'science_last_x': 20} | {'crpix_x': 8, 'crpix_y': 12, 'parent_first_y': 8, 'parent_last_y': 37, 'science_first_x': 1, 'science_last_x': 20} | Failed |
| astronomical fixture 3 | {'crpix_x': 16, 'crpix_y': 25, 'parent_first_y': -2, 'parent_last_y': 26, 'science_first_x': 3, 'science_last_x': 22} | {'crpix_x': 16, 'crpix_y': 25, 'parent_first_y': -2, 'parent_last_y': 27, 'science_first_x': 3, 'science_last_x': 22} | Failed |
| astronomical fixture 4 | {'crpix_x': 10, 'crpix_y': 15, 'parent_first_y': 8, 'parent_last_y': 7, 'science_first_x': 3, 'science_last_x': 3} | {'crpix_x': 10, 'crpix_y': 15, 'parent_first_y': 8, 'parent_last_y': 8, 'science_first_x': 3, 'science_last_x': 3} | Failed |
| astronomical fixture 5 | {'crpix_x': 7, 'crpix_y': 18, 'parent_first_y': 3, 'parent_last_y': 31, 'science_first_x': 5, 'science_last_x': 24} | {'crpix_x': 7, 'crpix_y': 18, 'parent_first_y': 3, 'parent_last_y': 32, 'science_first_x': 5, 'science_last_x': 24} | Failed |
SHA-256 / 5db7f203a36967b71ddbaf8351b27bac982af0310cb8cc1f66b2f9b524019d90
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'crpix_x': d['rx']-d['sx']+d['hx'], 'crpix_y': d['ry']-d['sy']+d['hy'], 'science_first_x': d['hx']+1, 'science_last_x': d['hx']+d['w'], 'parent_first_y': d['sy']+1, 'parent_last_y': d['sy']+d['h']+d['hy']}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'rx': 12, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 10, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 12, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 14, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 12, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 8, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 12, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 16, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 12, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 10, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 12, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 7, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})], 2: [({'rx': 13, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 11, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 13, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 15, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 13, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 9, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 13, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 17, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 13, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 11, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 13, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 8, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})], 3: [({'rx': 14, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 12, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 14, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 16, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 14, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 10, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 14, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 18, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 14, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 12, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 14, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 9, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})], 4: [({'rx': 15, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 13, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 15, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 17, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 15, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 11, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 15, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 19, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 15, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 13, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 15, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 10, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})], 5: [({'rx': 16, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 14, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 16, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 18, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 16, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 12, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 16, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 20, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 16, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 14, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 16, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 11, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})]}
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| astronomical fixture 0 | {'crpix_x': 10, 'crpix_y': 15, 'parent_first_y': 8, 'parent_last_y': 40, 'science_first_x': 3, 'science_last_x': 22} | {'crpix_x': 10, 'crpix_y': 15, 'parent_first_y': 8, 'parent_last_y': 37, 'science_first_x': 3, 'science_last_x': 22} | Failed |
| astronomical fixture 1 | {'crpix_x': 14, 'crpix_y': 22, 'parent_first_y': 1, 'parent_last_y': 33, 'science_first_x': 3, 'science_last_x': 22} | {'crpix_x': 14, 'crpix_y': 22, 'parent_first_y': 1, 'parent_last_y': 30, 'science_first_x': 3, 'science_last_x': 22} | Failed |
| astronomical fixture 2 | {'crpix_x': 8, 'crpix_y': 12, 'parent_first_y': 8, 'parent_last_y': 37, 'science_first_x': 1, 'science_last_x': 20} | {'crpix_x': 8, 'crpix_y': 12, 'parent_first_y': 8, 'parent_last_y': 37, 'science_first_x': 1, 'science_last_x': 20} | Passed |
| astronomical fixture 3 | {'crpix_x': 16, 'crpix_y': 25, 'parent_first_y': -2, 'parent_last_y': 30, 'science_first_x': 3, 'science_last_x': 22} | {'crpix_x': 16, 'crpix_y': 25, 'parent_first_y': -2, 'parent_last_y': 27, 'science_first_x': 3, 'science_last_x': 22} | Failed |
| astronomical fixture 4 | {'crpix_x': 10, 'crpix_y': 15, 'parent_first_y': 8, 'parent_last_y': 11, 'science_first_x': 3, 'science_last_x': 3} | {'crpix_x': 10, 'crpix_y': 15, 'parent_first_y': 8, 'parent_last_y': 8, 'science_first_x': 3, 'science_last_x': 3} | Failed |
| astronomical fixture 5 | {'crpix_x': 7, 'crpix_y': 18, 'parent_first_y': 3, 'parent_last_y': 33, 'science_first_x': 5, 'science_last_x': 24} | {'crpix_x': 7, 'crpix_y': 18, 'parent_first_y': 3, 'parent_last_y': 32, 'science_first_x': 5, 'science_last_x': 24} | Failed |
SHA-256 / 4dd777d6e9069aadef3c6ae33775666974fafa60085ebac8da31f6a0712114b2
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'crpix_x': d['rx']-d['sx']+d['hx'], 'crpix_y': d['ry']-d['sy']+d['hy'], 'science_first_x': d['hx']+1, 'science_last_x': d['hx']+d['w'], 'parent_first_y': d['sy']+1, 'parent_last_y': d['sy']+d['h']}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'rx': 12, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 10, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 12, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 14, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 12, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 8, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 12, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 16, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 12, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 10, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 12, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 7, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})], 2: [({'rx': 13, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 11, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 13, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 15, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 13, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 9, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 13, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 17, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 13, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 11, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 13, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 8, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})], 3: [({'rx': 14, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 12, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 14, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 16, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 14, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 10, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 14, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 18, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 14, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 12, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 14, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 9, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})], 4: [({'rx': 15, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 13, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 15, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 17, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 15, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 11, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 15, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 19, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 15, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 13, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 15, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 10, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})], 5: [({'rx': 16, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 14, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 16, 'ry': 19, 'sx': 0, 'sy': 0, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 18, 'crpix_y': 22, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': 1, 'parent_last_y': 30}), ({'rx': 16, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 0, 'hy': 0, 'w': 20, 'h': 30}, {'crpix_x': 12, 'crpix_y': 12, 'science_first_x': 1, 'science_last_x': 20, 'parent_first_y': 8, 'parent_last_y': 37}), ({'rx': 16, 'ry': 19, 'sx': -2, 'sy': -3, 'hx': 2, 'hy': 3, 'w': 20, 'h': 30}, {'crpix_x': 20, 'crpix_y': 25, 'science_first_x': 3, 'science_last_x': 22, 'parent_first_y': -2, 'parent_last_y': 27}), ({'rx': 16, 'ry': 19, 'sx': 4, 'sy': 7, 'hx': 2, 'hy': 3, 'w': 1, 'h': 1}, {'crpix_x': 14, 'crpix_y': 15, 'science_first_x': 3, 'science_last_x': 3, 'parent_first_y': 8, 'parent_last_y': 8}), ({'rx': 16, 'ry': 19, 'sx': 9, 'sy': 2, 'hx': 4, 'hy': 1, 'w': 20, 'h': 30}, {'crpix_x': 11, 'crpix_y': 18, 'science_first_x': 5, 'science_last_x': 24, 'parent_first_y': 3, 'parent_last_y': 32})]}
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| astronomical fixture 0 | {'crpix_x': 10, 'crpix_y': 15, 'parent_first_y': 8, 'parent_last_y': 37, 'science_first_x': 3, 'science_last_x': 22} | {'crpix_x': 10, 'crpix_y': 15, 'parent_first_y': 8, 'parent_last_y': 37, 'science_first_x': 3, 'science_last_x': 22} | Passed |
| astronomical fixture 1 | {'crpix_x': 14, 'crpix_y': 22, 'parent_first_y': 1, 'parent_last_y': 30, 'science_first_x': 3, 'science_last_x': 22} | {'crpix_x': 14, 'crpix_y': 22, 'parent_first_y': 1, 'parent_last_y': 30, 'science_first_x': 3, 'science_last_x': 22} | Passed |
| astronomical fixture 2 | {'crpix_x': 8, 'crpix_y': 12, 'parent_first_y': 8, 'parent_last_y': 37, 'science_first_x': 1, 'science_last_x': 20} | {'crpix_x': 8, 'crpix_y': 12, 'parent_first_y': 8, 'parent_last_y': 37, 'science_first_x': 1, 'science_last_x': 20} | Passed |
| astronomical fixture 3 | {'crpix_x': 16, 'crpix_y': 25, 'parent_first_y': -2, 'parent_last_y': 27, 'science_first_x': 3, 'science_last_x': 22} | {'crpix_x': 16, 'crpix_y': 25, 'parent_first_y': -2, 'parent_last_y': 27, 'science_first_x': 3, 'science_last_x': 22} | Passed |
| astronomical fixture 4 | {'crpix_x': 10, 'crpix_y': 15, 'parent_first_y': 8, 'parent_last_y': 8, 'science_first_x': 3, 'science_last_x': 3} | {'crpix_x': 10, 'crpix_y': 15, 'parent_first_y': 8, 'parent_last_y': 8, 'science_first_x': 3, 'science_last_x': 3} | Passed |
| astronomical fixture 5 | {'crpix_x': 7, 'crpix_y': 18, 'parent_first_y': 3, 'parent_last_y': 32, 'science_first_x': 5, 'science_last_x': 24} | {'crpix_x': 7, 'crpix_y': 18, 'parent_first_y': 3, 'parent_last_y': 32, 'science_first_x': 5, 'science_last_x': 24} | Passed |
SHA-256 / 2d4f1df39b1a3775d880a541e36dc7812b7fd591c308dc43c58cf8db908b639f
Verification & scope
Explicitly stipulated finite algebraic adapter; no standards conformance, physical accuracy, or production-library claim. Inputs are the documented finite valid model domain. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:45:52.356095+00:00.
Case digest / aa901572a5145df5bf947e57cd48f70510c624c1f2ce61aa95cd5c33d1eeab9b