1
1
import os
2
2
from snapista import Graph , Operator
3
3
4
+
4
5
def get_identifier (safe ):
5
6
6
- return os .path .basename (safe ).replace ('.SAFE' , '' )
7
+ return os .path .basename (safe ).replace (".SAFE" , "" )
8
+
7
9
8
10
def graph_calibrate_s1 (safe ):
9
11
10
12
identifier = get_identifier (safe )
11
13
12
- g = Graph ()
13
-
14
- g .add_node (operator = Operator ('Read' ,
15
- formatName = 'SENTINEL-1' ,
16
- file = f'{ safe } ' ),
17
- node_id = 'read' )
18
-
19
-
20
-
21
- g .add_node (operator = Operator ('Apply-Orbit-File' ,
22
- continueOnFail = 'true' ),
23
- node_id = 'apply-orbit-file' ,
24
- source = 'read' )
25
-
26
-
27
- g .add_node (operator = Operator ('Remove-GRD-Border-Noise' ,
28
- borderLimit = '2000' ,
29
- trimThreshold = '0.2' ),
30
- node_id = 'noise-removal' ,
31
- source = 'apply-orbit-file' )
32
-
33
- g .add_node (operator = Operator ('Calibration' ,
34
- selectedPolarisations = 'VV' ),
35
- node_id = 'calibration' ,
36
- source = 'noise-removal' )
37
-
38
-
39
- g .add_node (operator = Operator ('LinearToFromdB' ,
40
- sourceBandNames = 'Sigma0_VV' ),
41
- node_id = 'linear' ,
42
- source = 'calibration' )
43
-
44
-
45
-
46
- g .add_node (operator = Operator ('Terrain-Correction' ,
47
- pixelSpacingInMeter = '20.0' ,
48
- demName = 'SRTM 1Sec HGT' ),
49
- node_id = 'terrain-correction' ,
50
- source = 'linear' )
51
-
52
- g .add_node (operator = Operator ('Write' ,
53
- file = f'{ identifier } _SIGMA0_DB' ,
54
- formatName = 'GeoTIFF-BigTIFF' ),
55
- node_id = 'write' ,
56
- source = 'terrain-correction' )
57
-
58
- return g
14
+ g = Graph ()
15
+
16
+ g .add_node (operator = Operator ("Read" , formatName = "SENTINEL-1" , file = f"{ safe } " ), node_id = "read" )
17
+
18
+ g .add_node (
19
+ operator = Operator ("Apply-Orbit-File" , continueOnFail = "true" ),
20
+ node_id = "apply-orbit-file" ,
21
+ source = "read" ,
22
+ )
23
+
24
+ g .add_node (
25
+ operator = Operator ("Remove-GRD-Border-Noise" , borderLimit = "2000" , trimThreshold = "0.2" ),
26
+ node_id = "noise-removal" ,
27
+ source = "apply-orbit-file" ,
28
+ )
29
+
30
+ g .add_node (
31
+ operator = Operator ("Calibration" , selectedPolarisations = "VV" ),
32
+ node_id = "calibration" ,
33
+ source = "noise-removal" ,
34
+ )
35
+
36
+ g .add_node (
37
+ operator = Operator ("LinearToFromdB" , sourceBandNames = "Sigma0_VV" ),
38
+ node_id = "linear" ,
39
+ source = "calibration" ,
40
+ )
41
+
42
+ g .add_node (
43
+ operator = Operator (
44
+ "Terrain-Correction" , pixelSpacingInMeter = "20.0" , demName = "SRTM 1Sec HGT"
45
+ ),
46
+ node_id = "terrain-correction" ,
47
+ source = "linear" ,
48
+ )
49
+
50
+ g .add_node (
51
+ operator = Operator ("Write" , file = f"{ identifier } _SIGMA0_DB" , formatName = "GeoTIFF-BigTIFF" ),
52
+ node_id = "write" ,
53
+ source = "terrain-correction" ,
54
+ )
55
+
56
+ return g
0 commit comments