dendrograms / astrodendro

Generate a dendrogram from a dataset
https://dendrograms.readthedocs.io/
Other
37 stars 36 forks source link

Restored dendrogram object missing WCS attribute #129

Closed keflavich closed 9 years ago

keflavich commented 9 years ago

A dendrogram object read from hdf5 has no wcs attribute, which breaks the viewer:

In [13]: d = Dendrogram.compute(np.ones([10,10,10]))

In [14]: d.wcs

In [15]: d.save_to('test.hdf5')

In [16]: d2 = Dendrogram.load_from('test.hdf5')

In [17]: d2.wcs
Traceback (most recent call last):
  File "<ipython-input-17-98af2fbd20f5>", line 1, in <module>
    d2.wcs
AttributeError: 'Dendrogram' object has no attribute 'wcs'
keflavich commented 9 years ago

Should the viewer work at all if the dendrogram is loaded from disk? Perhaps not. It would be nice to have a clear example of how to load a dendrogram + the originating file separately and create a viewer from the pair.

tomr-stargazer commented 9 years ago

Hi Adam, this might be my fault! I introduced the wcs object in pull request #126 (https://github.com/dendrograms/astrodendro/pull/126) and didn't update @ChrisBeaumont who I think was interested in updating the "save/load" functionality to be wcs-aware.

On Wed, Sep 17, 2014 at 4:35 AM, Adam Ginsburg notifications@github.com wrote:

Should the viewer work at all if the dendrogram is loaded from disk? Perhaps not. It would be nice to have a clear example of how to load a dendrogram + the originating file separately and create a viewer from the pair.

— Reply to this email directly or view it on GitHub https://github.com/dendrograms/astrodendro/issues/129#issuecomment-55864360 .

ChrisBeaumont commented 9 years ago

Yep, at a minimum Dendrogram.wcs needs to be initialized to None or something that keeps the viewer from breaking. Better still to preserve wcs during saving/loading

ChrisBeaumont commented 9 years ago

Closed via #137