lunar_toolkit.kaguya¶
lunar_toolkit.kaguya.tc
¶
Kaguya Terrain Camera Level 2B0: ODE file selection, download and ISIS import.
TcProduct(product_id, image_url, label_url, image_kbytes=None)
dataclass
¶
Data and label URLs of one Level 2B0 TC product.
sensor
property
¶
"TC1" or "TC2".
TcOutputs(product_id, cube, camera=None, map_cube=None, geotiff=None)
dataclass
¶
Files written for one product (None for skipped steps).
TcProcessor(output_dir=Path('kaguya'), *, web=True, csm=True, only_naif_spice=None, mapproject=False, projection=DEFAULT_PROJECTION, resolution=None, keep=False, force=False, kaguyatc2isis_params=None, spiceinit_params=None)
¶
Download and import Kaguya TC Level 2B0 products into ISIS.
Each product ends up in output_dir as <id>.cub (spiceinit'ed),
<id>.json (CSM camera, when csm) and, when mapproject,
<id>.tif (GEOTIFF_OPTIONS), the
same flat layout and resume / keep / force behaviour as
NacProcessor. Steps whose output
exists are skipped unless force.
| Parameters: |
|
|---|
process(source)
¶
Download (if needed) and import one product.
source is a TcProduct, a local .lbl path or a product
ID (looked up on ODE).
process_batch(sources, max_workers=2)
¶
Process several products in parallel (None for failures).
import_label(label)
¶
Run the ISIS chain on a downloaded PDS3 label (image beside it).
is_tc_product_id(product_id)
¶
True for a Level 2B0 TC product ID that kaguyatc2isis can import.
select_tc_files(files, product_id=None)
¶
Pick the data and label files of a TC product from its ODE files list.
| Parameters: |
|
|---|
| Returns: |
|
|---|
tc_products(df)
¶
TC products with downloadable data + label files from an ODE search.
Rows that are not Level 2B0 products (DTMs, ortho maps) or lack either file are skipped with a warning.
lookup_products(product_ids, client=None)
¶
Query ODE by product ID and return the observation DataFrame (see
OdeClient.lookup).
image_pointer(label)
¶
File name in the label's ^IMAGE pointer (None if attached / absent).
decompress(gz, out=None, remove=False)
¶
Gunzip gz to out (default: name without .gz) via a .part file.
download_product(product, output_dir, force=False, keep_gz=False, show_progress=True)
¶
Download (and gunzip) one product's label and image into output_dir.
The image is written under the name in the label's ^IMAGE pointer so
kaguyatc2isis finds it next to the label. Existing files are reused
unless force. Returns the label path.
import_tc(label, output_dir=None, **kwargs)
¶
Import one downloaded TC product; see TcProcessor for
kwargs.
lunar_toolkit.kaguya.mi
¶
Kaguya Multiband Imager Level 2B2: ODE file selection, download and ISIS import.
MiProduct(product_id, image_url, label_url, image_kbytes=None)
dataclass
¶
Data and label URLs of one Level 2B2 MI product.
sensor
property
¶
"VIS" (5 bands) or "NIR" (4 bands).
MiOutputs(product_id, cube, camera=None, map_cube=None, geotiff=None)
dataclass
¶
Files written for one product (None for skipped steps).
MiProcessor(output_dir=Path('kaguya'), *, web=True, csm=None, mapproject=False, projection=DEFAULT_PROJECTION, resolution=None, keep=False, force=False, kaguyami2isis_params=None, spiceinit_params=None)
¶
Download and import Kaguya MI Level 2B2 products into ISIS.
Each product ends up in output_dir as <id>.cub (multi-band,
spiceinit'ed), <id>.json (CSM camera, when csm) and, when
mapproject, <id>.tif. Steps whose output exists are skipped
unless force.
| Parameters: |
|
|---|
process(source)
¶
Download (if needed) and import one product.
source is a MiProduct, a local .lbl path or a product
ID (looked up on ODE).
process_batch(sources, max_workers=2)
¶
Process several products in parallel (None for failures).
import_label(label)
¶
Run the ISIS chain on a downloaded PDS3 label (image beside it).
is_mi_product_id(product_id)
¶
True for a Level 2B2 MI product ID that kaguyami2isis can import.
select_mi_files(files, product_id=None)
¶
Pick the data and label files of an MI product from its ODE files list.
MI products have the TC layout (detached .lbl + .img.gz), so
this follows select_tc_files.
| Returns: |
|
|---|
mi_products(df)
¶
MI Level 2B2 products with downloadable data + label files from an ODE search.
Rows that are not Level 2B2 products (2C2, 3C5, maps) or lack either file are skipped with a warning.
lookup_mi_products(product_ids, client=None)
¶
Query ODE by product ID and return the observation DataFrame (see
OdeClient.lookup).
download_mi_product(product, output_dir, force=False, keep_gz=False, show_progress=True)
¶
Download (and gunzip) one product's label and image; returns the label path.
See download_product.
import_mi(label, output_dir=None, **kwargs)
¶
Import one downloaded MI product; see MiProcessor for
kwargs.