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

Region handling: some valid ds9 regions are not supported #1064

Closed
keflavich opened this issue Mar 31, 2021 · 11 comments · Fixed by #1142
Closed

Region handling: some valid ds9 regions are not supported #1064

keflavich opened this issue Mar 31, 2021 · 11 comments · Fixed by #1142
Assignees

Comments

@keflavich
Copy link

I encountered an issue where a region file formatted like this:

icrs
point(17:25:26.34, -28:30:40.54) # point=x

is not recognized as a region file by CARTA, but it is a valid ds9 region file.

@kswang1029
Copy link
Contributor

kswang1029 commented Mar 31, 2021

@keflavich weird. I cannot reproduce the issue. Could you send me the region file? The file is not in dos format, for sure?

@keflavich
Copy link
Author

that's exactly the region file; I saved it as test.reg and could not open it. It is not DOS format, though an earlier test version was - is this a problem?

@kswang1029
Copy link
Contributor

kswang1029 commented Mar 31, 2021

We had an issue due to the dos format. Now fixed in dev #658
Not sure if that’s related or this is a new one🤔

@kswang1029
Copy link
Contributor

Do you have the header line starting with #?

@keflavich
Copy link
Author

no, there is no header line

@kswang1029
Copy link
Contributor

please add

# Region file format: DS9 CARTA 1.4

as the 1st line, otherwise it is hard to tell the region file is in ds9 format or crtf.

@keflavich
Copy link
Author

I know that's a workaround, but that is not a requirement for a file to be a valid ds9 region file. The user should be able to tell CARTA what type of region file it is and try to read it. This is important because there are potentially enormous numbers of ds9-compatible .reg files around, and if CARTA can only read a subset of them, it results in creation of a new format standard.

@veggiesaurus
Copy link
Collaborator

I know that's a workaround, but that is not a requirement for a file to be a valid ds9 region file. The user should be able to tell CARTA what type of region file it is and try to read it. This is important because there are potentially enormous numbers of ds9-compatible .reg files around, and if CARTA can only read a subset of them, it results in creation of a new format standard.

I agree. CRTF requires #CRTF in the first line, so that narrows things down, and we can attempt to parse things as DS9 if they're missing that header line

@keflavich
Copy link
Author

iirc, ds9 provided a large suite of test files, but I can't find it. In astropy-regions, we have a bunch too, though all of these presently have headers - this issue motivates adding a headerless test case:
https://github.com/astropy/regions/tree/main/regions/io/ds9/tests/data

@keflavich
Copy link
Author

ah, the .strip.reg files are headerless

@o-smirnov
Copy link

Experiencing a similar problem with DS9 line regions:

image

Region file: im2di_clustered.tessel.reg.txt

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

Successfully merging a pull request may close this issue.

5 participants