eradiate.scenes.biosphere.load_scenario

Contents

eradiate.scenes.biosphere.load_scenario#

eradiate.scenes.biosphere.load_scenario(scenario_folder, padding, spectral_data=None)[source]#

Parse JSON file of scenario from a given path. Apply transformation to the data by converting units of wavelengths and compute instance positions.

Parameters:
  • scenario_folder (path-like) – Path of the folder containing scenario JSON file.

  • padding (int) – Padding to apply to the scenario.

  • spectral_data (dict[str, t.Any or dict[str, t.Any]] or None) – Spectral data to apply to the scenario, defaults to None (keep original). Example:

    spectral_data = {
        "ground": {
            "reflectance": ground_reflectance,
        },
        "object_name": {
            "subobject_name": {
                # Spectral data for the subobject, such as
                "reflectance": reflectance,
                "transmittance": transmittance,
            },
        }
    }
    

    Each spectral data specified replaces the original data completely, so it is necessary to specify all the data for the object.

Returns:

dict – Returns a dictionary parsed from JSON with transformations applied.