You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: