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

baseline exclude= specifications complain if units are used #260

Closed
teuben opened this issue May 23, 2024 · 1 comment · Fixed by #449
Closed

baseline exclude= specifications complain if units are used #260

teuben opened this issue May 23, 2024 · 1 comment · Fixed by #449
Assignees
Labels
bug Something isn't working

Comments

@teuben
Copy link
Collaborator

teuben commented May 23, 2024

Describe the bug
The example for baseline subtraction claim we can use units in the exclude=, but it fails .

How to Reproduce

In the FS notebook I used

  exclude = [(-1500*kms,-400*kms),(-200*kms,50*kms),(600*kms,2200*kms)]

which caused the error

  ...
  File ~/GBT/dysh/src/dysh/spectra/core.py:126 in exclude_to_region
     if len(np.shape(exclude[0])) == 0:

   File ~/GBT/anaconda3/lib/python3.11/site-packages/numpy/core/fromnumeric.py:2024 in shape
     result = asarray(a).shape

   File ~/GBT/anaconda3/lib/python3.11/site-packages/astropy/units/quantity.py:1352 in __float__
     raise TypeError(

 TypeError: only dimensionless scalar quantities can be converted to Python scalars

Environment

  • Dysh version
  • Python version
  • OS
@teuben teuben added the bug Something isn't working label May 23, 2024
@astrofle
Copy link
Collaborator

Just to be pedantic, the example notebook says explicitly: Right now, compound exclusions only work in channel space.

@astrofle astrofle mentioned this issue Jan 16, 2025
@astrofle astrofle linked a pull request Jan 16, 2025 that will close this issue
@astrofle astrofle self-assigned this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants