|
4 | 4 | __author__ = "Wasim Raja" |
5 | 5 |
|
6 | 6 | import gc |
7 | | -from typing import Literal, NamedTuple, Optional |
| 7 | +from typing import Literal, NamedTuple |
8 | 8 |
|
9 | 9 | import numpy as np |
10 | 10 | import scipy.signal |
@@ -134,7 +134,7 @@ def convolve( |
134 | 134 | new_beam: Beam, |
135 | 135 | dx: u.Quantity, |
136 | 136 | dy: u.Quantity, |
137 | | - cutoff: Optional[float] = None, |
| 137 | + cutoff: float | None = None, |
138 | 138 | ) -> ConvolutionResult: |
139 | 139 | """Convolve by X-ing in the Fourier domain. |
140 | 140 | - convolution with Gaussian kernels only |
@@ -248,7 +248,7 @@ def convolve_scipy( |
248 | 248 | new_beam: Beam, |
249 | 249 | dx: u.Quantity, |
250 | 250 | dy: u.Quantity, |
251 | | - cutoff: Optional[float] = None, |
| 251 | + cutoff: float | None = None, |
252 | 252 | ) -> ConvolutionResult: |
253 | 253 | """Convolve using scipy's convolution |
254 | 254 |
|
@@ -296,7 +296,7 @@ def convolve_astropy( |
296 | 296 | new_beam: Beam, |
297 | 297 | dx: u.Quantity, |
298 | 298 | dy: u.Quantity, |
299 | | - cutoff: Optional[float] = None, |
| 299 | + cutoff: float | None = None, |
300 | 300 | ) -> ConvolutionResult: |
301 | 301 | """Convolve using astropy's convolution |
302 | 302 |
|
@@ -347,7 +347,7 @@ def convolve_astropy_fft( |
347 | 347 | new_beam: Beam, |
348 | 348 | dx: u.Quantity, |
349 | 349 | dy: u.Quantity, |
350 | | - cutoff: Optional[float] = None, |
| 350 | + cutoff: float | None = None, |
351 | 351 | ) -> ConvolutionResult: |
352 | 352 | """Convolve using astropy's FFT convolution |
353 | 353 |
|
@@ -434,7 +434,7 @@ def get_convolving_beam( |
434 | 434 | new_beam: Beam, |
435 | 435 | dx: u.Quantity, |
436 | 436 | dy: u.Quantity, |
437 | | - cutoff: Optional[float] = None, |
| 437 | + cutoff: float | None = None, |
438 | 438 | ) -> tuple[Beam, float]: |
439 | 439 | """Get the beam to use for smoothing |
440 | 440 |
|
@@ -502,7 +502,7 @@ def smooth( |
502 | 502 | dx: u.Quantity, |
503 | 503 | dy: u.Quantity, |
504 | 504 | conv_mode: Literal["robust", "scipy", "astropy", "astropy_fft"] = "robust", |
505 | | - cutoff: Optional[float] = None, |
| 505 | + cutoff: float | None = None, |
506 | 506 | ) -> np.ndarray: |
507 | 507 | """Apply smoothing to image in Jy/beam |
508 | 508 |
|
|
0 commit comments