zoghbi-a / nicer-background

A model for estimating NICER background using Machine Learning
MIT License
5 stars 0 forks source link

NICER

The Neutron star Interior Composition Explorer (NICER) is an International Space Station (ISS) payload devoted to the study of high energy X-ray sources in the Universe. Primarily designed to study Neutron Stars, but it can also study black holes in stellar systems and also in active galactic nuclei (AGN).

Unlike detectors that have CCD detectors that allow one to simultaenously separate photons from the source from those of the background by selecting the relevant regoins on the CCD, NICER does not produce images, so estimating the background is a non-trivial task.

To help with background estimates, NICER observed regions of the sky that are known to contain no X-ray sources, called BKGD_RXTE[1..8]. This model used those observations to train a machine learning model to estimate the background in observations of targets of interest.

The basic idea is to use MKF parameters that come with every observations, that contain information about the telescope and the envirenment during the observations, to estimate the background.

Content

This repository contains the trained model and spectral data that can be used to estimate the background of specific observations. The model has been trained using xgboost, and the final product is provided here so it can be used.

There are 2 components in the model data:

Requirement

The python libraries can be installed with conda (e.g. pip install numpy astropy pandas sklearn py-xgboost).

Note that py-xgboost is available only through conda not through pip. See the section "Known Issues" below.

USAGE:

Running nicerBgML.py -h print some useful information on the usages:

usage: nicerBgML.py [-h] [--dataDir dataDir] [--modelFile modelFile] [-v] obsID kpDir

Estimate NICER background using Machine Learning. This is a basic version that uses 50 MPUs (standard minus 14 and 34). Version 0.4.t1.200e uses tBin=1
seconds and 50 spectral bins (nGrp). The main difference compared to other version is that we model the spectra in two bands: 0.2-0.4 and 0.4-15, so the model
has the largest energy coverage of previously-released models. Similar to the 0.3 version model, we use more MKF parameters including the space weather model.
- tBin is the time bin size used for constructing the model, and it is the time bin size that will be used when binning the MKF data. - nGrp is the number of
basis spectra used in the modeling The kpDir parameter should point to the directory containing the geomagnetic data: dst_kyoto.fits, f107_petincton.fits,
geomag.tar.gz, kp_noaa.fits, kp_potsdam.fits, solarphi_oulu.fits availabel in: https://heasarc.gsfc.nasa.gov/FTP/caldb/data/gen/pcf/geomag See
https://heasarc.gsfc.nasa.gov/docs/nicer/analysis_threads/geomag/ for details.

positional arguments:
  obsID                 The obsID for which the background spectrum is to be estimated
  kpDir                 Location of the geomagnetic data. Download from: https://heasarc.gsfc.nasa.gov/FTP/caldb/data/gen/pcf/geomag/; There are 6 files:
                        dst_kyoto.fits f107_petincton.fits geomag.tar.gz kp_noaa.fits kp_potsdam.fits solarphi_oulu.fits

optional arguments:
  -h, --help            show this help message and exit
  --dataDir dataDir     The path to the directory containing the model data, including the basis spectra (default: nicerBgML)
  --modelFile modelFile
                        The name of the model npz file. Search in current folder and in dataDir (default: model.npz)
  -v, --version         show program's version number and exit

VERSIONS:

WARNING

This is a basic version that uses 50 MPUs (standard 52 minus 14 and 34) using standard filtering criteria (detlist=launch,-14,-34 min_fpm=50 in nicerl2). If you use a different number of MPUs, you will have to scale the background spectrum accordingly.

If you use a filtering criterian that is different from the standard one in nicerl2, this model may not be applicable. I am working on ways to include non-standard selection criteria in the future.

Known Issues