lithology_choice¶
petrophys.interpretation.lithology.labels.lithology_choice
- lithology_choice(lithology, options)[source]¶
The option of a lithology parameter (a function’s choices declared with role
lithology) that a rock takes, or None when no option names it.lithologyis a rock name or a lithology group (lithology_group_for_label()reads it). The rock takes, in order: the option its name is (“shaly sandstone” isshaly_sandstonewhere that is an option); its own group, when that is an option; the matrix the workflow’s porosity step uses for the group (siltandshaletakesandstonegrains,calcareous_shalelimestone,chertquartz), when that is an option;evaporitefor an evaporite group (halite, anhydrite, gypsum and the potash salts), when that is an option. A name that is no recognized rock, or a rock no option names, is None: the caller says so and leaves the parameter at its default.Examples
>>> m = ("limestone", "sandstone", "dolomite", "quartz") >>> [lithology_choice(x, m) for x in ("Sst", "SILT", "shaly sandstone", "calcareous_shale", "chert", "halite")] ['sandstone', 'sandstone', 'sandstone', 'limestone', 'quartz', None] >>> lithology_choice("ANHYDRITE", ("sandstone", "shale", "evaporite")) 'evaporite' >>> lithology_choice("CALCAREOUS SHALE", ("sandstone", "shale", "calcareous_shale")) 'calcareous_shale' >>> [lithology_choice("Shaly Sandstone", o) for o in (("sandstone", "shaly_sandstone"), m)] ['shaly_sandstone', 'sandstone'] >>> lithology_choice("sand/shale", m) is None True
- Parameters:
lithology (object)
options (Collection[str])
- Return type:
str | None