match
match(
obs,
mod,
*,
obs_item=None,
mod_item=None,
gtype=None,
max_model_gap=None,
spatial_method=None,
spatial_tolerance=0.001,
obs_no_overlap='error',
)Match observation and model result data in space and time
NOTE: In case of multiple model results with different time coverage, only the overlapping time period will be used! (intersection)
NOTE: In case of multiple observations, multiple models can only be matched if they are all of SpatialField type, e.g. DfsuModelResult or GridModelResult.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| obs | (str, Path, pd.DataFrame, Observation, Sequence[Observation]) | Observation(s) to be compared | required |
| mod | (str, Path, pd.DataFrame, ModelResult, Sequence[ModelResult]) | Model result(s) to be compared | required |
| obs_item | int or str | observation item if obs is a file/dataframe, by default None | None |
| mod_item | (int, str) | model item if mod is a file/dataframe, by default None | None |
| gtype | (str, optional) | Geometry type of the model result (if mod is a file/dataframe). If not specified, it will be guessed. | None |
| max_model_gap | (float, optional) | Maximum time gap (s) in the model result (e.g. for event-based model results), by default None | None |
| spatial_method | str | For Dfsu- and GridModelResult, spatial interpolation/selection method. - For DfsuModelResult, one of: ‘contained’ (=isel), ‘nearest’, ‘inverse_distance’ (with 5 nearest points), by default “inverse_distance”. - For GridModelResult, passed to xarray.interp() as method argument, by default ‘linear’. | None |
| spatial_tolerance | float | Spatial tolerance (in the units of the coordinate system) for matching model track points to observation track points. Model points outside this tolerance will be discarded. Only relevant for TrackModelResult and TrackObservation, by default 1e-3. | 0.001 |
| obs_no_overlap | Literal['ignore', 'error', 'warn'] | How to handle observations with no overlap with model results. One of: ‘ignore’, ‘error’, ‘warn’, by default ‘error’. | 'error' |
Returns
| Name | Type | Description |
|---|---|---|
| Comparer | In case of a single observation | |
| ComparerCollection | In case of multiple observations |
See Also
from_matched - Create a Comparer from observation and model results that are already matched