Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9cc1c24
Added a nicer directory/index file, and pointed to it in the top leve…
DavidT3 Oct 20, 2025
d511e37
Finished the first ingestion of the SciServer NICER notebook. For iss…
DavidT3 Oct 20, 2025
8806ad8
Added something to catch something that I believe is a bug in nicerl2…
DavidT3 Oct 20, 2025
5036753
The notebook now for sure runs on Fornax, so it should be able to pas…
DavidT3 Oct 20, 2025
a796049
Made some minor code changes (added a new tick formatter to a spectru…
DavidT3 Oct 20, 2025
e475375
Added more commentary to the model fitting and plotting steps, also m…
DavidT3 Oct 21, 2025
612fd33
Added more commentary to data-analysis-nicer.md, and improved the lig…
DavidT3 Oct 21, 2025
12fe8d1
Removed blank space from source name in NICER notebook. Also added NI…
DavidT3 Oct 21, 2025
1ec782e
The NICER notebook added for issue #115 and now in PR #116, does not …
DavidT3 Oct 21, 2025
6512ae4
Actually closed the if statement in the getting XSPEC model step of c…
DavidT3 Oct 21, 2025
5476d20
Made sure an unzip installation doesn't ask the user for input in the…
DavidT3 Oct 21, 2025
739bd08
Screwed up the micromamba command to install unzip, put the -y flag i…
DavidT3 Oct 21, 2025
cef7089
Really trying to make unzip be installed into a conda environment in …
DavidT3 Oct 21, 2025
28bebe6
Continued to screw up the unzip install command in every possible way…
DavidT3 Oct 21, 2025
7768f18
Unzip now installs but because I switched the environment it was bein…
DavidT3 Oct 21, 2025
abcd2e7
Mistyped the path to the XSPEC model data directory. For PR #116
DavidT3 Oct 21, 2025
2b00b43
The NICER notebook (#115) is still failing to execute on CircleCI whe…
DavidT3 Oct 21, 2025
16b15cd
Really trying to understand what is causing the issue with the NICER …
DavidT3 Oct 21, 2025
beb6248
Added some stupid debugging steps to figure out what is going on in C…
DavidT3 Oct 21, 2025
7eed712
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2025
5f4e6bb
Added some stupid debugging steps to figure out what is going on in C…
DavidT3 Oct 22, 2025
c319c1e
Added some stupid debugging steps to figure out what is going on in C…
DavidT3 Oct 22, 2025
f11dcff
May have found the cause of my continued issues with the NICER notebo…
DavidT3 Oct 22, 2025
cd6a30c
In a fit of optimism I have restored the original contents of the spe…
DavidT3 Oct 22, 2025
265e777
Added a way of manually specifying the XSPEC data version acquired by…
DavidT3 Oct 22, 2025
c422e48
Added a way of manually specifying the XSPEC data version acquired by…
DavidT3 Oct 22, 2025
2d7f5ea
My manual override for XSPEC data version is not working - trying to …
DavidT3 Oct 22, 2025
dc8d4c0
Removed some extra comments/echos that were in the CircleCI config.ym…
DavidT3 Oct 22, 2025
096ef88
Captured the output from nigeodown. Neatens the configuration cell in…
DavidT3 Oct 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 94 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
environment:
CHANDRA_CALDB_VER: 4.12.2
CIRCLECI_XMM_CCF_VER: 1
# This is a tricky one - we have a way of automatically identifying the apparently correct version
# required for the XSPEC-data package - but actually (at least with HEASoft v6.35.2) it is still
# identifying v6.36's XSPEC-data package as the right one (thanks to the Conda solver). So this
# will provide a manual override for the version number.
XSPEC_DATA_VER: 6.35

# What this job is actually going to do!
steps:
Expand All @@ -27,6 +32,7 @@ jobs:
# 1. Load the most recent cache that matches the stub of the MyST notebook cache key
# 2. Restore the XMM calibration file cache, saves us downloading it every time!
# 3. And the same thing with the Chandra CalDB cache
# 4. Load the XSPEC models cache (not included in the Fornax-Hea image as it is large!)
- restore_cache:
name: Restoring MyST notebook cache
# If there isn't a cache for this branch, we'll try and find the most recent cache.
Expand All @@ -42,6 +48,10 @@ jobs:
name: Restoring Chandra CalDB cache
keys:
- ciao-caldb-
- restore_cache:
name: Restoring XSPEC models directory
keys:
- xspec-models-

# Some missions (e.g. XMM, Chandra, eROSITA) require that their calibration files are available locally. We
# don't want to download them every single time, so we're going to cache them for future runs.
Expand Down Expand Up @@ -100,13 +110,85 @@ jobs:
echo "${CHANDRA_CALDB_VER}" > /home/jovyan/chandra-caldb/chandra-caldb.ver
fi

# The XSPEC model files directory is large and isn't included in the Fornax-Hea image. Some of the notebooks
# will need those files to be present, so we download and cache them here.
- run:
name: Acquiring XSPEC model files
no_output_timeout: 30m
command: |
if [ -z "${XSPEC_DATA_VER:-}" ]; then
# We can use the Conda solver to determine the right version of the xspec-data package for our
# current version of HEASoft - using 'dry run' means it doesn't actually do the downloading itself
CONDA_OUTPUT=$(micromamba install -n heasoft -c https://heasarc.gsfc.nasa.gov/FTP/software/conda/ --dry-run --json xspec-data 2>/dev/null)

# Remove the 'activating heasoft in /opt/envs/heasoft/heasoft' line from the output - this is due to
# a line in one of the activation scripts for the heasoft environment
CLEAN_CONDA_OUTPUT=$(echo $CONDA_OUTPUT | sed 's/ activating heasoft in \/opt\/envs\/heasoft\/heasoft//')

# Parse the output json-formatted string to extract the xspec-data package version and link
XSPEC_DATA_VER=$(echo "$CLEAN_CONDA_OUTPUT" | jq -r '.actions.FETCH[] | select(.name == "xspec-data") | .version')
XSPEC_DATA_LINK=$(echo "$CLEAN_CONDA_OUTPUT" | jq -r '.actions.LINK[] | select(.name == "xspec-data") | .url')
else
CONDA_OUTPUT=$(micromamba install -n heasoft -c https://heasarc.gsfc.nasa.gov/FTP/software/conda/ --dry-run --json xspec-data=$XSPEC_DATA_VER 2>/dev/null)

# Remove the 'activating heasoft in /opt/envs/heasoft/heasoft' line from the output - this is due to
# a line in one of the activation scripts for the heasoft environment
CLEAN_CONDA_OUTPUT=$(echo $CONDA_OUTPUT | sed 's/ activating heasoft in \/opt\/envs\/heasoft\/heasoft//')

XSPEC_DATA_LINK=$(echo "$CLEAN_CONDA_OUTPUT" | jq -r '.actions.LINK[] | select(.name == "xspec-data") | .url')
fi

# Show the XSPEC data version and link
echo $XSPEC_DATA_VER
echo $XSPEC_DATA_LINK

# If the xspec-data directory doesn't exist, or it does but the version file doesn't contain the same
# version as the one we just determined from the conda solver, we have to download the data.
if [ ! -d /home/jovyan/xspec-data ] || [ ! -f /home/jovyan/xspec-data/xspec-data.ver ] || [[ ! "$(<"/home/jovyan/xspec-data/xspec-data.ver")" == "$XSPEC_DATA_VER" ]]; then

# Make a directory (this helps avoid CircleCI's restrictions on
# dynamical cache key/path names) - delete an existing directory if it exists
[ -d /home/jovyan/xspec-data ] && rm -rf /home/jovyan/xspec-data
mkdir -p /home/jovyan/xspec-data

# Also make a temporary working directory
mkdir -p /home/jovyan/xspec-data-work-dir

# Store current WD and move to the temporary working directory
PRE_XSPEC_DATA_WD=$(pwd)
cd /home/jovyan/xspec-data-work-dir

# Download the XSPEC model files
wget $XSPEC_DATA_LINK -O xspec-data.zip

# Install unzip, as the *.conda file we just downloaded is a zip archive
micromamba install -y -c conda-forge -n heasoft unzip
# Unzip the archive
micromamba run -n heasoft unzip xspec-data.zip

# Untar and decompress the part of the *.conda package file that contains the package contents, as
# opposed to the metadata.
tar --use-compress-program=unzstd -xvf pkg-xspec-data-*.tar.zst

mv heasoft/spectral/modelData /home/jovyan/xspec-data/
# Make a version file
echo "${XSPEC_DATA_VER}" > /home/jovyan/xspec-data/xspec-data.ver

# Move back to the original working directory
cd $PRE_XSPEC_DATA_WD

# Delete the temporary working directory
rm -rf /home/jovyan/xspec-data-work-dir

fi

# Now we're sure we've downloaded all the local calibration files we need, we need to make sure that
# the mission-specific software can find those files.
# Normally you do this by setting certain environment variables, but in this case those variables will be
# set by conda environments loaded in during the build process - they would override anything we set here. As
# such, we will symlink the calibration files to where the Fornax-Hea environments expect them to be.
- run:
name: Setting up calibration files
name: Setting up calibration files and XSPEC models
command: |
# On the Fornax system, the support data directory (which we use to store calibration files, amongst
# other things) is mounted from a different AWS system. In some versions of the Fornax-Hea images, that
Expand All @@ -127,6 +209,10 @@ jobs:
# Linking the Chandra CalDB
ln -s /home/jovyan/chandra-caldb $SUPPORT_DATA_DIR/ciao-caldb-${CHANDRA_CALDB_VER}

# Linking the XSPEC models directory
rm $ENV_DIR/heasoft/heasoft/spectral/modelData
ln -s /home/jovyan/xspec-data/modelData $ENV_DIR/heasoft/heasoft/spectral/modelData

- run:
name: Installing extra dependencies
# TODO THIS METHOD OF DEFINING DEPS IS NOT GOOD ENOUGH, EVEN FOR A TEMPORARY SOLUTION
Expand Down Expand Up @@ -175,6 +261,13 @@ jobs:
paths:
- /home/jovyan/chandra-caldb

# Store the XSPEC model files in a cache. They are big enough that we definitely don't want
# to be downloading them repeatedly
- save_cache:
key: xspec-models-cs{{ checksum "/home/jovyan/xspec-data/xspec-data.ver" }}
paths:
- /home/jovyan/xspec-data

- store_artifacts:
path: _build/html

Expand Down
1 change: 1 addition & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ caption: Mission specific tutorials
---
tutorials/mission_specific_analyses/nustar/nustar_index
tutorials/mission_specific_analyses/rxte/rxte_index
tutorials/mission_specific_analyses/nicer/nicer_index
```

## Demonstrations of useful high-energy tools
Expand Down
Loading
Loading