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 Dec 11, 2025
Conversation
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.
…iated with the source, but one of them is
…f srctool will be used.
… the new line in the XSPEC script that errors with very poor spectra is not raised as an error unless it is actually called.
…SPEC template script.
…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.
Owner
Author
|
This is all now working |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.