-
Notifications
You must be signed in to change notification settings - Fork 0
Ingested the introduction to NICER analysis notebook from SciServer cookbooks #116
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
base: main
Are you sure you want to change the base?
Conversation
…l index.md - for issue #115
… pipeline. For issue #115
…s CI/CD checks. Now to add more commentary and do some editing. For issue #115
…m plot), but made a fair few changes to the commentary around all the code cells. For issue #115
…ade the major tick formatter of the spectrum x-axis the same as the minor formatter. Also also fixed a stupid mistake where I tried to import matplotlib.plot rather than matplotlib.pyplot (honestly...). For issue #115
…ht curve figure(s). This may move issue #115 to review, after testing
…CER timing guide to additional resources. For issue #115
|
Failure on CircleCI may be to do with the Scorpeon background model - so I suspect that this is the first instance of the XSPEC models directory not being available in the Fornax-Hea image causing issues. Should be easy to sort, I'll set up a cache for XSPEC models in the same way I have done for calibration data. |
…run on CircleCI (though does on Fornax proper). I think this is because of the lack of some XSPEC model files. The CircleCI config has been altered to download the right version of those files for the current heasoft, and store them in a cache. They should also be restored from the cache on subsequent runs.
…onfig.yml for CircleCI. For PR #116
… CircleCI config yml. For PR #116
…n the wrong place. For PR #116
…CircleCI so I can deal with these XSPEC model files I'm downloading. For PR #116
…g installed in the next step (actually running it) fails... For issue #116
…n it does work on Fornax proper. Added some debug ls-es to try and see whether the xspec data are set up properly
…notebook on CircleCI. For PR #116. Upped the chatter of the failing task to get some more info.
for more information, see https://pre-commit.ci
…ircleCI (now read and print the XSPEC log file).
|
The cause of my continued problems is still to do with the XSPEC model data - it is now successfully downloaded and linked, but I think my 'clever' way of finding the correct version of xspec-data to download (dry run of conda install) was giving the wrong version of xspec-data because I wasn't running it in the right environment. That then causes issues like this: When nicerl3-spect tries to generate a background spectrum from the SCORPEON model. |
…ok on CircleCI - the method I have for determining the version of model files to download was being run in the wrong environment, so was just retrieving the latest version of xspec-data. For PR #116
… CircleCI. Should help solve the problems I'm seeing with PR #116
… CircleCI. Should help solve the problems I'm seeing with PR #116
…l, now I've finally gotten it working for PR #116.
| from matplotlib.ticker import FuncFormatter | ||
| ``` | ||
|
|
||
| ## Global Setup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add this globally:
# raise errors if a heasoftpy task fails; Remove once this becomes a default in heasoftpy
hsp.Config.allow_failure = False| ```{code-cell} python | ||
| :tags: [hide-input] | ||
|
|
||
| # This cell will be automatically collapsed when the notebook is rendered, which helps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this text?
|
|
||
| # NICER ObsID that we will use for this example. | ||
| OBS_ID = "4020180445" | ||
| SRC_NAME = "PSR-B0833-45" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
referenced only once. Is this really needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this name is not resolvable. Change to: 'PSR B0833-45' (no dash)
| SRC_NAME = "PSR-B0833-45" | ||
|
|
||
| # The name of the HEASARC table that logs all NICER observations | ||
| HEASARC_TABLE_NAME = "nicermastr" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A user does not generally know this name. Better to find it.
HEASARC_TABLE_NAME = Heasarc.list_catalogs(keywords='nicer', master=True)['name'][0]| :tags: [hide-input] | ||
|
|
||
| # Set up the path of the directory into which we will download NICER data | ||
| if os.path.exists("../../../_data"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am guessing this is for the CI?
It would be great if we can hide this stuff from a user running the notebook interactively.
| ) | ||
| ``` | ||
|
|
||
| ```{error} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we just set evtsuffix ourselves in nicerl2 and other tasks and avoid this part. We can say (in a tip or a warning) we are doing this because there is a bug in heasoft 6.36, and that it is generally not needed.
| bkgmodeltype="scorpeon", | ||
| clobber=True, | ||
| noprompt=True, | ||
| allow_failure=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do it globally
| filtcolumns="NICERV5", | ||
| clobber=True, | ||
| noprompt=True, | ||
| allow_failure=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do this part globally
| lcfile="lc.fits", | ||
| clobber=True, | ||
| noprompt=True, | ||
| allow_failure=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do this globally
| xs.Fit.perform() | ||
|
|
||
| # Read out the plotting information for spectrum and model. | ||
| xs.Plot("lda") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expand lda
HEASARC notebook review
Critical review criteria
The author of the pull request should make an effort to go through these check points and ensure that their submission satisfies each point - reviewers will also compare to these checklists.
Science review checklist
Formatting checklist
Tech review checklist
try/exceptstatements that are narrow in scope?