glue-viz / glue

Linked Data Visualizations Across Multiple Files
http://glueviz.org
Other
721 stars 152 forks source link

Tables with skycoords #2487

Closed keflavich closed 1 month ago

keflavich commented 7 months ago

Describe the bug When I try to open a FITS table that contains a skycoord column, I get the following error:

Traceback (most recent call last):
  File "/Users/adam/mambaforge/envs/py310forge/lib/python3.10/site-packages/glue_qt/main.py", line 184, in start_glue
    datasets = load_data_files(datafiles)
  File "/Users/adam/mambaforge/envs/py310forge/lib/python3.10/site-packages/glue_qt/main.py", line 105, in load_data_files
    datasets.append(load_data(df))
  File "/Users/adam/mambaforge/envs/py310forge/lib/python3.10/site-packages/glue/core/data_factories/helpers.py", line 279, in load_data
    d = as_list(factory(path, **kwargs))
  File "/Users/adam/mambaforge/envs/py310forge/lib/python3.10/site-packages/glue/core/data_factories/fits.py", line 154, in fits_reader
    component = Component.autotyped(column, units=column.unit)
  File "/Users/adam/mambaforge/envs/py310forge/lib/python3.10/site-packages/astropy/coordinates/sky_coordinate.py", line 887, in __getattr__
    return self.__getattribute__(attr)
AttributeError: 'SkyCoord' object has no attribute 'unit'
$ glue --version
1.16.0
$ python --version
Python 3.10.12
Mac OS 13.6
pip install'd
keflavich commented 7 months ago

It's not just FITS tables, ecsv's too.

keflavich commented 2 months ago

@astrofrog Any idea of a workaround or solution for this? I'm pretty well blocked from using glue for any application I'm interested in while this is in my way.

astrofrog commented 2 months ago

@keflavich - sorry for not getting back to you sooner! This is likely an issue with mixin columns in general. This is an issue with glue-core, so will move the issue there.