isgri 0.6.1__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: isgri
3
- Version: 0.6.1
3
+ Version: 0.7.0
4
4
  Summary: Python package for INTEGRAL IBIS/ISGRI lightcurve analysis
5
5
  Author: Dominik Patryk Pacholski
6
6
  License: MIT
@@ -8,6 +8,7 @@ License-File: LICENSE
8
8
  Requires-Python: >=3.9
9
9
  Requires-Dist: astropy
10
10
  Requires-Dist: click
11
+ Requires-Dist: joblib
11
12
  Requires-Dist: numpy
12
13
  Requires-Dist: platformdirs
13
14
  Requires-Dist: tomli-w
@@ -22,19 +23,20 @@ Python toolkit for INTEGRAL/ISGRI data analysis.
22
23
 
23
24
  ### Command Line Interface
24
25
  Query catalogs directly from the terminal:
26
+ - Interactive and direct query modes
25
27
  - Filter by time, position, quality, revolution
26
- - Export results to FITS/CSV
27
- - List SWIDs for batch processing
28
+ - Export results to FITS/CSV or SWID lists
28
29
 
29
30
  ### SCW Catalog Query
30
31
  Query INTEGRAL Science Window catalogs with a fluent Python API:
31
32
  - Filter by time, position, quality, revolution
32
33
  - Calculate detector offsets
33
- - Export results to any auto detectable astropy table extension or in table aligned data for any other extension.
34
+ - Export results to any auto detectable astropy table extension or in table aligned data for any other extension
34
35
 
35
36
  ### Light Curve Analysis
36
37
  Extract and analyze ISGRI light curves:
37
- - Event loading with PIF weighting
38
+ - Load from file paths or SWID/source lookup
39
+ - PIF weighting with adjustable thresholds
38
40
  - Custom time binning
39
41
  - Module-by-module analysis
40
42
  - Quality metrics (chi-squared tests)
@@ -53,18 +55,26 @@ pip install isgri
53
55
 
54
56
  ```bash
55
57
  # Configure default paths (once)
56
- isgri config-set --catalog ~/data/scw_catalog.fits
58
+ isgri config-set --archive /path/to/archive --catalog ~/data/scw_catalog.fits --pif /path/to/pif
57
59
 
58
- # Interactive method
59
- isgri query
60
-
61
- # Query by time range
62
- isgri query --tstart 2010-01-01 --tstop 2010-12-31
63
-
64
- # Query Crab with quality cut
65
- isgri query --ra 83.63 --dec 22.01 --max-chi 2.0 --fov full
60
+ # View current config
61
+ isgri config
66
62
 
67
- # Get list of SWIDs for processing
63
+ # Interactive catalog query
64
+ isgri query
65
+ # query> time
66
+ # Start: 2010-01-01
67
+ # Stop: 2010-12-31
68
+ # → 1234 SCWs
69
+ # query> pos
70
+ # RA: 83.63
71
+ # Dec: 22.01
72
+ # ...
73
+
74
+ # Direct catalog query
75
+ isgri query --tstart 2010-01-01 --tstop 2010-12-31 --ra 83.63 --dec 22.01 --max-chi 2.0
76
+
77
+ # Get SWID list for batch processing
68
78
  isgri query --tstart 3000 --tstop 3100 --list-swids > swids.txt
69
79
 
70
80
  # Export results
@@ -87,8 +97,14 @@ results = (cat
87
97
  .get()
88
98
  )
89
99
 
90
- # Save selected columns to the file
91
- cat.write('example_file.any_extension',columns=['SWID','TSTART','TSTOP'])
100
+ # Filter by revolution(s)
101
+ results = cat.revolution([1000, 1001, 1002]).get()
102
+
103
+ # Save selected columns
104
+ cat.write('results.fits', columns=['SWID', 'TSTART', 'TSTOP'])
105
+
106
+ # Get SWID list
107
+ swids = cat.get_swids()
92
108
 
93
109
  print(f"Found {len(results)} observations")
94
110
  ```
@@ -98,20 +114,49 @@ print(f"Found {len(results)} observations")
98
114
  ```python
99
115
  from isgri.utils import LightCurve, QualityMetrics
100
116
 
101
- # Load events with PIF weighting
117
+ # Method 1: Load from file paths
102
118
  lc = LightCurve.load_data(
103
119
  events_path="isgri_events.fits",
104
120
  pif_path="source_model.fits",
121
+ use_pif=True,
105
122
  pif_threshold=0.5
106
123
  )
107
124
 
108
- # Create 1-second binned light curve
109
- time, counts = lc.rebin(binsize=1.0, emin=20, emax=100)
125
+ # Method 2: Load by SWID (requires config)
126
+ lc = LightCurve.load_data(swid="255900280010")
127
+
128
+ # Method 3: Load by SWID + source (auto-finds PIF)
129
+ lc = LightCurve.load_data(
130
+ swid="255900280010",
131
+ source="SGR1935",
132
+ use_pif=True,
133
+ pif_threshold=0.5
134
+ )
110
135
 
111
- # Compute quality metrics
112
- qm = QualityMetrics(lc, binsize=1.0, emin=20, emax=100)
113
- chi = qm.raw_chi_squared()
114
- print(f"Chisq/dof = {chi:.2f}")
136
+ # Create binned lightcurve
137
+ time, counts = lc.rebin(binsize=1.0, emin=30, emax=100)
138
+
139
+ # Override PIF settings temporarily
140
+ time, counts = lc.rebin(binsize=1.0, emin=30, emax=100, use_pif=True, pif_threshold=0.8)
141
+
142
+ # Or change instance settings
143
+ lc.pif_threshold = 0.7
144
+ lc.use_pif = True
145
+ time, counts = lc.rebin(binsize=1.0, emin=30, emax=100)
146
+
147
+ # Module-by-module analysis
148
+ times, module_counts = lc.rebin_by_modules(binsize=1.0, emin=30, emax=300)
149
+
150
+ # Quality metrics
151
+ qm = QualityMetrics(lc, binsize=1.0, emin=30, emax=100)
152
+ chi_raw = qm.raw_chi_squared()
153
+ chi_clipped = qm.sigma_clip_chi_squared(sigma=1)
154
+ chi_gti = qm.gti_chi_squared()
155
+ print(f"Chisq/dof = {chi_raw:.2f}")
156
+
157
+ # Time conversions
158
+ from isgri.utils.time_conversion import ijd2utc, utc2ijd
159
+ print(f"Start time: {ijd2utc(lc.t0)}")
115
160
  ```
116
161
 
117
162
  ## Configuration
@@ -123,17 +168,30 @@ ISGRI stores configuration in default config folder for each system (see: platfo
123
168
  isgri config
124
169
 
125
170
  # Set paths
126
- isgri config-set --archive /path/to/archive --catalog /path/to/catalog.fits
171
+ isgri config-set --archive /path/to/archive
172
+ isgri config-set --catalog /path/to/catalog.fits
173
+ isgri config-set --pif /path/to/pif
174
+
175
+ # Set all at once
176
+ isgri config-set --archive /path/to/archive --catalog /path/to/catalog.fits --pif /path/to/pif
127
177
  ```
128
178
 
129
- Config can also be used in Python:
179
+ Config in Python:
130
180
 
131
181
  ```python
132
- from isgri.config import get_config
182
+ from isgri.config import Config
133
183
 
134
- cfg = get_config()
184
+ cfg = Config()
135
185
  print(cfg.archive_path)
136
186
  print(cfg.catalog_path)
187
+ print(cfg.pif_path)
188
+
189
+ # Create new config programmatically
190
+ cfg.create_new(
191
+ archive_path="/path/to/archive",
192
+ catalog_path="/path/to/catalog.fits",
193
+ pif_path="/path/to/pif"
194
+ )
137
195
  ```
138
196
 
139
197
  Local config file `isgri_config.toml` in current directory overrides global config.
@@ -144,4 +202,9 @@ Local config file `isgri_config.toml` in current directory overrides global conf
144
202
  - **CLI Reference**: Run `isgri --help` or `isgri <command> --help`
145
203
  - **Catalog Tutorial**: [scwquery_walkthrough.ipynb](https://github.com/dominp/isgri/blob/main/demo/scwquery_walkthrough.ipynb)
146
204
  - **Light Curve Tutorial**: [lightcurve_walkthrough.ipynb](https://github.com/dominp/isgri/blob/main/demo/lightcurve_walkthrough.ipynb)
147
- - **API Reference**: Use `help()` in Python or see docstrings
205
+ - **API Reference**: Use `help()` in Python or see docstrings
206
+
207
+
208
+ ## License
209
+
210
+ MIT
@@ -0,0 +1,21 @@
1
+ isgri/__init__.py,sha256=V2hnOxXKcjMiusdGP8sOAR4QsBlWHQ0pZZMN2Cean6o,38
2
+ isgri/__version__.py,sha256=P1kRuZW02tF-ekLuBqSjV_tIKKqcbfRPDdpp9C8ftUY,21
3
+ isgri/config.py,sha256=8hziHnQN_dnS3FkOtrPUUV1QLJ9HmGiPzDuAiq3GoXc,5044
4
+ isgri/catalog/__init__.py,sha256=IGfzGcGx1F1zplj7YIUuzE5Cvvxg7XJi0zu0aBXI0-A,113
5
+ isgri/catalog/builder.py,sha256=EDda0QIHBRwh1nPUndSYfw4nvJHxjXPmVgyPscksBrM,15490
6
+ isgri/catalog/scwquery.py,sha256=v7nR6-6PmYaBunFeGtmDWPqDkUBUvwjv2jtM1RbGQx4,20397
7
+ isgri/catalog/wcs.py,sha256=mD6bZxiBxKYpuYCl8f2tSCc8uuWFzMRL2jf5SuFAhfg,5562
8
+ isgri/cli/__init__.py,sha256=SCIcTdOvfEkrZd1doOtOnvCj8PmdRuXu18YYJQxfFrs,24
9
+ isgri/cli/main.py,sha256=EfBN4E9oUvhB0GfQldLU3eSvmRC4JjxM72qWFEc2_IA,6379
10
+ isgri/cli/query.py,sha256=jIAJ8Ghr73OivSIqTjqYE-y-gn9hw4-QpEeH-z6Bny0,8012
11
+ isgri/utils/__init__.py,sha256=H83Al7urc6LNW5KUzUBRdtRBUTahiZmkehKFiK90RrU,183
12
+ isgri/utils/file_loaders.py,sha256=E4-0QA6r1QAX1gV1Dd5qhKPDXZIdSEk7AWdOQrovHGo,17423
13
+ isgri/utils/lightcurve.py,sha256=v_JNLzf1SBvFLzrU7ZXpSj44eRKaZChiO4gvS2_O35Y,17408
14
+ isgri/utils/pif.py,sha256=sAtzQhe3spLS41UkP1yZsqGPxe3IHLmIGA_d3bVg2v4,9121
15
+ isgri/utils/quality.py,sha256=7CbYaNstoX60AYz2_ym-xjMkiDLpkYgQfaTStYuQZtk,13409
16
+ isgri/utils/time_conversion.py,sha256=MNPVjrsrmwRDbCWmqdWN0xRs8PtHkFGli-H2cYwF9Ns,5204
17
+ isgri-0.7.0.dist-info/METADATA,sha256=7MSVI7E4DdtSpm7GZXdYJ-SD1mTTddf0sewrJNkgYcE,5115
18
+ isgri-0.7.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
19
+ isgri-0.7.0.dist-info/entry_points.txt,sha256=aM2K4RGihbwsj9crjPG-BvWhErcdtZt3tJqT6AaOojU,46
20
+ isgri-0.7.0.dist-info/licenses/LICENSE,sha256=Q8oxmHR1cSnEXSHCjY3qeXMtupZI_1ZQZ1MBt4oeANE,1102
21
+ isgri-0.7.0.dist-info/RECORD,,
@@ -1,21 +0,0 @@
1
- isgri/__init__.py,sha256=V2hnOxXKcjMiusdGP8sOAR4QsBlWHQ0pZZMN2Cean6o,38
2
- isgri/__version__.py,sha256=XvHFZM0padtrqitt9-p2enlBUGqc6vGvWNLx2iJv09g,21
3
- isgri/config.py,sha256=i1ibczZsmgqELv4ik2h2nWLnHyl68_5KGsz5Ec8Uf4E,4365
4
- isgri/catalog/__init__.py,sha256=CT9Zd1WISpv7kowf3bqagKewZ8SjLr1rZzVSFkwEj3o,58
5
- isgri/catalog/builder.py,sha256=Ure_erpyApjSiAmIvhJahuf6c11VNXBn5R6-nQzsDw4,3488
6
- isgri/catalog/scwquery.py,sha256=3X9Es79UNGedhsS7EvArNGo8KMAMuUU9hMQIsrfRuBs,20259
7
- isgri/catalog/wcs.py,sha256=mD6bZxiBxKYpuYCl8f2tSCc8uuWFzMRL2jf5SuFAhfg,5562
8
- isgri/cli/__init__.py,sha256=-bBNFYOq80A2Egtpo5V5zWJtYOxQfRZFQ_feve5lkFU,23
9
- isgri/cli/main.py,sha256=pOwTbJ7nuOC48cdVm-e84GGjlOFic1ZMEvU2e3yKP4k,5613
10
- isgri/cli/query.py,sha256=dUzLsEjjyzCQ1lbG3pVe0pvIWcDcNs-6T57ugUFUTdk,5542
11
- isgri/utils/__init__.py,sha256=H83Al7urc6LNW5KUzUBRdtRBUTahiZmkehKFiK90RrU,183
12
- isgri/utils/file_loaders.py,sha256=g-LUfYw35hPePlFeicymaL-NbZXzZWfNmM127XJjCKY,12497
13
- isgri/utils/lightcurve.py,sha256=Pjys-eIyKShDKHqFpGa9SZ0Dzz7LiLIwBpUkp_6s41g,14133
14
- isgri/utils/pif.py,sha256=LixlkShy1j_ymfdJLyCV8zl0EeHgfVDVjddSex18GLQ,8648
15
- isgri/utils/quality.py,sha256=Na-sNEX1E4xWQJx0FYe9vbOAgPrTcLohHeUAnmlKYSw,13348
16
- isgri/utils/time_conversion.py,sha256=MNPVjrsrmwRDbCWmqdWN0xRs8PtHkFGli-H2cYwF9Ns,5204
17
- isgri-0.6.1.dist-info/METADATA,sha256=89GNYk4YvwD6xxSHjFyZJbF9ZquuuSFND7jWj-DKu_k,3613
18
- isgri-0.6.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
19
- isgri-0.6.1.dist-info/entry_points.txt,sha256=aM2K4RGihbwsj9crjPG-BvWhErcdtZt3tJqT6AaOojU,46
20
- isgri-0.6.1.dist-info/licenses/LICENSE,sha256=Q8oxmHR1cSnEXSHCjY3qeXMtupZI_1ZQZ1MBt4oeANE,1102
21
- isgri-0.6.1.dist-info/RECORD,,
File without changes