pspipe 0.6.0__tar.gz → 0.7__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.
- {pspipe-0.6.0 → pspipe-0.7}/PKG-INFO +2 -2
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/database.py +1 -4
- pspipe-0.7/pspipe/utils.py +82 -0
- {pspipe-0.6.0 → pspipe-0.7}/pyproject.toml +3 -3
- pspipe-0.6.0/pspipe/utils.py +0 -47
- {pspipe-0.6.0 → pspipe-0.7}/LICENSE +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/README.md +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/__init__.py +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/obsdata.py +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/settings.py +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/tasks.py +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/eor_bins_a12.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/eor_bins_alo.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/eor_bins_hba.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/eor_bins_nenufar.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/flagger.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/flagger_pre_combine.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/gpr_config_a12.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/gpr_config_hba.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/gpr_config_nenufar.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/gpr_config_v.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/ps_config_a12.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/ps_config_alo.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/ps_config_hba.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/config/ps_config_nenufar.parset +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/default_a12.toml +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/default_alo.toml +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/default_hba.toml +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/default_nenufar.toml +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/templates/default_settings.toml +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/tests/__init__.py +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/tests/test_settings.py +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/tests/test_utils.py +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/tools/__init__.py +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/tools/psdb.py +0 -0
- {pspipe-0.6.0 → pspipe-0.7}/pspipe/tools/pspipe.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pspipe
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7
|
|
4
4
|
Summary: Power spectra pipeline for Cosmic Dawn, Epoch of Reionization radio interferometric experiments
|
|
5
5
|
Author: Florent Mertens
|
|
6
6
|
Author-email: florent.mertens@gmail.com
|
|
@@ -14,9 +14,9 @@ Provides-Extra: ml-gpr
|
|
|
14
14
|
Requires-Dist: astropy (>6.0)
|
|
15
15
|
Requires-Dist: click (>=8.0)
|
|
16
16
|
Requires-Dist: libpipe (>=0.1.5)
|
|
17
|
-
Requires-Dist: nenucal (>=0.1.11)
|
|
18
17
|
Requires-Dist: ps-eor (>=0.8)
|
|
19
18
|
Requires-Dist: ps-eor[ml-gpr] (>=0.8) ; extra == "ml-gpr"
|
|
19
|
+
Requires-Dist: python-casacore (>=3.0)
|
|
20
20
|
Requires-Dist: tables (>=3.2)
|
|
21
21
|
Requires-Dist: tabulate (>=0.8)
|
|
22
22
|
Requires-Dist: toml (>=0.10)
|
|
@@ -15,7 +15,6 @@ from libpipe import futils
|
|
|
15
15
|
from libpipe.attrmap import OrderedSet
|
|
16
16
|
|
|
17
17
|
# Lazy loaded:
|
|
18
|
-
# - nenucal.msutils in ObsIDMeta.set_ms_info()
|
|
19
18
|
# - .obsdata.ObsData in VisRevision.get_data()
|
|
20
19
|
|
|
21
20
|
from .settings import Settings
|
|
@@ -365,9 +364,7 @@ class ObsIDMeta(AbstractJsonMeta):
|
|
|
365
364
|
return ObsIDMeta(file, d)
|
|
366
365
|
|
|
367
366
|
def set_ms_files(self, ms_files):
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
self.update(msutils.get_info_from_ms_files(ms_files[0]))
|
|
367
|
+
self.update(utils.get_info_from_ms_files(ms_files[0]))
|
|
371
368
|
self['ms_files'] = ms_files
|
|
372
369
|
self.save()
|
|
373
370
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Mixed utilities
|
|
2
|
+
#
|
|
3
|
+
# Author: F. Mertens
|
|
4
|
+
|
|
5
|
+
import itertools
|
|
6
|
+
|
|
7
|
+
import astropy.time as at
|
|
8
|
+
from casacore import tables
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def alphanum(s):
|
|
12
|
+
return "".join(filter(str.isalnum, s))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def all_same(l):
|
|
16
|
+
return not l or l.count(l[0]) == len(l)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def all_in_other(l, other):
|
|
20
|
+
return all(elem in other for elem in l)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def get_lst(obs_mjd, longitude=6.57):
|
|
24
|
+
return at.Time(obs_mjd, scale='utc', format='mjd').sidereal_time('mean', longitude=longitude).value
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def is_in_lst_bin(lst, lst_s, lst_e):
|
|
28
|
+
if lst_s == lst_e:
|
|
29
|
+
return False
|
|
30
|
+
if lst_e > lst_s:
|
|
31
|
+
return (lst >= lst_s) and (lst < lst_e)
|
|
32
|
+
return (lst >= lst_s) or (lst < lst_e)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def pairwise(iterable):
|
|
36
|
+
'''s -> (s0,s1), (s1,s2), (s2, s3), ...'''
|
|
37
|
+
a, b = itertools.tee(iterable)
|
|
38
|
+
next(b, None)
|
|
39
|
+
return list(zip(a, b))
|
|
40
|
+
|
|
41
|
+
def is_number(i):
|
|
42
|
+
'''Check if input is a string or an integer'''
|
|
43
|
+
try:
|
|
44
|
+
bool_i = i.isdigit()
|
|
45
|
+
|
|
46
|
+
except AttributeError:
|
|
47
|
+
bool_i = isinstance(i, int)
|
|
48
|
+
|
|
49
|
+
return bool_i
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def get_ms_freqs(ms_file):
|
|
53
|
+
with tables.table(os.path.join(ms_file, 'SPECTRAL_WINDOW'), readonly=True, ack=False) as t_spec_win:
|
|
54
|
+
freqs = t_spec_win.getcol('CHAN_FREQ').reshape(-1)
|
|
55
|
+
chan_widths = t_spec_win.getcol('CHAN_WIDTH').reshape(-1)
|
|
56
|
+
|
|
57
|
+
return freqs, chan_widths
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def get_info_from_ms_files(files):
|
|
61
|
+
t_start = []
|
|
62
|
+
t_end = []
|
|
63
|
+
t_total = 0
|
|
64
|
+
|
|
65
|
+
for file in files:
|
|
66
|
+
with tables.table(file, ack=False) as t:
|
|
67
|
+
start = t.getcell('TIME', 0)
|
|
68
|
+
end = t.getcell('TIME', t.nrows() - 1)
|
|
69
|
+
t_int = t.getcell('INTERVAL', 0)
|
|
70
|
+
t_start.append(start)
|
|
71
|
+
t_end.append(end)
|
|
72
|
+
t_total += end - start
|
|
73
|
+
freqs, chan_widths = get_ms_freqs(file)
|
|
74
|
+
n_chan = len(freqs)
|
|
75
|
+
chan_width = chan_widths.mean()
|
|
76
|
+
|
|
77
|
+
t_start = min(t_start)
|
|
78
|
+
t_end = max(t_end)
|
|
79
|
+
|
|
80
|
+
return {'start_time': t_start, 'end_time': t_end, 'int_time': t_int,
|
|
81
|
+
'total_time': t_total, 'n_channels': n_chan, 'chan_width': chan_width}
|
|
82
|
+
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pspipe"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.7"
|
|
8
8
|
description = "Power spectra pipeline for Cosmic Dawn, Epoch of Reionization radio interferometric experiments"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -20,8 +20,8 @@ dependencies = [
|
|
|
20
20
|
"tables>=3.2",
|
|
21
21
|
"tabulate>=0.8",
|
|
22
22
|
"ps-eor>=0.8",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
23
|
+
"libpipe>=0.1.5",
|
|
24
|
+
"python-casacore>=3.0",
|
|
25
25
|
]
|
|
26
26
|
|
|
27
27
|
[project.optional-dependencies]
|
pspipe-0.6.0/pspipe/utils.py
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# Mixed utilities
|
|
2
|
-
#
|
|
3
|
-
# Author: F. Mertens
|
|
4
|
-
|
|
5
|
-
import itertools
|
|
6
|
-
import astropy.time as at
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def alphanum(s):
|
|
10
|
-
return "".join(filter(str.isalnum, s))
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def all_same(l):
|
|
14
|
-
return not l or l.count(l[0]) == len(l)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def all_in_other(l, other):
|
|
18
|
-
return all(elem in other for elem in l)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def get_lst(obs_mjd, longitude=6.57):
|
|
22
|
-
return at.Time(obs_mjd, scale='utc', format='mjd').sidereal_time('mean', longitude=longitude).value
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def is_in_lst_bin(lst, lst_s, lst_e):
|
|
26
|
-
if lst_s == lst_e:
|
|
27
|
-
return False
|
|
28
|
-
if lst_e > lst_s:
|
|
29
|
-
return (lst >= lst_s) and (lst < lst_e)
|
|
30
|
-
return (lst >= lst_s) or (lst < lst_e)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def pairwise(iterable):
|
|
34
|
-
'''s -> (s0,s1), (s1,s2), (s2, s3), ...'''
|
|
35
|
-
a, b = itertools.tee(iterable)
|
|
36
|
-
next(b, None)
|
|
37
|
-
return list(zip(a, b))
|
|
38
|
-
|
|
39
|
-
def is_number(i):
|
|
40
|
-
'''Check if input is a string or an integer'''
|
|
41
|
-
try:
|
|
42
|
-
bool_i = i.isdigit()
|
|
43
|
-
|
|
44
|
-
except AttributeError:
|
|
45
|
-
bool_i = isinstance(i, int)
|
|
46
|
-
|
|
47
|
-
return bool_i
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|