Data Classes¶
This module defines the dataclasses that carry configuration and results through the
EMBRS pipeline. Users encounter them in two main contexts: setting up a simulation
(via SimParams,
MapParams, and
WeatherParams loaded from .cfg files)
and working with fire prediction outputs
(via PredictionOutput,
EnsemblePredictionOutput, and
StateEstimate returned by
FirePredictor). Most fields mirror the configuration file
options documented in the Tutorials section.
Dataclasses for simulation parameters and state.
This module defines dataclasses used throughout EMBRS for storing configuration parameters, simulation state, and intermediate results.
Classes:
| Name | Description |
|---|---|
- MapDrawerData |
Data from the map drawing interface. |
- GeoInfo |
Geographic information for a simulation area. |
- LandscapeData |
Landscape raster data from LCP files. |
- MapParams |
Parameters for map configuration. |
- PlaybackVisualizerParams |
Parameters for playback visualization. |
- VisualizerInputs |
Input data for the visualizer. |
- WeatherEntry |
Single weather observation. |
- WeatherParams |
Weather input configuration. |
- SimParams |
Full simulation parameters. |
- PredictorParams |
Fire predictor configuration. |
- WindNinjaTask |
WindNinja processing task parameters. |
- CellData |
Cell-level data for fire calculations. |
- PredictionOutput |
Output from a single fire prediction. |
- StateEstimate |
Estimated fire state from observations. |
- CellStatistics |
Statistics for ensemble cell metrics. |
- EnsemblePredictionOutput |
Output from ensemble predictions. |
Note
ForecastData, ForecastPool, and ForecastPoolManager have been moved to
embrs.tools.forecast_pool. Importing them from this module still works
but is deprecated.
CellData
dataclass
¶
Cell-level data for fire behavior calculations.
Attributes:
| Name | Type | Description |
|---|---|---|
fuel_type |
Fuel
|
Fuel model for this cell. |
elevation |
float
|
Elevation in meters. |
aspect |
float
|
Aspect in degrees (0=N, 90=E). |
slope_deg |
float
|
Slope in degrees. |
canopy_cover |
float
|
Canopy cover as a percentage. |
canopy_height |
float
|
Canopy height in meters. |
canopy_base_height |
float
|
Canopy base height in meters. |
canopy_bulk_density |
float
|
Canopy bulk density in kg/m^3. |
init_dead_mf |
List[float]
|
Initial dead fuel moisture fractions [1hr, 10hr, 100hr]. |
live_h_mf |
float
|
Live herbaceous moisture fraction. |
live_w_mf |
float
|
Live woody moisture fraction. |
Source code in embrs/utilities/data_classes.py
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 | |
CellStatistics
dataclass
¶
Statistics for a single metric across ensemble members.
Attributes:
| Name | Type | Description |
|---|---|---|
mean |
float
|
Mean value across ensemble members. |
std |
float
|
Standard deviation across ensemble members. |
min |
float
|
Minimum value across ensemble members. |
max |
float
|
Maximum value across ensemble members. |
count |
int
|
Number of ensemble members with data for this cell. |
Source code in embrs/utilities/data_classes.py
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 | |
EnsemblePredictionOutput
dataclass
¶
Output from ensemble fire prediction runs.
Aggregates statistics across multiple prediction runs with varying parameters to quantify prediction uncertainty.
Attributes:
| Name | Type | Description |
|---|---|---|
n_ensemble |
int
|
Number of ensemble members. |
burn_probability |
dict
|
Maps time (s) to dict of (x, y) to burn probability (0-1). |
flame_len_m_stats |
dict
|
Maps (x, y) to CellStatistics for flame length. |
fli_kw_m_stats |
dict
|
Maps (x, y) to CellStatistics for fireline intensity. |
ros_ms_stats |
dict
|
Maps (x, y) to CellStatistics for rate of spread. |
spread_dir_stats |
dict
|
Maps (x, y) to dict with 'mean_x' and 'mean_y' for circular mean spread direction. |
crown_fire_probability |
dict
|
Maps time in seconds to dict of (x, y) to crown fire probability (0-1). |
hold_prob_stats |
dict
|
Maps (x, y) to CellStatistics for hold probability. |
breach_frequency |
dict
|
Maps (x, y) to breach probability (0-1). |
active_fire_probability |
Optional[dict]
|
Maps time in seconds to dict of (x, y) to probability of active fire presence (0-1). Optional. |
burnt_probability |
Optional[dict]
|
Maps time in seconds to dict of (x, y) to probability of being burnt (0-1). Optional. |
individual_predictions |
List[PredictionOutput]
|
Individual prediction outputs for inspection. Optional. |
forecast_indices |
Optional[List[int]]
|
List of ints indicating the indices of the forecast_pool used for each of the predictions in the ensemble. |
Source code in embrs/utilities/data_classes.py
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | |
GeoInfo
dataclass
¶
Geographic information for a simulation area.
Attributes:
| Name | Type | Description |
|---|---|---|
bounds |
BoundingBox
|
Spatial bounds from rasterio. |
center_lat |
float
|
Center latitude in degrees (WGS84). |
center_lon |
float
|
Center longitude in degrees (WGS84). |
timezone |
str
|
IANA timezone string (e.g., 'America/Denver'). |
north_angle_deg |
float
|
Rotation from grid north to true north in degrees. |
Source code in embrs/utilities/data_classes.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
calc_center_coords(source_crs)
¶
Calculate center lat/lon from bounds and source CRS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_crs
|
CRS
|
Coordinate reference system of the bounds. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If bounds is None. |
Source code in embrs/utilities/data_classes.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
calc_time_zone()
¶
Calculate timezone from center coordinates.
Raises:
| Type | Description |
|---|---|
ValueError
|
If center coordinates are not set. |
Source code in embrs/utilities/data_classes.py
101 102 103 104 105 106 107 108 109 110 111 | |
LandscapeData
dataclass
¶
Landscape raster data extracted from LCP files.
Attributes:
| Name | Type | Description |
|---|---|---|
elevation_map |
ndarray
|
Elevation in meters. |
slope_map |
ndarray
|
Slope in degrees. |
aspect_map |
ndarray
|
Aspect in degrees (0=N, 90=E). |
fuel_map |
ndarray
|
Fuel model IDs. |
canopy_cover_map |
ndarray
|
Canopy cover as fraction. |
canopy_height_map |
ndarray
|
Canopy height in meters. |
canopy_base_height_map |
ndarray
|
Canopy base height in meters. |
canopy_bulk_density_map |
ndarray
|
Canopy bulk density in kg/m^3. |
rows |
int
|
Number of raster rows. |
cols |
int
|
Number of raster columns. |
resolution |
int
|
Raster resolution in meters. |
width_m |
float
|
Total width in meters. |
height_m |
float
|
Total height in meters. |
transform |
any
|
Rasterio affine transform. |
crs |
any
|
Coordinate reference system. |
Source code in embrs/utilities/data_classes.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
MapDrawerData
dataclass
¶
Data collected from the interactive map drawing interface.
Attributes:
| Name | Type | Description |
|---|---|---|
fire_breaks |
Dict
|
Fire break geometries keyed by ID. |
break_widths |
List
|
Width in meters for each fire break. |
break_ids |
List
|
Identifiers for fire breaks. |
initial_ign |
List
|
Initial ignition point coordinates. |
Source code in embrs/utilities/data_classes.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
MapParams
dataclass
¶
Parameters for map configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
folder |
str
|
Path to the map data folder. |
lcp_filepath |
str
|
Path to the source LCP file. |
cropped_lcp_path |
str
|
Path to cropped LCP file if applicable. |
import_roads |
bool
|
Whether to import roads from OSM. |
lcp_data |
LandscapeData
|
Extracted landscape data. |
roads |
List
|
List of road geometries. |
geo_info |
GeoInfo
|
Geographic information. |
scenario_data |
MapDrawerData
|
User-drawn scenario elements. |
fbfm_type |
str
|
Fuel model type ('Anderson' or 'ScottBurgan'). |
Source code in embrs/utilities/data_classes.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
shape(cell_size)
¶
Calculate grid shape for a given cell size.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell_size
|
int
|
Hexagon side length in meters. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[int, int]
|
Tuple[int, int]: (rows, cols) for the hexagonal grid. |
Source code in embrs/utilities/data_classes.py
186 187 188 189 190 191 192 193 194 195 196 197 198 | |
size()
¶
Get the map size in meters.
Returns:
| Type | Description |
|---|---|
Tuple[float, float]
|
Tuple[float, float]: (width_m, height_m). |
Source code in embrs/utilities/data_classes.py
178 179 180 181 182 183 184 | |
PlaybackVisualizerParams
dataclass
¶
Parameters for playback visualization from log files.
Attributes:
| Name | Type | Description |
|---|---|---|
cell_file |
str
|
Path to cell_logs.parquet file. |
init_location |
bool
|
Whether init_state.parquet was found. |
save_video |
bool
|
Whether to save visualization as video. |
video_folder |
str
|
Folder to save video output. |
video_name |
str
|
Video filename. |
has_agents |
bool
|
Whether agent logs are available. |
has_actions |
bool
|
Whether action logs are available. |
has_predictions |
bool
|
Whether prediction logs are available. |
video_fps |
int
|
Video frames per second. |
agent_file |
str
|
Path to agent_logs.parquet. |
action_file |
str
|
Path to action_logs.parquet. |
prediction_file |
str
|
Path to prediction_logs.parquet. |
freq |
float
|
Update frequency in seconds. |
scale_km |
float
|
Scale bar size in kilometers. |
show_legend |
bool
|
Whether to display fuel legend. |
show_wind_cbar |
bool
|
Whether to show wind colorbar. |
show_wind_field |
bool
|
Whether to show wind field. |
show_weather_data |
bool
|
Whether to show weather info. |
show_compass |
bool
|
Whether to show compass. |
show_visualization |
bool
|
Whether to render visualization. |
show_temp_in_F |
bool
|
Whether to display temperature in Fahrenheit. |
Source code in embrs/utilities/data_classes.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |
PredictionOutput
dataclass
¶
Output from a single fire spread prediction.
Attributes:
| Name | Type | Description |
|---|---|---|
spread |
dict
|
Maps time in seconds to list of (x, y) positions where fire is predicted to arrive at that time. |
flame_len_m |
dict
|
Maps (x, y) to flame length in meters. |
fli_kw_m |
dict
|
Maps (x, y) to fireline intensity in kW/m. |
ros_ms |
dict
|
Maps (x, y) to rate of spread in m/s. |
spread_dir |
dict
|
Maps (x, y) to spread direction in degrees. |
all_crown_fire |
dict
|
Maps (x, y) to time in seconds when crown fire is first predicted. |
active_crown_fire |
dict
|
Maps time in seconds to dict of ((x, y), crown_fire_status('active' or 'passive')). |
end_active_crown |
dict
|
Maps (x,y) to time in seconds when crown fire goes out. |
breaches |
dict
|
Maps (x, y) to breach status (bool). |
active_fire_front |
dict
|
Maps time in seconds to list of (x, y) positions where fire is predicted to be currently burning at that time. |
burnt_spread |
dict
|
Maps time in seconds to list of (x, y) positions where cells are predicted to already be fully burnt. |
forecast_index |
Optional[int]
|
Indicates the index of the forecast_pool that was used to generate the prediction. |
Source code in embrs/utilities/data_classes.py
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 | |
PredictorParams
dataclass
¶
Fire predictor configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
time_horizon_hr |
float
|
Prediction time horizon in hours. |
time_step_s |
int
|
Prediction time step in seconds. |
cell_size_m |
float
|
Cell size in meters. |
dead_mf |
float
|
Dead fuel moisture fraction. |
live_mf |
float
|
Live fuel moisture fraction. |
model_spotting |
bool
|
Whether to model spotting. |
spot_delay_s |
float
|
Spot ignition delay in seconds. |
wind_speed_bias |
float
|
Wind speed bias in m/s. |
wind_dir_bias |
float
|
Wind direction bias in degrees. |
wind_uncertainty_factor |
float
|
Wind uncertainty scaling factor. |
ros_bias |
float
|
Rate of spread bias factor. |
max_wind_speed_bias |
float
|
Maximum wind speed bias in m/s. |
max_wind_dir_bias |
float
|
Maximum wind direction bias in degrees. |
base_wind_spd_std |
float
|
Base wind speed std dev in m/s. |
base_wind_dir_std |
float
|
Base wind direction std dev in degrees. |
max_beta |
float
|
Maximum uncertainty beta value. |
Source code in embrs/utilities/data_classes.py
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 | |
SimParams
dataclass
¶
Full simulation parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
map_params |
MapParams
|
Map configuration. |
log_folder |
str
|
Path to log output folder. |
weather_input |
WeatherParams
|
Weather configuration. |
t_step_s |
int
|
Simulation time step in seconds. |
cell_size |
int
|
Hexagon side length in meters. |
init_mf |
List[float]
|
Initial dead fuel moisture [1hr, 10hr, 100hr]. |
fuel_moisture_map |
Dict
|
Per-fuel-model moisture values. |
fms_has_live |
bool
|
Whether FMS file includes live moisture. |
live_h_mf |
float
|
Live herbaceous moisture fraction. |
live_w_mf |
float
|
Live woody moisture fraction. |
model_spotting |
bool
|
Whether to model spotting. |
canopy_species |
int
|
Canopy species ID for spotting. |
dbh_cm |
float
|
Diameter at breast height in cm. |
spot_ign_prob |
float
|
Spot ignition probability (0-1). |
min_spot_dist |
float
|
Minimum spotting distance in meters. |
spot_delay_s |
float
|
Spot ignition delay in seconds. |
duration_s |
float
|
Simulation duration in seconds. |
visualize |
bool
|
Whether to show real-time visualization. |
num_runs |
int
|
Number of simulation iterations. |
user_path |
str
|
Path to user control module. |
user_class |
str
|
Name of user control class. |
write_logs |
bool
|
Whether to write log files. |
Source code in embrs/utilities/data_classes.py
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | |
StateEstimate
dataclass
¶
Estimated fire state from observations.
Attributes:
| Name | Type | Description |
|---|---|---|
burnt_polys |
List[Polygon]
|
Polygons of burnt area. |
burning_polys |
List[Polygon]
|
Polygons of actively burning area. |
start_time_s |
Optional[float]
|
Start time in seconds from simulation start. If None, uses current fire simulation time. |
scheduled_ignitions |
Optional[Dict[float, List[Polygon]]]
|
Future ignitions keyed by absolute simulation time (seconds). Used for staggered strip firing rollouts. Polygons are resolved to cells inside the worker process via get_cells_at_geometry(). |
Source code in embrs/utilities/data_classes.py
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 | |
VisualizerInputs
dataclass
¶
Input data for the real-time visualizer.
Attributes:
| Name | Type | Description |
|---|---|---|
cell_size |
float
|
Hexagon side length in meters. |
sim_shape |
Tuple[int, int]
|
Grid shape (rows, cols). |
sim_size |
Tuple[float, float]
|
Map size (width_m, height_m). |
start_datetime |
datetime
|
Simulation start time. |
north_dir_deg |
float
|
Rotation to true north in degrees. |
wind_forecast |
ndarray
|
Wind field data array. |
wind_resolution |
float
|
Wind mesh resolution in meters. |
wind_t_step |
float
|
Wind time step in seconds. |
wind_xpad |
float
|
Wind field x padding in meters. |
wind_ypad |
float
|
Wind field y padding in meters. |
temp_forecast |
ndarray
|
Temperature forecast values. |
rh_forecast |
ndarray
|
Relative humidity forecast values. |
forecast_t_step |
float
|
Forecast time step in seconds. |
elevation |
ndarray
|
Coarse elevation data for display. |
roads |
list
|
Road geometries for display. |
fire_breaks |
list
|
Fire break geometries for display. |
init_entries |
list
|
Initial cell state entries. |
scale_bar_km |
float
|
Scale bar size in kilometers. |
show_legend |
bool
|
Whether to show fuel legend. |
show_wind_cbar |
bool
|
Whether to show wind colorbar. |
show_wind_field |
bool
|
Whether to show wind field. |
show_weather_data |
bool
|
Whether to show weather info. |
show_temp_in_F |
bool
|
Whether to show temperature in Fahrenheit. |
show_compass |
bool
|
Whether to show compass. |
Source code in embrs/utilities/data_classes.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
WeatherEntry
dataclass
¶
Single weather observation at a point in time.
Attributes:
| Name | Type | Description |
|---|---|---|
wind_speed |
float
|
Wind speed in m/s. |
wind_dir_deg |
float
|
Wind direction in degrees (meteorological). |
temp |
float
|
Temperature in Celsius. |
rel_humidity |
float
|
Relative humidity as fraction (0-1). |
cloud_cover |
float
|
Cloud cover as fraction (0-1). |
rain |
float
|
Rainfall in mm. |
dni |
float
|
Direct normal irradiance in W/m^2. |
dhi |
float
|
Diffuse horizontal irradiance in W/m^2. |
ghi |
float
|
Global horizontal irradiance in W/m^2. |
solar_zenith |
float
|
Solar zenith angle in degrees. |
solar_azimuth |
float
|
Solar azimuth angle in degrees. |
Source code in embrs/utilities/data_classes.py
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | |
WeatherParams
dataclass
¶
Weather input configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
input_type |
str
|
Weather source type ('OpenMeteo' or 'File'). |
file |
str
|
Path to weather file if using file input. |
mesh_resolution |
int
|
WindNinja mesh resolution in meters. |
conditioning_start |
datetime
|
Start time for fuel moisture conditioning. |
start_datetime |
datetime
|
Simulation start time. |
end_datetime |
datetime
|
Simulation end time. |
Source code in embrs/utilities/data_classes.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | |
WindNinjaTask
dataclass
¶
Parameters for a WindNinja processing task.
Attributes:
| Name | Type | Description |
|---|---|---|
index |
int
|
Task index in the processing queue. |
time_step |
float
|
Time step for this wind field. |
entry |
WeatherEntry
|
Weather data for this time step. |
elevation_path |
str
|
Path to elevation raster file. |
timezone |
str
|
IANA timezone string. |
north_angle |
float
|
Rotation to true north in degrees. |
mesh_resolution |
float
|
WindNinja mesh resolution in meters. |
temp_file_path |
str
|
Path for temporary output files. |
cli_path |
str
|
Path to WindNinja CLI executable. |
start_datetime |
timedelta
|
Time offset from simulation start. |
wind_height |
float
|
Wind measurement height. |
wind_height_units |
str
|
Units for wind height. |
input_speed_units |
str
|
Units for input wind speed. |
temperature_units |
str
|
Units for temperature. |
Source code in embrs/utilities/data_classes.py
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | |
__getattr__(name)
¶
Lazy import for backwards compatibility.
ForecastData, ForecastPool, and ForecastPoolManager have been moved to embrs.tools.forecast_pool. This allows old import paths to continue working while avoiding circular imports.
Source code in embrs/utilities/data_classes.py
647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 | |