Scene Configuration
Top-level configuration classes for defining a scene generation run.
s2gos_generator.core.config.scene.SceneGenConfig
pydantic-model
Bases: BaseModel
Comprehensive scene generation configuration.
Provides a validated configuration system for all scene generation parameters.
Pass an instance to
SceneGenerationPipeline
and call run() to produce a
SceneDescription.
Optional spatial zones are controlled by BufferConfig and BackgroundConfig. Vegetation placement is configured via VegetationPlacementConfig.
Config:
default:{'validate_assignment': True, 'arbitrary_types_allowed': True}
Fields:
-
config_version(str) -
scene_name(str) -
description(Optional[str]) -
location(SceneLocation) -
data_sources(DataSources) -
output_dir(PathRef) -
dem_resolution_m(float) -
landcover_resolution_m(float) -
texture_resolution_m(Optional[float]) -
snow(Optional[SnowConfig]) -
processing(ProcessingOptions) -
atmosphere(AtmosphereConfig) -
buffer(Optional[BufferConfig]) -
background(Optional[BackgroundConfig]) -
hamster(Optional[HamsterConfig]) -
roads(Optional[RoadsConfig]) -
spectral_matching(Optional[SpectralMatchingConfig]) -
buildings(Optional[BuildingsConfig]) -
mesh_refinement(Optional[MeshRefinementConfig]) -
user_assets(list[UserAssets]) -
xml_scenes(list[XmlSceneConfig]) -
material_regions(list[MaterialRegion]) -
region_material_defs(Dict[str, Dict[str, Any]]) -
vegetation_placement(Optional[VegetationPlacementConfig]) -
vegetation_exclusion_zones(List[VegetationExclusionZone]) -
created_at(datetime)
Validators:
Attributes
background
pydantic-field
Background area configuration (None disables background). See BackgroundConfig.
buffer
pydantic-field
Buffer area configuration (None disables buffer). See BufferConfig.
buildings
pydantic-field
Building configuration (None disables buildings). See BuildingsConfig.
dem_resolution_m
pydantic-field
DEM resolution in meters (controls terrain mesh detail)
description
pydantic-field
Metadata, only used in case of serialization
hamster
pydantic-field
HAMSTER albedo data configuration for baresoil. See HamsterConfig.
landcover_resolution_m
pydantic-field
Landcover resolution in meters
material_regions
pydantic-field
Material regions for spatially-selective material overrides. See MaterialRegion.
mesh_refinement
pydantic-field
Adaptive mesh refinement configuration (None disables refinement). See MeshRefinementConfig.
region_material_defs
pydantic-field
Material definitions for region materials
roads
pydantic-field
Road infrastructure configuration (None disables roads). See RoadsConfig.
scene_output_dir
property
Get the specific output directory for this scene.
snow
pydantic-field
Seasonal snow configuration (None disables snow). See SnowConfig.
spectral_matching
pydantic-field
Spectral matching configuration (None disables). See SpectralMatchingConfig.
texture_resolution_m
pydantic-field
Texture resolution in meters per pixel. When set finer than landcover_resolution_m, roads and landcover are rasterized at higher pixel density, reducing road blockiness. Defaults to native landcover resolution when None.
user_assets
pydantic-field
User assets to be placed in generated scene. See UserAssets.
vegetation_exclusion_zones
pydantic-field
Standalone vegetation exclusion zones
vegetation_placement
pydantic-field
Vegetation placement configuration (None disables vegetation). See VegetationPlacementConfig.
xml_scenes
pydantic-field
XML scene files to import for additional assets and materials. See XmlSceneConfig.
Functions
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
|
set_atmosphere_heterogeneous
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 using molecular configuration.
validate_output_dir
pydantic-validator
Validate and create output directory if needed.
s2gos_generator.core.config.scene.SceneLocation
pydantic-model
Bases: BaseModel
Geographic location configuration.
Fields:
-
center_lat(float) -
center_lon(float) -
aoi_size_km(float)
s2gos_generator.core.config.scene.BufferConfig
pydantic-model
Bases: BaseModel
Buffer area configuration. Presence (non-None) enables buffer processing.
Fields:
-
size_km(float) -
resolution_m(float)
s2gos_generator.core.config.scene.BackgroundConfig
pydantic-model
Bases: BaseModel
Background area configuration. Presence (non-None) enables background processing.
Fields:
-
size_km(float) -
resolution_m(float) -
elevation(float)
s2gos_generator.core.config.scene.SnowConfig
pydantic-model
Bases: BaseModel
Seasonal snow configuration. Presence (non-None) enables snow.
Fields:
-
season_month(Month) -
material_index(int) -
thermoprops(Optional[ThermophysicalConfig]) -
random_seed(Optional[int])
Attributes
random_seed
pydantic-field
Random seed for reproducible snow mask generation. If None, uses system entropy.
season_month
pydantic-field
Month for seasonal snow calculation (JUNE or DECEMBER)
s2gos_generator.core.config.scene.DataSources
pydantic-model
Bases: BaseModel
Data source configuration using FileResolver.
Fields:
-
dem(IndexedGeoTiff | Zarr) -
landcover(IndexedGeoTiff | Zarr) -
material_config_path(PathRef) -
building_tiles(Optional[PathRef])
Validators:
-
_load_defaults_and_merge_overrides -
validate_path_exists→material_config_path,building_tiles
Attributes
building_tiles
pydantic-field
Directory of quadkey-indexed OpenBuildingMap tiles (plus index CSV).
material_config_path
pydantic-field
Path to custom material configuration JSON
Functions
s2gos_generator.core.config.scene.ProcessingOptions
pydantic-model
Bases: BaseModel
Processing options for scene generation.
Fields:
-
generate_texture_preview(bool) -
handle_dem_nans(bool) -
dem_fillna_value(float) -
flatten_dem(bool)
Attributes
generate_texture_preview
pydantic-field
Generate texture preview images
s2gos_generator.core.config.scene.Month
Bases: str, Enum
Month selection for seasonal adjustments.
s2gos_generator.core.config.scene.create_scene_config
create_scene_config(
scene_name: str,
center_lat: float,
center_lon: float,
aoi_size_km: float,
output_dir: PathRef,
dem_resolution_m: float = 30.0,
landcover_resolution_m: float = 10.0,
description: Optional[str] = None,
data_overrides: Optional[dict] = None,
atmosphere: Optional[AtmosphereConfig] = None,
**kwargs,
) -> SceneGenConfig
Scene generation configuration using PathResolver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scene_name
|
str
|
Scene name (used for output files) |
required |
center_lat
|
float
|
Center latitude in degrees |
required |
center_lon
|
float
|
Center longitude in degrees |
required |
aoi_size_km
|
float
|
Area of interest size in kilometers |
required |
output_dir
|
PathRef
|
Output directory for generated scene |
required |
dem_resolution_m
|
float
|
DEM resolution in meters (default: 30.0) |
30.0
|
landcover_resolution_m
|
float
|
Landcover resolution in meters (default: 30.0) |
10.0
|
description
|
Optional[str]
|
Optional scene description |
None
|
data_overrides
|
Optional[dict]
|
Optional dict with user data overrides: - dem_index: Custom DEM index file - landcover_index: Custom landcover index file - materials_config: Custom materials config file |
None
|
atmosphere
|
Optional[AtmosphereConfig]
|
Optional atmosphere configuration |
None
|
**kwargs
|
Additional configuration options |
{}
|