ankflag 3.0.0__tar.gz

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.
ankflag-3.0.0/LICENSE ADDED
@@ -0,0 +1,31 @@
1
+ MIT License with Citation Requirement
2
+
3
+ Copyright (c) 2025 Devojyoti Kansabanik
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ 1. The above copyright notice and this permission notice shall be included
13
+ in all copies or substantial portions of the Software.
14
+
15
+ 2. Any publications, software, or works that make use of this Software,
16
+ in whole or in part, must include proper academic citation to the
17
+ following reference(s):
18
+
19
+ Kansabanik, D. et al., "MeerSOLAR", 10.5281/zenodo.16040508.
20
+
21
+ 3. A copy of the CITATION.cff file or equivalent citation information
22
+ must be distributed with any copy of the Software or derived works.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30
+ THE SOFTWARE.
31
+
ankflag-3.0.0/PKG-INFO ADDED
@@ -0,0 +1,167 @@
1
+ Metadata-Version: 2.4
2
+ Name: ankflag
3
+ Version: 3.0.0
4
+ Summary: A package to perform RFI flagging of radio interferometric data
5
+ Author-email: Apurba Bera <apurba7777@gmail.com>, Devojyoti Kansabanik <devojyoti96@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/devojyoti96/aNKflag
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: aiohappyeyeballs==2.6.2
14
+ Requires-Dist: aiohttp==3.13.5
15
+ Requires-Dist: aiosignal==1.4.0
16
+ Requires-Dist: astropy==6.1.4
17
+ Requires-Dist: astropy-iers-data==0.2026.5.25.1.14.13
18
+ Requires-Dist: asttokens==3.0.1
19
+ Requires-Dist: async-timeout==5.0.1
20
+ Requires-Dist: attrs==26.1.0
21
+ Requires-Dist: certifi==2026.5.20
22
+ Requires-Dist: charset-normalizer==3.4.7
23
+ Requires-Dist: cycler==0.12.1
24
+ Requires-Dist: decorator==5.3.1
25
+ Requires-Dist: exceptiongroup==1.3.1
26
+ Requires-Dist: executing==2.2.1
27
+ Requires-Dist: fonttools==4.63.0
28
+ Requires-Dist: frozenlist==1.8.0
29
+ Requires-Dist: idna==3.17
30
+ Requires-Dist: jedi==0.20.0
31
+ Requires-Dist: kiwisolver==1.5.0
32
+ Requires-Dist: matplotlib==3.5.2
33
+ Requires-Dist: matplotlib-inline==0.1.7
34
+ Requires-Dist: multidict==6.7.1
35
+ Requires-Dist: numpy==1.26.4
36
+ Requires-Dist: packaging==26.0
37
+ Requires-Dist: parfive==2.3.1
38
+ Requires-Dist: parso==0.8.7
39
+ Requires-Dist: pexpect==4.9.0
40
+ Requires-Dist: pillow==12.2.0
41
+ Requires-Dist: prompt_toolkit==3.0.52
42
+ Requires-Dist: propcache==0.5.2
43
+ Requires-Dist: psutil==7.2.2
44
+ Requires-Dist: ptyprocess==0.7.0
45
+ Requires-Dist: pure_eval==0.2.3
46
+ Requires-Dist: pyerfa==2.0.1.5
47
+ Requires-Dist: pyfiglet==1.0.4
48
+ Requires-Dist: Pygments==2.20.0
49
+ Requires-Dist: pyparsing==3.3.2
50
+ Requires-Dist: python-dateutil==2.9.0.post0
51
+ Requires-Dist: PyYAML==6.0.1
52
+ Requires-Dist: requests==2.34.2
53
+ Requires-Dist: six==1.17.0
54
+ Requires-Dist: stack-data==0.6.3
55
+ Requires-Dist: tqdm==4.67.3
56
+ Requires-Dist: traitlets==5.15.0
57
+ Requires-Dist: typing_extensions==4.15.0
58
+ Requires-Dist: udocker==1.3.17
59
+ Requires-Dist: urllib3==2.7.0
60
+ Requires-Dist: wcwidth==0.7.0
61
+ Requires-Dist: yarl==1.24.2
62
+ Provides-Extra: dev
63
+ Requires-Dist: sphinx>=7.2.6; extra == "dev"
64
+ Requires-Dist: furo>=2024.5.6; extra == "dev"
65
+ Requires-Dist: sphinx_rtd_theme>=2.0.0; extra == "dev"
66
+ Requires-Dist: sphinx-autodoc-typehints>=2.0.0; extra == "dev"
67
+ Requires-Dist: sphinx-copybutton>=0.5.2; extra == "dev"
68
+ Requires-Dist: sphinxcontrib-programoutput>=0.17; extra == "dev"
69
+ Requires-Dist: sphinx-togglebutton>=0.3.2; extra == "dev"
70
+ Requires-Dist: myst-parser>=2.0.0; extra == "dev"
71
+ Requires-Dist: sphinxcontrib-apidoc>=0.4.0; extra == "dev"
72
+ Requires-Dist: sphinx-automodapi>=0.15.0; extra == "dev"
73
+ Requires-Dist: numpydoc>=1.6.0; extra == "dev"
74
+ Requires-Dist: sphinxcontrib-mermaid>=0.9.2; extra == "dev"
75
+ Requires-Dist: graphviz>=0.20.3; extra == "dev"
76
+ Requires-Dist: sphinx-autobuild>=2021.3.14; extra == "dev"
77
+ Requires-Dist: pytest==8.3.3; extra == "dev"
78
+ Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
79
+ Requires-Dist: ruff; extra == "dev"
80
+ Dynamic: license-file
81
+
82
+ <p align="center">
83
+ <img src="https://raw.githubusercontent.com/devojyoti96/aNKflag/refs/heads/master/anklogo.png" alt="aNKflag Logo" width="200"/>
84
+ </p>
85
+ <p align="center">
86
+ <h1>aNKflag</h1> An intelligent radio frequency interference (RFI) removal tool to work in multi-dimensions radio interferometric data.
87
+ </p>
88
+
89
+ ## Background
90
+
91
+ <!-- start elevator-pitch -->
92
+
93
+ Radio interferometric observations are generally affected by terrestrial radio emission, known as radio frequency interference (RFI). **aNKflag** is an intelligent tool developed to detect and remove these RFIs both in time-frequency as well as in the Fourier domain, popularly known as **uv-domain** in radio interferometry.
94
+
95
+ - aNKflag works on UVFITS files
96
+ - Before flagging one needs to convert CASA measurement set to UVFITS
97
+ - After flagging one needs to convert UVFITS to CASA measurement set and copy the flags to original measurement set.
98
+ - These features are not provided in **aNKflag**, as these are readily available in CASA.
99
+ - This python version uses precompiled and containersed sourcecode of **aNKflag**, so no need to worry about installing C/C++ libraries.
100
+
101
+ <!-- end elevator-pitch -->
102
+
103
+ ## Documentation
104
+
105
+ aNKflag documentation is available at: [ankflag.readthedocs.io]
106
+
107
+ [ankflag.readthedocs.io]: https://ankflag.readthedocs.io
108
+
109
+ ## Quickstart
110
+
111
+ <!-- start quickstart -->
112
+
113
+ **aNKflag** is distributed on [PyPI]. To use it:
114
+
115
+ 1. Create conda environment with python 3
116
+
117
+ ```text
118
+ conda create -n ankflag_env python=3.10
119
+ conda activate ankflag_env
120
+ ```
121
+
122
+ 2. Install aNKflag in conda environment
123
+
124
+ ```text
125
+ pip install ankflag
126
+ ```
127
+
128
+ 3. Initiate necessary metadata and containers
129
+
130
+ ```text
131
+ run-ankflag init --datadir </full/path/to/data/directory>
132
+ ```
133
+
134
+ Contaniers will be stored in the data directory.
135
+
136
+ 4. Run aNKflag
137
+
138
+ ```text
139
+ run-ankflag run </full/path/to/input/uvfits> </full/path/to/output/uvfits> --scratchdir </full/path/to/ankflag/workdir> --flagmode <uvbin/baseline> --npol <num_of_polarisation> --nthreads <num_of_cpu_threads> --target_type <target_type>
140
+ ```
141
+
142
+ That's all. You run aNKflag for analysing flagging RFI. It will create a UVFITS file with output file location 🎉.
143
+
144
+ [pypi]: https://pypi.org/project/meersolar/
145
+
146
+ <!-- end quickstart -->
147
+
148
+ ## Acknowledgements
149
+
150
+ aNKflag is developed by Apurba Bera (ASTRON, NL) and Devojyoti Kansabanik (IAA-CSIC, Spain). If you use **aNKflag** for analysing your work, include the following statement in your paper
151
+
152
+ ```text
153
+ RFI flagging is perfomed using aNKflag.
154
+ ```
155
+
156
+ 1. Cite aNKflag software in zenodo: https://doi.org/10.5281/zenodo.20568784
157
+
158
+ and cite the following papers.
159
+
160
+ 2. [aNKflag paper: Kansabanik et al., ApJS 2023][kansabanik2023]
161
+
162
+ [Kansabanik2023]: https://doi.org/10.3847/1538-4365/acac79
163
+
164
+
165
+ ## License
166
+
167
+ This project is licensed under the MIT License.
@@ -0,0 +1,86 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/devojyoti96/aNKflag/refs/heads/master/anklogo.png" alt="aNKflag Logo" width="200"/>
3
+ </p>
4
+ <p align="center">
5
+ <h1>aNKflag</h1> An intelligent radio frequency interference (RFI) removal tool to work in multi-dimensions radio interferometric data.
6
+ </p>
7
+
8
+ ## Background
9
+
10
+ <!-- start elevator-pitch -->
11
+
12
+ Radio interferometric observations are generally affected by terrestrial radio emission, known as radio frequency interference (RFI). **aNKflag** is an intelligent tool developed to detect and remove these RFIs both in time-frequency as well as in the Fourier domain, popularly known as **uv-domain** in radio interferometry.
13
+
14
+ - aNKflag works on UVFITS files
15
+ - Before flagging one needs to convert CASA measurement set to UVFITS
16
+ - After flagging one needs to convert UVFITS to CASA measurement set and copy the flags to original measurement set.
17
+ - These features are not provided in **aNKflag**, as these are readily available in CASA.
18
+ - This python version uses precompiled and containersed sourcecode of **aNKflag**, so no need to worry about installing C/C++ libraries.
19
+
20
+ <!-- end elevator-pitch -->
21
+
22
+ ## Documentation
23
+
24
+ aNKflag documentation is available at: [ankflag.readthedocs.io]
25
+
26
+ [ankflag.readthedocs.io]: https://ankflag.readthedocs.io
27
+
28
+ ## Quickstart
29
+
30
+ <!-- start quickstart -->
31
+
32
+ **aNKflag** is distributed on [PyPI]. To use it:
33
+
34
+ 1. Create conda environment with python 3
35
+
36
+ ```text
37
+ conda create -n ankflag_env python=3.10
38
+ conda activate ankflag_env
39
+ ```
40
+
41
+ 2. Install aNKflag in conda environment
42
+
43
+ ```text
44
+ pip install ankflag
45
+ ```
46
+
47
+ 3. Initiate necessary metadata and containers
48
+
49
+ ```text
50
+ run-ankflag init --datadir </full/path/to/data/directory>
51
+ ```
52
+
53
+ Contaniers will be stored in the data directory.
54
+
55
+ 4. Run aNKflag
56
+
57
+ ```text
58
+ run-ankflag run </full/path/to/input/uvfits> </full/path/to/output/uvfits> --scratchdir </full/path/to/ankflag/workdir> --flagmode <uvbin/baseline> --npol <num_of_polarisation> --nthreads <num_of_cpu_threads> --target_type <target_type>
59
+ ```
60
+
61
+ That's all. You run aNKflag for analysing flagging RFI. It will create a UVFITS file with output file location 🎉.
62
+
63
+ [pypi]: https://pypi.org/project/meersolar/
64
+
65
+ <!-- end quickstart -->
66
+
67
+ ## Acknowledgements
68
+
69
+ aNKflag is developed by Apurba Bera (ASTRON, NL) and Devojyoti Kansabanik (IAA-CSIC, Spain). If you use **aNKflag** for analysing your work, include the following statement in your paper
70
+
71
+ ```text
72
+ RFI flagging is perfomed using aNKflag.
73
+ ```
74
+
75
+ 1. Cite aNKflag software in zenodo: https://doi.org/10.5281/zenodo.20568784
76
+
77
+ and cite the following papers.
78
+
79
+ 2. [aNKflag paper: Kansabanik et al., ApJS 2023][kansabanik2023]
80
+
81
+ [Kansabanik2023]: https://doi.org/10.3847/1538-4365/acac79
82
+
83
+
84
+ ## License
85
+
86
+ This project is licensed under the MIT License.
File without changes
File without changes
@@ -0,0 +1,84 @@
1
+ # -----------------------------------------------------------------
2
+ # This file provides the control parameters for aNKflag
3
+ # -----------------------------------------------------------------
4
+
5
+ Ukey: "UU" # Keyword for u
6
+ Vkey: "VV" # Keyword for v
7
+ Wkey: "WW" # Keyword for w
8
+ UgridCal: 1 # Gridsize in u for calibrators
9
+ VgridCal: 1 # Gridsize in v for calibrators
10
+ UgridTar: 10 # Gridsize in u for Target
11
+ VgridTar: 10 # Gridsize in v for Target
12
+ Npols: 2 # Number of polarizations
13
+ N_ants: 30 # Maximum number of antennas
14
+ ScanFlMean: ['rms', 1.5, 1.5, 0.01] # [FLAGON, tolerance_mean, tolearnce_rms, min fraction (should be > 0.01)]]
15
+ # ONLY for 'baseline' mode
16
+ ScanBrkSec: 300.0 # Scan break time (minimum)
17
+ BlockPow: 0.8 # Power low for Block non-Gaussianity
18
+
19
+
20
+ # Actual flagging parameters
21
+
22
+ FlgCalCh0: # Applicable to single channel calibrators only
23
+ - {what: 'rec_ind', flagon: 'mean', stat: 'median', data: 'am', tol: 5.0, minfrac: 0.1}
24
+ - {what: 'rec_ind', flagon: 'mean', stat: 'median', data: 'am', tol: 2.0, minfrac: 0.1}
25
+ - {what: 'rec_ind', flagon: 'mean', stat: 'median', data: 'am', tol: 1.5, minfrac: 0.1}
26
+ - {what: 'rec_ind', flagon: 'mean', stat: 'median', data: 're', tol: 1.2, minfrac: 0.1}
27
+ - {what: 'rec_ind', flagon: 'mean', stat: 'median', data: 'im', tol: 1.2, minfrac: 0.1}
28
+ - {what: 'rec_ind', flagon: 'mean', stat: 'median', data: 'am', tol: 1.1, minfrac: 0.1}
29
+ - {what: 'rec_ind', flagon: 'mean', stat: 'median', data: 're', tol: 1.1, minfrac: 0.1}
30
+ - {what: 'rec_ind', flagon: 'mean', stat: 'median', data: 'im', tol: 1.1, minfrac: 0.1}
31
+
32
+
33
+ FlgCalBp: # Applicable to bandpass calibrators only
34
+ - {what: 'rec_ind', flagon: 'rms', stat: 'median', data: 'am', tol: 5.0, minfrac: 0.1, fitorder: 0}
35
+ - {what: 'chan_ind', flagon: 'rms', stat: 'median', data: 'am', tol: 5.0, minfrac: 0.1, fitorder: 0}
36
+ - {what: 'rec_ind', flagon: 'rms', stat: 'mean', data: 'am', tol: 5.0, minfrac: 0.1, fitorder: 0}
37
+ - {what: 'chan_ind', flagon: 'rms', stat: 'mean', data: 'am', tol: 5.0, minfrac: 0.1, fitorder: 0}
38
+ - {what: 'rec_ind', flagon: 'rms', stat: 'mean', data: 'am', tol: 2.0, minfrac: 0.1, fitorder: 0}
39
+ - {what: 'chan_ind', flagon: 'rms', stat: 'mean', data: 'am', tol: 2.0, minfrac: 0.1, fitorder: 0}
40
+ - {what: 'chan_ind', flagon: 'rms', stat: 'median', data: 'am', tol: 1.5, minfrac: 0.1, fitorder: 2}
41
+ - {what: 'chan_ind', flagon: 'rms', stat: 'median', data: 're', tol: 1.5, minfrac: 0.1, fitorder: 2}
42
+ - {what: 'chan_ind', flagon: 'rms', stat: 'median', data: 'im', tol: 1.5, minfrac: 0.1, fitorder: 2}
43
+ - {what: 'rec_ind', flagon: 'rms', stat: 'median', data: 'am', tol: 1.5, minfrac: 0.1, fitorder: 2}
44
+ - {what: 'rec_ind', flagon: 'rms', stat: 'median', data: 're', tol: 1.5, minfrac: 0.1, fitorder: 2}
45
+ - {what: 'rec_ind', flagon: 'rms', stat: 'median', data: 'im', tol: 1.5, minfrac: 0.1, fitorder: 2}
46
+ - {what: 'chan_ind', flagon: 'rms', stat: 'mean', data: 're', tol: 1.5, minfrac: 0.1, fitorder: 2}
47
+ - {what: 'chan_ind', flagon: 'rms', stat: 'mean', data: 'im', tol: 1.5, minfrac: 0.1, fitorder: 2}
48
+ - {what: 'rec_ind', flagon: 'rms', stat: 'mean', data: 're', tol: 1.5, minfrac: 0.1, fitorder: 2}
49
+ - {what: 'rec_ind', flagon: 'rms', stat: 'mean', data: 'im', tol: 1.5, minfrac: 0.1, fitorder: 2}
50
+ - {what: 'chan_ind', flagon: 'rms', stat: 'median', data: 'am', tol: 1.2, minfrac: 0.1, fitorder: 2}
51
+ - {what: 'chan_ind', flagon: 'rms', stat: 'median', data: 're', tol: 1.2, minfrac: 0.1, fitorder: 2}
52
+ - {what: 'chan_ind', flagon: 'rms', stat: 'median', data: 'im', tol: 1.2, minfrac: 0.1, fitorder: 2}
53
+ - {what: 'rec_ind', flagon: 'rms', stat: 'median', data: 'am', tol: 1.2, minfrac: 0.1, fitorder: 2}
54
+ - {what: 'rec_ind', flagon: 'rms', stat: 'median', data: 're', tol: 1.2, minfrac: 0.1, fitorder: 2}
55
+ - {what: 'rec_ind', flagon: 'rms', stat: 'median', data: 'im', tol: 1.2, minfrac: 0.1, fitorder: 2}
56
+
57
+
58
+ FlgNorm: # Applicable to calibrated target
59
+ - {what: 'vis_ind', flagon: 'mean', stat: 'mean', data: 'am', tol: 5.0, minfrac: 0.1, fitorder: 0}
60
+ - {what: 'vis_ind', flagon: 'mean', stat: 'mean', data: 'am', tol: 3.0, minfrac: 0.1, fitorder: 0}
61
+ - {what: 'vis_ind', flagon: 'mean', stat: 'median', data: 'am', tol: 2.0, minfrac: 0.1, fitorder: 1}
62
+ - {what: 'chan_ind', flagon: 'rms', stat: 'mean', data: 'am', tol: 2.0, minfrac: 0.1, fitorder: 0}
63
+ - {what: 'rec_ind', flagon: 'rms', stat: 'mean', data: 'am', tol: 2.0, minfrac: 0.1, fitorder: 0}
64
+ - {what: 'vis_ind', flagon: 'mean', stat: 'median', data: 'am', tol: 1.6, minfrac: 0.1, fitorder: 2}
65
+ - {what: 'chan_ind', flagon: 'rms', stat: 'mean', data: 'am', tol: 1.5, minfrac: 0.1, fitorder: 2}
66
+ - {what: 'rec_ind', flagon: 'rms', stat: 'mean', data: 'am', tol: 1.5, minfrac: 0.1, fitorder: 2}
67
+ - {what: 'chan_ind', flagon: 'rms', stat: 'median', data: 're', tol: 1.2, minfrac: 0.1, fitorder: 2}
68
+ - {what: 'chan_ind', flagon: 'rms', stat: 'median', data: 'im', tol: 1.2, minfrac: 0.1, fitorder: 2}
69
+ - {what: 'rec_ind', flagon: 'rms', stat: 'median', data: 're', tol: 1.2, minfrac: 0.1, fitorder: 2}
70
+ - {what: 'rec_ind', flagon: 'rms', stat: 'median', data: 'im', tol: 1.2, minfrac: 0.1, fitorder: 2}
71
+
72
+
73
+ FlgUvsub: # Applicable to UV-subtracted target
74
+ - {what: 'vis_ind', flagon: 'mean', stat: 'mean', data: 'am', tol: 5.0, minfrac: 0.1, fitorder: 0}
75
+ - {what: 'vis_ind', flagon: 'mean', stat: 'mean', data: 'am', tol: 3.0, minfrac: 0.1, fitorder: 0}
76
+ - {what: 'vis_ind', flagon: 'mean', stat: 'median', data: 'am', tol: 2.0, minfrac: 0.1, fitorder: 1}
77
+ - {what: 'chan_ind', flagon: 'rms', stat: 'mean', data: 'am', tol: 2.0, minfrac: 0.1, fitorder: 0}
78
+ - {what: 'rec_ind', flagon: 'rms', stat: 'mean', data: 'am', tol: 2.0, minfrac: 0.1, fitorder: 0}
79
+ - {what: 'chan_ind', flagon: 'rms', stat: 'mean', data: 'am', tol: 1.5, minfrac: 0.1, fitorder: 2}
80
+ - {what: 'chan_ind', flagon: 'rms', stat: 'median', data: 're', tol: 1.2, minfrac: 0.1, fitorder: 2}
81
+ - {what: 'chan_ind', flagon: 'rms', stat: 'median', data: 'im', tol: 1.2, minfrac: 0.1, fitorder: 2}
82
+
83
+
84
+
File without changes