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

Error with plotting mom1 in matplotlib=3.8 #94

Closed
kmhess opened this issue May 20, 2024 · 1 comment
Closed

Error with plotting mom1 in matplotlib=3.8 #94

kmhess opened this issue May 20, 2024 · 1 comment

Comments

@kmhess
Copy link
Owner

kmhess commented May 20, 2024

The following error doesn't appear in earlier versions of matplotlib, but magically does in when running SIP with matplotlib = 3.8:

Traceback (most recent call last):
  File "/mnt/home/student/csuvas/miniconda3/envs/sip2/bin/sofia_image_pipeline", line 8, in <module>
    sys.exit(main())
  File "/mnt/home/student/csuvas/miniconda3/envs/sip2/lib/python3.9/site-packages/src/image_pipeline.py", line 190, in main
    make_images.main(source, src_basename, opt_view=opt_view, suffix=suffix, sofia=sofia, beam=beam,
  File "/mnt/home/student/csuvas/miniconda3/envs/sip2/lib/python3.9/site-packages/src/make_images.py", line 1125, in main
    make_mom1(source, src_basename, cube_params, patch, opt_head, opt_view, HIlowest, suffix=suffix, sofia=2)
  File "/mnt/home/student/csuvas/miniconda3/envs/sip2/lib/python3.9/site-packages/src/make_images.py", line 518, in make_mom1
    cf = ax1.contour(mom1_d, colors=clevels, levels=levels, linewidths=0.6, transform=ax1.get_transform(cubew))
  File "/mnt/home/student/csuvas/miniconda3/envs/sip2/lib/python3.9/site-packages/astropy/visualization/wcsaxes/core.py", line 264, in contour
    transform_contour_set_inplace(cset, transform)
  File "/mnt/home/student/csuvas/miniconda3/envs/sip2/lib/python3.9/site-packages/astropy/visualization/wcsaxes/utils.py", line 176, in transform_contour_set_inplace
    vertices = transform.transform(vertices)
  File "/mnt/home/student/csuvas/miniconda3/envs/sip2/lib/python3.9/site-packages/matplotlib/transforms.py", line 1495, in transform
    res = self.transform_affine(self.transform_non_affine(values))
  File "/mnt/home/student/csuvas/miniconda3/envs/sip2/lib/python3.9/site-packages/matplotlib/_api/deprecation.py", line 297, in wrapper
    return func(*args, **kwargs)
  File "/mnt/home/student/csuvas/miniconda3/envs/sip2/lib/python3.9/site-packages/matplotlib/transforms.py", line 2419, in transform_non_affine
    return self._b.transform_non_affine(self._a.transform(values))
  File "/mnt/home/student/csuvas/miniconda3/envs/sip2/lib/python3.9/site-packages/astropy/visualization/wcsaxes/wcsapi.py", line 318, in transform
    raise ValueError(
ValueError: Expected 2 world coordinates, got 0 

Solution so far is to limit possible versions of matplotlib in setup.py, but will likely need a longer term solution. Maybe it's an astropy compatability with matplotlib issue?

@kmhess
Copy link
Owner Author

kmhess commented Jun 20, 2024

Sorted with the release of version 1.3.1 which removed version limits. See also #97.

@kmhess kmhess closed this as completed Jun 20, 2024
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

1 participant