geost.bro.geotop.GeotopUnits.select_unit_contains#
- GeotopUnits.select_unit_contains(substring: str | list[str], case_sensitive: bool = False) GeotopUnits[source]#
Select metadata by a substring for a partial unit code or codes.
- Parameters:
substring (str | list[str]) – Substring or list of substrings to match within the unit codes.
case_sensitive (bool, optional) – Whether the match should be case-sensitive, by default False.
- Returns:
class – GeotopUnits instance containing the metadata subset for the selected units.
- Return type:
~geost.bro.geotop.GeotopUnits
- Raises:
MissingUnitError – Raised if none of the specified substrings are present in the metadata.
Examples
Select units from the stratigraphic metadata of GeoTOP that contain a specific substring:
>>> gtp_meta_strat = geost.bro.get_geotop_metadata_strat() >>> selected_meta = gtp_meta_strat.select_unit_contains("NIHO") # Select a single substring >>> selected_meta = gtp_meta_strat.select_unit_contains(["NIHO", "NIBA"]) # Select multiple substrings