Gaussian puff¶
Time-resolved Gaussian puff (Pasquill–Gifford), diffrax wind integration, and Ornstein–Uhlenbeck sub-grid turbulence. Tier I.
gauss_puff
¶
Gaussian puff model (JAX + diffrax + NumPyro).
Submodules
- dispersion — Pasquill-Gifford σ(s) coefficients + shared Briggs dispatch
- wind — piecewise-linear WindSchedule + diffrax cumulative integrals
- turbulence — Ornstein-Uhlenbeck sub-grid position disturbances on puff centres
- puff — single-puff kernel, evolve_puffs, simulate_puff (xarray)
- inference — NumPyro Bayesian inference for Q (constant) and Q_i (random walk)
The inference submodule is imported lazily on first attribute access so
that from plumax import gauss_puff does not pull in NumPyro
for consumers of only the forward model.
puff_concentration_vmap
module-attribute
¶
puff_concentration_vmap = vmap(puff_concentration, in_axes=(None, None, None, 0, 0, 0, 0, 0, 0, 0), out_axes=0)
Vectorised over puffs (per-puff params batched along axis 0, receptor shared).
PuffState
¶
Bases: Module
Container for the Lagrangian state of a puff ensemble at a single time.
Attributes¶
release_times : Float[Array, "N"] Puff release times [s]. x, y, z : Float[Array, "N"] Puff-centre positions at the evaluation time [m]. travel_distance : Float[Array, "N"] Cumulative travel distance since release [m]. mass : Float[Array, "N"] Puff mass [kg]. Inactive puffs (not yet released) have mass 0.
OUTurbulence
dataclass
¶
Ornstein-Uhlenbeck turbulence for puff-release position disturbances.
Attributes¶
sigma_fluctuations : float
OU fluctuation amplitude [m/√s]. Together with correlation_time
it sets the steady-state RMS offset σ_∞ = σ_f · √(τ_c / 2) [m].
correlation_time : float
OU correlation time [s]. Offsets for puffs released within τ_c
of each other are strongly correlated; puffs released more than a
few τ_c apart are effectively independent.
Notes¶
Gorroño et al. (2023) calibrated comparable parameters against large-eddy simulations of methane plumes; defaults in the Eucalyptus release are (σ_f, τ_c) = (0.5 m/s, 60 s) giving a steady-state RMS offset of about 2.7 m — appropriate for 20 m-GSD Sentinel-2 pixels.
stationary_std
property
¶
Steady-state RMS per-component offset σ_f · √(τ_c / 2) [m].
WindSchedule
¶
Bases: Module
Piecewise-linear time-varying wind field.
Attributes¶
times : Float[Array, "T"] Monotone increasing time knots [s]. u_wind : Float[Array, "T"] x-component of wind velocity at the knots [m/s]. v_wind : Float[Array, "T"] y-component of wind velocity at the knots [m/s].
Notes¶
The schedule behaves as a piecewise-linear interpolant between knots.
Queries outside [times[0], times[-1]] linearly extrapolate — consumers
that need strict clamping should range-check times before calling.
from_speed_direction
classmethod
¶
from_speed_direction(times: ndarray | ndarray, wind_speed: ndarray | ndarray, wind_direction: ndarray | ndarray) -> WindSchedule
Build a schedule from (speed, direction) in meteorological "from" convention.
wind_direction = 270° is a wind from the west (u > 0);
wind_direction = 0° is a wind from the north (v < 0).
u = −|V| · sin(θ), v = −|V| · cos(θ), θ = direction (radians).
Parameters¶
times : array-like, shape (T,) Monotone time knots [s]. wind_speed : array-like, shape (T,) Wind speed at each knot [m/s]. Must be ≥ 0. wind_direction : array-like, shape (T,) Wind direction at each knot [degrees from North].
Returns¶
WindSchedule
Source code in src/plumax/gauss_puff/wind.py
wind_at
¶
Interpolate the wind velocity components at time t.
speed_at
¶
calculate_briggs_dispersion_xyz
¶
calculate_briggs_dispersion_xyz(distance: ndarray, params: ndarray) -> tuple[jnp.ndarray, jnp.ndarray, jnp.ndarray]
Evaluate σ_x(s), σ_y(s), σ_z(s) from Briggs parameters.
Thin wrapper around the plume model's Briggs evaluator that additionally
exposes σ_x = σ_y so this routine is signature-compatible with
:func:calculate_pg_dispersion. Lets callers swap dispersion schemes
without changing downstream code.
Parameters¶
distance : jnp.ndarray
Puff travel distance [m].
params : jnp.ndarray, shape (6,)
Briggs parameters [a_y, b_y, c_y, a_z, b_z, c_z].
Returns¶
sigma_x, sigma_y, sigma_z : jnp.ndarray
Dispersion coefficients [m]. σ_x = σ_y.
Source code in src/plumax/gauss_puff/dispersion.py
calculate_pg_dispersion
¶
calculate_pg_dispersion(distance: ndarray, params: ndarray) -> tuple[jnp.ndarray, jnp.ndarray, jnp.ndarray]
Evaluate σ_x(s), σ_y(s), σ_z(s) from Pasquill-Gifford parameters.
σ_i(s) = exp(a_i + b_i · ln(s) + c_i · (ln s)²) for i ∈ {y, z}; σ_x := σ_y.
Parameters¶
distance : jnp.ndarray
Puff travel distance [m]. Non-positive values are clamped to 1 m
so that ln(s) stays finite.
params : jnp.ndarray, shape (6,)
[a_y, b_y, c_y, a_z, b_z, c_z].
Returns¶
sigma_x, sigma_y : jnp.ndarray
Horizontal dispersion coefficients [m]. σ_x = σ_y.
sigma_z : jnp.ndarray
Vertical dispersion coefficient [m].
Source code in src/plumax/gauss_puff/dispersion.py
get_dispersion_scheme
¶
Return (params_dict, calculator_fn) for a named dispersion scheme.
Parameters¶
scheme : str
One of 'pg' (Pasquill-Gifford, default) or 'briggs'.
Raises¶
ValueError
If scheme is not a registered key.
Source code in src/plumax/gauss_puff/dispersion.py
get_pg_params
¶
Return the Pasquill-Gifford parameter vector for a stability class.
Parameters¶
stability_class : str
One of 'A', 'B', 'C', 'D', 'E', 'F'.
Returns¶
params : jnp.ndarray, shape (6,)
[a_y, b_y, c_y, a_z, b_z, c_z].
Raises¶
ValueError
If stability_class is not one of A-F.
Source code in src/plumax/gauss_puff/dispersion.py
evolve_puffs
¶
evolve_puffs(schedule: WindSchedule, release_times: Float[Array, N], current_time: Float[Array, ''], source_location: tuple[float, float, float], puff_mass: Float[Array, N] | float, position_disturbance: tuple[Float[Array, N], Float[Array, N]] | None = None) -> PuffState
Advance a puff ensemble to current_time under a time-varying wind.
Uses :func:cumulative_wind_integrals to compute (I_u, I_v, S) at the
release times and at current_time in a single diffrax solve, then
derives per-puff positions and travel distances as differences.
Puffs with release_times > current_time are "not yet released" — their
mass is set to 0 and position is placed at the source, so they contribute
nothing to the downstream field.
Parameters¶
schedule : WindSchedule
Time-varying wind field.
release_times : Float[Array, "N"]
Monotone increasing puff release times [s].
current_time : Float[Array, ""]
Evaluation time [s].
source_location : tuple of float, (3,)
(x, y, z) source coordinates [m]. z ≥ 0.
puff_mass : Float[Array, "N"] or float
Per-puff mass [kg], or a scalar applied to all puffs.
position_disturbance : tuple of Float[Array, "N"], optional
Per-puff (Δx, Δy) offsets [m] applied on top of the wind advection.
Intended for OU-process turbulence samples (see
:func:plumax.gauss_puff.turbulence.sample_ou_offsets),
but any caller-provided offset array is accepted. Offsets for
not-yet-released puffs are ignored.
Returns¶
puff_state : PuffState
Puff positions, travel distances, and masses at current_time.
Source code in src/plumax/gauss_puff/puff.py
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 | |
frequency_to_release_interval
¶
Convert a release frequency f [Hz] into a release interval Δt [s].
Δt = 1 / f.
Source code in src/plumax/gauss_puff/puff.py
make_release_times
¶
Evenly spaced puff release times in [t_start, t_end).
Parameters¶
t_start, t_end : float
Simulation time window [s]. t_start < t_end required.
release_frequency : float
Puff release rate [Hz]. Must be > 0.
Returns¶
release_times : jnp.ndarray, shape (N,)
Times [t_start, t_start + Δt, t_start + 2Δt, ...] with
Δt = 1 / release_frequency, all strictly less than t_end.
Notes¶
The count is ceil((t_end − t_start) / Δt), so when the window is not an
exact multiple of Δt the final, partial interval still gets a
release (e.g. [0, 0.5) at 1 Hz yields one puff at t = 0, and
[0, 10.5) yields eleven). That trailing puff represents a shorter slice
of the continuous source, so its emitted mass must be weighted by its actual
interval duration — see :func:release_durations and how simulate_puff
assigns puff_mass. All release times remain strictly < t_end.
Source code in src/plumax/gauss_puff/puff.py
puff_concentration
¶
puff_concentration(x: ndarray, y: ndarray, z: ndarray, puff_x: float, puff_y: float, puff_z: float, sigma_x: float, sigma_y: float, sigma_z: float, puff_mass: float) -> jnp.ndarray
Evaluate the concentration from a single Gaussian puff (JIT).
Includes ground-reflection via an image source at z = −puff_z.
Parameters¶
x, y, z : jnp.ndarray
Receptor coordinates [m]. Broadcast-compatible.
puff_x, puff_y, puff_z : float
Puff-centre position [m]. puff_z ≥ 0.
sigma_x, sigma_y, sigma_z : float
Dispersion coefficients [m]. All > 0.
puff_mass : float
Mass of the puff [kg]. Must be ≥ 0.
Returns¶
concentration : jnp.ndarray Mass concentration [kg/m³], same shape as the broadcast of the input coordinates.
Source code in src/plumax/gauss_puff/puff.py
release_durations
¶
Per-puff emission-interval durations [s] for a continuous source.
Each puff carries the mass emitted over its interval, i.e. up to the next
release (or t_end for the last puff). The durations therefore sum to
t_end − release_times[0] exactly: interior intervals equal the release
spacing Δt while the final, possibly partial interval is the remainder.
Multiply by the emission rate Q to get the per-puff mass.
Parameters¶
release_times : jnp.ndarray, shape (N,)
Monotone increasing release times [s], as from
:func:make_release_times.
t_end : float
End of the emission window [s]; must exceed the last release time.
Returns¶
durations : jnp.ndarray, shape (N,) Per-puff interval durations [s], all > 0.
Source code in src/plumax/gauss_puff/puff.py
release_interval_to_frequency
¶
Convert a release interval Δt [s] into a release frequency f [Hz].
f = 1 / Δt. Both Δt and f are common ways to parametrise puff cadence;
this pair of helpers makes the conversion explicit.
Source code in src/plumax/gauss_puff/puff.py
simulate_puff
¶
simulate_puff(emission_rate: float | ndarray, source_location: tuple[float, float, float], wind_speed: ndarray, wind_direction: ndarray, stability_class: str, domain_x: tuple[float, float, int], domain_y: tuple[float, float, int], domain_z: tuple[float, float, int], time_array: ndarray, release_frequency: float = 1.0, scheme: str = 'pg', background_conc: float = 0.0, turbulence: OUTurbulence | None = None, turbulence_seed: int | Generator | None = None) -> xr.Dataset
Simulate a time-resolved Gaussian-puff dispersion field on a 3-D grid.
Wraps :func:evolve_puffs + :func:simulate_puff_field with grid
construction, a diffrax-driven time-varying wind solve, and optional
column integration. Returns an :class:xarray.Dataset with variables
on a (time, x, y, z) grid.
Parameters¶
emission_rate : float or ndarray
Continuous emission rate Q [kg/s]. Scalar constant Q, or an array of
length n_puffs specifying Q at each puff release time. The puff
mass is Q · Δt_release with Δt_release = 1/release_frequency.
Entries must be ≥ 0 (scalar or array); Q = 0 yields a zero field.
source_location : tuple of float, (3,)
(x, y, z) source coordinates [m]. z ≥ 0.
wind_speed : ndarray, shape (T_w,)
Wind speed [m/s] at each entry in time_array. Must be same length.
wind_direction : ndarray, shape (T_w,)
Wind direction [deg from North]. Same length as time_array.
stability_class : str
One of 'A', …, 'F'.
domain_x, domain_y, domain_z : tuple of (float, float, int)
(start, stop, n_points) for each axis.
time_array : ndarray, shape (T,)
Monotone increasing evaluation times [s].
release_frequency : float
Puff release rate [Hz]. Δt_release = 1/release_frequency. Default 1 Hz.
scheme : str
Dispersion scheme: 'pg' (Pasquill-Gifford, default) or
'briggs' (sharing coefficients with the steady plume model).
background_conc : float
Additive background concentration [kg/m³]. Default 0.
turbulence : OUTurbulence, optional
Ornstein-Uhlenbeck sub-grid turbulence applied as per-puff (Δx, Δy)
offsets at release time. Adds realistic meander on top of the
wind-driven advection. Defaults to None (deterministic puffs).
turbulence_seed : int or numpy.random.Generator, optional
Seed for the OU sampler; required for bit-exact reproducibility
when turbulence is set.
Returns¶
ds : xarray.Dataset
Variables: concentration (time, x, y, z) [kg/m³],
column_concentration (time, x, y) [kg/m²],
wind_speed/wind_direction (time,).
Raises¶
ValueError On invalid stability class, non-positive emission rate, shape mismatches, unknown scheme, or malformed domain tuples.
Source code in src/plumax/gauss_puff/puff.py
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 | |
simulate_puff_field
¶
simulate_puff_field(receptor_coords: tuple[Float[Array, P], Float[Array, P], Float[Array, P]], puff_state: PuffState, dispersion_params: Float[Array, 6], dispersion_fn: Callable) -> Float[Array, P]
Sum the contributions of all puffs at each receptor.
Parameters¶
receptor_coords : tuple of Float[Array, "P"]
(x, y, z) receptor coordinates [m].
puff_state : PuffState
Per-puff positions, travel distances, and masses.
dispersion_params : Float[Array, "6"]
Dispersion coefficient vector for the chosen scheme and stability class.
dispersion_fn : callable
A function with signature (distance, params) → (σ_x, σ_y, σ_z).
See :func:plumax.gauss_puff.dispersion.calculate_pg_dispersion
and :func:calculate_briggs_dispersion_xyz.
Returns¶
concentration : Float[Array, "P"] Total concentration [kg/m³] at each receptor.
Source code in src/plumax/gauss_puff/puff.py
sample_ou_offsets
¶
sample_ou_offsets(turbulence: OUTurbulence, release_times: Float[ndarray, N] | ndarray, seed: int | Generator | None = None) -> tuple[np.ndarray, np.ndarray]
Draw per-puff (Δx, Δy) offsets from a 2-D OU process at release times.
Integrates the OU SDE via its exact transition density — the two-point
Gaussian update that is exact for constant coefficients — so the result
is statistically correct even for coarse release_times spacing and
does not accumulate Euler-Maruyama bias.
Parameters¶
turbulence : OUTurbulence
Turbulence parameters.
release_times : ndarray, shape (N,)
Puff release times [s]. Must be monotone non-decreasing. The first
puff starts at the OU stationary distribution so the ensemble is
already mixed (no warm-up transient visible in the field).
seed : int or numpy.random.Generator, optional
Seed or generator for reproducibility. If None a fresh default
generator is used and results will vary across calls.
Returns¶
dx, dy : ndarray, shape (N,)
Per-puff position offsets [m], to be added to the advected puff
centres in :func:~plumax.gauss_puff.puff.evolve_puffs.
Source code in src/plumax/gauss_puff/turbulence.py
cumulative_wind_integrals
¶
cumulative_wind_integrals(schedule: WindSchedule, save_at: Float[Array, M], rtol: float = 1e-06, atol: float = 1e-08) -> tuple[Float[Array, M], Float[Array, M], Float[Array, M]]
Compute cumulative wind integrals via a single diffrax ODE solve.
Integrates d(I_u, I_v, S)/dt = (u(t), v(t), √(u² + v²)) from
schedule.times[0] to max(save_at[-1], schedule.times[-1]) with
initial condition (0, 0, 0) using :class:diffrax.Tsit5 with an
adaptive :class:diffrax.PIDController, saving at the requested times.
Parameters¶
schedule : WindSchedule
Time-varying wind field.
save_at : Float[Array, "M"]
Monotone non-decreasing times [s] at which to return the integrals.
Save times outside [schedule.times[0], schedule.times[-1]] are
evaluated using the linear extrapolation supported by
:attr:WindSchedule — use the schedule knots to bound the physically
meaningful range when that matters.
rtol, atol : float
Relative and absolute tolerances for the adaptive step controller.
Returns¶
I_u, I_v, S : Float[Array, "M"]
Cumulative integrals of u, v, and wind speed, each evaluated at
save_at.
Source code in src/plumax/gauss_puff/wind.py
gaussian_puff_model
¶
gaussian_puff_model(observations: ndarray | None = None, receptor_coords: tuple[ndarray, ndarray, ndarray] | None = None, observation_times: ndarray | None = None, source_location: tuple[float, float, float] | None = None, schedule: WindSchedule | None = None, release_times: ndarray | None = None, release_interval: float | None = None, stability_class: str = 'C', scheme: str = 'pg', prior_emission_rate_mean: float = 0.1, prior_emission_rate_std: float = 0.05, background_prior_std: float = 5e-07, obs_noise_std: float = 5e-07, puff_durations: ndarray | None = None) -> jnp.ndarray
NumPyro model for the Gaussian puff forward with a constant Q prior.
Priors
emission_rate ~ LogNormal(μ_log, σ_log) [kg/s] background ~ HalfNormal(σ_bg) [kg/m³]
Likelihood
obs ~ Normal(f_puff(emission_rate, ...) + background, σ_obs)
where (μ_log, σ_log) are the log-space parameters derived from the
requested real-scale (prior_emission_rate_mean, prior_emission_rate_std).
Parameters¶
observations : jnp.ndarray, shape (N,), optional
Observed concentrations [kg/m³]. If None, runs in prior-predictive mode.
receptor_coords : tuple of jnp.ndarray, optional
(x, y, z) each shape (N,) [m].
observation_times : jnp.ndarray, shape (N,), optional
Time at which each observation was taken [s]. Matches observations
in length.
source_location : tuple of float, (3,), optional
schedule : WindSchedule, optional
release_times : jnp.ndarray, shape (N_puffs,), optional
release_interval : float, optional
Δt_release [s]. Required (as a presence flag) when a forward
evaluation is needed. Used for the per-puff mass m = Q · Δt only as
a fallback when puff_durations is not supplied.
puff_durations : jnp.ndarray, shape (N_puffs,), optional
Per-puff emission-interval durations [s] (from
:func:plumax.gauss_puff.puff.release_durations). When given, the
per-puff mass is m_i = Q · duration_i — so the trailing, possibly
partial interval carries only its actual duration, matching
simulate_puff and conserving emitted mass. Falls back to
Q · release_interval for every puff when omitted.
stability_class : str
scheme : str
Dispersion scheme: 'pg' or 'briggs'.
prior_emission_rate_mean, prior_emission_rate_std : float
background_prior_std, obs_noise_std : float
Source code in src/plumax/gauss_puff/inference.py
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 285 286 287 288 | |
gaussian_puff_rw_model
¶
gaussian_puff_rw_model(observations: ndarray, receptor_coords: tuple[ndarray, ndarray, ndarray], observation_times: ndarray, source_location: tuple[float, float, float], schedule: WindSchedule, release_times: ndarray, release_interval: float, stability_class: str = 'C', scheme: str = 'pg', prior_emission_rate_mean: float = 0.1, prior_emission_rate_std: float = 0.05, rw_step_std: float = 0.02, background_prior_std: float = 5e-07, obs_noise_std: float = 5e-07, puff_durations: ndarray | None = None) -> jnp.ndarray
Random-walk state-space model for a time-varying emission rate Q_i.
Each puff i has its own emission rate Q_i. A Gaussian random walk
on ln Q_i gives a smoothness prior, with the first step anchored by
the LogNormal(prior_mean, prior_std) prior:
ln Q_0 ~ Normal(μ_log, σ_log)
ln Q_i | ln Q_{i−1} ~ Normal(ln Q_{i−1}, rw_step_std) for i ≥ 1
Q_i = exp(ln Q_i) [kg/s]
Likelihood is the same as :func:gaussian_puff_model.
Source code in src/plumax/gauss_puff/inference.py
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 | |
infer_emission_rate
¶
infer_emission_rate(observations: NDArray, observation_coords: tuple[NDArray, NDArray, NDArray], observation_times: NDArray, source_location: tuple[float, float, float], wind_times: NDArray, wind_speed: NDArray, wind_direction: NDArray, release_frequency: float, t_start: float, t_end: float, stability_class: str = 'C', scheme: str = 'pg', prior_mean: float = 0.1, prior_std: float = 0.05, obs_noise_std: float = 5e-07, num_warmup: int = 500, num_samples: int = 1000, num_chains: int = 1, seed: int = 0, progress_bar: bool = False, print_summary: bool = False) -> dict[str, NDArray]
NUTS inference of a constant emission rate from puff observations.
Parameters¶
observations : ndarray, shape (N,)
Observed concentrations [kg/m³].
observation_coords : tuple of ndarray, each shape (N,)
(x, y, z) receptor coordinates [m].
observation_times : ndarray, shape (N,)
Evaluation time for each observation [s].
source_location : tuple of float, (3,)
wind_times, wind_speed, wind_direction : ndarray, shape (T_w,)
Wind schedule. Direction follows the meteorological "from" convention.
release_frequency : float
Puff release rate [Hz].
t_start, t_end : float
Simulation window [s]. Release times are laid down on [t_start, t_end).
stability_class : str
scheme : str
Dispersion scheme: 'pg' or 'briggs'.
prior_mean, prior_std : float
Real-scale prior moments for Q.
num_warmup, num_samples, num_chains, seed : int
progress_bar, print_summary : bool
Returns¶
samples : dict[str, ndarray]
Posterior draws keyed by site name: 'emission_rate', 'background'.
Source code in src/plumax/gauss_puff/inference.py
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 | |
infer_emission_timeseries
¶
infer_emission_timeseries(observations: NDArray, observation_coords: tuple[NDArray, NDArray, NDArray], observation_times: NDArray, source_location: tuple[float, float, float], wind_times: NDArray, wind_speed: NDArray, wind_direction: NDArray, release_frequency: float, t_start: float, t_end: float, stability_class: str = 'C', scheme: str = 'pg', prior_mean: float = 0.1, prior_std: float = 0.05, rw_step_std: float = 0.02, obs_noise_std: float = 5e-07, num_warmup: int = 500, num_samples: int = 1000, num_chains: int = 1, seed: int = 0, progress_bar: bool = False, print_summary: bool = False) -> dict[str, NDArray]
NUTS inference of a time-varying emission rate series Q_i.
Uses a Gaussian random-walk prior on ln Q along puff indices, anchored
by the LogNormal(prior_mean, prior_std) prior on ln Q_0. See
:func:gaussian_puff_rw_model.
Returns posterior draws with key 'emission_rate' of shape
(num_samples, n_puffs).
Source code in src/plumax/gauss_puff/inference.py
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 | |