esa-snappy 1.0.3__cp313-none-any.whl → 1.1.0__cp313-none-any.whl

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.
Files changed (27) hide show
  1. esa_snappy/examples/snappy_bmaths.py +1 -5
  2. esa_snappy/examples/snappy_flh.py +1 -5
  3. esa_snappy/examples/snappy_geo_roi.py +1 -4
  4. esa_snappy/examples/snappy_ndvi.py +1 -5
  5. esa_snappy/examples/snappy_ndvi_with_masks.py +1 -5
  6. esa_snappy/examples/snappy_reader_writer_formats.py +0 -5
  7. esa_snappy/examples/snappy_subset.py +2 -5
  8. esa_snappy/examples/snappy_write_image.py +1 -5
  9. esa_snappy/snapista/binning/aggregator_avg.py +7 -7
  10. esa_snappy/snapista/binning/aggregator_avg_outlier.py +2 -2
  11. esa_snappy/snapista/binning/aggregator_minmax.py +2 -2
  12. esa_snappy/snapista/binning/aggregator_on_max_set.py +3 -3
  13. esa_snappy/snapista/binning/aggregator_percentile.py +2 -2
  14. esa_snappy/snapista/binning/aggregator_sum.py +2 -2
  15. esa_snappy/snapista/binning/binning_band.py +2 -2
  16. esa_snappy/snapista/demo/data/subset_0_of_S3A_OL_1_ERR____20160701T092853_20160701T093053_20170919T102725_0119_006_036______MR1_R_NT_002.nc +0 -0
  17. esa_snappy/snapista/demo/data/subset_1_of_S3A_OL_2_WRR____20210304T082509_20210304T090900_20210609T141823_2631_069_121______MAR_R_NT_003.nc +0 -0
  18. esa_snappy/snapista/demo/data/subset_1_of_S3A_OL_2_WRR____20210308T082053_20210308T090445_20210609T070006_2632_069_178______MAR_R_NT_003.nc +0 -0
  19. esa_snappy/snapista/demo/snapista-demo-bandmaths.ipynb +418 -0
  20. esa_snappy/snapista/demo/snapista-demo-binning.ipynb +438 -0
  21. esa_snappy/snapista/graph.py +28 -13
  22. esa_snappy/snappyutil.py +20 -45
  23. {esa_snappy-1.0.3.dist-info → esa_snappy-1.1.0.dist-info}/METADATA +4 -3
  24. {esa_snappy-1.0.3.dist-info → esa_snappy-1.1.0.dist-info}/RECORD +27 -22
  25. {esa_snappy-1.0.3.dist-info → esa_snappy-1.1.0.dist-info}/WHEEL +1 -1
  26. {esa_snappy-1.0.3.dist-info → esa_snappy-1.1.0.dist-info/licenses}/LICENSE +0 -0
  27. {esa_snappy-1.0.3.dist-info → esa_snappy-1.1.0.dist-info}/top_level.txt +0 -0
@@ -2,17 +2,13 @@ import sys
2
2
 
3
3
  # This example requires a MERIS L1b product as input
4
4
 
5
- # This relative path is for the esa_snappy test setup only, as the esa_snappy module is located two folder levels above.
6
- # Adapt this path if script shall be run from a different location!
7
- sys.path.append('../../')
8
-
9
5
  from esa_snappy import GPF
10
6
  from esa_snappy import HashMap
11
7
  from esa_snappy import ProductIO
12
8
  from esa_snappy import jpy
13
9
 
14
10
  if len(sys.argv) != 2:
15
- print("usage: %s <file>" % sys.argv[0])
11
+ print("usage: %s <MERIS L1b product>" % sys.argv[0])
16
12
  sys.exit(1)
17
13
 
18
14
  file = sys.argv[1]
@@ -3,10 +3,6 @@ import sys
3
3
 
4
4
  # This example requires a MERIS L2 water product as input
5
5
 
6
- # This relative path is for the esa_snappy test setup only, as the esa_snappy module is located two folder levels above.
7
- # Adapt this path if script shall be run from a different location!
8
- sys.path.append('../../')
9
-
10
6
  from esa_snappy import Product
11
7
  from esa_snappy import ProductData
12
8
  from esa_snappy import ProductIO
@@ -15,7 +11,7 @@ from esa_snappy import String
15
11
 
16
12
 
17
13
  if len(sys.argv) != 2:
18
- print("usage: %s <file>" % sys.argv[0]);
14
+ print("usage: %s <MERIS L2 water product>" % sys.argv[0]);
19
15
  sys.exit(1)
20
16
 
21
17
  print("Reading...")
@@ -2,10 +2,6 @@
2
2
 
3
3
  import sys
4
4
 
5
- # This relative path is for the esa_snappy test setup only, as the esa_snappy module is located two folder levels above.
6
- # Adapt this path if script shall be run from a different location!
7
- sys.path.append('../../')
8
-
9
5
  from esa_snappy import (ProgressMonitor, VectorDataNode,
10
6
  WKTReader, ProductIO, PlainFeatureFactory,
11
7
  SimpleFeatureBuilder, DefaultGeographicCRS,
@@ -13,6 +9,7 @@ from esa_snappy import (ProgressMonitor, VectorDataNode,
13
9
 
14
10
  if len(sys.argv) != 3:
15
11
  print("usage: %s <inputProduct> <wkt>" % sys.argv[0])
12
+ print(" e.g.: %s ./TEST.dim \"POLYGON((15.786082 45.30223, 11.798364 46.118263, 10.878688 43.61961, 14.72272742.85818, 15.786082 45.30223))\"" % sys.argv[0])
16
13
  sys.exit(1)
17
14
 
18
15
  input = sys.argv[1]
@@ -4,10 +4,6 @@ import numpy
4
4
 
5
5
  # This example requires a MERIS L1b product as input
6
6
 
7
- # This relative path is for the esa_snappy test setup only, as the esa_snappy module is located two folder levels above.
8
- # Adapt this path if script shall be run from a different location!
9
- sys.path.append('../../')
10
-
11
7
  from esa_snappy import Product
12
8
  from esa_snappy import ProductData
13
9
  from esa_snappy import ProductIO
@@ -15,7 +11,7 @@ from esa_snappy import ProductUtils
15
11
  from esa_snappy import FlagCoding
16
12
 
17
13
  if len(sys.argv) != 2:
18
- print("usage: %s <file>" % sys.argv[0])
14
+ print("usage: %s <MERIS L1b product>" % sys.argv[0])
19
15
  sys.exit(1)
20
16
 
21
17
  file = sys.argv[1]
@@ -4,10 +4,6 @@ import numpy
4
4
 
5
5
  # This example requires a MERIS L1b product as input
6
6
 
7
- # This relative path is for the esa_snappy test setup only, as the esa_snappy module is located two folder levels above.
8
- # Adapt this path if script shall be run from a different location!
9
- sys.path.append('../../')
10
-
11
7
  from esa_snappy import String
12
8
  from esa_snappy import Product
13
9
  from esa_snappy import ProductData
@@ -16,7 +12,7 @@ from esa_snappy import ProductUtils
16
12
 
17
13
 
18
14
  if len(sys.argv) != 2:
19
- print("usage: %s <file>" % sys.argv[0]);
15
+ print("usage: %s <MERIS L1b product>" % sys.argv[0]);
20
16
  sys.exit(1)
21
17
 
22
18
  print("Reading...")
@@ -1,8 +1,3 @@
1
- import sys
2
-
3
- # This relative path is for the esa_snappy test setup only, as the esa_snappy module is located two folder levels above.
4
- # Adapt this path if script shall be run from a different location!
5
- sys.path.append('../../')
6
1
  from esa_snappy import jpy
7
2
 
8
3
  ProductIOPlugInManager = jpy.get_type('org.esa.snap.core.dataio.ProductIOPlugInManager')
@@ -2,17 +2,14 @@ import sys
2
2
 
3
3
  # This example requires an arbitrary input product which can be read by SNAP
4
4
 
5
- # This relative path is for the esa_snappy test setup only, as the esa_snappy module is located two folder levels above.
6
- # Adapt this path if script shall be run from a different location!
7
- sys.path.append('../../')
8
5
  import esa_snappy
9
6
  from esa_snappy import ProductIO, WKTReader
10
7
 
11
8
  SubsetOp = esa_snappy.jpy.get_type('org.esa.snap.core.gpf.common.SubsetOp')
12
9
 
13
10
  if len(sys.argv) != 3:
14
- print("usage: %s <file> <geometry-wkt>" % sys.argv[0])
15
- print(" %s ./TEST.N1 \"POLYGON((15.786082 45.30223, 11.798364 46.118263, 10.878688 43.61961, 14.722727"
11
+ print("usage: %s <input product> <geometry-wkt>" % sys.argv[0])
12
+ print(" e.g.: %s ./TEST.dim \"POLYGON((15.786082 45.30223, 11.798364 46.118263, 10.878688 43.61961, 14.722727"
16
13
  "42.85818, 15.786082 45.30223))\"" % sys.argv[0])
17
14
  sys.exit(1)
18
15
 
@@ -2,15 +2,11 @@ import sys
2
2
 
3
3
  # This example requires a MERIS L1b product as input
4
4
 
5
- # This relative path is for the esa_snappy test setup only, as the esa_snappy module is located two folder levels above.
6
- # Adapt this path if script shall be run from a different location!
7
- sys.path.append('../../')
8
-
9
5
  import esa_snappy
10
6
  from esa_snappy import (ProductIO, ProductUtils, ProgressMonitor)
11
7
 
12
8
  if len(sys.argv) != 2:
13
- print("usage: %s <file>" % sys.argv[0])
9
+ print("usage: %s <MERIS L1b product>" % sys.argv[0])
14
10
  sys.exit(1)
15
11
 
16
12
  file = sys.argv[1]
@@ -15,17 +15,17 @@ class AggregatorAvg(object):
15
15
  # outputSums = attr.ib(default="true")
16
16
 
17
17
  type = field(init=False, default="AVG")
18
- var_name = field()
19
- target_name = field()
20
- weight_coeff = field(default=0.0)
21
- output_counts = field(default="true")
22
- output_sums = field(default="true")
23
- @output_counts.validator
18
+ varName = field()
19
+ targetName = field()
20
+ weightCoeff = field(default=0.0)
21
+ outputCounts = field(default="true")
22
+ outputSums = field(default="true")
23
+ @outputCounts.validator
24
24
  def _check_type(self, attribute, value):
25
25
  if value not in ["true", "false"]:
26
26
  raise ValueError("output_counts value is either 'true' or 'false'")
27
27
 
28
- @output_sums.validator
28
+ @outputSums.validator
29
29
  def _check_type(self, attribute, value):
30
30
  if value not in ["true", "false"]:
31
31
  raise ValueError("output_sums value is either 'true' or 'false'")
@@ -6,8 +6,8 @@ from attrs import asdict, define, field
6
6
  class AggregatorAvgOutlier(object):
7
7
 
8
8
  type = field(init=False, default="AVG_OUTLIER")
9
- var_name = field()
10
- target_name = field()
9
+ varName = field()
10
+ targetName = field()
11
11
 
12
12
  def __str__(self):
13
13
 
@@ -6,8 +6,8 @@ import lxml.etree as etree
6
6
  class AggregatorMinMax(object):
7
7
 
8
8
  type = field(init=False, default="MIN_MAX")
9
- var_name = field()
10
- target_name = field()
9
+ varName = field()
10
+ targetName = field()
11
11
 
12
12
  def __str__(self):
13
13
 
@@ -6,9 +6,9 @@ import lxml.etree as etree
6
6
  class AggregatorOnMaxSet(object):
7
7
 
8
8
  type = field(init=False, default="ON_MAX_SET")
9
- target_name = field()
10
- on_max_var_name = field()
11
- set_var_names = field(default=None)
9
+ targetName = field()
10
+ onMaxVarName = field()
11
+ setVarNames = field(default=None)
12
12
 
13
13
  def __str__(self):
14
14
 
@@ -6,8 +6,8 @@ import lxml.etree as etree
6
6
  class AggregatorPercentile(object):
7
7
 
8
8
  type = field(init=False, default="PERCENTILE")
9
- var_name = field()
10
- target_name = field()
9
+ varName = field()
10
+ targetName = field()
11
11
  percentage = field(default=90)
12
12
 
13
13
  @percentage.validator
@@ -6,8 +6,8 @@ import lxml.etree as etree
6
6
  class AggregatorSum(object):
7
7
 
8
8
  type = field(init=False, default="SUM")
9
- var_name = field()
10
- target_name = field()
9
+ varName = field()
10
+ targetName = field()
11
11
 
12
12
  def __str__(self):
13
13
 
@@ -7,8 +7,8 @@ class BinningBand(object):
7
7
 
8
8
  index = field()
9
9
  name = field()
10
- min_value = field()
11
- max_value = field()
10
+ minValue = field()
11
+ maxValue = field()
12
12
 
13
13
  def __str__(self):
14
14
 
@@ -0,0 +1,418 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "eff9f1b9-ebce-4968-aa1d-eb33efd37813",
6
+ "metadata": {},
7
+ "source": [
8
+ "## Snapista Demo notebook - Using band maths, setting up operators, creating and running a graph..."
9
+ ]
10
+ },
11
+ {
12
+ "cell_type": "code",
13
+ "execution_count": 1,
14
+ "id": "77db105d",
15
+ "metadata": {},
16
+ "outputs": [
17
+ {
18
+ "name": "stdout",
19
+ "output_type": "stream",
20
+ "text": [
21
+ "Python version: 3.11.9 | packaged by Anaconda, Inc. | (main, Apr 19 2024, 16:40:41) [MSC v.1916 64 bit (AMD64)]\n",
22
+ "Location of esa_snappy package: D:\\olaf\\miniconda3_py311\\Lib\\site-packages\\esa_snappy\n"
23
+ ]
24
+ }
25
+ ],
26
+ "source": [
27
+ "# Some information...\n",
28
+ "\n",
29
+ "import os\n",
30
+ "import sys\n",
31
+ "print(\"Python version: \" + sys.version)\n",
32
+ "\n",
33
+ "import sysconfig\n",
34
+ "print(\"Location of esa_snappy package: \" + sysconfig.get_paths()['purelib'] + os.sep + \"esa_snappy\")"
35
+ ]
36
+ },
37
+ {
38
+ "cell_type": "code",
39
+ "execution_count": 2,
40
+ "id": "f3b2ca32-63fc-4a92-8be4-5f459be87a9f",
41
+ "metadata": {},
42
+ "outputs": [],
43
+ "source": [
44
+ "# Import esa_snappy and snapista...\n",
45
+ "\n",
46
+ "import esa_snappy\n",
47
+ "import snapista\n",
48
+ "\n",
49
+ "from snapista import Graph\n",
50
+ "from snapista import Operator\n",
51
+ "from snapista import read_file\n",
52
+ "from snapista import TargetBand\n",
53
+ "from snapista import TargetBandDescriptors"
54
+ ]
55
+ },
56
+ {
57
+ "cell_type": "code",
58
+ "execution_count": 3,
59
+ "id": "d0ac6a29-c799-41b2-b028-e55a3315de63",
60
+ "metadata": {},
61
+ "outputs": [],
62
+ "source": [
63
+ "# Set up a graph...\n",
64
+ "\n",
65
+ "try:\n",
66
+ " g = Graph()\n",
67
+ "except Exception as ex:\n",
68
+ " print(\"Cannot set up Snapista Graph():\", ex)"
69
+ ]
70
+ },
71
+ {
72
+ "cell_type": "code",
73
+ "execution_count": 4,
74
+ "id": "1a94bc96-3104-4726-b01c-48fad9cfb5d6",
75
+ "metadata": {},
76
+ "outputs": [],
77
+ "source": [
78
+ "# Add 'Read' operator to the graph for reading example input...\n",
79
+ "\n",
80
+ "g.add_node(operator=Operator(\"Read\", file='./data/subset_0_of_S3A_OL_1_ERR____20160701T092853_20160701T093053_20170919T102725_0119_006_036______MR1_R_NT_002.nc'), node_id=\"Read\")\n"
81
+ ]
82
+ },
83
+ {
84
+ "cell_type": "code",
85
+ "execution_count": 5,
86
+ "id": "96b93cd5-2f58-442b-88c3-ce4cbc793661",
87
+ "metadata": {},
88
+ "outputs": [],
89
+ "source": [
90
+ "# Set up a 'BandMaths' operator to compute a simple NDVI. Set up a target band for NDVI result...\n",
91
+ "\n",
92
+ "band_maths = Operator('BandMaths')\n",
93
+ "\n",
94
+ "ndvi = TargetBand(name='ndvi', expression='(Oa08_radiance - Oa17_radiance)/(Oa08_radiance + Oa17_radiance)')\n",
95
+ " \n",
96
+ "band_maths.targetBandDescriptors = TargetBandDescriptors([ndvi])"
97
+ ]
98
+ },
99
+ {
100
+ "cell_type": "code",
101
+ "execution_count": 6,
102
+ "id": "1564302c-f7a2-47a2-a5f6-85147b88536b",
103
+ "metadata": {},
104
+ "outputs": [
105
+ {
106
+ "name": "stdout",
107
+ "output_type": "stream",
108
+ "text": [
109
+ "targetBandDescriptors <snapista.target_band_descriptors.TargetBandDescriptors object at 0x000001B75A9730D0>\n",
110
+ "Instance TargetBandDescriptors: True\n",
111
+ "Instance Aggregators: False\n",
112
+ "Instance BinningOutputBands: False\n",
113
+ "Instance BinningVariables: False\n",
114
+ "Instance str: False\n"
115
+ ]
116
+ }
117
+ ],
118
+ "source": [
119
+ "# Add 'BandMaths' operator to the graph...\n",
120
+ "\n",
121
+ "g.add_node(operator=band_maths, node_id=\"BandMaths\" ,source='Read')"
122
+ ]
123
+ },
124
+ {
125
+ "cell_type": "code",
126
+ "execution_count": 7,
127
+ "id": "6558126a-e281-497d-a365-3a6b0497762c",
128
+ "metadata": {},
129
+ "outputs": [
130
+ {
131
+ "data": {
132
+ "text/plain": [
133
+ "Operator('BandMerge', sourceBandNames='None', geographicError='1.0E-5f', source='['Read', 'BandMaths']')"
134
+ ]
135
+ },
136
+ "execution_count": 7,
137
+ "metadata": {},
138
+ "output_type": "execute_result"
139
+ }
140
+ ],
141
+ "source": [
142
+ "# Set up a 'Merge' operator to merge input with NDVI result...\n",
143
+ "\n",
144
+ "merge = Operator(\"BandMerge\", source=[\"Read\", \"BandMaths\"])\n",
145
+ "\n",
146
+ "merge"
147
+ ]
148
+ },
149
+ {
150
+ "cell_type": "code",
151
+ "execution_count": 8,
152
+ "id": "216903df-8ef4-403b-9437-5653733120fb",
153
+ "metadata": {},
154
+ "outputs": [],
155
+ "source": [
156
+ "# Add 'Merge' operator to the graph...\n",
157
+ "\n",
158
+ "g.add_node(operator=merge, node_id=\"Merge\", source=[\"Read\", \"BandMaths\"])"
159
+ ]
160
+ },
161
+ {
162
+ "cell_type": "code",
163
+ "execution_count": 9,
164
+ "id": "cc5346c1-d9f6-49b2-8f7a-a59b9104e589",
165
+ "metadata": {},
166
+ "outputs": [
167
+ {
168
+ "data": {
169
+ "text/plain": [
170
+ "Operator('Subset', bandNames='Oa08_radiance,Oa17_radiance,ndvi', tiePointGridNames='None', region='None', referenceBand='None', geoRegion='None', subSamplingX='1', subSamplingY='1', fullSwath='false', copyMetadata='false')"
171
+ ]
172
+ },
173
+ "execution_count": 9,
174
+ "metadata": {},
175
+ "output_type": "execute_result"
176
+ }
177
+ ],
178
+ "source": [
179
+ "# Set up a 'Subset' operator to extract just three bands...\n",
180
+ "\n",
181
+ "subset = Operator('Subset', bandNames=\"Oa08_radiance,Oa17_radiance,ndvi\")\n",
182
+ "\n",
183
+ "subset"
184
+ ]
185
+ },
186
+ {
187
+ "cell_type": "code",
188
+ "execution_count": 10,
189
+ "id": "5120cf7c-9fd4-4c50-a90c-38800b6ba01d",
190
+ "metadata": {},
191
+ "outputs": [],
192
+ "source": [
193
+ "# Add 'Subset' operator to the graph...\n",
194
+ "\n",
195
+ "g.add_node(operator=subset, node_id=\"Subset\", source='Merge')"
196
+ ]
197
+ },
198
+ {
199
+ "cell_type": "code",
200
+ "execution_count": 11,
201
+ "id": "8f90a68b-d124-428e-bdf6-1f3ea070c667",
202
+ "metadata": {},
203
+ "outputs": [
204
+ {
205
+ "data": {
206
+ "text/plain": [
207
+ "Operator('Write', file='None', formatName='BEAM-DIMAP', deleteOutputOnFailure='true', writeEntireTileRows='false', clearCacheAfterRowWrite='false')"
208
+ ]
209
+ },
210
+ "execution_count": 11,
211
+ "metadata": {},
212
+ "output_type": "execute_result"
213
+ }
214
+ ],
215
+ "source": [
216
+ "# Set up a 'Write' operator to write final target product with the three bands...\n",
217
+ "\n",
218
+ "write = Operator(\"Write\")\n",
219
+ "\n",
220
+ "write"
221
+ ]
222
+ },
223
+ {
224
+ "cell_type": "code",
225
+ "execution_count": 12,
226
+ "id": "0548a3a6-cf3c-4f26-a48d-0e92556ee09c",
227
+ "metadata": {},
228
+ "outputs": [],
229
+ "source": [
230
+ "# Add 'Write' operator to the graph. Define a NetCDF output file...\n",
231
+ "\n",
232
+ "g.add_node(operator=Operator(\"Write\", file='./data/snapista_demo_bandmaths_result.nc', formatName='NetCDF4-BEAM'), node_id=\"Write\", source='Subset')"
233
+ ]
234
+ },
235
+ {
236
+ "cell_type": "code",
237
+ "execution_count": 13,
238
+ "id": "825327d3-cc7f-4a1d-840d-52d40a39c4fd",
239
+ "metadata": {},
240
+ "outputs": [
241
+ {
242
+ "name": "stdout",
243
+ "output_type": "stream",
244
+ "text": [
245
+ "<graph>\n",
246
+ " <version>1.0</version>\n",
247
+ " <node id=\"Read\">\n",
248
+ " <operator>Read</operator>\n",
249
+ " <sources/>\n",
250
+ " <parameters class=\"com.bc.ceres.binding.dom.XppDomElement\">\n",
251
+ " <bandNames/>\n",
252
+ " <copyMetadata>true</copyMetadata>\n",
253
+ " <file>./data/subset_0_of_S3A_OL_1_ERR____20160701T092853_20160701T093053_20170919T102725_0119_006_036______MR1_R_NT_002.nc</file>\n",
254
+ " <formatName/>\n",
255
+ " <geometryRegion/>\n",
256
+ " <maskNames/>\n",
257
+ " <pixelRegion/>\n",
258
+ " <useAdvancedOptions>false</useAdvancedOptions>\n",
259
+ " </parameters>\n",
260
+ " </node>\n",
261
+ " <node id=\"BandMaths\">\n",
262
+ " <operator>BandMaths</operator>\n",
263
+ " <sources>\n",
264
+ " <sourceProduct refid=\"Read\"/>\n",
265
+ " </sources>\n",
266
+ " <parameters class=\"com.bc.ceres.binding.dom.XppDomElement\">\n",
267
+ " <targetBands>\n",
268
+ " <targetBand>\n",
269
+ " <name>ndvi</name>\n",
270
+ " <expression>(Oa08_radiance - Oa17_radiance)/(Oa08_radiance + Oa17_radiance)</expression>\n",
271
+ " <type>float32</type>\n",
272
+ " <description/>\n",
273
+ " <unit/>\n",
274
+ " <no_data_value>NaN</no_data_value>\n",
275
+ " </targetBand>\n",
276
+ " </targetBands>\n",
277
+ " <variables/>\n",
278
+ " </parameters>\n",
279
+ " </node>\n",
280
+ " <node id=\"Merge\">\n",
281
+ " <operator>BandMerge</operator>\n",
282
+ " <sources>\n",
283
+ " <sourceProduct refid=\"Read\"/>\n",
284
+ " <sourceProduct.1 refid=\"BandMaths\"/>\n",
285
+ " </sources>\n",
286
+ " <parameters class=\"com.bc.ceres.binding.dom.XppDomElement\">\n",
287
+ " <geographicError>1.0E-5f</geographicError>\n",
288
+ " <sourceBandNames/>\n",
289
+ " </parameters>\n",
290
+ " </node>\n",
291
+ " <node id=\"Subset\">\n",
292
+ " <operator>Subset</operator>\n",
293
+ " <sources>\n",
294
+ " <sourceProduct refid=\"Merge\"/>\n",
295
+ " </sources>\n",
296
+ " <parameters class=\"com.bc.ceres.binding.dom.XppDomElement\">\n",
297
+ " <bandNames>Oa08_radiance,Oa17_radiance,ndvi</bandNames>\n",
298
+ " <copyMetadata>false</copyMetadata>\n",
299
+ " <fullSwath>false</fullSwath>\n",
300
+ " <geoRegion/>\n",
301
+ " <referenceBand/>\n",
302
+ " <region/>\n",
303
+ " <subSamplingX>1</subSamplingX>\n",
304
+ " <subSamplingY>1</subSamplingY>\n",
305
+ " <tiePointGridNames/>\n",
306
+ " </parameters>\n",
307
+ " </node>\n",
308
+ " <node id=\"Write\">\n",
309
+ " <operator>Write</operator>\n",
310
+ " <sources>\n",
311
+ " <sourceProduct refid=\"Subset\"/>\n",
312
+ " </sources>\n",
313
+ " <parameters class=\"com.bc.ceres.binding.dom.XppDomElement\">\n",
314
+ " <clearCacheAfterRowWrite>false</clearCacheAfterRowWrite>\n",
315
+ " <deleteOutputOnFailure>true</deleteOutputOnFailure>\n",
316
+ " <file>./data/snapista_demo_bandmaths_result.nc</file>\n",
317
+ " <formatName>NetCDF4-BEAM</formatName>\n",
318
+ " <writeEntireTileRows>false</writeEntireTileRows>\n",
319
+ " </parameters>\n",
320
+ " </node>\n",
321
+ "</graph>\n",
322
+ "\n"
323
+ ]
324
+ }
325
+ ],
326
+ "source": [
327
+ "# View graph in XML representation...\n",
328
+ "\n",
329
+ "g.view()"
330
+ ]
331
+ },
332
+ {
333
+ "cell_type": "code",
334
+ "execution_count": 14,
335
+ "id": "3328eb96-de62-4fbe-9f05-f0266b22b69d",
336
+ "metadata": {},
337
+ "outputs": [
338
+ {
339
+ "name": "stdout",
340
+ "output_type": "stream",
341
+ "text": [
342
+ "Processing the graph, this may take a while. Please wait...\n",
343
+ "Executing processing graph\n",
344
+ "15%30%45%60%...70%..90% done.\n",
345
+ "SEVERE: org.esa.snap.runtime.Engine: Failed to modify class loader field 'usr_paths'\n",
346
+ "java.lang.NoSuchMethodException: java.lang.ClassLoader.initializePath(java.lang.String)\n",
347
+ "\tat java.base/java.lang.Class.getDeclaredMethod(Class.java:2848)\n",
348
+ "\tat org.esa.snap.runtime.Engine.setJavaLibraryPath(Engine.java:286)\n",
349
+ "\tat org.esa.snap.runtime.Engine.setJavaLibraryPath(Engine.java:265)\n",
350
+ "\tat org.esa.snap.runtime.Engine.<init>(Engine.java:46)\n",
351
+ "\tat org.esa.snap.runtime.Engine.start(Engine.java:117)\n",
352
+ "\tat org.esa.snap.runtime.Engine.start(Engine.java:90)\n",
353
+ "\tat org.esa.snap.runtime.Launcher.run(Launcher.java:51)\n",
354
+ "\tat org.esa.snap.runtime.Launcher.main(Launcher.java:31)\n",
355
+ "\tat java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)\n",
356
+ "\tat java.base/java.lang.reflect.Method.invoke(Method.java:580)\n",
357
+ "\tat com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84)\n",
358
+ "\tat com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)\n",
359
+ "\tat com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)\n",
360
+ "\n",
361
+ "INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters\n",
362
+ "INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.\n",
363
+ "WARNING: org.esa.snap.dataio.netcdf.util.MetadataUtils: Missing configuration property 'snap.dataio.netcdf.metadataElementLimit'. Using default (100).\n",
364
+ "4280 [main] INFO serverStartup - Nc4Iosp: NetCDF-4 C library loaded (jna_path='C:\\Users\\olafd\\.snap\\auxdata\\netcdf_natives\\12.0.0.0\\amd64', libname='netcdf').\n",
365
+ "4287 [main] INFO serverStartup - NetcdfLoader: set log level: old=0 new=0\n",
366
+ "4287 [main] INFO serverStartup - Nc4Iosp: set log level: old=0 new=0\n",
367
+ "Processing finished successfully.\n"
368
+ ]
369
+ },
370
+ {
371
+ "data": {
372
+ "text/plain": [
373
+ "0"
374
+ ]
375
+ },
376
+ "execution_count": 14,
377
+ "metadata": {},
378
+ "output_type": "execute_result"
379
+ }
380
+ ],
381
+ "source": [
382
+ "# Save graph as XML file, then run it...\n",
383
+ "\n",
384
+ "g.save_graph('./data/snapista_demo_bandmaths.xml')\n",
385
+ "g.run()"
386
+ ]
387
+ },
388
+ {
389
+ "cell_type": "code",
390
+ "execution_count": null,
391
+ "id": "eaef2574-6a7d-484b-86f9-69f8f4b531e3",
392
+ "metadata": {},
393
+ "outputs": [],
394
+ "source": []
395
+ }
396
+ ],
397
+ "metadata": {
398
+ "kernelspec": {
399
+ "display_name": "Python 3 (ipykernel)",
400
+ "language": "python",
401
+ "name": "python3"
402
+ },
403
+ "language_info": {
404
+ "codemirror_mode": {
405
+ "name": "ipython",
406
+ "version": 3
407
+ },
408
+ "file_extension": ".py",
409
+ "mimetype": "text/x-python",
410
+ "name": "python",
411
+ "nbconvert_exporter": "python",
412
+ "pygments_lexer": "ipython3",
413
+ "version": "3.11.9"
414
+ }
415
+ },
416
+ "nbformat": 4,
417
+ "nbformat_minor": 5
418
+ }