asdf: Can't open ASDF in FITS

I upgraded asdf and can no longer read files. Example:

$ /blue/adamginsburg/adamginsburg/miniconda3/envs/python39/bin/ipython -c "import asdf; print(asdf.__version__); asdf.open('F200W/pipeline/jw01182004001_04101_00001_nrca1_cal.fits')"
Logging to /blue/adamginsburg/adamginsburg/jwst/brick/ipython_log_2023-11-13.py
[TerminalIPythonApp] WARNING | Config option `ignore_old_config` not recognized by `TerminalIPythonApp`.
Activating auto-logging. Current session state plus future input saved.
Filename       : /blue/adamginsburg/adamginsburg/jwst/brick/ipython_log_2023-11-13.py
Mode           : append
Output logging : False
Raw input log  : False
Timestamping   : False
State          : active
/blue/adamginsburg/adamginsburg/.ipython/profile_default/startup/05_log.py:15: DeprecationWarning: `magic(...)` is deprecated since IPython 0.13 (warning added in 8.1), use run_line_magic(magic_name, parameter_s).
  ip.magic('logstart -o %s append' % filename)
/orange/adamginsburg/miniconda3/envs/python39/lib/python3.9/site-packages/IPython/core/magics/logging.py:130: UserWarning: Couldn't start log: Log file is already active: /blue/adamginsburg/adamginsburg/jwst/brick/ipython_log_2023-11-13.py
  warn("Couldn't start log: %s" % sys.exc_info()[1])
 Logging to /blue/adamginsburg/adamginsburg/jwst/brick/ipython_log_2023-11-13.py
3.0.1
/orange/adamginsburg/miniconda3/envs/python39/lib/python3.9/site-packages/asdf/extension/_converter.py:186: AsdfWarning: Converter handles multiple tags for this extension, but does not implement a select_tag method. This previously worked because Converter subclasses inherited the now removed select_tag. This will be an error in a future version of asdf
  warnings.warn(msg, AsdfWarning)
Traceback (most recent call last):
  Cell In[1], line 1
    import asdf; print(asdf.__version__); asdf.open('F200W/pipeline/jw01182004001_04101_00001_nrca1_cal.fits')
  File /orange/adamginsburg/miniconda3/envs/python39/lib/python3.9/site-packages/asdf/asdf.py:1584 in open_asdf
    return AsdfFile._open_impl(
  File /orange/adamginsburg/miniconda3/envs/python39/lib/python3.9/site-packages/asdf/asdf.py:881 in _open_impl
    return cls._open_asdf(
  File /orange/adamginsburg/miniconda3/envs/python39/lib/python3.9/site-packages/asdf/asdf.py:791 in _open_asdf
    self._file_format_version = cls._parse_header_line(header_line)
  File /orange/adamginsburg/miniconda3/envs/python39/lib/python3.9/site-packages/asdf/asdf.py:709 in _parse_header_line
    raise ValueError(msg)
ValueError: Does not appear to be a ASDF file.

This worked on earlier versions:

>>> import asdf
>>> print(asdf.__version__)
>>> asdf.open('F356W/pipeline/jw01182004001_02101_00001_nrcalong_cal.fits')
2.15.1
<asdf.fits_embed.AsdfInFits at 0x14c75ec01130>

I see that this is intentional: https://github.com/asdf-format/asdf/pull/1288 but it broke my workflows and was a very surprising error. I’d like to request a clearer error message and guide to migration.

About this issue

  • Original URL
  • State: open
  • Created 8 months ago
  • Comments: 20 (20 by maintainers)

Most upvoted comments

Would you open an issue over at stdatamodels? https://github.com/spacetelescope/stdatamodels/issues

I’d like to leave this issue open in case other folks run into similar errors.

Thanks again for opening this. I pinned this issue so that hopefully other folks that encounter this issue will see this discussion.