Skip to content

Reference

Python API

Use the Python surface when you want the same file-based workflow as the CLI but need to stay inside a notebook, script, or larger scientific application.

Batch NEON runs

go_forth_and_multiply is the top-level batch entry point.

Single-flightline control

process_one_flightline exposes the ordered restart-safe stages for one flight line.

Drone workflows

run_drone_pipeline handles one local source tree; run_drone_bulk_production owns remote campaign production and compact bulk closeout.

Cross-run analysis

run_bulk_pipeline catalogs canonical flightlines, streams compact sufficient statistics, and runs population-aware sensor translation.

Canonical usage

Most users should start here

from spectralbridge import go_forth_and_multiply

go_forth_and_multiply(
    base_folder="output_demo",
    site_code="NIWO",
    year_month="2023-08",
    product_code="DP1.30006.001",
    flight_lines=[
        "NEON_D13_NIWO_DP1_L020-1_20230815_directional_reflectance",
    ],
    max_workers=1,
    engine="thread",
)

This follows the same ordered, restart-safe contract as the CLI and writes the same on-disk outputs.

Public entry points

What is intentionally public?

go_forth_and_multiply

Batch-oriented NEON orchestration including download, export, correction, harmonization, parquet writing, merge, and QA.

process_one_flightline

Single-flightline execution with explicit knobs for chunk size, merge behavior, polygon options, and engine choice.

run_drone_pipeline

Local drone processing path with QA, polygon support, and mixed HDF5/TIFF source handling.

run_bulk_pipeline

Independent, restart-safe post-processing path with read-only discovery, compact streaming statistics, balanced regressions, leave-one-site-out validation, and opt-in spectral-library reports.

run_drone_bulk_production

Resolves campaign-root, year-sibling, or explicit year-bound remote sources; inventories manifest-expected ExportPackages; stages one H5 at a time; validates canonical drone flights; enforces per-year completeness; delegates bulk analysis and interpretation; packages compact results; and optionally uploads and verifies the closeout.

inspect_drone_collection

Builds a JSON/CSV-serializable inventory without downloading H5 data. run_drone_campaign and validate_bulk_ready_flightline expose the producer-only and producer-to-consumer gates.

summarize_bulk_results

Interprets an existing completed bulk run from compact model tables alone, producing weighting, stability, transferability, warning, figure, and Markdown-report artifacts without the source raster archive. Configure screening with BulkResultsConfig from spectralbridge.bulk.

run_spectral_library_analysis

Reads one existing merged polygon Parquet in place and writes compact species summaries plus explicitly requested low-alpha variability PDFs. Configure it with SpectralLibraryPlotConfig from spectralbridge.bulk.

inspect_spectral_library_preflight

Reads one spectral-library Parquet in place and returns detected schema, visualization-valid counts, group-size warnings, expected pages, and estimated scan cost without writing summaries or PDFs.

apply_brightness_correction

Lower-level reflectance adjustment helper used when you need targeted brightness normalization logic outside the main pipeline.

API philosophy

How to think about the Python surface

  • Prefer the top-level orchestrators over stitching internal helpers together yourself.
  • Treat output files and naming conventions as part of the public contract.
  • Use tests and nearby docs to distinguish stable entry points from implementation details.
  • Expect idempotent, restart-safe behavior rather than pure in-memory return-value workflows.

Autogenerated reference

Module reference

Use the API docs below when you need the full function and class signatures in addition to the workflow-oriented guides.

SpectralBridge public package surface.

_PLOT_EXPORTS = (make_micasense_vs_landsat_panels.__name__, make_sensor_vs_neon_panels.__name__) module-attribute

__all__ = sorted(set(__all__ + (['apply_brightness_correction', 'build_harmonized_dataset', 'build_drone_translation_coefficient_registry', 'get_drone_translation_coefficient', 'go_forth_and_multiply', 'process_one_flightline', 'run_bulk_pipeline', 'run_drone_pipeline', 'run_drone_campaign', 'run_drone_bulk_production', 'inspect_drone_collection', 'stage_drone_collection', 'validate_bulk_ready_flightline', 'BulkProductionResult', 'DroneCampaignConfig', 'DroneCampaignIncompleteError', 'DroneCampaignResult', 'DroneCollectionInventory', 'DroneFlightStatus', 'DroneSource', 'DroneYearSource', 'RemoteDronePackage', 'run_spectral_library_analysis', 'summarize_bulk_results', 'inspect_spectral_library_preflight', 'load_drone_translation_coefficients', load_brightness_coefficients.__name__] + list(_PLOT_EXPORTS)))) module-attribute

__version__ = '2.3.0rc1' module-attribute

__getattr__(name)

load_brightness_coefficients(system_pair='landsat_to_micasense')

Load brightness coefficients for a given system pair.

Parameters

system_pair : str Key identifying the pair of systems, e.g. "landsat_to_micasense".

Returns

dict[int, float] Mapping from 1-based band index to brightness coefficient (percent).

Notes

  • Values are stored in percent (e.g., -7.3959 means "reduce by 7.3959%").

make_micasense_vs_landsat_panels(merged_dir, out_dir=None, *, max_points=50000, sentinel_at_or_below=-9999.0)

make_sensor_vs_neon_panels(merged_dir, out_dir=None, *, max_points=50000, sentinel_at_or_below=-9999.0)