dartobsgen.ModelStateProvider#

class dartobsgen.ModelStateProvider[source]#

Bases: ABC

Supplies one single-timeslice model state per assimilation window.

__init__()#

Methods

__init__()

available_times()

Return the valid times of every state this provider can serve.

state_for_window(date0, date1)

Return the model state for the window (date0, date1].

abstractmethod state_for_window(date0, date1)[source]#

Return the model state for the window (date0, date1].

The interval is open below and closed above, matching the window perfect_model_obs is given (first_obs = date0 + 1s, last_obs = date1). A state landing exactly on date0 belongs to the previous window; returning it here would place every observation one second before first_obs.

Returns:

None if no model state falls within the window; the window is then skipped (no obs_seq file is written).

Return type:

ModelState or None

Parameters:
available_times()[source]#

Return the valid times of every state this provider can serve.

Sorted ascending. The default returns None, meaning the provider cannot enumerate its states; PerfectModelSource then skips its pre-flight coverage check rather than guessing. Override this in providers that index their input up front, so a mismatch between the run’s analysis times and the model output times is reported before any window runs.

Return type:

list[datetime] | None