Incorrect links in nustar tutorial

I ran into an error in the first kernel of “section 5. Extracting the spectrum” in the NuSTAR analysis tutorial. When it gets to the stage of running numkarf, the link to the psf files is incorrect. It fails to find the file at

https://nasa-heasarc.s3.us-east-1.amazonaws.com/caldb/data/nustar/fpm/bcf/psf//n
uA2dpsfen1_20100101v001.fits

which is empty. The issue seems to be the extra slash before the file name, as

https://nasa-heasarc.s3.us-east-1.amazonaws.com/caldb/data/nustar/fpm/bcf/psf/n
uA2dpsfen1_20100101v001.fits

contains the expected file. This issue persists for other psf files, each of which seem to share the double-slash problem. Error messages for those files are copied below:

numkarf_0.3.9: Info: Processing https://nasa-heasarc.s3.us-east-1.amazonaws.com/caldb/data/nustar/fpm/bcf/vign/nuAvign20100101v008.fits file.
numkarf_0.3.9: Warning: CalGetFileName: There are 4 files which match selection criteria.
numkarf_0.3.9: Info: Processing 5039tmp_gti.fits file.
numkarf_0.3.9: Error: OpenFitsFile: FITSIO routine ffopen returned error #104: could not open the named file
numkarf_0.3.9: Error: Unable to open
numkarf_0.3.9: Error: 'https://nasa-heasarc.s3.us-east-1.amazonaws.com/caldb/data/nustar/fpm/bcf/psf//nuA2dpsfen1_20100101v001.fits' file.
numkarf_0.3.9: Error: Unable to read psf file https://nasa-heasarc.s3.us-east-1.amazonaws.com/caldb/data/nustar/fpm/bcf/psf//nuA2dpsfen1_20100101v001.fits
numkarf_0.3.9: Error: Unable to compute PSF correction coefficients.
---------------------------------------------------------------------
numkarf_0.3.9: Exit with Error.

Hi!

We’re sorry you’ve run into this problem, it’s a consequence of Fornax accessing calibration data from an Amazon S3 bucket rather than off of HEASARC’s FTP server.

There is a very easy fix, you can put the following line in a code cell after the import statements:

os.environ[“CALDB”] = “https://heasarc.gsfc.nasa.gov/FTP/caldb”

If you run the notebook again you shouldn’t have any problems.

This is due to an issue we recently discovered in HEASoft, we’ll fix it in the next release and NuSTAR tasks will be able to use S3-bucket-hosted calibration files properly.

1 Like