lunar-toolkit 0.1.0.dev2__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.
- lunar_toolkit/__init__.py +6 -0
- lunar_toolkit/asp.py +432 -0
- lunar_toolkit/cli/__init__.py +88 -0
- lunar_toolkit/cli/_jobs.py +437 -0
- lunar_toolkit/cli/_status.py +368 -0
- lunar_toolkit/cli/_utils.py +128 -0
- lunar_toolkit/cli/app.py +205 -0
- lunar_toolkit/cli/build_db.py +130 -0
- lunar_toolkit/cli/download.py +111 -0
- lunar_toolkit/cli/kaguya.py +253 -0
- lunar_toolkit/cli/ode_search.py +144 -0
- lunar_toolkit/cli/pairs.py +236 -0
- lunar_toolkit/cli/process.py +138 -0
- lunar_toolkit/cli/query.py +70 -0
- lunar_toolkit/cli/reference.py +233 -0
- lunar_toolkit/cli/search.py +90 -0
- lunar_toolkit/cli/serve.py +706 -0
- lunar_toolkit/cli/sfs.py +344 -0
- lunar_toolkit/cli/sfs_report.py +148 -0
- lunar_toolkit/cli/shadowcam.py +246 -0
- lunar_toolkit/cli/stereo.py +85 -0
- lunar_toolkit/cli/workspace.py +84 -0
- lunar_toolkit/config.py +345 -0
- lunar_toolkit/constants.py +217 -0
- lunar_toolkit/csm.py +340 -0
- lunar_toolkit/downloader.py +447 -0
- lunar_toolkit/geometry.py +556 -0
- lunar_toolkit/isis.py +222 -0
- lunar_toolkit/kaguya/__init__.py +45 -0
- lunar_toolkit/kaguya/mi.py +274 -0
- lunar_toolkit/kaguya/tc.py +370 -0
- lunar_toolkit/lroc/__init__.py +6 -0
- lunar_toolkit/lroc/cumindex.py +1197 -0
- lunar_toolkit/lroc/nac.py +702 -0
- lunar_toolkit/observation.py +127 -0
- lunar_toolkit/ode.py +485 -0
- lunar_toolkit/provenance.py +312 -0
- lunar_toolkit/reference.py +1111 -0
- lunar_toolkit/selection.py +714 -0
- lunar_toolkit/sfs.py +1534 -0
- lunar_toolkit/sfs_products.py +676 -0
- lunar_toolkit/sfs_report.py +1328 -0
- lunar_toolkit/shadowcam/__init__.py +29 -0
- lunar_toolkit/shadowcam/sc.py +392 -0
- lunar_toolkit/static/index.html +3259 -0
- lunar_toolkit/stereo.py +519 -0
- lunar_toolkit/stereo_dem.py +145 -0
- lunar_toolkit/tools.py +264 -0
- lunar_toolkit/workspace.py +1173 -0
- lunar_toolkit-0.1.0.dev2.dist-info/METADATA +177 -0
- lunar_toolkit-0.1.0.dev2.dist-info/RECORD +55 -0
- lunar_toolkit-0.1.0.dev2.dist-info/WHEEL +5 -0
- lunar_toolkit-0.1.0.dev2.dist-info/entry_points.txt +2 -0
- lunar_toolkit-0.1.0.dev2.dist-info/licenses/LICENSE +28 -0
- lunar_toolkit-0.1.0.dev2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""search - footprint search of the local PDS index (poles and 0/360 safe)."""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import sys
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
COMMAND = "search"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def add_parser(sub: argparse._SubParsersAction) -> None:
|
|
11
|
+
p = sub.add_parser(
|
|
12
|
+
COMMAND,
|
|
13
|
+
help="Find images whose footprint intersects a box, point+radius or AOI polygon (local index).",
|
|
14
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
15
|
+
epilog="""
|
|
16
|
+
Examples
|
|
17
|
+
--------
|
|
18
|
+
lunar search --bbox 0 -90 360 -85 --nac-only --inc 80 95
|
|
19
|
+
lunar search --bbox 355 -5 5 5 # crosses the 0/360 seam
|
|
20
|
+
lunar search --point -89.67 129.8 --radius-km 15 --csv shackleton.csv
|
|
21
|
+
lunar search --aoi aoi.geojson --nac-only # QuickMap-exported polygon
|
|
22
|
+
lunar search --aoi "POLYGON((350 -5, 10 -5, 10 5, 350 5, 350 -5))"
|
|
23
|
+
|
|
24
|
+
--bbox is WEST SOUTH EAST NORTH (degrees, positive east; WEST > EAST crosses 0/360).
|
|
25
|
+
--aoi takes a GeoJSON / WKT file or a WKT string (lon lat, degrees, positive
|
|
26
|
+
east); bbox matches are refined by exact polygon intersection.
|
|
27
|
+
""",
|
|
28
|
+
)
|
|
29
|
+
p.add_argument("--dataset", choices=["edr", "cdr"], default="edr", help="Index to search (default: edr).")
|
|
30
|
+
region = p.add_mutually_exclusive_group(required=True)
|
|
31
|
+
region.add_argument("--bbox", nargs=4, type=float, metavar=("WEST", "SOUTH", "EAST", "NORTH"))
|
|
32
|
+
region.add_argument("--point", nargs=2, type=float, metavar=("LAT", "LON"))
|
|
33
|
+
region.add_argument(
|
|
34
|
+
"--aoi", metavar="FILE_OR_WKT", help="Area of interest: GeoJSON / WKT file or WKT polygon string."
|
|
35
|
+
)
|
|
36
|
+
p.add_argument("--radius-km", type=float, default=1.0, metavar="KM")
|
|
37
|
+
p.add_argument("--inc", nargs=2, type=float, metavar=("MIN", "MAX"), help="Incidence angle range.")
|
|
38
|
+
p.add_argument("--emi", nargs=2, type=float, metavar=("MIN", "MAX"), help="Emission angle range.")
|
|
39
|
+
p.add_argument("--phase", nargs=2, type=float, metavar=("MIN", "MAX"), help="Phase angle range.")
|
|
40
|
+
p.add_argument("--nac-only", action="store_true", help="Only NAC products.")
|
|
41
|
+
p.add_argument("--limit", type=int, default=None, metavar="N")
|
|
42
|
+
p.add_argument("--csv", metavar="FILE", help="Write matching rows to CSV.")
|
|
43
|
+
p.add_argument("--wkt", action="store_true", help="Include an FP_WKT footprint column.")
|
|
44
|
+
p.add_argument(
|
|
45
|
+
"--data-dir", type=Path, default=None, metavar="DIR", help="Override Parquet data directory."
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def run(args: argparse.Namespace) -> int:
|
|
50
|
+
from ..lroc.cumindex import CumIndex
|
|
51
|
+
from ._utils import region_args
|
|
52
|
+
|
|
53
|
+
ci = CumIndex(dataset=args.dataset, data_dir=args.data_dir)
|
|
54
|
+
try:
|
|
55
|
+
df = ci.search(
|
|
56
|
+
**region_args(args),
|
|
57
|
+
incidence_angle=tuple(args.inc) if args.inc else None,
|
|
58
|
+
emission_angle=tuple(args.emi) if args.emi else None,
|
|
59
|
+
phase_angle=tuple(args.phase) if args.phase else None,
|
|
60
|
+
nac_only=args.nac_only,
|
|
61
|
+
wkt=args.wkt,
|
|
62
|
+
limit=args.limit,
|
|
63
|
+
)
|
|
64
|
+
except FileNotFoundError as exc:
|
|
65
|
+
print(exc, file=sys.stderr)
|
|
66
|
+
return 1
|
|
67
|
+
except ValueError as exc:
|
|
68
|
+
print(f"Error: {exc}", file=sys.stderr)
|
|
69
|
+
return 1
|
|
70
|
+
|
|
71
|
+
print(f"{len(df)} image(s)")
|
|
72
|
+
if not df.empty:
|
|
73
|
+
cols = [
|
|
74
|
+
c
|
|
75
|
+
for c in (
|
|
76
|
+
"PRODUCT_ID",
|
|
77
|
+
"START_TIME",
|
|
78
|
+
"CENTER_LATITUDE",
|
|
79
|
+
"CENTER_LONGITUDE",
|
|
80
|
+
"INCIDENCE_ANGLE",
|
|
81
|
+
"EMISSION_ANGLE",
|
|
82
|
+
"RESOLUTION",
|
|
83
|
+
)
|
|
84
|
+
if c in df.columns
|
|
85
|
+
]
|
|
86
|
+
print(df[cols].to_string(index=False, max_rows=40))
|
|
87
|
+
if args.csv:
|
|
88
|
+
df.to_csv(args.csv, index=False)
|
|
89
|
+
print(f"Wrote {args.csv}")
|
|
90
|
+
return 0
|