Weather¶
This module handles weather data ingestion and processing for fire simulations. It supports two input sources: the Open-Meteo historical reanalysis API and RAWS-format weather station files (.wxs). The WeatherStream class builds a time-indexed sequence of weather observations, computes derived quantities (solar radiation, Growing Season Index, foliar moisture content, live fuel moisture), and provides the weather data that drives the simulation's fire behavior calculations.
Weather data ingestion and processing for fire simulation.
Fetch, parse, and package hourly weather observations into a stream of
WeatherEntry records for use by the fire simulation. Supports two
input sources:
- OpenMeteo: Historical reanalysis data fetched via the Open-Meteo API.
- File: RAWS-format weather station files (
.wxs).
Also computes derived quantities: site-specific temperature/humidity corrections, local solar radiation, foliar moisture content (FMC), and the Growing Season Index (GSI) for estimating live fuel moisture.
Classes:
| Name | Description |
|---|---|
- WeatherStream |
Build a weather stream from config parameters. |
Functions:
| Name | Description |
|---|---|
- filter_hourly_data |
Subset hourly data by datetime range. |
- apply_site_specific_correction |
Elevation-lapse adjustment for temperature and humidity. |
- calc_local_solar_radiation |
Slope- and canopy-adjusted irradiance. |
- datetime_to_julian_date |
Convert a datetime to Julian date. |
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 | |
DailySummary
dataclass
¶
One day of aggregated weather for GSI computation.
Attributes:
| Name | Type | Description |
|---|---|---|
date |
datetime
|
Calendar date for this summary. |
min_temp_F |
float
|
Daily minimum temperature (Fahrenheit). |
max_temp_F |
float
|
Daily maximum temperature (Fahrenheit). |
min_rh |
float
|
Daily minimum relative humidity (percent, 0-100). |
rain_cm |
float
|
Total rainfall for this day (cm). |
Source code in embrs/models/weather.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
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 | |
Fuel
¶
Base fuel model for Rothermel fire spread calculations.
Encapsulate the physical properties of a fuel type and precompute derived constants used in the Rothermel (1972) equations. Non-burnable fuel types (e.g., water, urban) store only name and model number.
All internal units follow the Rothermel convention: loading in lb/ft², surface-area-to-volume ratio in 1/ft, fuel depth in ft, heat content in BTU/lb.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Human-readable fuel model name. |
model_num |
int
|
Numeric fuel model identifier. |
burnable |
bool
|
Whether this fuel can sustain fire. |
dynamic |
bool
|
Whether herbaceous fuel transfer is applied. |
load |
ndarray
|
Fuel loading per class (tons/acre), shape (6,). Order: [1h, 10h, 100h, dead herb, live herb, live woody]. |
s |
ndarray
|
Surface-area-to-volume ratio per class (1/ft), shape (6,). |
sav_ratio |
int
|
Characteristic SAV ratio (1/ft). |
dead_mx |
float
|
Dead fuel moisture of extinction (fraction). |
fuel_depth_ft |
float
|
Fuel bed depth (feet). |
heat_content |
float
|
Heat content (BTU/lb), default 8000. |
rho_p |
float
|
Particle density (lb/ft³), default 32. |
Source code in embrs/models/fuel_models.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 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 112 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 150 151 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 199 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 250 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 | |
__init__(name, model_num, burnable, dynamic, w_0, s, s_total, dead_mx, fuel_depth)
¶
Initialize a fuel model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Human-readable fuel model name. |
required |
model_num
|
int
|
Numeric identifier for the fuel model. |
required |
burnable
|
bool
|
Whether this fuel can sustain fire. |
required |
dynamic
|
bool
|
Whether herbaceous transfer applies. |
required |
w_0
|
ndarray
|
Fuel loading per class (tons/acre), shape (6,). None for non-burnable models. |
required |
s
|
ndarray
|
SAV ratio per class (1/ft), shape (6,). None for non-burnable models. |
required |
s_total
|
int
|
Characteristic SAV ratio (1/ft). |
required |
dead_mx
|
float
|
Dead fuel moisture of extinction (fraction). |
required |
fuel_depth
|
float
|
Fuel bed depth (feet). |
required |
Source code in embrs/models/fuel_models.py
56 57 58 59 60 61 62 63 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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
calc_E_B_C()
¶
Compute wind factor coefficients E, B, and C.
These coefficients parameterize the wind factor equation in the Rothermel model as a function of the characteristic SAV ratio.
Returns:
| Type | Description |
|---|---|
tuple
|
Tuple[float, float, float]: |
Source code in embrs/models/fuel_models.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
calc_W(w_0_tpa)
¶
Compute dead-to-live fuel loading ratio W.
W is used to determine live fuel moisture of extinction. Returns
np.inf when there is no live fuel loading (denominator is zero).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w_0_tpa
|
ndarray
|
Fuel loading per class (tons/acre), shape (6,). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Dead-to-live loading ratio (dimensionless), or |
Source code in embrs/models/fuel_models.py
250 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 | |
calc_flux_ratio()
¶
Compute propagating flux ratio for the Rothermel equation.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Propagating flux ratio (dimensionless). |
Source code in embrs/models/fuel_models.py
132 133 134 135 136 137 138 139 140 141 | |
compute_f_and_g_weights()
¶
Compute fuel class weighting factors f_ij, g_ij, and category fractions f_i.
Derive weighting arrays from fuel loading and SAV ratios. f_ij
gives fractional area weights within dead/live categories. g_ij
gives SAV-bin-based moisture weighting factors. f_i gives the
dead vs. live category fractions.
Side Effects
Sets self.f_ij (2×6), self.g_ij (2×6), and
self.f_i (2,) arrays.
Source code in embrs/models/fuel_models.py
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 199 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 | |
set_fuel_loading(w_n)
¶
Set net fuel loading and recompute weighted dead/live net loadings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w_n
|
ndarray
|
Net fuel loading per class (lb/ft²), shape (6,). |
required |
Side Effects
Updates self.w_n, self.w_n_dead, and self.w_n_live.
Source code in embrs/models/fuel_models.py
237 238 239 240 241 242 243 244 245 246 247 248 | |
GSITracker
¶
Track rolling weather data and recompute GSI during simulation.
Maintains a 56-day rolling buffer of :class:DailySummary records
(seeded from pre-simulation data) and accumulates hourly weather
entries into daily summaries as the simulation advances. Call
:meth:compute_gsi after each day boundary to get an updated
Growing Season Index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geo
|
GeoInfo
|
:class: |
required |
pre_sim_summaries
|
List[DailySummary]
|
Daily summaries from the pre-simulation window (up to 56 days). Oldest first. |
required |
initial_cum_rain
|
float
|
Cumulative rain value (cm) from the last pre-simulation weather entry, used to correctly compute rain deltas for the first simulation hour. |
0.0
|
Source code in embrs/models/weather.py
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 112 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 150 151 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 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
compute_gsi()
¶
Compute GSI from the rolling daily buffer.
Uses the same sub-index formulas as
:meth:GSITracker.compute_gsi: photoperiod, minimum temperature,
vapor pressure deficit, and 28-day accumulated precipitation.
Returns:
| Type | Description |
|---|---|
float
|
GSI value in [0, 1], or -1 if fewer than 2 days are available. |
Source code in embrs/models/weather.py
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 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
ingest_hourly(entry, sim_datetime)
¶
Feed one hourly weather observation into the tracker.
Accumulates temperature, humidity, and rain delta. When the
calendar day changes, the previous day is finalized into a
:class:DailySummary and appended to the rolling buffer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
WeatherEntry
|
Current weather entry (temp in F, rel_humidity in percent, rain cumulative in cm). |
required |
sim_datetime
|
datetime
|
Simulation datetime corresponding to this entry. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if a day boundary was crossed (a new daily summary was |
bool
|
finalized), False otherwise. |
Source code in embrs/models/weather.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 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 | |
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 | |
WeatherStream
¶
Build and manage a weather stream for fire simulation.
Ingest weather data from either the Open-Meteo API or a RAWS-format
.wxs file, compute derived quantities (solar geometry, GSI, live
fuel moisture, foliar moisture content), and produce a list of
WeatherEntry records indexed by time.
Attributes:
| Name | Type | Description |
|---|---|---|
stream |
list[WeatherEntry]
|
Ordered weather entries for the simulation period (including conditioning lead-in). |
stream_times |
DatetimeIndex
|
Timestamps corresponding to
each entry in |
sim_start_idx |
int
|
Index into |
fmc |
float
|
Foliar moisture content (percent). |
live_h_mf |
float | None
|
Live herbaceous fuel moisture (fraction), or None if GSI is disabled. |
live_w_mf |
float | None
|
Live woody fuel moisture (fraction), or None if GSI is disabled. |
time_step |
int
|
Weather observation interval (minutes). |
ref_elev |
float
|
Reference elevation of the weather source (meters). |
Source code in embrs/models/weather.py
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 250 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 307 308 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 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 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 412 413 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 454 455 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 491 492 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 522 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 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 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 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 | |
__init__(params, geo, use_gsi=True)
¶
Initialize a weather stream from configuration parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
WeatherParams
|
Weather configuration specifying input type, date range, and optional file path. |
required |
geo
|
GeoInfo
|
Geographic information (lat, lon, timezone, center coordinates). |
required |
use_gsi
|
bool
|
Whether to compute the Growing Season Index for live fuel moisture estimation. Defaults to True. |
True
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in embrs/models/weather.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
calc_fmc()
¶
Compute foliar moisture content based on latitude and date.
Uses the Forestry Canada Fire Danger Group (1992) method, which estimates the day of minimum FMC from latitude, longitude, and elevation, then applies a polynomial fit.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Foliar moisture content (percent). |
Source code in embrs/models/weather.py
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 | |
generate_stream(hourly_data)
¶
Yield full WeatherEntry records from hourly data arrays.
Rainfall is accumulated across entries (cumulative sum).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hourly_data
|
dict
|
Dictionary with keys 'wind_speed', 'wind_direction', 'temperature', 'rel_humidity', 'cloud_cover', 'ghi', 'dhi', 'dni', 'rain', 'solar_zenith', 'solar_azimuth'. |
required |
Yields:
| Name | Type | Description |
|---|---|---|
WeatherEntry |
WeatherEntry
|
Fully populated weather entry with cumulative rainfall. |
Source code in embrs/models/weather.py
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | |
get_stream_from_openmeteo()
¶
Fetch weather data from the Open-Meteo historical archive API.
Retrieves hourly wind, temperature, humidity, cloud cover, solar radiation, and precipitation. Computes GSI-based live fuel moisture if enabled, then builds the weather stream with a conditioning lead-in period.
Side Effects
Sets self.stream, self.stream_times, self.sim_start_idx,
self.fmc, self.live_h_mf, self.live_w_mf,
self.ref_elev, self.time_step, and input unit attributes.
Source code in embrs/models/weather.py
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 307 308 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 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 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 | |
get_stream_from_wxs()
¶
Parse a RAWS-format .wxs weather file and build the stream.
Read weather observations from the file, apply unit conversions (English or Metric to internal units), fetch solar irradiance from Open-Meteo to supplement the file data, compute GSI, and assemble the final weather stream.
Side Effects
Sets self.stream, self.stream_times, self.sim_start_idx,
self.fmc, self.live_h_mf, self.live_w_mf,
self.ref_elev, self.time_step, and input unit attributes.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the file has insufficient data or unknown units. |
Source code in embrs/models/weather.py
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 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 454 455 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 491 492 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 522 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 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 | |
set_live_moistures(gsi)
¶
Compute live fuel moisture fractions from the Growing Season Index.
Map GSI to live herbaceous and woody moisture using linear interpolation between dormant and green-up values. Below the green-up threshold (GSI < 0.2), dormant values are returned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gsi
|
float
|
Growing Season Index in [0, 1]. |
required |
Returns:
| Type | Description |
|---|---|
tuple
|
Tuple[float, float]: |
Source code in embrs/models/weather.py
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 | |
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 | |
BTU_ft2_min_to_kW_m2(f_btu_ft2_min)
¶
Convert heat flux from BTU/(ft^2*min) to kW/m^2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_btu_ft2_min
|
float
|
Heat flux in BTU/(ft^2*min). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Heat flux in kW/m^2. |
Source code in embrs/utilities/unit_conversions.py
220 221 222 223 224 225 226 227 228 229 | |
BTU_ft_min_to_kW_m(f_btu_ft_min)
¶
Convert fireline intensity from BTU/(ft*min) to kW/m.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_btu_ft_min
|
float
|
Fireline intensity in BTU/(ft*min). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Fireline intensity in kW/m. |
Source code in embrs/utilities/unit_conversions.py
232 233 234 235 236 237 238 239 240 241 | |
BTU_ft_min_to_kcal_s_m(f_btu_ft_min)
¶
Convert fireline intensity from BTU/(ftmin) to kcal/(sm).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_btu_ft_min
|
float
|
Fireline intensity in BTU/(ft*min). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Fireline intensity in kcal/(s*m). |
Source code in embrs/utilities/unit_conversions.py
244 245 246 247 248 249 250 251 252 253 | |
BTU_lb_to_cal_g(f_btu_lb)
¶
Convert heat content from BTU/lb to cal/g.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_btu_lb
|
float
|
Heat content in BTU/lb. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Heat content in cal/g. |
Source code in embrs/utilities/unit_conversions.py
272 273 274 275 276 277 278 279 280 281 | |
F_to_C(f_f)
¶
Convert temperature from Fahrenheit to Celsius.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_f
|
float
|
Temperature in degrees Fahrenheit. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Temperature in degrees Celsius. |
Source code in embrs/utilities/unit_conversions.py
48 49 50 51 52 53 54 55 56 57 | |
KiSq_to_Lbsft2(f_kisq)
¶
Convert fuel loading from kg/m^2 to lb/ft^2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_kisq
|
float
|
Fuel loading in kg/m^2. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Fuel loading in lb/ft^2. |
Source code in embrs/utilities/unit_conversions.py
156 157 158 159 160 161 162 163 164 165 | |
KiSq_to_TPA(f_kisq)
¶
Convert fuel loading from kg/m^2 to tons per acre.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_kisq
|
float
|
Fuel loading in kg/m^2. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Fuel loading in tons per acre. |
Source code in embrs/utilities/unit_conversions.py
204 205 206 207 208 209 210 211 212 213 | |
Lbsft2_to_KiSq(f_libsft2)
¶
Convert fuel loading from lb/ft^2 to kg/m^2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_libsft2
|
float
|
Fuel loading in lb/ft^2. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Fuel loading in kg/m^2. |
Source code in embrs/utilities/unit_conversions.py
144 145 146 147 148 149 150 151 152 153 | |
Lbsft2_to_TPA(f_lbsft2)
¶
Convert fuel loading from lb/ft^2 to tons per acre.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_lbsft2
|
float
|
Fuel loading in lb/ft^2. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Fuel loading in tons per acre. |
Source code in embrs/utilities/unit_conversions.py
192 193 194 195 196 197 198 199 200 201 | |
TPA_to_KiSq(f_tpa)
¶
Convert fuel loading from tons per acre to kg/m^2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_tpa
|
float
|
Fuel loading in tons per acre. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Fuel loading in kg/m^2. |
Source code in embrs/utilities/unit_conversions.py
168 169 170 171 172 173 174 175 176 177 | |
TPA_to_Lbsft2(f_tpa)
¶
Convert fuel loading from tons per acre to lb/ft^2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_tpa
|
float
|
Fuel loading in tons per acre. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Fuel loading in lb/ft^2. |
Source code in embrs/utilities/unit_conversions.py
180 181 182 183 184 185 186 187 188 189 | |
apply_site_specific_correction(cell, elev_ref, curr_weather)
¶
Apply elevation lapse-rate correction for temperature and humidity.
Adjust the reference-station temperature and relative humidity to the cell's elevation using standard lapse rates (Stephenson 1988).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
Cell
|
Cell with |
required |
elev_ref
|
float
|
Reference weather station elevation (meters). |
required |
curr_weather
|
WeatherEntry
|
Current weather entry with |
required |
Returns:
| Type | Description |
|---|---|
Tuple[float, float]
|
Tuple[float, float]: |
Source code in embrs/models/weather.py
839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 | |
cal_g_to_BTU_lb(f_cal_g)
¶
Convert heat content from cal/g to BTU/lb.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_cal_g
|
float
|
Heat content in cal/g. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Heat content in BTU/lb. |
Source code in embrs/utilities/unit_conversions.py
260 261 262 263 264 265 266 267 268 269 | |
calc_local_solar_radiation(cell, curr_weather)
¶
Compute slope- and canopy-adjusted solar irradiance at a cell.
Use pvlib to compute plane-of-array irradiance for the cell's slope and aspect, then reduce by canopy transmittance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
Cell
|
Cell with |
required |
curr_weather
|
WeatherEntry
|
Entry with |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Total irradiance at the cell surface (W/m²). |
Source code in embrs/models/weather.py
877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 | |
datetime_to_julian_date(dt)
¶
Convert a datetime to Julian date.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dt
|
datetime
|
A datetime-like object with year, month, day, hour, minute, and second attributes. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Julian date (fractional day number). |
Source code in embrs/models/weather.py
909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 | |
filter_hourly_data(hourly_data, start_datetime, end_datetime)
¶
Filter hourly weather data to a datetime range (inclusive).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hourly_data
|
dict
|
Dictionary with a 'date' key and parallel value arrays. |
required |
start_datetime
|
datetime
|
Start of desired range (datetime-like). |
required |
end_datetime
|
datetime
|
End of desired range (datetime-like). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Filtered copy with the same keys, values trimmed to the matching datetime window. |
Source code in embrs/models/weather.py
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 | |
ft_min_to_m_s(f_ft_min)
¶
Convert speed from feet per minute to meters per second.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_ft_min
|
float
|
Speed in ft/min. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Speed in m/s. |
Source code in embrs/utilities/unit_conversions.py
92 93 94 95 96 97 98 99 100 101 | |
ft_min_to_mph(f_ft_min)
¶
Convert speed from feet per minute to miles per hour.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_ft_min
|
float
|
Speed in ft/min. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Speed in mph. |
Source code in embrs/utilities/unit_conversions.py
116 117 118 119 120 121 122 123 124 125 | |
ft_to_m(f_ft)
¶
Convert length from feet to meters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_ft
|
float
|
Length in feet. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Length in meters. |
Source code in embrs/utilities/unit_conversions.py
76 77 78 79 80 81 82 83 84 85 | |
m_s_to_ft_min(m_s)
¶
Convert speed from meters per second to feet per minute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m_s
|
float
|
Speed in m/s. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Speed in ft/min. |
Source code in embrs/utilities/unit_conversions.py
104 105 106 107 108 109 110 111 112 113 | |
m_to_ft(f_m)
¶
Convert length from meters to feet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_m
|
float
|
Length in meters. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Length in feet. |
Source code in embrs/utilities/unit_conversions.py
64 65 66 67 68 69 70 71 72 73 | |
mph_to_ft_min(f_mph)
¶
Convert speed from miles per hour to feet per minute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_mph
|
float
|
Speed in mph. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Speed in ft/min. |
Source code in embrs/utilities/unit_conversions.py
128 129 130 131 132 133 134 135 136 137 | |