# sec_interp.core.utils.parsing module

Coordinate and string parsing utilities.

sec_interp.core.utils.parsing.parse_strike(value: Any) → float | None

  Parse a strike value from various formats into an azimuth (0-360).

  Supports numeric values, strings, and quadrant notation (e.g., “N 30 E”, “S 45 W”).

  Parameters:

    value – The raw strike value (string, int, float, or None).

  Returns:

    Strike in azimuth degrees (0-360) or None if parsing fails.

sec_interp.core.utils.parsing.parse_dip(value: Any) → tuple[float | None, float | None]

  Parse a dip value from various formats.

  Supports numeric dip (“45”) and field notation with direction (“45 NE”, “22 SW”).

  Parameters:

    value – The raw dip value.

  Returns:

    A tuple of (dip_angle, dip_direction_azimuth). Values are None if parsing fails.

sec_interp.core.utils.parsing.cardinal_to_azimuth(text: str) → float | None

  Convert a cardinal direction string to its equivalent azimuth.

  Supports: N, NE, E, SE, S, SW, W, NW.

  Parameters:

    text – The cardinal direction string.

  Returns:

    The azimuth in degrees (0-360), or None if invalid.