Skip to content

Moved the XSPEC template script's check for a minimum number of noticed channels to before model declaration#1487

Merged
DavidT3 merged 26 commits intoUnitTests/NeateningAndFormalisingfrom
refine/moveXSPECNumChanCheck
Dec 11, 2025
Merged

Moved the XSPEC template script's check for a minimum number of noticed channels to before model declaration#1487
DavidT3 merged 26 commits intoUnitTests/NeateningAndFormalisingfrom
refine/moveXSPECNumChanCheck

Conversation

@DavidT3
Copy link
Owner

@DavidT3 DavidT3 commented Dec 10, 2025

We've experienced some mysterious seg faults with low quality spectra, particularly from eRASS data, that I hypothesised were to do with model declaration failing when there were 0 or 1 noticed channels.

The spectrum checking part of the script did check for a minimum number of noticed channels, but it was after a model was declared (which seems to be the seg fault point), and the check was only performed if spectrum checking was enabled by the user and for the model.

Now the check is always performed, and is used to screen out spectra before we get anywhere near a model.

Another, actually much more significant change in terms of lines altered in the code base, is that I went through the generate.esass.spec._spec_cmds function, neatened it up a bunch, avoided some potential pitfalls with variables in an internal function shadowing names in the outer scope, and added better support for eSASS4DR1.

David Turner added 26 commits December 8, 2025 12:51
…al_xspec_fit.xcm script to BEFORE the optional single-spectrum model fit and result quality check step. The min channel check is now mandatory, and will hopefully avoid any of the weird seg faults caused by 0 or 1 channel spectra being fit. For issue #1345
…ndard error and outs are written to disk and more easily accessible. For issue #1233
…ot pass the 'region' string for out_radius - not that anyone but me ever used that option as far as I know.
…nt just contains constant definitions of the low and high energy bounds of the image to be used as an extmap for eROSITA product generation.
…ts of neatening things, trying to avoid collisions in namespaces, etc.
…ds function. Think it was causing no spectra to be generated after my revamp of the function.
… the new line in the XSPEC script that errors with very poor spectra is not raised as an error unless it is actually called.
…o figure out why combined spec are being deleted.
… function of _spec_cmds, and hopefully ensured that combined-TM spectra will be written out properly for eSASS4DR1.
@DavidT3
Copy link
Owner Author

DavidT3 commented Dec 11, 2025

This is all now working

@DavidT3 DavidT3 merged commit 525a82e into UnitTests/NeateningAndFormalising Dec 11, 2025
1 check passed
@DavidT3 DavidT3 deleted the refine/moveXSPECNumChanCheck branch December 11, 2025 02:28
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 this pull request may close these issues.

1 participant