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

pnspectra will choke on a provided region text file longer than 1024 characters #1

Open
joshuaekingsbury opened this issue May 22, 2023 · 6 comments

Comments

@joshuaekingsbury
Copy link
Owner

joshuaekingsbury commented May 22, 2023

Equivalent to about 18 circular regions with current unnecessary 10-point precision of radius size of circles, 2-point x/y det coords, and including white space characters.

Previous region selection strings used for spatially resolved spectroscopy were all under 900 characters, so I did not face this issue with previous selection expressions output from this script.

For now, seeing if 18-circle limit works okay.

@joshuaekingsbury
Copy link
Owner Author

[...]

** evselect: error (SyntaxError), (PATTERN<=0)&&(FLAG == 0)&&((DETX,DETY) in BOX(-2196,-1110,16060,15510,0))&&((CCDNR == 1)||(CCDNR == 2)||(CCDNR == 3)||(CCDNR == 4)||(CCDNR == 5)||(CCDNR == 6)||(CCDNR == 7)||(CCDNR == 8)||(CCDNR == 9)||(CCDNR == 10)||(CCDNR == 11)||(CCDNR == 12))&&!((DETX,DETY) IN circle(-24.2,-259.0,3839.9399999692)||(DETX,DETY) IN circle(-1637.6,-5818.3,678.0199967945)||(DETX,DETY) IN circle(2950.2,-4270.6,431.9999999965)||(DETX,DETY) IN circle(2985.9,-7249.7,931.6999943925)||(DETX,DETY) IN circle(-4715.5,4970.6,431.9999999965)||(DETX,DETY) IN circle(-4419.5,4435.1,431.9999999965)||(DETX,DETY) IN circle(-5397.2,6338.1,431.9999999965)||(DETX,DETY) IN circle(-5454.6,7074.3,431.9999999965)||(DETX,DETY) IN circle(-4605.1,8447.2,431.9999999965)||(DETX,DETY) IN circle(-8561.6,10314.7,431.9999999965)||(DETX,DETY) IN circle(-11361.4,5009.7,431.9999999965)||(DETX,DETY) IN circle(1423.1,14285.3,1037.6399951916)||(DETX,DETY) IN circle(6789.2,12021.4,299.9999951976)||(DETX,DETY) IN circle(9059.9,11237.5,613.4999975950)||(DETX,DETY) IN circle(8804.9,9499.7,469.6999991962)||(DETX,DETY) IN circle(7217.6,5961.8,688.9799951944)||(DETX,DETY) IN circle(-272.1,-14745.3,566.2199951954)||(DETX,DETY) IN circle(-167.0,-15675.4,739.0999943940)||(DETX,DETY) IN circle(-5559.0,-11262.1,359.99&&((DETX,DETY) IN circle(-2200,-1110,17980))&&region(pnS003-bkgregtdet.fits)
^ parse error
Syntax error in expression: '(PATTERN<=0)&&(FLAG == 0)&&((DETX,DETY) in BOX(-2196,-1110,16060,15510,0))&&((CCDNR == 1)||(CCDNR == 2)||(CCDNR == 3)||(CCDNR == 4) [...]'

Provided region selection string here is truncated at 1024 characters before next condition is appended:

&&!((DETX,DETY) IN circle(-24.2,-259.0,3839.9399999692)||(DETX,DETY) IN circle(-1637.6,-5818.3,678.0199967945)||(DETX,DETY) IN circle(2950.2,-4270.6,431.9999999965)||(DETX,DETY) IN circle(2985.9,-7249.7,931.6999943925)||(DETX,DETY) IN circle(-4715.5,4970.6,431.9999999965)||(DETX,DETY) IN circle(-4419.5,4435.1,431.9999999965)||(DETX,DETY) IN circle(-5397.2,6338.1,431.9999999965)||(DETX,DETY) IN circle(-5454.6,7074.3,431.9999999965)||(DETX,DETY) IN circle(-4605.1,8447.2,431.9999999965)||(DETX,DETY) IN circle(-8561.6,10314.7,431.9999999965)||(DETX,DETY) IN circle(-11361.4,5009.7,431.9999999965)||(DETX,DETY) IN circle(1423.1,14285.3,1037.6399951916)||(DETX,DETY) IN circle(6789.2,12021.4,299.9999951976)||(DETX,DETY) IN circle(9059.9,11237.5,613.4999975950)||(DETX,DETY) IN circle(8804.9,9499.7,469.6999991962)||(DETX,DETY) IN circle(7217.6,5961.8,688.9799951944)||(DETX,DETY) IN circle(-272.1,-14745.3,566.2199951954)||(DETX,DETY) IN circle(-167.0,-15675.4,739.0999943940)||(DETX,DETY) IN circle(-5559.0,-11262.1,359.99

@joshuaekingsbury
Copy link
Owner Author

Reduced unnecessary radius precision. Should be able to get ~22 circle regions now @ ~45 chars per circle region

@joshuaekingsbury
Copy link
Owner Author

A 940 char txt file of 21 circle regions worked without crashing pnspectra/evselect.

[...] evselect:- Executing (routine): evselect table=pnS003-allevc.fits:EVENTS filteredset=filtered.fits withfilteredset=yes keepfilteroutput=yes flagcolumn=EVFLAG flagbit=-1 destruct=yes dssblock='' expression='(PATTERN<=0)&&(FLAG == 0)&&(PI in [350:1100])&&((CCDNR == 1)||(CCDNR == 2)||(CCDNR == 3)||(CCDNR == 4)||(CCDNR == 5)||(CCDNR == 6)||(CCDNR == 7)||(CCDNR == 8)||(CCDNR == 9)||(CCDNR == 10)||(CCDNR == 11)||(CCDNR == 12))&&((DETX,DETY) in BOX(-2196,-1110,16060,15510,0))&&!((DETX,DETY) IN circle(6789.2,12021.4,299)||(DETX,DETY) IN circle(-5559.0,-11262.1,359)||(DETX,DETY) IN circle(-9782.3,-6438.3,359)||(DETX,DETY) IN circle(-13701.4,-5013.2,428)||(DETX,DETY) IN circle(-14892.4,-282.4,359)||(DETX,DETY) IN circle(-14120.8,2117.8,359)||(DETX,DETY) IN circle(-148.8,-15098.8,1282)||(DETX,DETY) IN circle(7335.2,14160.8,431)||(DETX,DETY) IN circle(4805.1,-3459.5,431)||(DETX,DETY) IN circle(-12554.5,-11197.4,1197)||(DETX,DETY) IN circle(-24.2,-259.0,3839)||(DETX,DETY) IN circle(2985.9,-7249.7,931)||(DETX,DETY) IN circle(-1637.6,-5818.3,678)||(DETX,DETY) IN circle(7217.6,5961.8,688)||(DETX,DETY) IN circle(1423.1,14285.3,1037)||(DETX,DETY) IN circle(-5349.8,6578.3,850)||(DETX,DETY) IN circle(-4607.8,4644.9,932)||(DETX,DETY) IN circle(4964.6,-2193.3,534)||(DETX,DETY) IN circle(-4265.9,-816.8,551)||(DETX,DETY) IN circle(6657.2,-8203.0,549)||(DETX,DETY) IN circle(-5403.7,-1683.9,676))&&((DETX,DETY) IN circle(-2200,-1110,17980))&&region(pnS003-bkgregtdet.fits)' filtertype=expression [...]

@joshuaekingsbury
Copy link
Owner Author

Thought I should note I'm currently working with SAS v21.0

@joshuaekingsbury
Copy link
Owner Author

Was able to run pnspectra successfully on ~7 observations after reducing custom regions selected such that resulting selection string for each was under 1024 characters.

@joshuaekingsbury
Copy link
Owner Author

Ticket submitted by email to XMM-NEWTON HELPDESK.

Error was briefly described, links were shared to this repo/issue thread, and request was made for a way to increase string length of selection expression in region file that pnspectra/mosspectra will accept without truncating.

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