3
3
import pathlib
4
4
import tempfile
5
5
from dataclasses import dataclass
6
- from typing import Literal , Optional , Union
6
+ from typing import Optional , Union
7
7
8
8
import isce3
9
9
import numpy as np
10
10
from pybind_isce3 .unwrap import _snaphu_unwrap
11
11
12
12
13
- TransmitMode = Literal ["pingpong" , "repeat_pass" , "single_antenna_transmit" ]
14
- TransmitMode .__doc__ = """Radar transmit mode
15
-
16
- 'pingpong' and 'repeat_pass' modes indicate that both antennas both
17
- transmitted and received. Both modes have the same effect in the algorithm.
18
-
19
- 'single_antenna_transmit' indicates that a single antenna was used to
20
- transmit while both antennas received. In this mode, the baseline is
21
- effectively halved.
22
- """
23
-
24
-
25
13
@dataclass (frozen = True )
26
14
class TopoCostParams :
27
15
r"""Configuration parameters for SNAPHU "topo" cost mode
@@ -159,7 +147,7 @@ class TopoCostParams:
159
147
range_res : float
160
148
az_res : float
161
149
wavelength : float
162
- transmit_mode : TransmitMode
150
+ transmit_mode : str
163
151
altitude : float
164
152
earth_radius : float = 6_378_000.0
165
153
kds : float = 0.02
@@ -656,7 +644,7 @@ def tostring(self):
656
644
657
645
658
646
@contextlib .contextmanager
659
- def scratch_directory (d : Optional [os .PathLike ] = None , / ) -> pathlib .Path :
647
+ def scratch_directory (d : Optional [os .PathLike ] = None ) -> pathlib .Path :
660
648
"""Context manager that creates a (possibly temporary) filesystem directory
661
649
662
650
If the input is a path-like object, a directory will be created at the
@@ -772,9 +760,6 @@ def from_flat_file(
772
760
raster .data [i0 :i1 ] = mmap [i0 :i1 ]
773
761
774
762
775
- CostMode = Literal ["topo" , "defo" , "smooth" , "p-norm" ]
776
- CostMode .__doc__ = """SNAPHU cost mode options"""
777
-
778
763
CostParams = Union [
779
764
TopoCostParams , DefoCostParams , SmoothCostParams , PNormCostParams ,
780
765
]
@@ -787,7 +772,7 @@ def unwrap(
787
772
igram : isce3 .io .gdal .Raster ,
788
773
corr : isce3 .io .gdal .Raster ,
789
774
nlooks : float ,
790
- cost : CostMode = "smooth" ,
775
+ cost : str = "smooth" ,
791
776
cost_params : Optional [CostParams ] = None ,
792
777
pwr : Optional [isce3 .io .gdal .Raster ] = None ,
793
778
mask : Optional [isce3 .io .gdal .Raster ] = None ,
0 commit comments