sarpyx 0.1.5__py3-none-any.whl → 0.1.6__py3-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.
- docs/examples/advanced/batch_processing.py +1 -1
- docs/examples/advanced/custom_processing_chains.py +1 -1
- docs/examples/advanced/performance_optimization.py +1 -1
- docs/examples/basic/snap_integration.py +1 -1
- docs/examples/intermediate/quality_assessment.py +1 -1
- outputs/baseline/20260205-234828/__init__.py +33 -0
- outputs/baseline/20260205-234828/main.py +493 -0
- outputs/final/20260205-234851/__init__.py +33 -0
- outputs/final/20260205-234851/main.py +493 -0
- sarpyx/__init__.py +2 -2
- sarpyx/algorithms/__init__.py +2 -2
- sarpyx/cli/__init__.py +1 -1
- sarpyx/cli/focus.py +3 -5
- sarpyx/cli/main.py +106 -7
- sarpyx/cli/shipdet.py +1 -1
- sarpyx/cli/worldsar.py +549 -0
- sarpyx/processor/__init__.py +1 -1
- sarpyx/processor/core/decode.py +43 -8
- sarpyx/processor/core/focus.py +104 -57
- sarpyx/science/__init__.py +1 -1
- sarpyx/sla/__init__.py +8 -0
- sarpyx/sla/metrics.py +101 -0
- sarpyx/{snap → snapflow}/__init__.py +1 -1
- sarpyx/snapflow/engine.py +6165 -0
- sarpyx/{snap → snapflow}/op.py +0 -1
- sarpyx/utils/__init__.py +1 -1
- sarpyx/utils/geos.py +652 -0
- sarpyx/utils/grid.py +285 -0
- sarpyx/utils/io.py +77 -9
- sarpyx/utils/meta.py +55 -0
- sarpyx/utils/nisar_utils.py +652 -0
- sarpyx/utils/rfigen.py +108 -0
- sarpyx/utils/wkt_utils.py +109 -0
- sarpyx/utils/zarr_utils.py +55 -37
- {sarpyx-0.1.5.dist-info → sarpyx-0.1.6.dist-info}/METADATA +9 -5
- {sarpyx-0.1.5.dist-info → sarpyx-0.1.6.dist-info}/RECORD +41 -32
- {sarpyx-0.1.5.dist-info → sarpyx-0.1.6.dist-info}/WHEEL +1 -1
- sarpyx-0.1.6.dist-info/licenses/LICENSE +201 -0
- sarpyx-0.1.6.dist-info/top_level.txt +4 -0
- tests/test_zarr_compat.py +35 -0
- sarpyx/processor/core/decode_v0.py +0 -0
- sarpyx/processor/core/decode_v1.py +0 -849
- sarpyx/processor/core/focus_old.py +0 -1550
- sarpyx/processor/core/focus_v1.py +0 -1566
- sarpyx/processor/core/focus_v2.py +0 -1625
- sarpyx/snap/engine.py +0 -633
- sarpyx-0.1.5.dist-info/top_level.txt +0 -2
- {sarpyx-0.1.5.dist-info → sarpyx-0.1.6.dist-info}/entry_points.txt +0 -0
sarpyx/cli/main.py
CHANGED
|
@@ -9,12 +9,6 @@ import argparse
|
|
|
9
9
|
import sys
|
|
10
10
|
from typing import List
|
|
11
11
|
|
|
12
|
-
from .shipdet import main as shipdet_main
|
|
13
|
-
from .decode import main as decode_main
|
|
14
|
-
from .focus import main as focus_main
|
|
15
|
-
from .unzip import main as unzip_main
|
|
16
|
-
from .upload import main as upload_main
|
|
17
|
-
|
|
18
12
|
|
|
19
13
|
def create_main_parser() -> argparse.ArgumentParser:
|
|
20
14
|
"""
|
|
@@ -34,6 +28,7 @@ Available commands:
|
|
|
34
28
|
shipdet Ship detection using SNAP GPT engine
|
|
35
29
|
unzip Extract SAR data from zip archives
|
|
36
30
|
upload Upload data to Hugging Face Hub
|
|
31
|
+
worldsar Process SAR products with SNAP GPT pipelines and tiling
|
|
37
32
|
|
|
38
33
|
Examples:
|
|
39
34
|
sarpyx decode --input /path/to/file.dat --output /path/to/output
|
|
@@ -41,6 +36,9 @@ Examples:
|
|
|
41
36
|
sarpyx shipdet --product-path /path/to/S1A_*.SAFE --outdir /path/to/output
|
|
42
37
|
sarpyx unzip --input /path/to/file.zip --output /path/to/output
|
|
43
38
|
sarpyx upload --folder /path/to/folder --repo username/dataset-name
|
|
39
|
+
sarpyx worldsar --input /path/to/product --output /path/to/output \\
|
|
40
|
+
--cuts-outdir /path/to/tiles --product-wkt "POLYGON ((...))" \\
|
|
41
|
+
--prod-mode S1TOPS
|
|
44
42
|
|
|
45
43
|
For command-specific help:
|
|
46
44
|
sarpyx <command> --help
|
|
@@ -50,7 +48,7 @@ For command-specific help:
|
|
|
50
48
|
parser.add_argument(
|
|
51
49
|
'--version',
|
|
52
50
|
action='version',
|
|
53
|
-
version='sarpyx-cli 0.1.
|
|
51
|
+
version='sarpyx-cli 0.1.6'
|
|
54
52
|
)
|
|
55
53
|
|
|
56
54
|
# Create subparsers for different commands
|
|
@@ -99,6 +97,14 @@ For command-specific help:
|
|
|
99
97
|
description='Upload processed SAR data to Hugging Face Hub'
|
|
100
98
|
)
|
|
101
99
|
_add_upload_arguments(upload_parser)
|
|
100
|
+
|
|
101
|
+
# WorldSAR subcommand
|
|
102
|
+
worldsar_parser = subparsers.add_parser(
|
|
103
|
+
'worldsar',
|
|
104
|
+
help='Process SAR products with SNAP GPT pipelines and tiling',
|
|
105
|
+
description='Process SAR products from multiple missions and generate tiles'
|
|
106
|
+
)
|
|
107
|
+
_add_worldsar_arguments(worldsar_parser)
|
|
102
108
|
|
|
103
109
|
return parser
|
|
104
110
|
|
|
@@ -350,6 +356,90 @@ def _add_upload_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
350
356
|
)
|
|
351
357
|
|
|
352
358
|
|
|
359
|
+
def _add_worldsar_arguments(parser: argparse.ArgumentParser) -> None:
|
|
360
|
+
"""
|
|
361
|
+
Add arguments for the worldsar subcommand.
|
|
362
|
+
|
|
363
|
+
Args:
|
|
364
|
+
parser: The subparser for worldsar command.
|
|
365
|
+
"""
|
|
366
|
+
parser.add_argument(
|
|
367
|
+
'--input',
|
|
368
|
+
'-i',
|
|
369
|
+
dest='product_path',
|
|
370
|
+
type=str,
|
|
371
|
+
required=True,
|
|
372
|
+
help='Path to the input SAR product.'
|
|
373
|
+
)
|
|
374
|
+
parser.add_argument(
|
|
375
|
+
'--output',
|
|
376
|
+
'-o',
|
|
377
|
+
dest='output_dir',
|
|
378
|
+
type=str,
|
|
379
|
+
required=True,
|
|
380
|
+
help='Directory to save the processed output.'
|
|
381
|
+
)
|
|
382
|
+
parser.add_argument(
|
|
383
|
+
'--cuts-outdir',
|
|
384
|
+
'--cuts_outdir',
|
|
385
|
+
dest='cuts_outdir',
|
|
386
|
+
type=str,
|
|
387
|
+
required=True,
|
|
388
|
+
help='Where to store the tiles after extraction.'
|
|
389
|
+
)
|
|
390
|
+
parser.add_argument(
|
|
391
|
+
'--product-wkt',
|
|
392
|
+
'--product_wkt',
|
|
393
|
+
dest='product_wkt',
|
|
394
|
+
type=str,
|
|
395
|
+
required=True,
|
|
396
|
+
help='WKT string defining the product region of interest.'
|
|
397
|
+
)
|
|
398
|
+
parser.add_argument(
|
|
399
|
+
'--prod-mode',
|
|
400
|
+
'--prod_mode',
|
|
401
|
+
dest='prod_mode',
|
|
402
|
+
type=str,
|
|
403
|
+
required=True,
|
|
404
|
+
help='Product mode: ["S1TOPS", "S1STRIP", "BM", "NISAR", "TSX", "CSG", "ICE"].'
|
|
405
|
+
)
|
|
406
|
+
parser.add_argument(
|
|
407
|
+
'--gpt-path',
|
|
408
|
+
dest='gpt_path',
|
|
409
|
+
type=str,
|
|
410
|
+
default=None,
|
|
411
|
+
help='Override GPT executable path (default: gpt_path env var).'
|
|
412
|
+
)
|
|
413
|
+
parser.add_argument(
|
|
414
|
+
'--grid-path',
|
|
415
|
+
dest='grid_path',
|
|
416
|
+
type=str,
|
|
417
|
+
default=None,
|
|
418
|
+
help='Override grid GeoJSON path (default: grid_path env var).'
|
|
419
|
+
)
|
|
420
|
+
parser.add_argument(
|
|
421
|
+
'--db-dir',
|
|
422
|
+
dest='db_dir',
|
|
423
|
+
type=str,
|
|
424
|
+
default=None,
|
|
425
|
+
help='Override database output directory (default: db_dir env var).'
|
|
426
|
+
)
|
|
427
|
+
parser.add_argument(
|
|
428
|
+
'--gpt-memory',
|
|
429
|
+
dest='gpt_memory',
|
|
430
|
+
type=str,
|
|
431
|
+
default=None,
|
|
432
|
+
help='Override GPT Java heap (e.g., 24G).'
|
|
433
|
+
)
|
|
434
|
+
parser.add_argument(
|
|
435
|
+
'--gpt-parallelism',
|
|
436
|
+
dest='gpt_parallelism',
|
|
437
|
+
type=int,
|
|
438
|
+
default=None,
|
|
439
|
+
help='Override GPT parallelism (number of tiles).'
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
|
|
353
443
|
def main() -> None:
|
|
354
444
|
"""
|
|
355
445
|
Main entry point for sarpyx CLI.
|
|
@@ -367,20 +457,29 @@ def main() -> None:
|
|
|
367
457
|
|
|
368
458
|
try:
|
|
369
459
|
if args.command == 'decode':
|
|
460
|
+
from .decode import main as decode_main
|
|
370
461
|
sys.argv = ['sarpyx-decode'] + [arg for arg in original_argv[2:]]
|
|
371
462
|
decode_main()
|
|
372
463
|
elif args.command == 'focus':
|
|
464
|
+
from .focus import main as focus_main
|
|
373
465
|
sys.argv = ['sarpyx-focus'] + [arg for arg in original_argv[2:]]
|
|
374
466
|
focus_main()
|
|
375
467
|
elif args.command == 'shipdet':
|
|
468
|
+
from .shipdet import main as shipdet_main
|
|
376
469
|
sys.argv = ['sarpyx-shipdet'] + [arg for arg in original_argv[2:]]
|
|
377
470
|
shipdet_main()
|
|
378
471
|
elif args.command == 'unzip':
|
|
472
|
+
from .unzip import main as unzip_main
|
|
379
473
|
sys.argv = ['sarpyx-unzip'] + [arg for arg in original_argv[2:]]
|
|
380
474
|
unzip_main()
|
|
381
475
|
elif args.command == 'upload':
|
|
476
|
+
from .upload import main as upload_main
|
|
382
477
|
sys.argv = ['sarpyx-upload'] + [arg for arg in original_argv[2:]]
|
|
383
478
|
upload_main()
|
|
479
|
+
elif args.command == 'worldsar':
|
|
480
|
+
from .worldsar import main as worldsar_main
|
|
481
|
+
sys.argv = ['sarpyx-worldsar'] + [arg for arg in original_argv[2:]]
|
|
482
|
+
worldsar_main()
|
|
384
483
|
else:
|
|
385
484
|
print(f'Unknown command: {args.command}', file=sys.stderr)
|
|
386
485
|
sys.exit(1)
|