firebench.stats
- firebench.stats.internal.fuel_models.anderson_2015_stats(output_filename: str | None = None, unit_wind: str = 'm/s', unit_ros: str = 'm/s', dpi: int = 150)[source]
Plot statistics from the Anderson 2015 dataset.
- This function processes the Anderson (2015) dataset and visualizes:
Histogram of observed rate of spread (ROS)
Scatter plot of wind speed vs dead fuel moisture
Histogram of closest Scott and Burgan 40 (SB40) fuel model matches
- Parameters:
output_filename (str, optional) – If provided, the resulting figure will be saved to this file path. If None, the figure is displayed interactively. Default None.
unit_wind (str, optional) – Unit to which wind speed observations are converted (e.g., “km/h”). Default “m/s”.
unit_ros (str, optional) – Unit to which rate of spread observations are converted (e.g., “ft/min”). Default “m/s”.
dpi (int, optional) – The resolution in dots per inch. Default 150.
Notes
For more details about the dataset structure and variables, refer to the documentation page for the Anderson (2015) validation dataset.
- firebench.stats.utils.hist.auto_bins(data, max_bins=40, base=10)[source]
Automatically generate histogram bin edges for plotting, based on data range.
The function estimates a “nice” bin width using a logarithmic base scaling and selects a width that produces up to max_bins bins while preserving human-readable spacing. It handles NaNs and constant data gracefully.
- Parameters:
data (array_like) – Input array of values to be histogrammed.
max_bins (int, optional) – Maximum number of bins to aim for (default is 40).
base (float, optional) – Logarithmic base used to scale bin widths (default is 10).
- Returns:
bins – Array of bin edges suitable for use with np.histogram or plt.hist.
- Return type:
np.ndarray
Examples
>>> auto_bins([0.1, 0.2, 0.3, 0.4]) array([0. , 0.1, 0.2, 0.3, 0.4, 0.5])