Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example script #71

Open
felialves opened this issue Feb 22, 2022 · 1 comment
Open

example script #71

felialves opened this issue Feb 22, 2022 · 1 comment

Comments

@felialves
Copy link

When running the example script in the example folder, I got the following error:

n [2]: run example_filament_profile.py

AttributeError Traceback (most recent call last)
/usr/local/lib/python3.9/site-packages/FilFinder/examples/example_filament_profile.py in
45 # p.ion()
46 dists, profiles, extents, fit_table =
---> 47 filament_profile(labels == 3, noiseimg, hdr, max_dist=0.14*u.pc,
48 distance=250.*u.pc, bright_unit="", noise=None,
49 verbose=True)
/usr/local/lib/python3.9/site-packages/fil_finder-1.7.2-py3.9.egg/fil_finder/width_profiles/profile_line_width.py in filament_profile(skeleton, image, pixscale, max_dist, distance, num_avg, verbose, bright_unit, noise, fit_profiles)
95 '''
96
---> 97 deg_per_pix = pixscale.to(u.deg) / u.pixel
98
99 if distance is not None:
AttributeError: 'Header' object has no attribute 'to'

With some help from a friend, we figured that the problem is that the function filament_profile expected the pixscale as a variable with a unit, but instead had received the header object. So we changed "hdr" in line 47 to "abs(hdr['cdelt1'])" and it works. This is just a note that perhaps the example script should have this replacement.

@e-koch
Copy link
Owner

e-koch commented Feb 23, 2022

Thanks for reporting this @felialves! Your fix sounds right to me and I'll update this in the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants