Skip to content

Scene Configuration

Top-level configuration classes for defining a scene generation run.

s2gos_generator.core.config.scene.SceneGenConfig pydantic-model

Bases: BaseModel

Comprehensive scene configuration using Pydantic.

Provides a modern, validated, and flexible configuration system for scene generation.

Config:

  • default: {'validate_assignment': True, 'arbitrary_types_allowed': True}

Fields:

Validators:

Attributes

atmosphere pydantic-field

atmosphere: AtmosphereConfig

Atmosphere configuration

background pydantic-field

background: Optional[BackgroundConfig] = None

Background area configuration (None disables background)

buffer pydantic-field

buffer: Optional[BufferConfig] = None

Buffer area configuration (None disables buffer)

config_version pydantic-field

config_version: str

Configuration schema version

created_at pydantic-field

created_at: datetime

Configuration creation time

data_dir property

data_dir: PathRef

Get the data output directory.

data_sources pydantic-field

data_sources: DataSources

Data source configuration

description pydantic-field

description: Optional[str] = None

Metadata, only used in case of serialization

hamster pydantic-field

hamster: Optional[HamsterConfig] = None

HAMSTER albedo data configuration for baresoil

location pydantic-field

location: SceneLocation

Geographic location

material_regions pydantic-field

material_regions: list[MaterialRegion] = []

Material regions for spatially-selective material overrides

meshes_dir property

meshes_dir: PathRef

Get the meshes output directory.

output_dir pydantic-field

output_dir: PathRef

Output directory for generated scene

processing pydantic-field

processing: ProcessingOptions

Processing options

random_seed pydantic-field

random_seed: Optional[int] = None

Random seed for reproducible scene generation. If None, uses system entropy.

region_material_defs pydantic-field

region_material_defs: Dict[str, Dict[str, Any]]

Material definitions for region materials

scene_name pydantic-field

scene_name: str

Scene name (used for output files)

scene_output_dir property

scene_output_dir: PathRef

Get the specific output directory for this scene.

snow pydantic-field

snow: Optional[SnowConfig] = None

Seasonal snow configuration (None disables snow)

target_resolution_m pydantic-field

target_resolution_m: float = 30.0

Target resolution in meters

textures_dir property

textures_dir: PathRef

Get the textures output directory.

trees_enabled property

trees_enabled: bool

Backward compatibility property for trees_enabled check.

user_assets pydantic-field

user_assets: list[UserAssets] = []

User assets to be placed in generated scene

vegetation_exclusion_zones pydantic-field

vegetation_exclusion_zones: List[VegetationExclusionZone]

Standalone vegetation exclusion zones

vegetation_placement pydantic-field

vegetation_placement: Optional[
    VegetationPlacementConfig
] = None

Vegetation placement configuration (None disables vegetation)

xml_scenes pydantic-field

xml_scenes: list[XmlSceneConfig] = []

XML scene files to import for additional assets and materials

Functions

disable_hamster_albedo

disable_hamster_albedo()

Disable HAMSTER albedo system.

enable_hamster_albedo

enable_hamster_albedo(
    data_path: PathRef,
    variable_name: str = "albedo",
    fallback_on_error: bool = True,
)

Enable HAMSTER albedo data for baresoil material replacement.

Parameters:

Name Type Description Default
data_path PathRef

Path to HAMSTER NetCDF data file

required
variable_name str

Variable name in NetCDF file (default: "albedo")

'albedo'
fallback_on_error bool

Fall back to standard baresoil material on errors

True

from_json classmethod

from_json(path: PathRef) -> SceneGenConfig

Load from JSON file.

set_atmosphere_heterogeneous

set_atmosphere_heterogeneous(
    molecular_config=None, particle_layers=None
)

Set atmosphere using heterogeneous configuration with molecular and particle layers.

set_atmosphere_homogeneous

set_atmosphere_homogeneous(
    aerosol_dataset,
    optical_thickness: float = 0.1,
    scale_height: float = 1000.0,
)

Set atmosphere using homogeneous configuration.

set_atmosphere_molecular

set_atmosphere_molecular(molecular_config)

Set atmosphere using molecular configuration.

to_dict

to_dict() -> Dict[str, Any]

Convert to dictionary for serialization.

to_json

to_json(
    path: Optional[PathRef] = None, indent: int = 2
) -> str

Export to JSON format.

validate_output_dir pydantic-validator

validate_output_dir(v)

Validate and create output directory if needed.

validate_scene_config pydantic-validator

validate_scene_config()

Validate complete scene configuration.

s2gos_generator.core.config.scene.SceneLocation pydantic-model

Bases: BaseModel

Geographic location configuration.

Fields:

Attributes

aoi_size_km pydantic-field

aoi_size_km: float

Area of interest size in kilometers

center_lat pydantic-field

center_lat: float

Center latitude in degrees

center_lon pydantic-field

center_lon: float

Center longitude in degrees

s2gos_generator.core.config.scene.DataSources pydantic-model

Bases: BaseModel

Data source configuration using FileResolver.

Fields:

Validators:

Attributes

dem pydantic-field

dem: IndexedGeoTiff | Zarr

DEM Dataset

landcover pydantic-field

landcover: IndexedGeoTiff | Zarr

Landcover Dataset

material_config_path pydantic-field

material_config_path: PathRef

Path to custom material configuration JSON

Functions

validate_path_exists pydantic-validator

validate_path_exists(v)

Validate that local files or directories exist.

s2gos_generator.core.config.scene.ProcessingOptions pydantic-model

Bases: BaseModel

Processing options for scene generation.

Fields:

Attributes

dem_fillna_value pydantic-field

dem_fillna_value: float = 0.0

Fill value for DEM NaN values

flatten_dem pydantic-field

flatten_dem: bool = False

Flatten DEM to zero elevation for testing

generate_texture_preview pydantic-field

generate_texture_preview: bool = True

Generate texture preview images

handle_dem_nans pydantic-field

handle_dem_nans: bool = True

Handle NaN values in DEM data

s2gos_generator.core.config.scene.Month

Bases: str, Enum

Month selection for seasonal adjustments.