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
wcsaxes.transforms.get_transform does not recognise sliced WCS objects. When one is entered, a TypeError is returned saying TypeError: output_system should be a WCS instance, string, or a coordinate frame instance
Expected behavior
Actual behavior
Steps to Reproduce
[First Step]
[Second Step]
[and so on...]
# Put your Python code snippet here.# Let wcs1 and wcs2 be two FITS WCS objects, describing arrays data1 and data2.# data1/wcs1 is an image, while data2/wcs2 is an image cube. So slice data2/wcs2 to overplot.>>>data3=data2[0]
>>>wcs3=wcs2[0]
>>>importmatplotlib>>>ax=plt.subplot(projection=wcs1)
>>>ax.imshow(data1)
>>>ax.contour(data3, transform=ax.get_transform(wcs3), colors='red')
---------------------------------------------------------------------------TypeErrorTraceback (mostrecentcalllast)
/tmp/ipykernel_26357/1992842180.pyin<module>1ax=plt.subplot(projection=wcs1)
2ax.imshow(data1)
---->3ax.contour(data3, transform=ax.get_transform(wcs3), colors='red')
~/miniconda3/envs/foxsi2/lib/python3.9/site-packages/astropy/visualization/wcsaxes/core.pyinget_transform(self, frame)
564* :class:`~astropy.coordinates.BaseCoordinateFrame`instance.
565 """
--> 566 return self._get_transform_no_transdata(frame).inverted() + self.transData
567
568 def _get_transform_no_transdata(self, frame):
~/miniconda3/envs/foxsi2/lib/python3.9/site-packages/astropy/visualization/wcsaxes/core.py in _get_transform_no_transdata(self, frame)
603 else:
604
--> 605 coordinate_transform = CoordinateTransform(self._transform_pixel2world.frame_out, frame)
606
607 if coordinate_transform.same_frames:
~/miniconda3/envs/foxsi2/lib/python3.9/site-packages/astropy/visualization/wcsaxes/transforms.py in __init__(self, input_system, output_system)
87 self.output_system = self._output_system_name
88 else:
---> 89 raise TypeError("output_system should be a WCS instance, string, or a coordinate frame instance")
9091ifself.output_system==self.input_system:
TypeError: output_systemshouldbeaWCSinstance, string, oracoordinateframeinstance
Description
wcsaxes.transforms.get_transform
does not recognise sliced WCS objects. When one is entered, a TypeError is returned sayingTypeError: output_system should be a WCS instance, string, or a coordinate frame instance
Expected behavior
Actual behavior
Steps to Reproduce
System Details
Linux-5.8.0-59-generic-x86_64-with-glibc2.31
Python 3.9.6 | packaged by conda-forge | (default, Jul 11 2021, 03:39:48)
[GCC 9.3.0]
Numpy 1.21.1
astropy 4.2.1 (Same issue with 4.3rc1)
Scipy 1.7.0
Matplotlib 3.4.2
The text was updated successfully, but these errors were encountered: