main_time_dims#
- geobricks.main_time_dims(data_ds, all_coords=False, all_vars=False)[source]#
Infer the time dimension and the other main time variables from a dataset.
Parameters#
- data_dsxarray.Dataset or geopandas.GeoDataFrame
Data whose time variable(s) will be retrieved.
- all_coordsbool, default False
Only used if
data_ds
is a xarray variable. If False, only dimensions are considered as potential time coordinates. If True, even coordinates not associated to any dimension will be considered as well as potential time coordinates (alongdims
).- all_varsbool, default False
Only used if
data_ds
is a xarray variable. If True, data variables (data_vars
) will be considered as well as potential time coordinates (alongdims
).
Returns#
- varlist of str
List of potential time coordinate names, the first one being the most relevant.