dendrograms / astrodendro

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

Unable to get wcs working #151

Closed ajrigby closed 2 years ago

ajrigby commented 8 years ago

Hello, I've been trying to load WCS information, following your example listed under 'Plotting Dendrograms', but I am having an issue. Here's what I have:

import astrodendro from astropy.io.fits import getdata from astropy import wcs data, header = getdata('image.fits', header=True) wcs = wcs.WCS(header) d = astrodendro.Dendrogram.compute(data, wcs=wcs) v = d.viewer() v.show()

But I then get an error message:

Traceback (most recent call last): File "Dendrogram_test.py", line 7, in <module> d = astrodendro.Dendrogram.compute(data, wcs=wcs) `TypeError: compute() got an unexpected keyword argument 'wcs'``

What's wrong with the wcs keyword here? What am I missing? Thanks.

tomr-stargazer commented 8 years ago

Hi @AndrewRigby, What version of astrodendro and astropy are you using?

ajrigby commented 8 years ago

I'm currently using astropy 1.1.2 and astrodendro 0.1.0

tomr-stargazer commented 8 years ago

Hi @AndrewRigby , apologies for the long delay between replies - I've been on vacation. I think you might be using a version of astrodendro available on pip (found here: https://pypi.python.org/pypi/astrodendro last updated in 2013). Is this the case? The wcs functionality might not be available on the pip version of astrodendro – it was developed later. If you install astrodendro directly from GitHub (by doing a "git clone" or a "git pull"), I think you should be able to access the wcs functionality you're looking for, as well as other updates.

Tagging @astrofrog in case we want to discuss updating the version number of astrodendro to help diagnose cases like this, or consider a new pip release. At the very least, keeping astrodendro.__version__ == '0.1.0' is less helpful than some other version scheme, I think.

e-koch commented 8 years ago

+1 for a new release. A lot of functionality has been added since the last one.

ajrigby commented 8 years ago

Thank you, @tomr-stargazer. That's done the trick and it's working as expected now.

I had indeed installed astodendro using pip, as recommended on http://www.dendrograms.org/en/latest/installing.html.