17 Commits

Author SHA1 Message Date
a58a1f612e Merge pull request 'Fixed bad-pix files generation' (#1) from amukhin/nuwavdet:master into master
Reviewed-on: #1
2023-05-24 16:29:46 +03:00
07cfdab953 Fixed bad-pix files generation 2023-05-11 18:35:46 +03:00
fa640ad707 port 3000 removed 2023-03-16 13:23:24 +03:00
0b6bbf41d1 test 2023-03-07 13:16:59 +03:00
d33b11f51c test 2023-03-07 13:14:36 +03:00
62213e667a Delete 'nuwavdet/__pycache__/nuwavsource.cpython-39.pyc' 2023-03-07 12:22:29 +03:00
fa14d156d7 Delete 'nuwavdet/__pycache__/nuwavdet.cpython-39.pyc' 2023-03-07 12:22:24 +03:00
8d3843b8a1 Delete 'nuwavdet/__pycache__/__init__.cpython-39.pyc' 2023-03-07 12:22:07 +03:00
7890de5151 Merge pull request #7 from andrey-rrousan/release_version
Release version
2023-03-02 17:44:30 +03:00
2b1b35ea78 Merge branch 'master' into release_version 2023-03-02 17:44:17 +03:00
Andrey Mukhin
d29c07d576 alpha test commit 2023-03-02 17:42:51 +03:00
ba39fc023c Update MANIFEST.in 2022-12-15 15:36:23 +03:00
a4698b3bee Merge pull request #6 from Andreyousan/code_trimming
Code trimming
2022-12-15 15:35:37 +03:00
319a14f2a2 Merge pull request #5 from Andreyousan/code_trimming
Code trimming
2022-09-19 15:56:50 +03:00
5b4f898901 Merge pull request #4 from Andreyousan/code_trimming
Code trimming
2022-09-05 13:43:18 +03:00
8615bdaf0c Merge pull request #3 from Andreyousan/code_trimming
Code trimming
2022-08-31 16:49:40 +03:00
0c231202ae Create README.md 2022-08-30 18:28:14 +03:00
28 changed files with 668 additions and 615 deletions

View File

@@ -1,2 +1,3 @@
include nuwavsource/pixpos/* include nuwavdet/pixpos/*
include nuwavsource/badpix_headers/* include nuwavdet/badpix_headers/*

View File

@@ -1,10 +1,37 @@
# nuwavsource # nuwavdet
This package is supposed to be used to detect the sources in NuStar observations and generate a mask excluding the signal from the sources of any kind. This pacakge is used to generate region masks separating any focused X-ray flux from background signal in NuSTAR observations.
Additionaly, it generates a table containing: ## Installation
This package is to be used with Python 3.x.x
```python
pip install git+http://heagit.cosmos.ru/nustar/nuwavdet.git
```
Useful data about the observation: ## Main use
To use the package in your project, import it in by writing:
```python
from nuwavdet import nuwavdet as nw
```
The main functionality of the pacakge is presented with a single function
```python
process(obs_path, thresh)
```
Inputs are string with path to the _cl.evt file to use and a tuple of thresholds, e.g.
```python
process('D:\\Data\\obs_cl.evt', (3, 2))
```
Outputs of the function are:
1. dictionary with some metadata and properties of the observation after mask generation procedure.
2. region array with mask in DET1 coordinate frame. Note that this mask is for numpy mask application so 1 corresponds to masked pixel and 0 otherwise.
3. custom bad pixel table with flagged pixels in RAW coordinates. It can be exported as fits file or each separate table can be acessed directly.
4. array with the sum of wavelet planes used in the processing.
Metadata about the observation file:
1. OBS_ID 1. OBS_ID
2. Detector 2. Detector
@@ -14,32 +41,16 @@ Useful data about the observation:
Useful algorythm-related data: Useful algorythm-related data:
6. Average count rate on unmasked area 6. Average count rate of unmasked area
7. Portion of unmasked area 7. Fraction of unmasked area
8. Specific statistical metric[1] before and after masking the detected sources 8. Modified Cash-statistic per bin before and after masking the detected sources
9. Root-mean-square of counts in unmasked area
## Installation ## Other uses
This package is to be used with Python 3.x.x
To install tha package write
```bash
pip install nuwavsource
```
## Usage
To use the package in your project, import it in by writing
```python
from nuwavsource import nuwavsource
```
You can process the cl.evt file by creating an Observation class object: You can process the cl.evt file by creating an Observation class object:
```python ```python
obs = nuwavsource.Observation(path_to_evt_file) obs = nw.Observation(path_to_evt_file)
``` ```
Additionally, the energy band in KeV to get events from can be passed as an argument. The default value is [3,20]. Additionally, the energy band in KeV to get events from can be passed as an argument. The default value is [3,20].

1
nuwavdet/__init__.py Normal file
View File

@@ -0,0 +1 @@
name = 'nuwavdet'

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
name = 'nuwavsource'

View File

@@ -4,14 +4,14 @@ with open("README.md", "r") as fh:
long_description = fh.read() long_description = fh.read()
setuptools.setup( setuptools.setup(
name="nuwavsource", name="nuwavdet",
version="0.0.8", version="0.1.0",
author="Andrey Mukhin", author="Andrey Mukhin",
author_email="amukhin@phystech.edu", author_email="amukhin@phystech.edu",
description="A package for source exclusion in NuStar observation data using wavelet decomposition", description="A package for source exclusion in NuStar observation data using wavelet decomposition",
long_description=long_description, long_description=long_description,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
url="https://github.com/Andreyousan/nuwavsource", url="https://github.com/andrey-rrousan/nuwavdet",
packages=setuptools.find_packages(), packages=setuptools.find_packages(),
include_package_data=True, include_package_data=True,
classifiers=( classifiers=(