cli

cli

PlanetaryPy unified CLI.

Usage: plp fetch mro.ctx.edr P02_001916_2221_XI_42N027W plp hifetch PSP_003092_0985 –browse plp ctxqv J05_046771_1950 plp catalog build

Functions

Name Description
catalog_ambiguous List instruments whose mission/instrument mapping is ambiguous.
catalog_build Build the PDS catalog database from pdr-tests definitions.
catalog_list Browse the pdr-tests catalog inventory.
catalog_search Search the catalog (mission/instrument/product_key/product_id).
catalog_show Show full catalog + INDEX_REGISTRY info for a single product type.
catalog_summary Per-mission counts of instruments, product types, and products.
ctx_migrate Move existing CTX files on disk to match current [edr.local] layout.
ctxqv Show a downsampled quickview of a CTX image.
example_pid Print an example product ID from a registered PDS index.
fetch Download a PDS product by ID.
hibrowse Download a HiRISE browse JPEG from EXTRAS.
hiedr Download HiRISE EDR channel files by observation ID.
himos Create a HiRISE CCD mosaic from EDR data via ISIS.
indexes_info Show config + cache status for a registered PDS index.
indexes_list Browse the registered PDS indexes (the operational fetch surface).
indexes_refresh Refresh upstream index config or re-download a single index.
meta Print the metadata row for a product from its PDS cumulative index.
spicer Show current SPICE data for a solar system body.

catalog_ambiguous

cli.catalog_ambiguous()

List instruments whose mission/instrument mapping is ambiguous.

[source]

catalog_build

cli.catalog_build(
    force=typer.Option(False, '--force', help='Force rebuild from scratch'),
    validate_urls=typer.Option(False, '--validate-urls', help='Run URL validation after build'),
)

Build the PDS catalog database from pdr-tests definitions.

[source]

catalog_list

cli.catalog_list(
    key=typer.Argument(None, help="Optional dotted key: 'mission' or 'mission.instrument'. Omit to list missions."),
)

Browse the pdr-tests catalog inventory.

Examples: plp catalog list # all missions plp catalog list cassini # cassini instruments plp catalog list cassini.iss # cassini.iss product types

[source]

catalog_show

cli.catalog_show(
    key=typer.Argument(..., help="Dotted key 'mission.instrument.product_key' for full detail."),
)

Show full catalog + INDEX_REGISTRY info for a single product type.

[source]

catalog_summary

cli.catalog_summary()

Per-mission counts of instruments, product types, and products.

[source]

ctx_migrate

cli.ctx_migrate(
    dry_run=typer.Option(False, '--dry-run', '-n', help='Show what would be moved without touching anything'),
)

Move existing CTX files on disk to match current [edr.local] layout.

Scans each mrox_* volume folder under the configured EDR local root and relocates any file named <pid>.<ext> (26-char CTX product_id) to the location that the active config dictates. Idempotent: a second run does nothing.

Typical use: after switching [edr.local].with_pid between false and true, run this once to bring existing downloads (and any co-located derived files) into the new layout.

[source]

ctxqv

cli.ctxqv(
    imgid=typer.Argument(help='CTX product ID (short or full), e.g. J05_046771_1950', autocompletion=_complete_ctx_pid),
    stride=typer.Option(10, '--stride', '-s', help='Downsample factor'),
    save=typer.Option(None, '--save', '-o', help='Save to PNG instead of displaying'),
    stretch=typer.Option('1,99', '--stretch', '-p', help="Percentile stretch as 'low,high'. Use 'none' to disable."),
    edr=typer.Option(False, '--edr', help='Force raw EDR, skip calibrated files'),
    center_box=typer.Option(None, '--center-box', '-c', help='Show full-res center crop of N pixels (default 500 if flag used)'),
)

Show a downsampled quickview of a CTX image.

Automatically uses the best available level: map-projected > calibrated > cube > raw EDR.

Use –center-box to also show a full-resolution crop from the image center.

[source]

example_pid

cli.example_pid(
    key=typer.Argument(help='Dotted index key, e.g. mro.ctx.edr', autocompletion=_complete_index_key),
)

Print an example product ID from a registered PDS index.

Useful as a seed for plp fetch, demo notebooks, and smoke tests.

Examples: plp example_pid mro.ctx.edr plp example_pid cassini.iss.index

[source]

fetch

cli.fetch(
    key=typer.Argument(help='Dotted product key, e.g. mro.ctx.edr'),
    product_id=typer.Argument(help='Product identifier', autocompletion=_complete_product_id),
    force=typer.Option(False, '--force', '-f', help='Re-download even if cached'),
    label_only=typer.Option(False, '--label-only', '-l', help='Download only the label file'),
    here=typer.Option(False, '--here', '-H', help='Download into current directory instead of planetarypy storage'),
    folder=typer.Option(False, '--folder', '-d', help='Print the local folder instead of file paths (composes with `cd`)'),
)

Download a PDS product by ID.

Examples: plp fetch mro.ctx.edr P02_001916_2221_XI_42N027W plp fetch –here mro.ctx.edr P02_001916_2221_XI_42N027W cd (plp fetch –folder mro.ctx.edr P02_001916_2221_XI_42N027W)

[source]

hibrowse

cli.hibrowse(
    product_id=typer.Argument(help='HiRISE product ID, e.g. PSP_003092_0985_RED or PSP_004238_1135_RED1_1', autocompletion=_complete_hirise_obsid_rdr),
    annotated=typer.Option(True, '--annotated/--clean', '-a/-c', help='Annotated (default) or clean browse'),
    here=typer.Option(False, '--here', '-H', help='Download into current directory'),
    force=typer.Option(False, '--force', '-f', help='Re-download even if cached'),
)

Download a HiRISE browse JPEG from EXTRAS.

Bare observation IDs default to RDR RED browse.

Examples: plp hibrowse PSP_003092_0985_RED (annotated browse) plp hibrowse –clean PSP_003092_0985_RED (clean browse) plp hibrowse ESP_075422_2040_COLOR plp hibrowse PSP_004238_1135_RED1_1 (EDR CCD) plp hibrowse PSP_003092_0985 (defaults to RDR RED)

[source]

hiedr

cli.hiedr(
    obsid=typer.Argument(help='HiRISE observation ID, e.g. PSP_003092_0985', autocompletion=_complete_hirise_obsid_edr),
    red=typer.Option(False, '--red', help='Download RED CCDs (RED0–RED9, 20 files)'),
    ir=typer.Option(False, '--ir', help='Download IR CCDs (IR10–IR11, 4 files)'),
    bg=typer.Option(False, '--bg', help='Download BG CCDs (BG12–BG13, 4 files)'),
    ccds=typer.Option(None, '--ccds', help="Specific CCD numbers, e.g. '4,5' for RED4+RED5 only"),
    here=typer.Option(False, '--here', '-H', help='Download into current directory'),
    force=typer.Option(False, '--force', '-f', help='Re-download even if cached'),
)

Download HiRISE EDR channel files by observation ID.

Downloads both channels (0 and 1) for each CCD in the selected color. If no color flag is given, defaults to –red.

Examples: plp hiedr PSP_003092_0985 –red (all 20 RED files) plp hiedr PSP_003092_0985 –red –ccds 4,5 (RED4+RED5 only, 4 files) plp hiedr PSP_003092_0985 –ir (IR10+IR11, 4 files) plp hiedr PSP_003092_0985 –bg (BG12+BG13, 4 files) plp hiedr PSP_003092_0985 –here –ccds 4,5 (download to current dir)

[source]

himos

cli.himos(
    obsid=typer.Argument(help='HiRISE observation ID, e.g. PSP_003092_0985', autocompletion=_complete_hirise_obsid_edr),
    red=typer.Option(False, '--red', help='Process RED CCDs'),
    ir=typer.Option(False, '--ir', help='Process IR CCDs'),
    bg=typer.Option(False, '--bg', help='Process BG CCDs'),
    ccds=typer.Option(None, '--ccds', help="Specific CCD numbers, e.g. '4,5'"),
    mapfile=typer.Option(None, '--map', '-m', help='ISIS map projection file (.map)'),
    overwrite=typer.Option(False, '--force', '-f', help='Reprocess even if mosaic exists'),
)

Create a HiRISE CCD mosaic from EDR data via ISIS.

Full pipeline: download → hi2isis → spiceinit → hical → histitch → cubenorm → cam2map → equalizer → automos.

If no color flag is given, defaults to –red.

Examples: plp himos PSP_003092_0985 (all 10 RED CCDs) plp himos PSP_003092_0985 –ccds 4,5 (RED4+RED5 central pair) plp himos PSP_003092_0985 –ir (IR mosaic) plp himos PSP_003092_0985 –red –ir –bg (all three colors) plp himos PSP_003092_0985 –map mymap.map (custom projection)

[source]

indexes_info

cli.indexes_info(
    key=typer.Argument(..., help='Dotted index key, e.g. cassini.iss.index', autocompletion=_complete_index_key),
)

Show config + cache status for a registered PDS index.

[source]

indexes_list

cli.indexes_list(
    key=typer.Argument(None, help="Optional dotted key: 'mission' or 'mission.instrument'. Omit to list missions."),
    tree=typer.Option(False, '--tree', help='Render as a tree (mirrors planetarypy.pds.print_available_indexes).'),
)

Browse the registered PDS indexes (the operational fetch surface).

Examples: plp indexes list # all missions, summary table plp indexes list cassini # cassini instruments plp indexes list cassini.iss # cassini.iss indexes (with cache status) plp indexes list –tree # full tree (legacy print_available_indexes)

[source]

indexes_refresh

cli.indexes_refresh(
    config=typer.Option(False, '--config', help='Force-refresh upstream URL config (planetarypy_index_urls.toml).'),
    cache=typer.Option(None, '--cache', help="Re-download a specific index's cumulative parquet.", autocompletion=_complete_index_key),
)

Refresh upstream index config or re-download a single index.

[source]

meta

cli.meta(
    key=typer.Argument(help='Dotted index key, e.g. mro.ctx.edr', autocompletion=_complete_index_key),
    product_id=typer.Argument(help='Product identifier', autocompletion=_complete_product_id),
    long=typer.Option(False, '--long', '-l', help='Request the long form when the index has a custom display (no effect on indexes that always return the full row).'),
)

Print the metadata row for a product from its PDS cumulative index.

Thin wrapper around planetarypy.pds.get_meta(key, product_id, long=...). Matches the product ID against the configured (or conventional) PID column, tolerant of case and PDS path/extension/version-suffix decoration. Indexes may register custom display logic (short summaries, multi-row aggregation, …) which the --long flag toggles into the full-row form.

Examples: plp meta mro.ctx.edr P02_001916_2221_XI_42N027W plp meta cassini.iss.index 1_N1454725799

[source]

spicer

cli.spicer(
    body=typer.Argument(help='NAIF body name, e.g. Mars, Moon, Enceladus'),
    time=typer.Option(None, '--time', '-t', help='UTC time (default: now)'),
    lon=typer.Option(None, '--lon', help='Longitude [deg] for surface illumination'),
    lat=typer.Option(None, '--lat', help='Latitude [deg] for surface illumination'),
)

Show current SPICE data for a solar system body.

Without –lon/–lat, shows global properties (L_s, subsolar point, solar constant). With coordinates, adds surface illumination.

Examples: plp spicer Mars plp spicer Moon –time 2024-06-15T12:00:00 plp spicer Mars –lon 137.4 –lat -4.6

[source]