radio-astro-tools / spectral-cube

Library for reading and analyzing astrophysical spectral data cubes
http://spectral-cube.rtfd.org
BSD 3-Clause "New" or "Revised" License
96 stars 63 forks source link

DS9 region strings not working with subcube_from_ds9region #867

Closed astrofle closed 8 months ago

astrofle commented 1 year ago

When trying to extract a subcube using a DS9 region string, e.g.,'fk5;circle(140.511,50.9766,240")' with v0.7 of regions the function regions.Region.read is called which expects a file. Instead, the regions.Region.parse function should be called (to preserve the previous behavior). Example: region_list = regions.Regions.parse(ds9_region, format="ds9") The change should be made in this line

keflavich commented 1 year ago

@astrofle we'd welcome a pull request!