sot / mica

Microscope on Chandra aspect
https://sot.github.io/mica
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Astropy UnitsWarning (not supported by the FITS standard) #280

Closed javierggt closed 1 year ago

javierggt commented 1 year ago

This warning happens when running testr on ska3-prime (2023.1rc4).

=============================== warnings summary ===============================
vv/tests/test_vv.py::test_run_vv
vv/tests/test_vv.py::test_run_vv_omitted_slot
vv/tests/test_vv.py::test_run_vv_multi_interval
vv/tests/test_vv.py::test_run_vv_omitted_fid
vv/tests/test_vv.py::test_run_vv_7_track_slots
  /export/jgonzale/github-workflows/miniconda3/envs/ska3-flight-2023.1rc4/lib/python3.10/site-packages/astropy/units/core.py:2097: UnitsWarning: 'marcsec' did not parse as fits unit: At col 0, Unit 'marcsec' not supported by the FITS standard. Did you mean arcsec? If this is meant to be a custom unit, define it with 'u.def_unit'. To have it recognized inside a file reader or other code, enable it with 'u.add_enabled_units'. For details, see https://docs.astropy.org/en/latest/units/combining_and_defining.html
    warnings.warn(msg, UnitsWarning)

vv/tests/test_vv.py::test_run_vv
vv/tests/test_vv.py::test_run_vv_omitted_slot
vv/tests/test_vv.py::test_run_vv_multi_interval
vv/tests/test_vv.py::test_run_vv_omitted_fid
vv/tests/test_vv.py::test_run_vv_7_track_slots
  /export/jgonzale/github-workflows/miniconda3/envs/ska3-flight-2023.1rc4/lib/python3.10/site-packages/astropy/units/core.py:2097: UnitsWarning: 'marcsec/yr' did not parse as fits unit: At col 0, Unit 'marcsec' not supported by the FITS standard. Did you mean arcsec? If this is meant to be a custom unit, define it with 'u.def_unit'. To have it recognized inside a file reader or other code, enable it with 'u.add_enabled_units'. For details, see https://docs.astropy.org/en/latest/units/combining_and_defining.html
    warnings.warn(msg, UnitsWarning)

in chandra_aca, this was fixed by passing the argument unit_parse_strict="silent" to astropy.table.Table.read, but I took a quick look at the code and it was not obvious to me where the change should be, and the change would not be confined to the test, so I figure @jeanconn should take a look or point me in the right direction. I can look again later.