convolve-rs 2.1.0__tar.gz → 2.2.1__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.
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/.github/workflows/cd.yml +1 -1
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/.github/workflows/ci.yml +10 -1
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/.pre-commit-config.yaml +1 -1
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/Cargo.lock +117 -186
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/Cargo.toml +9 -9
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/PKG-INFO +1 -1
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/src/cube_io.rs +24 -6
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/src/main.rs +117 -29
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/src/python.rs +1 -1
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/tests/cube_io_roundtrip.rs +104 -4
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/.cargo/config.toml +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/.gitignore +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/.readthedocs.yaml +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/LICENSE +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/NOTICE.md +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/README.md +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/benches/convolve_bench.rs +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/convolve_rs/__init__.py +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/convolve_rs/_convolve_rs/__init__.pyi +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/docs/_static/.gitkeep +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/docs/_templates/.gitkeep +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/docs/algorithms.md +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/docs/cli.md +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/docs/conf.py +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/docs/index.md +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/docs/performance.md +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/docs/quickstart.md +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/pyproject.toml +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/scripts/bench_gpu_vs_cpu.py +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/scripts/bench_vs_racs_tools.py +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/scripts/benchmark.ipynb +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/scripts/compare_beamcon.sh +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/scripts/gpu-acceleration-decision.md +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/scripts/make_dummy_fits.py +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/scripts/make_test_cube.py +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/scripts/profile_cube.sh +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/src/beam.rs +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/src/common_beam.rs +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/src/convolve_uv.rs +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/src/fits_io.rs +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/src/lib.rs +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/src/smooth.rs +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/tests/cli_2d.rs +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/tests/miriad_compat.rs +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/tests/test_doctests.py +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/tests/test_python.py +0 -0
- {convolve_rs-2.1.0 → convolve_rs-2.2.1}/uv.lock +0 -0
|
@@ -57,7 +57,7 @@ jobs:
|
|
|
57
57
|
include:
|
|
58
58
|
- { platform: linux, runner: ubuntu-latest, target: x86_64 }
|
|
59
59
|
- { platform: linux, runner: ubuntu-latest, target: aarch64 }
|
|
60
|
-
- { platform: macos, runner: macos-
|
|
60
|
+
- { platform: macos, runner: macos-26, target: aarch64 }
|
|
61
61
|
# No Windows wheel: cfitsio can't be built from source under MSVC.
|
|
62
62
|
# Windows users can build from the sdist or use conda/WSL.
|
|
63
63
|
steps:
|
|
@@ -16,7 +16,7 @@ env:
|
|
|
16
16
|
FORCE_COLOR: 3
|
|
17
17
|
CARGO_TERM_COLOR: always
|
|
18
18
|
# Bump this to invalidate the cached MIRIAD build.
|
|
19
|
-
MIRIAD_CACHE_VERSION:
|
|
19
|
+
MIRIAD_CACHE_VERSION: v2
|
|
20
20
|
|
|
21
21
|
jobs:
|
|
22
22
|
lint:
|
|
@@ -103,7 +103,16 @@ jobs:
|
|
|
103
103
|
if: steps.miriad-cache.outputs.cache-hit != 'true'
|
|
104
104
|
run: |
|
|
105
105
|
git clone --depth 1 https://github.com/csiro/miriad.git /tmp/miriad-src
|
|
106
|
+
# GCC 15 defaults to C23, where PGPLOT's drivers (pndriv.c) no
|
|
107
|
+
# longer compile: they use `false` as an enum constant. PGPLOT is
|
|
108
|
+
# built by its own makefile, which calls `gcc` with fixed flags, so
|
|
109
|
+
# put a gcc on PATH that defaults to gnu17.
|
|
110
|
+
mkdir -p "$HOME/gcc-gnu17"
|
|
111
|
+
printf '#!/bin/sh\nexec /usr/bin/gcc -std=gnu17 "$@"\n' > "$HOME/gcc-gnu17/gcc"
|
|
112
|
+
chmod +x "$HOME/gcc-gnu17/gcc"
|
|
113
|
+
export PATH="$HOME/gcc-gnu17:$PATH"
|
|
106
114
|
cmake -S /tmp/miriad-src -B /tmp/miriad-build \
|
|
115
|
+
-DCMAKE_C_COMPILER="$HOME/gcc-gnu17/gcc" \
|
|
107
116
|
-DCMAKE_INSTALL_PREFIX="$HOME/miriad-install"
|
|
108
117
|
cmake --build /tmp/miriad-build --target install -j"$(nproc)"
|
|
109
118
|
|
|
@@ -11,6 +11,15 @@ dependencies = [
|
|
|
11
11
|
"memchr",
|
|
12
12
|
]
|
|
13
13
|
|
|
14
|
+
[[package]]
|
|
15
|
+
name = "alloca"
|
|
16
|
+
version = "0.4.0"
|
|
17
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
18
|
+
checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4"
|
|
19
|
+
dependencies = [
|
|
20
|
+
"cc",
|
|
21
|
+
]
|
|
22
|
+
|
|
14
23
|
[[package]]
|
|
15
24
|
name = "android_system_properties"
|
|
16
25
|
version = "0.1.5"
|
|
@@ -62,7 +71,7 @@ version = "1.1.5"
|
|
|
62
71
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
63
72
|
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
|
|
64
73
|
dependencies = [
|
|
65
|
-
"windows-sys
|
|
74
|
+
"windows-sys",
|
|
66
75
|
]
|
|
67
76
|
|
|
68
77
|
[[package]]
|
|
@@ -73,7 +82,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
|
|
|
73
82
|
dependencies = [
|
|
74
83
|
"anstyle",
|
|
75
84
|
"once_cell_polyfill",
|
|
76
|
-
"windows-sys
|
|
85
|
+
"windows-sys",
|
|
77
86
|
]
|
|
78
87
|
|
|
79
88
|
[[package]]
|
|
@@ -84,9 +93,9 @@ checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
|
|
|
84
93
|
|
|
85
94
|
[[package]]
|
|
86
95
|
name = "atfits-rs"
|
|
87
|
-
version = "1.
|
|
96
|
+
version = "1.3.0"
|
|
88
97
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
89
|
-
checksum = "
|
|
98
|
+
checksum = "964fa2982494ce10e143d341c50f2b7dc8059659b04617eb2793fda6d01c846d"
|
|
90
99
|
dependencies = [
|
|
91
100
|
"fitsio",
|
|
92
101
|
"thiserror",
|
|
@@ -206,7 +215,7 @@ dependencies = [
|
|
|
206
215
|
"heck",
|
|
207
216
|
"proc-macro2",
|
|
208
217
|
"quote",
|
|
209
|
-
"syn",
|
|
218
|
+
"syn 2.0.117",
|
|
210
219
|
]
|
|
211
220
|
|
|
212
221
|
[[package]]
|
|
@@ -223,20 +232,19 @@ checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
|
|
|
223
232
|
|
|
224
233
|
[[package]]
|
|
225
234
|
name = "console"
|
|
226
|
-
version = "0.
|
|
235
|
+
version = "0.16.6"
|
|
227
236
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
228
|
-
checksum = "
|
|
237
|
+
checksum = "e96a4956774c13c126a8b5af4daa79384f4d826534c95a02d76afb39e2ab64e3"
|
|
229
238
|
dependencies = [
|
|
230
239
|
"encode_unicode",
|
|
231
240
|
"libc",
|
|
232
|
-
"once_cell",
|
|
233
241
|
"unicode-width",
|
|
234
|
-
"windows-sys
|
|
242
|
+
"windows-sys",
|
|
235
243
|
]
|
|
236
244
|
|
|
237
245
|
[[package]]
|
|
238
246
|
name = "convolve-rs"
|
|
239
|
-
version = "2.1
|
|
247
|
+
version = "2.2.1"
|
|
240
248
|
dependencies = [
|
|
241
249
|
"anyhow",
|
|
242
250
|
"atfits-rs",
|
|
@@ -265,25 +273,24 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
|
|
|
265
273
|
|
|
266
274
|
[[package]]
|
|
267
275
|
name = "criterion"
|
|
268
|
-
version = "0.
|
|
276
|
+
version = "0.8.2"
|
|
269
277
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
270
|
-
checksum = "
|
|
278
|
+
checksum = "950046b2aa2492f9a536f5f4f9a3de7b9e2476e575e05bd6c333371add4d98f3"
|
|
271
279
|
dependencies = [
|
|
280
|
+
"alloca",
|
|
272
281
|
"anes",
|
|
273
282
|
"cast",
|
|
274
283
|
"ciborium",
|
|
275
284
|
"clap",
|
|
276
285
|
"criterion-plot",
|
|
277
|
-
"
|
|
278
|
-
"itertools 0.10.5",
|
|
286
|
+
"itertools 0.13.0",
|
|
279
287
|
"num-traits",
|
|
280
|
-
"once_cell",
|
|
281
288
|
"oorandom",
|
|
289
|
+
"page_size",
|
|
282
290
|
"plotters",
|
|
283
291
|
"rayon",
|
|
284
292
|
"regex",
|
|
285
293
|
"serde",
|
|
286
|
-
"serde_derive",
|
|
287
294
|
"serde_json",
|
|
288
295
|
"tinytemplate",
|
|
289
296
|
"walkdir",
|
|
@@ -291,12 +298,12 @@ dependencies = [
|
|
|
291
298
|
|
|
292
299
|
[[package]]
|
|
293
300
|
name = "criterion-plot"
|
|
294
|
-
version = "0.
|
|
301
|
+
version = "0.8.2"
|
|
295
302
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
296
|
-
checksum = "
|
|
303
|
+
checksum = "d8d80a2f4f5b554395e47b5d8305bc3d27813bacb73493eb1001e8f76dae29ea"
|
|
297
304
|
dependencies = [
|
|
298
305
|
"cast",
|
|
299
|
-
"itertools 0.
|
|
306
|
+
"itertools 0.13.0",
|
|
300
307
|
]
|
|
301
308
|
|
|
302
309
|
[[package]]
|
|
@@ -450,12 +457,6 @@ version = "0.5.0"
|
|
|
450
457
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
451
458
|
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
452
459
|
|
|
453
|
-
[[package]]
|
|
454
|
-
name = "hermit-abi"
|
|
455
|
-
version = "0.5.2"
|
|
456
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
457
|
-
checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
|
|
458
|
-
|
|
459
460
|
[[package]]
|
|
460
461
|
name = "iana-time-zone"
|
|
461
462
|
version = "0.1.65"
|
|
@@ -492,27 +493,18 @@ dependencies = [
|
|
|
492
493
|
|
|
493
494
|
[[package]]
|
|
494
495
|
name = "indicatif"
|
|
495
|
-
version = "0.
|
|
496
|
+
version = "0.18.6"
|
|
496
497
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
497
|
-
checksum = "
|
|
498
|
+
checksum = "9433806cd6b4ec1aba79c021c7e4c58fb4c3b9977c085062e611ac929998fb0c"
|
|
498
499
|
dependencies = [
|
|
499
500
|
"console",
|
|
500
|
-
"number_prefix",
|
|
501
501
|
"portable-atomic",
|
|
502
502
|
"rayon",
|
|
503
503
|
"unicode-width",
|
|
504
|
+
"unit-prefix",
|
|
504
505
|
"web-time",
|
|
505
506
|
]
|
|
506
507
|
|
|
507
|
-
[[package]]
|
|
508
|
-
name = "indoc"
|
|
509
|
-
version = "2.0.7"
|
|
510
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
511
|
-
checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
|
|
512
|
-
dependencies = [
|
|
513
|
-
"rustversion",
|
|
514
|
-
]
|
|
515
|
-
|
|
516
508
|
[[package]]
|
|
517
509
|
name = "inventory"
|
|
518
510
|
version = "0.3.24"
|
|
@@ -531,18 +523,7 @@ dependencies = [
|
|
|
531
523
|
"heck",
|
|
532
524
|
"proc-macro2",
|
|
533
525
|
"quote",
|
|
534
|
-
"syn",
|
|
535
|
-
]
|
|
536
|
-
|
|
537
|
-
[[package]]
|
|
538
|
-
name = "is-terminal"
|
|
539
|
-
version = "0.4.17"
|
|
540
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
541
|
-
checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46"
|
|
542
|
-
dependencies = [
|
|
543
|
-
"hermit-abi",
|
|
544
|
-
"libc",
|
|
545
|
-
"windows-sys 0.61.2",
|
|
526
|
+
"syn 2.0.117",
|
|
546
527
|
]
|
|
547
528
|
|
|
548
529
|
[[package]]
|
|
@@ -553,27 +534,27 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
|
|
|
553
534
|
|
|
554
535
|
[[package]]
|
|
555
536
|
name = "itertools"
|
|
556
|
-
version = "0.
|
|
537
|
+
version = "0.11.0"
|
|
557
538
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
558
|
-
checksum = "
|
|
539
|
+
checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57"
|
|
559
540
|
dependencies = [
|
|
560
541
|
"either",
|
|
561
542
|
]
|
|
562
543
|
|
|
563
544
|
[[package]]
|
|
564
545
|
name = "itertools"
|
|
565
|
-
version = "0.
|
|
546
|
+
version = "0.13.0"
|
|
566
547
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
567
|
-
checksum = "
|
|
548
|
+
checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
|
|
568
549
|
dependencies = [
|
|
569
550
|
"either",
|
|
570
551
|
]
|
|
571
552
|
|
|
572
553
|
[[package]]
|
|
573
554
|
name = "itertools"
|
|
574
|
-
version = "0.
|
|
555
|
+
version = "0.15.0"
|
|
575
556
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
576
|
-
checksum = "
|
|
557
|
+
checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc"
|
|
577
558
|
dependencies = [
|
|
578
559
|
"either",
|
|
579
560
|
]
|
|
@@ -651,20 +632,11 @@ version = "2.8.1"
|
|
|
651
632
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
652
633
|
checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8"
|
|
653
634
|
|
|
654
|
-
[[package]]
|
|
655
|
-
name = "memoffset"
|
|
656
|
-
version = "0.9.1"
|
|
657
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
658
|
-
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
|
|
659
|
-
dependencies = [
|
|
660
|
-
"autocfg",
|
|
661
|
-
]
|
|
662
|
-
|
|
663
635
|
[[package]]
|
|
664
636
|
name = "ndarray"
|
|
665
|
-
version = "0.
|
|
637
|
+
version = "0.17.2"
|
|
666
638
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
667
|
-
checksum = "
|
|
639
|
+
checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d"
|
|
668
640
|
dependencies = [
|
|
669
641
|
"matrixmultiply",
|
|
670
642
|
"num-complex",
|
|
@@ -681,7 +653,7 @@ version = "0.50.3"
|
|
|
681
653
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
682
654
|
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
|
|
683
655
|
dependencies = [
|
|
684
|
-
"windows-sys
|
|
656
|
+
"windows-sys",
|
|
685
657
|
]
|
|
686
658
|
|
|
687
659
|
[[package]]
|
|
@@ -727,17 +699,11 @@ dependencies = [
|
|
|
727
699
|
"autocfg",
|
|
728
700
|
]
|
|
729
701
|
|
|
730
|
-
[[package]]
|
|
731
|
-
name = "number_prefix"
|
|
732
|
-
version = "0.4.0"
|
|
733
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
734
|
-
checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
|
|
735
|
-
|
|
736
702
|
[[package]]
|
|
737
703
|
name = "numpy"
|
|
738
|
-
version = "0.
|
|
704
|
+
version = "0.30.0"
|
|
739
705
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
740
|
-
checksum = "
|
|
706
|
+
checksum = "aa0b9111761885449e894981fa8051dcf69e0bd114aecbd4bcdd830b6be4ed92"
|
|
741
707
|
dependencies = [
|
|
742
708
|
"libc",
|
|
743
709
|
"ndarray",
|
|
@@ -776,6 +742,16 @@ dependencies = [
|
|
|
776
742
|
"num-traits",
|
|
777
743
|
]
|
|
778
744
|
|
|
745
|
+
[[package]]
|
|
746
|
+
name = "page_size"
|
|
747
|
+
version = "0.6.0"
|
|
748
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
749
|
+
checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da"
|
|
750
|
+
dependencies = [
|
|
751
|
+
"libc",
|
|
752
|
+
"winapi",
|
|
753
|
+
]
|
|
754
|
+
|
|
779
755
|
[[package]]
|
|
780
756
|
name = "phf"
|
|
781
757
|
version = "0.11.3"
|
|
@@ -904,35 +880,32 @@ dependencies = [
|
|
|
904
880
|
|
|
905
881
|
[[package]]
|
|
906
882
|
name = "pyo3"
|
|
907
|
-
version = "0.
|
|
883
|
+
version = "0.30.1"
|
|
908
884
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
909
|
-
checksum = "
|
|
885
|
+
checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
|
|
910
886
|
dependencies = [
|
|
911
|
-
"indoc",
|
|
912
887
|
"libc",
|
|
913
|
-
"memoffset",
|
|
914
888
|
"once_cell",
|
|
915
889
|
"portable-atomic",
|
|
916
890
|
"pyo3-build-config",
|
|
917
891
|
"pyo3-ffi",
|
|
918
892
|
"pyo3-macros",
|
|
919
|
-
"unindent",
|
|
920
893
|
]
|
|
921
894
|
|
|
922
895
|
[[package]]
|
|
923
896
|
name = "pyo3-build-config"
|
|
924
|
-
version = "0.
|
|
897
|
+
version = "0.30.1"
|
|
925
898
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
926
|
-
checksum = "
|
|
899
|
+
checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
|
|
927
900
|
dependencies = [
|
|
928
901
|
"target-lexicon",
|
|
929
902
|
]
|
|
930
903
|
|
|
931
904
|
[[package]]
|
|
932
905
|
name = "pyo3-ffi"
|
|
933
|
-
version = "0.
|
|
906
|
+
version = "0.30.1"
|
|
934
907
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
935
|
-
checksum = "
|
|
908
|
+
checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
|
|
936
909
|
dependencies = [
|
|
937
910
|
"libc",
|
|
938
911
|
"pyo3-build-config",
|
|
@@ -940,41 +913,40 @@ dependencies = [
|
|
|
940
913
|
|
|
941
914
|
[[package]]
|
|
942
915
|
name = "pyo3-macros"
|
|
943
|
-
version = "0.
|
|
916
|
+
version = "0.30.1"
|
|
944
917
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
945
|
-
checksum = "
|
|
918
|
+
checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
|
|
946
919
|
dependencies = [
|
|
947
920
|
"proc-macro2",
|
|
948
921
|
"pyo3-macros-backend",
|
|
949
922
|
"quote",
|
|
950
|
-
"syn",
|
|
923
|
+
"syn 3.0.10",
|
|
951
924
|
]
|
|
952
925
|
|
|
953
926
|
[[package]]
|
|
954
927
|
name = "pyo3-macros-backend"
|
|
955
|
-
version = "0.
|
|
928
|
+
version = "0.30.1"
|
|
956
929
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
957
|
-
checksum = "
|
|
930
|
+
checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
|
|
958
931
|
dependencies = [
|
|
959
932
|
"heck",
|
|
960
933
|
"proc-macro2",
|
|
961
|
-
"pyo3-build-config",
|
|
962
934
|
"quote",
|
|
963
|
-
"syn",
|
|
935
|
+
"syn 3.0.10",
|
|
964
936
|
]
|
|
965
937
|
|
|
966
938
|
[[package]]
|
|
967
939
|
name = "pyo3-stub-gen"
|
|
968
|
-
version = "0.
|
|
940
|
+
version = "0.23.3"
|
|
969
941
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
970
|
-
checksum = "
|
|
942
|
+
checksum = "111b01c874bd90a65b31412077467e52a8f2993a0aa5e06d885df93512463526"
|
|
971
943
|
dependencies = [
|
|
972
944
|
"anyhow",
|
|
973
945
|
"chrono",
|
|
974
946
|
"either",
|
|
975
947
|
"indexmap",
|
|
976
948
|
"inventory",
|
|
977
|
-
"itertools 0.
|
|
949
|
+
"itertools 0.15.0",
|
|
978
950
|
"log",
|
|
979
951
|
"maplit",
|
|
980
952
|
"num-complex",
|
|
@@ -982,7 +954,6 @@ dependencies = [
|
|
|
982
954
|
"ordered-float",
|
|
983
955
|
"pyo3",
|
|
984
956
|
"pyo3-stub-gen-derive",
|
|
985
|
-
"rustpython-parser",
|
|
986
957
|
"serde",
|
|
987
958
|
"serde_json",
|
|
988
959
|
"time",
|
|
@@ -991,16 +962,16 @@ dependencies = [
|
|
|
991
962
|
|
|
992
963
|
[[package]]
|
|
993
964
|
name = "pyo3-stub-gen-derive"
|
|
994
|
-
version = "0.
|
|
965
|
+
version = "0.23.3"
|
|
995
966
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
996
|
-
checksum = "
|
|
967
|
+
checksum = "d82a32937b88ef0c95b794628f55a0a98d042ed0ecef92b7265687fb45c9a2ce"
|
|
997
968
|
dependencies = [
|
|
998
969
|
"heck",
|
|
999
970
|
"indexmap",
|
|
1000
971
|
"proc-macro2",
|
|
1001
972
|
"quote",
|
|
1002
973
|
"rustpython-parser",
|
|
1003
|
-
"syn",
|
|
974
|
+
"syn 3.0.10",
|
|
1004
975
|
]
|
|
1005
976
|
|
|
1006
977
|
[[package]]
|
|
@@ -1231,7 +1202,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
|
1231
1202
|
dependencies = [
|
|
1232
1203
|
"proc-macro2",
|
|
1233
1204
|
"quote",
|
|
1234
|
-
"syn",
|
|
1205
|
+
"syn 2.0.117",
|
|
1235
1206
|
]
|
|
1236
1207
|
|
|
1237
1208
|
[[package]]
|
|
@@ -1318,6 +1289,17 @@ dependencies = [
|
|
|
1318
1289
|
"unicode-ident",
|
|
1319
1290
|
]
|
|
1320
1291
|
|
|
1292
|
+
[[package]]
|
|
1293
|
+
name = "syn"
|
|
1294
|
+
version = "3.0.10"
|
|
1295
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1296
|
+
checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
|
|
1297
|
+
dependencies = [
|
|
1298
|
+
"proc-macro2",
|
|
1299
|
+
"quote",
|
|
1300
|
+
"unicode-ident",
|
|
1301
|
+
]
|
|
1302
|
+
|
|
1321
1303
|
[[package]]
|
|
1322
1304
|
name = "target-lexicon"
|
|
1323
1305
|
version = "0.13.5"
|
|
@@ -1326,22 +1308,22 @@ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
|
1326
1308
|
|
|
1327
1309
|
[[package]]
|
|
1328
1310
|
name = "thiserror"
|
|
1329
|
-
version = "
|
|
1311
|
+
version = "2.0.21"
|
|
1330
1312
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1331
|
-
checksum = "
|
|
1313
|
+
checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
|
|
1332
1314
|
dependencies = [
|
|
1333
1315
|
"thiserror-impl",
|
|
1334
1316
|
]
|
|
1335
1317
|
|
|
1336
1318
|
[[package]]
|
|
1337
1319
|
name = "thiserror-impl"
|
|
1338
|
-
version = "
|
|
1320
|
+
version = "2.0.21"
|
|
1339
1321
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1340
|
-
checksum = "
|
|
1322
|
+
checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
|
|
1341
1323
|
dependencies = [
|
|
1342
1324
|
"proc-macro2",
|
|
1343
1325
|
"quote",
|
|
1344
|
-
"syn",
|
|
1326
|
+
"syn 3.0.10",
|
|
1345
1327
|
]
|
|
1346
1328
|
|
|
1347
1329
|
[[package]]
|
|
@@ -1449,7 +1431,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
|
|
|
1449
1431
|
dependencies = [
|
|
1450
1432
|
"proc-macro2",
|
|
1451
1433
|
"quote",
|
|
1452
|
-
"syn",
|
|
1434
|
+
"syn 2.0.117",
|
|
1453
1435
|
]
|
|
1454
1436
|
|
|
1455
1437
|
[[package]]
|
|
@@ -1588,10 +1570,10 @@ dependencies = [
|
|
|
1588
1570
|
]
|
|
1589
1571
|
|
|
1590
1572
|
[[package]]
|
|
1591
|
-
name = "
|
|
1592
|
-
version = "0.2
|
|
1573
|
+
name = "unit-prefix"
|
|
1574
|
+
version = "0.5.2"
|
|
1593
1575
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1594
|
-
checksum = "
|
|
1576
|
+
checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3"
|
|
1595
1577
|
|
|
1596
1578
|
[[package]]
|
|
1597
1579
|
name = "utf8parse"
|
|
@@ -1653,7 +1635,7 @@ dependencies = [
|
|
|
1653
1635
|
"bumpalo",
|
|
1654
1636
|
"proc-macro2",
|
|
1655
1637
|
"quote",
|
|
1656
|
-
"syn",
|
|
1638
|
+
"syn 2.0.117",
|
|
1657
1639
|
"wasm-bindgen-shared",
|
|
1658
1640
|
]
|
|
1659
1641
|
|
|
@@ -1686,15 +1668,37 @@ dependencies = [
|
|
|
1686
1668
|
"wasm-bindgen",
|
|
1687
1669
|
]
|
|
1688
1670
|
|
|
1671
|
+
[[package]]
|
|
1672
|
+
name = "winapi"
|
|
1673
|
+
version = "0.3.9"
|
|
1674
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1675
|
+
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
|
1676
|
+
dependencies = [
|
|
1677
|
+
"winapi-i686-pc-windows-gnu",
|
|
1678
|
+
"winapi-x86_64-pc-windows-gnu",
|
|
1679
|
+
]
|
|
1680
|
+
|
|
1681
|
+
[[package]]
|
|
1682
|
+
name = "winapi-i686-pc-windows-gnu"
|
|
1683
|
+
version = "0.4.0"
|
|
1684
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1685
|
+
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
|
1686
|
+
|
|
1689
1687
|
[[package]]
|
|
1690
1688
|
name = "winapi-util"
|
|
1691
1689
|
version = "0.1.11"
|
|
1692
1690
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1693
1691
|
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
|
1694
1692
|
dependencies = [
|
|
1695
|
-
"windows-sys
|
|
1693
|
+
"windows-sys",
|
|
1696
1694
|
]
|
|
1697
1695
|
|
|
1696
|
+
[[package]]
|
|
1697
|
+
name = "winapi-x86_64-pc-windows-gnu"
|
|
1698
|
+
version = "0.4.0"
|
|
1699
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1700
|
+
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|
1701
|
+
|
|
1698
1702
|
[[package]]
|
|
1699
1703
|
name = "windows-core"
|
|
1700
1704
|
version = "0.62.2"
|
|
@@ -1716,7 +1720,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
|
|
|
1716
1720
|
dependencies = [
|
|
1717
1721
|
"proc-macro2",
|
|
1718
1722
|
"quote",
|
|
1719
|
-
"syn",
|
|
1723
|
+
"syn 2.0.117",
|
|
1720
1724
|
]
|
|
1721
1725
|
|
|
1722
1726
|
[[package]]
|
|
@@ -1727,7 +1731,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
|
|
|
1727
1731
|
dependencies = [
|
|
1728
1732
|
"proc-macro2",
|
|
1729
1733
|
"quote",
|
|
1730
|
-
"syn",
|
|
1734
|
+
"syn 2.0.117",
|
|
1731
1735
|
]
|
|
1732
1736
|
|
|
1733
1737
|
[[package]]
|
|
@@ -1754,15 +1758,6 @@ dependencies = [
|
|
|
1754
1758
|
"windows-link",
|
|
1755
1759
|
]
|
|
1756
1760
|
|
|
1757
|
-
[[package]]
|
|
1758
|
-
name = "windows-sys"
|
|
1759
|
-
version = "0.59.0"
|
|
1760
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1761
|
-
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
|
|
1762
|
-
dependencies = [
|
|
1763
|
-
"windows-targets",
|
|
1764
|
-
]
|
|
1765
|
-
|
|
1766
1761
|
[[package]]
|
|
1767
1762
|
name = "windows-sys"
|
|
1768
1763
|
version = "0.61.2"
|
|
@@ -1772,70 +1767,6 @@ dependencies = [
|
|
|
1772
1767
|
"windows-link",
|
|
1773
1768
|
]
|
|
1774
1769
|
|
|
1775
|
-
[[package]]
|
|
1776
|
-
name = "windows-targets"
|
|
1777
|
-
version = "0.52.6"
|
|
1778
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1779
|
-
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
|
1780
|
-
dependencies = [
|
|
1781
|
-
"windows_aarch64_gnullvm",
|
|
1782
|
-
"windows_aarch64_msvc",
|
|
1783
|
-
"windows_i686_gnu",
|
|
1784
|
-
"windows_i686_gnullvm",
|
|
1785
|
-
"windows_i686_msvc",
|
|
1786
|
-
"windows_x86_64_gnu",
|
|
1787
|
-
"windows_x86_64_gnullvm",
|
|
1788
|
-
"windows_x86_64_msvc",
|
|
1789
|
-
]
|
|
1790
|
-
|
|
1791
|
-
[[package]]
|
|
1792
|
-
name = "windows_aarch64_gnullvm"
|
|
1793
|
-
version = "0.52.6"
|
|
1794
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1795
|
-
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
|
1796
|
-
|
|
1797
|
-
[[package]]
|
|
1798
|
-
name = "windows_aarch64_msvc"
|
|
1799
|
-
version = "0.52.6"
|
|
1800
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1801
|
-
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
|
1802
|
-
|
|
1803
|
-
[[package]]
|
|
1804
|
-
name = "windows_i686_gnu"
|
|
1805
|
-
version = "0.52.6"
|
|
1806
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1807
|
-
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
|
1808
|
-
|
|
1809
|
-
[[package]]
|
|
1810
|
-
name = "windows_i686_gnullvm"
|
|
1811
|
-
version = "0.52.6"
|
|
1812
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1813
|
-
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
|
1814
|
-
|
|
1815
|
-
[[package]]
|
|
1816
|
-
name = "windows_i686_msvc"
|
|
1817
|
-
version = "0.52.6"
|
|
1818
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1819
|
-
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
|
1820
|
-
|
|
1821
|
-
[[package]]
|
|
1822
|
-
name = "windows_x86_64_gnu"
|
|
1823
|
-
version = "0.52.6"
|
|
1824
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1825
|
-
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
|
1826
|
-
|
|
1827
|
-
[[package]]
|
|
1828
|
-
name = "windows_x86_64_gnullvm"
|
|
1829
|
-
version = "0.52.6"
|
|
1830
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1831
|
-
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
|
1832
|
-
|
|
1833
|
-
[[package]]
|
|
1834
|
-
name = "windows_x86_64_msvc"
|
|
1835
|
-
version = "0.52.6"
|
|
1836
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1837
|
-
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
|
1838
|
-
|
|
1839
1770
|
[[package]]
|
|
1840
1771
|
name = "winnow"
|
|
1841
1772
|
version = "1.0.3"
|
|
@@ -1859,7 +1790,7 @@ checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930"
|
|
|
1859
1790
|
dependencies = [
|
|
1860
1791
|
"proc-macro2",
|
|
1861
1792
|
"quote",
|
|
1862
|
-
"syn",
|
|
1793
|
+
"syn 2.0.117",
|
|
1863
1794
|
]
|
|
1864
1795
|
|
|
1865
1796
|
[[package]]
|
|
@@ -3,7 +3,7 @@ name = "convolve-rs"
|
|
|
3
3
|
# Placeholder: the real version is the git tag, injected at release time by the
|
|
4
4
|
# CD workflow via `cargo set-version`. maturin reads this value, so the Python
|
|
5
5
|
# wheel/sdist version follows automatically.
|
|
6
|
-
version = "2.1
|
|
6
|
+
version = "2.2.1"
|
|
7
7
|
edition = "2024"
|
|
8
8
|
authors = ["Alec Thomson"]
|
|
9
9
|
license = "BSD-3-Clause"
|
|
@@ -48,29 +48,29 @@ abi3 = ["python", "pyo3/abi3-py310"]
|
|
|
48
48
|
stubgen = ["python", "dep:pyo3-stub-gen"]
|
|
49
49
|
|
|
50
50
|
[dependencies]
|
|
51
|
-
pyo3 = { version = "0.
|
|
52
|
-
numpy = { version = "0.
|
|
53
|
-
pyo3-stub-gen = { version = "0.
|
|
51
|
+
pyo3 = { version = "0.30", features = ["extension-module"], optional = true }
|
|
52
|
+
numpy = { version = "0.30", optional = true }
|
|
53
|
+
pyo3-stub-gen = { version = "0.23.3", optional = true }
|
|
54
54
|
# Shared low-level cfitsio helpers (pixel I/O, header editing, image creation).
|
|
55
|
-
atfits-rs = "1.
|
|
55
|
+
atfits-rs = "1.3"
|
|
56
56
|
# cfitsio linkage is controlled by the crate-level `fitsio-src` feature (see
|
|
57
57
|
# [features] above).
|
|
58
58
|
fitsio = { version = "0.21" }
|
|
59
|
-
ndarray = "0.
|
|
59
|
+
ndarray = "0.17"
|
|
60
60
|
rustfft = "6"
|
|
61
61
|
realfft = "3"
|
|
62
62
|
num-traits = "0.2"
|
|
63
63
|
rayon = "1"
|
|
64
64
|
clap = { version = "4", features = ["derive"] }
|
|
65
|
-
thiserror = "
|
|
65
|
+
thiserror = "2"
|
|
66
66
|
anyhow = "1"
|
|
67
67
|
tracing = "0.1"
|
|
68
68
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
69
|
-
indicatif = { version = "0.
|
|
69
|
+
indicatif = { version = "0.18", features = ["rayon"] }
|
|
70
70
|
|
|
71
71
|
[dev-dependencies]
|
|
72
72
|
# Benchmark harness (dev-only; not part of the published crate or wheel).
|
|
73
|
-
criterion = "0.
|
|
73
|
+
criterion = "0.8"
|
|
74
74
|
|
|
75
75
|
[[bench]]
|
|
76
76
|
name = "convolve_bench"
|
|
@@ -91,6 +91,18 @@ impl CubeMeta {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/// Which channel's beam goes in the primary header of an output cube.
|
|
95
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
|
96
|
+
pub enum RefChan {
|
|
97
|
+
/// The channel at the spectral axis' CRPIX, as racs_tools does by default.
|
|
98
|
+
#[default]
|
|
99
|
+
Crpix,
|
|
100
|
+
First,
|
|
101
|
+
Last,
|
|
102
|
+
/// Channel `nfreq / 2`: the upper middle one for an even count.
|
|
103
|
+
Mid,
|
|
104
|
+
}
|
|
105
|
+
|
|
94
106
|
/// The beamlog next to a FITS file: `{dir}/beamlog.{stem}.txt`.
|
|
95
107
|
pub fn beamlog_path(fits: &Path) -> PathBuf {
|
|
96
108
|
let dir = fits.parent().unwrap_or(Path::new("."));
|
|
@@ -271,11 +283,12 @@ impl CubeWriter {
|
|
|
271
283
|
target_beams: &[Option<Beam>],
|
|
272
284
|
mode: CubeMode,
|
|
273
285
|
meta: &CubeMeta,
|
|
286
|
+
ref_chan: RefChan,
|
|
274
287
|
) -> Result<Self, CubeError> {
|
|
275
288
|
let mut fptr = create_output(input_path, output_path, None)?;
|
|
276
289
|
write_primary_beam_keys(
|
|
277
290
|
&mut fptr,
|
|
278
|
-
ref_beam_for(target_beams, meta),
|
|
291
|
+
ref_beam_for(target_beams, meta, ref_chan),
|
|
279
292
|
mode == CubeMode::Natural,
|
|
280
293
|
)?;
|
|
281
294
|
Ok(Self {
|
|
@@ -309,11 +322,16 @@ impl CubeWriter {
|
|
|
309
322
|
}
|
|
310
323
|
}
|
|
311
324
|
|
|
312
|
-
/// The beam for the primary header: the target at
|
|
313
|
-
///
|
|
314
|
-
fn ref_beam_for(target_beams: &[Option<Beam>], meta: &CubeMeta) -> Beam {
|
|
315
|
-
let last = meta.nfreq.saturating_sub(1)
|
|
316
|
-
let ref_idx =
|
|
325
|
+
/// The beam for the primary header: the target at `ref_chan` (CRPIX clamped to
|
|
326
|
+
/// the channel range), else the first valid one, else zero.
|
|
327
|
+
fn ref_beam_for(target_beams: &[Option<Beam>], meta: &CubeMeta, ref_chan: RefChan) -> Beam {
|
|
328
|
+
let last = meta.nfreq.saturating_sub(1);
|
|
329
|
+
let ref_idx = match ref_chan {
|
|
330
|
+
RefChan::Crpix => (meta.crpix_freq - 1.0).clamp(0.0, last as f64) as usize,
|
|
331
|
+
RefChan::First => 0,
|
|
332
|
+
RefChan::Last => last,
|
|
333
|
+
RefChan::Mid => (meta.nfreq / 2).min(last),
|
|
334
|
+
};
|
|
317
335
|
target_beams[ref_idx]
|
|
318
336
|
.or_else(|| target_beams.iter().find_map(|b| *b))
|
|
319
337
|
.unwrap_or(Beam::zero())
|
|
@@ -12,7 +12,7 @@ use convolve_rs::{
|
|
|
12
12
|
beam::Beam,
|
|
13
13
|
common_beam::{common_beam, fits_in_beam},
|
|
14
14
|
convolve_uv::FftPlans,
|
|
15
|
-
cube_io::{self, CubeElem, CubeMeta, CubeMode, CubeReader, CubeWriter, PixelType},
|
|
15
|
+
cube_io::{self, CubeElem, CubeMeta, CubeMode, CubeReader, CubeWriter, PixelType, RefChan},
|
|
16
16
|
fits_io::{FitsImageHeader, output_path, read_fits_header, read_fits_plane, write_fits},
|
|
17
17
|
smooth::smooth,
|
|
18
18
|
};
|
|
@@ -98,9 +98,26 @@ struct SharedArgs {
|
|
|
98
98
|
/// Verbose output (-v, -vv).
|
|
99
99
|
#[arg(short, long, action = clap::ArgAction::Count)]
|
|
100
100
|
verbose: u8,
|
|
101
|
+
|
|
102
|
+
/// Threads to use [default: all cores, or RAYON_NUM_THREADS].
|
|
103
|
+
#[arg(short = 'n', long)]
|
|
104
|
+
ncores: Option<usize>,
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
impl SharedArgs {
|
|
108
|
+
/// Logging, then the thread pool every parallel step runs on.
|
|
109
|
+
fn init(&self) -> Result<()> {
|
|
110
|
+
init_logging(self.verbose);
|
|
111
|
+
if let Some(n) = self.ncores {
|
|
112
|
+
anyhow::ensure!(n > 0, "--ncores must be at least 1");
|
|
113
|
+
rayon::ThreadPoolBuilder::new()
|
|
114
|
+
.num_threads(n)
|
|
115
|
+
.build_global()
|
|
116
|
+
.context("setting up the thread pool")?;
|
|
117
|
+
}
|
|
118
|
+
Ok(())
|
|
119
|
+
}
|
|
120
|
+
|
|
104
121
|
fn output_for(&self, file: &Path) -> PathBuf {
|
|
105
122
|
output_path(
|
|
106
123
|
file,
|
|
@@ -145,7 +162,7 @@ struct BeamLogEntry2D {
|
|
|
145
162
|
}
|
|
146
163
|
|
|
147
164
|
fn cmd_2d(args: TwoDArgs) -> Result<()> {
|
|
148
|
-
|
|
165
|
+
args.shared.init()?;
|
|
149
166
|
let files = collect_files(&args.infile, args.listfile)?;
|
|
150
167
|
let cutoff = args.shared.cutoff;
|
|
151
168
|
|
|
@@ -333,37 +350,58 @@ struct ThreeDArgs {
|
|
|
333
350
|
/// Common-beam mode.
|
|
334
351
|
#[arg(long, default_value = "natural", value_enum)]
|
|
335
352
|
mode: ModeArg,
|
|
353
|
+
|
|
354
|
+
/// Channel whose beam goes in the output header's BMAJ/BMIN/BPA
|
|
355
|
+
/// [default: the spectral axis' CRPIX].
|
|
356
|
+
#[arg(long, value_enum)]
|
|
357
|
+
ref_chan: Option<RefChanArg>,
|
|
358
|
+
|
|
359
|
+
/// Reuse the target beams of a previous run, read from each output cube's
|
|
360
|
+
/// beamlog, instead of solving for them.
|
|
361
|
+
#[arg(long, conflicts_with_all = ["bmaj", "bmin", "bpa"])]
|
|
362
|
+
uselogs: bool,
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
#[derive(Clone, Copy, Debug, ValueEnum)]
|
|
366
|
+
enum RefChanArg {
|
|
367
|
+
/// The first channel.
|
|
368
|
+
First,
|
|
369
|
+
/// The last channel.
|
|
370
|
+
Last,
|
|
371
|
+
/// The middle channel (the upper middle for an even count).
|
|
372
|
+
Mid,
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
impl From<RefChanArg> for RefChan {
|
|
376
|
+
fn from(r: RefChanArg) -> Self {
|
|
377
|
+
match r {
|
|
378
|
+
RefChanArg::First => RefChan::First,
|
|
379
|
+
RefChanArg::Last => RefChan::Last,
|
|
380
|
+
RefChanArg::Mid => RefChan::Mid,
|
|
381
|
+
}
|
|
382
|
+
}
|
|
336
383
|
}
|
|
337
384
|
|
|
338
385
|
fn cmd_3d(args: ThreeDArgs) -> Result<()> {
|
|
339
|
-
|
|
386
|
+
args.shared.init()?;
|
|
340
387
|
let files = collect_files(&args.infile, args.listfile)?;
|
|
341
388
|
let metas = read_cube_metas(&files)?;
|
|
342
389
|
let nfreq = metas[0].nfreq;
|
|
343
390
|
let mode = CubeMode::from(args.mode);
|
|
391
|
+
let ref_chan = args.ref_chan.map_or(RefChan::default(), RefChan::from);
|
|
344
392
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
vec![Some(finish_target(b, &valid, args.shared.circularise)?); nfreq]
|
|
354
|
-
}
|
|
355
|
-
None => {
|
|
356
|
-
let sp = spinner(match mode {
|
|
357
|
-
CubeMode::Natural => "Solving for per-channel common beams…",
|
|
358
|
-
CubeMode::Total => "Solving for the common beam across all channels…",
|
|
359
|
-
});
|
|
360
|
-
let beams = compute_target_beams(&metas, mode, &args.shared)?;
|
|
361
|
-
sp.finish_and_clear();
|
|
362
|
-
beams
|
|
363
|
-
}
|
|
393
|
+
// One set of targets per cube: shared, unless read back from each one's log.
|
|
394
|
+
let per_cube: Vec<Vec<Option<Beam>>> = if args.uselogs {
|
|
395
|
+
metas
|
|
396
|
+
.iter()
|
|
397
|
+
.map(|m| read_previous_targets(&args.shared.output_for(&m.path), nfreq))
|
|
398
|
+
.collect::<Result<_>>()?
|
|
399
|
+
} else {
|
|
400
|
+
vec![solve_targets(&args, &metas, mode)?; metas.len()]
|
|
364
401
|
};
|
|
402
|
+
let target_beams = &per_cube[0];
|
|
365
403
|
|
|
366
|
-
let all_same = report_targets(
|
|
404
|
+
let all_same = report_targets(target_beams);
|
|
367
405
|
if args.shared.dryrun {
|
|
368
406
|
// stdout, so callers can capture it: one beam if all channels share
|
|
369
407
|
// it, else one `<channel> <beam>` line per channel.
|
|
@@ -383,21 +421,22 @@ fn cmd_3d(args: ThreeDArgs) -> Result<()> {
|
|
|
383
421
|
}
|
|
384
422
|
|
|
385
423
|
let pb = progress_bar((files.len() * nfreq) as u64);
|
|
386
|
-
for meta in &
|
|
424
|
+
for (meta, target_beams) in metas.iter().zip(&per_cube) {
|
|
387
425
|
let file = &meta.path;
|
|
388
426
|
let out = args.shared.output_for(file);
|
|
389
427
|
pb.suspend(|| info!("Initialising output cube {} …", out.display()));
|
|
390
428
|
pb.set_message("processing");
|
|
429
|
+
let cutoff = args.shared.cutoff;
|
|
391
430
|
match meta.dtype {
|
|
392
431
|
PixelType::F32 => {
|
|
393
|
-
process_cube::<f32>(&out, meta,
|
|
432
|
+
process_cube::<f32>(&out, meta, target_beams, mode, ref_chan, cutoff, &pb)?
|
|
394
433
|
}
|
|
395
434
|
PixelType::F64 => {
|
|
396
|
-
process_cube::<f64>(&out, meta,
|
|
435
|
+
process_cube::<f64>(&out, meta, target_beams, mode, ref_chan, cutoff, &pb)?
|
|
397
436
|
}
|
|
398
437
|
}
|
|
399
438
|
let beamlog = cube_io::beamlog_path(&out);
|
|
400
|
-
cube_io::write_beamlog(&beamlog,
|
|
439
|
+
cube_io::write_beamlog(&beamlog, target_beams)
|
|
401
440
|
.with_context(|| format!("writing beamlog {}", beamlog.display()))?;
|
|
402
441
|
pb.suspend(|| info!("{} → {}", file.display(), out.display()));
|
|
403
442
|
}
|
|
@@ -405,6 +444,53 @@ fn cmd_3d(args: ThreeDArgs) -> Result<()> {
|
|
|
405
444
|
Ok(())
|
|
406
445
|
}
|
|
407
446
|
|
|
447
|
+
/// The target beams a previous run wrote to the beamlog of output `out`.
|
|
448
|
+
fn read_previous_targets(out: &Path, nfreq: usize) -> Result<Vec<Option<Beam>>> {
|
|
449
|
+
let log = cube_io::beamlog_path(out);
|
|
450
|
+
let beams = cube_io::read_beamlog(&log)
|
|
451
|
+
.with_context(|| format!("reading the previous run's beamlog {}", log.display()))?;
|
|
452
|
+
anyhow::ensure!(
|
|
453
|
+
beams.len() == nfreq,
|
|
454
|
+
"{}: {} channels, but the cube has {nfreq}",
|
|
455
|
+
log.display(),
|
|
456
|
+
beams.len()
|
|
457
|
+
);
|
|
458
|
+
info!("Target beams read from {}", log.display());
|
|
459
|
+
Ok(beams
|
|
460
|
+
.into_iter()
|
|
461
|
+
.map(|b| (!b.is_zero()).then_some(b))
|
|
462
|
+
.collect())
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/// The per-channel target beams: the requested beam, or the common beams.
|
|
466
|
+
fn solve_targets(
|
|
467
|
+
args: &ThreeDArgs,
|
|
468
|
+
metas: &[CubeMeta],
|
|
469
|
+
mode: CubeMode,
|
|
470
|
+
) -> Result<Vec<Option<Beam>>> {
|
|
471
|
+
let nfreq = metas[0].nfreq;
|
|
472
|
+
Ok(match parse_target_beam(&args.shared)? {
|
|
473
|
+
Some(b) => {
|
|
474
|
+
let valid: Vec<Beam> = metas
|
|
475
|
+
.iter()
|
|
476
|
+
.flat_map(|m| m.beams.iter().flatten())
|
|
477
|
+
.copied()
|
|
478
|
+
.filter(|b| usable_beam(b, args.shared.cutoff))
|
|
479
|
+
.collect();
|
|
480
|
+
vec![Some(finish_target(b, &valid, args.shared.circularise)?); nfreq]
|
|
481
|
+
}
|
|
482
|
+
None => {
|
|
483
|
+
let sp = spinner(match mode {
|
|
484
|
+
CubeMode::Natural => "Solving for per-channel common beams…",
|
|
485
|
+
CubeMode::Total => "Solving for the common beam across all channels…",
|
|
486
|
+
});
|
|
487
|
+
let beams = compute_target_beams(metas, mode, &args.shared)?;
|
|
488
|
+
sp.finish_and_clear();
|
|
489
|
+
beams
|
|
490
|
+
}
|
|
491
|
+
})
|
|
492
|
+
}
|
|
493
|
+
|
|
408
494
|
/// Read every cube's metadata and check they can be smoothed together.
|
|
409
495
|
fn read_cube_metas(files: &[PathBuf]) -> Result<Vec<CubeMeta>> {
|
|
410
496
|
let sp = spinner(format!("Reading metadata from {} cube(s)…", files.len()));
|
|
@@ -477,6 +563,7 @@ fn process_cube<T: CubeElem>(
|
|
|
477
563
|
meta: &CubeMeta,
|
|
478
564
|
target_beams: &[Option<Beam>],
|
|
479
565
|
mode: CubeMode,
|
|
566
|
+
ref_chan: RefChan,
|
|
480
567
|
cutoff: Option<f64>,
|
|
481
568
|
pb: &ProgressBar,
|
|
482
569
|
) -> Result<()> {
|
|
@@ -486,8 +573,9 @@ fn process_cube<T: CubeElem>(
|
|
|
486
573
|
|
|
487
574
|
std::thread::scope(|s| {
|
|
488
575
|
let writer = s.spawn(move || -> Result<()> {
|
|
489
|
-
let mut writer =
|
|
490
|
-
.
|
|
576
|
+
let mut writer =
|
|
577
|
+
CubeWriter::create(&meta.path, out, target_beams, mode, meta, ref_chan)
|
|
578
|
+
.with_context(|| format!("initialising output cube {}", out.display()))?;
|
|
491
579
|
for (c, plane) in rx {
|
|
492
580
|
writer
|
|
493
581
|
.write_channel(c, &plane, meta)
|
|
@@ -163,7 +163,7 @@ impl PyBeam {
|
|
|
163
163
|
fn new_instance<'py>(cls: &Bound<'py, PyType>, beam: Beam) -> PyResult<Bound<'py, PyBeam>> {
|
|
164
164
|
Ok(cls
|
|
165
165
|
.call1((beam.major_deg(), beam.minor_deg(), beam.pa_deg()))?
|
|
166
|
-
.
|
|
166
|
+
.cast_into::<PyBeam>()?)
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
/// The smallest beam every beam in ``beams`` can be convolved to.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//! Cube I/O round trips and end-to-end `convolvers 3d` runs.
|
|
2
2
|
|
|
3
3
|
use convolve_rs::beam::Beam;
|
|
4
|
-
use convolve_rs::cube_io::{self, CubeElem, CubeMode, CubeReader, CubeWriter};
|
|
4
|
+
use convolve_rs::cube_io::{self, CubeElem, CubeMode, CubeReader, CubeWriter, RefChan};
|
|
5
5
|
use fitsio::FitsFile;
|
|
6
6
|
use fitsio::tables::{ColumnDataType, ColumnDescription};
|
|
7
7
|
use ndarray::Array2;
|
|
@@ -69,7 +69,7 @@ fn write_cube<T: CubeElem>(
|
|
|
69
69
|
meta: &cube_io::CubeMeta,
|
|
70
70
|
planes: &[Array2<T>],
|
|
71
71
|
) -> Result<(), cube_io::CubeError> {
|
|
72
|
-
let mut w = CubeWriter::create(input, out, target, mode, meta)?;
|
|
72
|
+
let mut w = CubeWriter::create(input, out, target, mode, meta, RefChan::default())?;
|
|
73
73
|
for (c, p) in planes.iter().enumerate() {
|
|
74
74
|
w.write_channel(c, p, meta)?;
|
|
75
75
|
}
|
|
@@ -194,8 +194,9 @@ fn natural_mode_write_channel_and_beams() {
|
|
|
194
194
|
|
|
195
195
|
// BEAMS extension must round-trip the per-channel target beams.
|
|
196
196
|
let out_meta = cube_io::read_cube_meta(&out).unwrap();
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
assert_eq!(out_meta.beams.len(), NFREQ);
|
|
198
|
+
for (c, b) in out_meta.beams.iter().enumerate() {
|
|
199
|
+
let b = b.expect("channel beam present");
|
|
199
200
|
assert!((b.major_arcsec() - (25.0 + c as f64)).abs() < 1e-3);
|
|
200
201
|
}
|
|
201
202
|
}
|
|
@@ -953,3 +954,102 @@ fn cli_cutoff_blanks_even_when_target_contains() {
|
|
|
953
954
|
.all(|v| v.is_nan())
|
|
954
955
|
);
|
|
955
956
|
}
|
|
957
|
+
|
|
958
|
+
/// The header BMAJ of `out`, in degrees, against its beamlog's channel `chan`.
|
|
959
|
+
fn header_and_logged_bmaj(out: &std::path::Path, chan: usize) -> (f64, f64) {
|
|
960
|
+
let (bmaj, ..) = read_primary_beam_keys(out);
|
|
961
|
+
let logged = cube_io::read_beamlog(&cube_io::beamlog_path(out)).unwrap();
|
|
962
|
+
(bmaj, logged[chan].major_deg())
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
#[test]
|
|
966
|
+
fn cli_ref_chan_picks_the_header_beam() {
|
|
967
|
+
let dir = workdir("cli_ref_chan");
|
|
968
|
+
let path = dir.join("in.fits");
|
|
969
|
+
make_varied_cube(&path);
|
|
970
|
+
let out = dir.join("in.sm.fits");
|
|
971
|
+
let p = path.to_str().unwrap();
|
|
972
|
+
|
|
973
|
+
// CRPIX3 = 1, so the default is channel 0
|
|
974
|
+
for (flag, chan) in [
|
|
975
|
+
(None, 0),
|
|
976
|
+
(Some("first"), 0),
|
|
977
|
+
(Some("mid"), NFREQ / 2),
|
|
978
|
+
(Some("last"), NFREQ - 1),
|
|
979
|
+
] {
|
|
980
|
+
let mut args = vec!["3d", p, "--mode", "natural"];
|
|
981
|
+
if let Some(f) = flag {
|
|
982
|
+
args.extend(["--ref-chan", f]);
|
|
983
|
+
}
|
|
984
|
+
let (ok, log) = run_cli(&args);
|
|
985
|
+
assert!(ok, "{flag:?}:\n{log}");
|
|
986
|
+
let (header, logged) = header_and_logged_bmaj(&out, chan);
|
|
987
|
+
assert!(
|
|
988
|
+
(header - logged).abs() < 1e-12,
|
|
989
|
+
"{flag:?}: {header} vs channel {chan} {logged}"
|
|
990
|
+
);
|
|
991
|
+
}
|
|
992
|
+
// Channel beams grow with channel, so the choices differ
|
|
993
|
+
let (last, _) = header_and_logged_bmaj(&out, NFREQ - 1);
|
|
994
|
+
let (_, first) = header_and_logged_bmaj(&out, 0);
|
|
995
|
+
assert!(last > first);
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
#[test]
|
|
999
|
+
fn cli_uselogs_reuses_the_previous_targets() {
|
|
1000
|
+
let dir = workdir("cli_uselogs");
|
|
1001
|
+
let path = dir.join("in.fits");
|
|
1002
|
+
make_varied_cube(&path);
|
|
1003
|
+
let p = path.to_str().unwrap();
|
|
1004
|
+
let out = dir.join("in.sm.fits");
|
|
1005
|
+
|
|
1006
|
+
// Without a previous run there is no log to use
|
|
1007
|
+
let (ok, log) = run_cli(&["3d", p, "--uselogs"]);
|
|
1008
|
+
assert!(!ok && log.contains("beamlog"), "{log}");
|
|
1009
|
+
|
|
1010
|
+
let (ok, log) = run_cli(&["3d", p, "--mode", "natural"]);
|
|
1011
|
+
assert!(ok, "{log}");
|
|
1012
|
+
// Hand-edit the log: the rerun must convolve to these, not re-solve
|
|
1013
|
+
let log_path = cube_io::beamlog_path(&out);
|
|
1014
|
+
let mut text = String::from("# Channel BMAJ[arcsec] BMIN[arcsec] BPA[deg]\n");
|
|
1015
|
+
for c in 0..NFREQ {
|
|
1016
|
+
text += &format!("{c} 40 35 10\n");
|
|
1017
|
+
}
|
|
1018
|
+
std::fs::write(&log_path, text).unwrap();
|
|
1019
|
+
|
|
1020
|
+
let (ok, log) = run_cli(&["3d", p, "--mode", "natural", "--uselogs"]);
|
|
1021
|
+
assert!(ok, "{log}");
|
|
1022
|
+
let meta = cube_io::read_cube_meta(&out).unwrap();
|
|
1023
|
+
for b in &meta.beams {
|
|
1024
|
+
let b = b.expect("every channel has a target");
|
|
1025
|
+
assert!((b.major_arcsec() - 40.0).abs() < 1e-3, "{b}");
|
|
1026
|
+
assert!((b.minor_arcsec() - 35.0).abs() < 1e-3, "{b}");
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
// A target beam and --uselogs contradict each other
|
|
1030
|
+
let (ok, _) = run_cli(&[
|
|
1031
|
+
"3d",
|
|
1032
|
+
p,
|
|
1033
|
+
"--uselogs",
|
|
1034
|
+
"--bmaj",
|
|
1035
|
+
"50",
|
|
1036
|
+
"--bmin",
|
|
1037
|
+
"50",
|
|
1038
|
+
"--bpa",
|
|
1039
|
+
"0",
|
|
1040
|
+
]);
|
|
1041
|
+
assert!(!ok);
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
#[test]
|
|
1045
|
+
fn cli_ncores_sets_the_thread_count() {
|
|
1046
|
+
let dir = workdir("cli_ncores");
|
|
1047
|
+
let path = dir.join("in.fits");
|
|
1048
|
+
make_varied_cube(&path);
|
|
1049
|
+
let p = path.to_str().unwrap();
|
|
1050
|
+
let (ok, log) = run_cli(&["3d", p, "--mode", "total", "--ncores", "1"]);
|
|
1051
|
+
assert!(ok, "{log}");
|
|
1052
|
+
assert!(dir.join("in.sm.fits").exists());
|
|
1053
|
+
let (ok, log) = run_cli(&["3d", p, "--ncores", "0"]);
|
|
1054
|
+
assert!(!ok && log.contains("--ncores"), "{log}");
|
|
1055
|
+
}
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|