INNER CODE UNIT · Python
_prepare_profile_inputs
QianyeSu/Skyborn · src/skyborn/calc/GPI/core.py:338
def _prepare_profile_inputs(
sst: float,
psl: float,
pressure_levels: np.ndarray,
temperature: np.ndarray,
mixing_ratio: np.ndarray,
actual_levels: Optional[int] = None,
) -> _PreparedInputs:
"""Validate, reorder, and materialize single-profile inputs."""
expected_len = len(np.asarray(pressure_levels))
if len(temperature) != expected_len or len(mixing_ratio) != expected_len:
raise ValueError(
f"Profile lengths mismatch - pressure: {expected_len}, temperature: {len(temperature)}, mixing_ratio: {len(mixing_ratio)}"
)
(pressure_levels, temperature, mixing_ratio), _has_missing = _validate_input_arrays(
pressure_levels,
temperature,