nuwavdet
This pacakge is used to generate region masks separating any focused X-ray flux from background signal in NuSTAR observations.
Installation
This package is to be used with Python 3.x.x
pip install git+http://heagit.cosmos.ru/nustar/nuwavdet.git
To update the package to the current version one should delete the previous version
pip uninstall nuwavdet
And simply repeat the intallation procedure again from the repository.
Installation verification
If the installation was successful the package can be used with the following import:
from nuwavdet import nuwavdet as nw
To verify the installation we suggest running a simple script:
from nuwavdet import nuwavdet as nw
print(nw.binary_array(2))
The output of the script should be
[[False False]
[False True]
[ True False]
[ True True]]
Main use
The main functionality of the package is presented with a single function
nw.process(obs_path, thresh)
Inputs are string with path to the _cl.evt file to use and a tuple of thresholds, e.g.
nw.process('D:\\Data\\obs_cl.evt', (3, 2))
The detailed script description of the data extraction with the script is presented in the examples folder of the repository.
The function nw.process returns severl python objects:
- python-dictionary with some metadata and properties of the observation after mask generation procedure.
- region array with mask in DET1 coordinate frame. Note that this mask is for numpy mask application so True (1) corresponds to masked pixel and False (0) otherwise.
- custom bad pixel table with flagged pixels in RAW coordinates. It can be exported as fits file for further application to the nupipeline as fpma_userbpfile or fpmb_userbpfile.
- array with the sum of wavelet planes for potential alternative applications.
Metadata about the observation returned by the nw.process is:
Observation metadata:
- OBS_ID
- Detector
- Coordinates in equatorial (ra,dec) and galactical (lon,lat) systems
- Time of the observation in seconds
- Exposure
Useful algorythm-related data:
- Average count rate of unmasked area
- Fraction of unmasked area
- Modified Cash-statistic per bin before and after masking the detected sources
Other uses
Other possbile usecases are shown in the examples folder.
Contact information
If you have any questions or issues with the code, feel free to contact Andrey Mukhin: amukhin@cosmos.ru