lunar_toolkit.shadowcam.sc
¶
KPLO ShadowCam: ODE file selection, download, SPICE and CSM cameras for ASP.
ScProduct(product_id, cube_url, label_url=None, cube_kbytes=None)
dataclass
¶
Cube and PDS4 label URLs of one ShadowCam product.
observation_id
property
¶
M013178466S for M013178466SE / M013178466SC.
ScOutputs(product_id, cube, camera=None, cam_test=None, geotiff=None)
dataclass
¶
Files written for one product (None for skipped steps).
ScProcessor(output_dir=Path('shadowcam'), *, product='raw', web=False, csm=True, validate=False, mapproject=False, dem=None, resolution=None, t_srs=None, projection=DEFAULT_PROJECTION, keep=False, force=False, spiceinit_params=None)
¶
Download ShadowCam cubes and prepare them for ASP (SPICE + CSM camera).
Follows the ASP 3.7 ShadowCam example: spiceinit on the delivered cube
(in place), isd_generate -k <cube> <cube> for the CSM camera and,
optionally, cam_test and mapproject. Needs ASP 3.7's custom ISIS /
ALE build and the KPLO kernels under $ISISDATA/kplo/kernels (rsync
from rsync.im-ldi.com::kplo) plus $ISISDATA/base/kernels.
Per product output_dir gets <id>.cub, <id>.json (when csm),
<id>.cam_test.txt (when validate) and <id>.tif (when
mapproject). Steps whose output exists (for spiceinit: a cube
whose History records it, see has_spice) are skipped unless
force.
| Parameters: |
|
|---|
process(source)
¶
Download (if needed) and process one product.
source is a ScProduct, a local .cub path or an
observation / product ID (looked up on ODE).
process_batch(sources, max_workers=2)
¶
Process several products in parallel (None for failures).
process_cube(cube)
¶
Run the SPICE / CSM chain on a downloaded ShadowCam cube.
is_sc_product_id(product_id)
¶
True for a ShadowCam observation (M…S) or product (M…SE / M…SC) ID.
product_id_for(source, product='raw')
¶
Product ID for an observation or product ID.
| Parameters: |
|
|---|
select_sc_files(files, product_id=None)
¶
Pick the cube and label of a ShadowCam product from its ODE files list.
| Parameters: |
|
|---|
| Returns: |
|
|---|
sc_products(df)
¶
ShadowCam products with a downloadable cube from an ODE search.
Rows that are not …SE / …SC products (mosaics, DTMs) or lack a
cube are skipped with a warning.
lookup_products(product_ids, client=None, product='raw')
¶
Query ODE by observation / product ID (see
product_id_for,
OdeClient.lookup).
download_product(product, output_dir, force=False, show_progress=True)
¶
Download one product's cube (and PDS4 label) into output_dir.
Existing files are reused unless force; interrupted downloads resume. Returns the cube path.
has_spice(cube)
¶
True when spiceinit completed on cube.
A failed spiceinit can leave SPICE tables in the label, so the cube's
History must also record a spiceinit run.
import_sc(cube, output_dir=None, **kwargs)
¶
Process one downloaded ShadowCam cube; see ScProcessor for
kwargs.