wwt_data_formats/imageset.py: accept the TPV projection

This is non-standard but comes up in DASCH data. It's TAN plus distortions, so if
we just treat it like TAN, the results for this routine should be OK.
This commit is contained in:
Peter Williams 2022-08-23 15:50:59 -04:00
Родитель 9bc33efb37
Коммит d2ba365f6f
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -426,7 +426,9 @@ class ImageSet(LockedXmlTraits, UrlContainer):
will do its best to detect and reject them.
"""
if headers["CTYPE1"] != "RA---TAN" or headers["CTYPE2"] != "DEC--TAN":
if headers["CTYPE1"] not in ("RA---TAN", "RA---TPV") or headers[
"CTYPE2"
] not in ("DEC--TAN", "DEC--TPV"):
raise ValueError("WCS coordinates must be in an equatorial/TAN projection")
# Figure out the stuff we need from the headers.

Просмотреть файл

@ -166,6 +166,14 @@ def test_wcs_1():
_check_wcs_roundtrip(imgset, 3000, wcs_keywords)
# Also check with TPV headers, which we allow for DASCH
wcs_keywords["CTYPE1"] = "RA---TPV"
wcs_keywords["CTYPE2"] = "DEC--TPV"
imgset.set_position_from_wcs(wcs_keywords, 3000, 3000)
observed_xml = imgset.to_xml()
assert_xml_trees_equal(expected_xml, observed_xml)
def test_wcs_only_two_pc_values():
expected_str = """