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
I got the following error when working on an image that has beam information in its header:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/var/folders/qh/btyjv_d12px7hzhdnhx71t8m0000gn/T/ipykernel_66057/151975569.py in <module>
37 ra_deg, dec_deg, width=width_deg, height=height_deg)
38 subfig.show_colorscale(cmap='coolwarm')
---> 39 subfig.add_beam()
40 subfig.beam.set_facecolor('w')
41 subfig.beam.set_linewidth(0)
~/software/miniconda3/envs/py3.7/lib/python3.7/site-packages/aplpy/decorators.py in wrapper(*args, **kwargs)
26
27 try:
---> 28 return f(*args, **kwargs)
29 finally:
30 mydata.nesting -= 1
~/software/miniconda3/envs/py3.7/lib/python3.7/site-packages/aplpy/core.py in add_beam(self, *args, **kwargs)
1970 # Initalize the beam and set parameters
1971 b = Beam(self)
-> 1972 b.show(*args, **kwargs)
1973
1974 if hasattr(self, 'beam'):
~/software/miniconda3/envs/py3.7/lib/python3.7/site-packages/aplpy/decorators.py in wrapper(*args, **kwargs)
26
27 try:
---> 28 return f(*args, **kwargs)
29 finally:
30 mydata.nesting -= 1
~/software/miniconda3/envs/py3.7/lib/python3.7/site-packages/aplpy/overlays.py in show(self, major, minor, angle, corner, frame, borderpad, pad, **kwargs)
379
380 if isinstance(major, str):
--> 381 major = self._header[major]
382
383 if isinstance(minor, str):
~/software/miniconda3/envs/py3.7/lib/python3.7/site-packages/astropy/io/fits/header.py in __getitem__(self, key)
155 keyword = key
156
--> 157 card = self._cards[self._cardindex(key)]
158
159 if card.field_specifier is not None and keyword == card.rawkeyword:
~/software/miniconda3/envs/py3.7/lib/python3.7/site-packages/astropy/io/fits/header.py in _cardindex(self, key)
1744
1745 if not indices:
-> 1746 raise KeyError(f"Keyword {keyword!r} not found.")
1747
1748 try:
KeyError: "Keyword 'BMAJ' not found."
Upon further tests, I noticed this error would go away if I don't use north=True when initializing the FITSFigure object. I haven't checked the source code, but I am guessing that the header information somehow gets dropped when converting the header to make the image north-aligned?
The text was updated successfully, but these errors were encountered:
I got the following error when working on an image that has beam information in its header:
Upon further tests, I noticed this error would go away if I don't use
north=True
when initializing the FITSFigure object. I haven't checked the source code, but I am guessing that the header information somehow gets dropped when converting the header to make the image north-aligned?The text was updated successfully, but these errors were encountered: