tobac.analysis.spatial.find_dataframe_horizontal_coords#
- tobac.analysis.spatial.find_dataframe_horizontal_coords(variable_dataframe, hdim1_coord=None, hdim2_coord=None, coord_type=None)#
Function to find the coordinates for the horizontal dimensions in a dataframe, either in Cartesian (xy) or Lat/Lon space. If both Cartesian and lat/lon coordinates exist, the cartesian coords will take priority
- Parameters:
variable_dataframe (pd.DataFrame) – Input dataframe
hdim1_coord (Optional[str], optional) – First horzontal coordinate name, by default None
hdim2_coord (Optional[str], optional) – Second horizontal coordinate name, by default None
coord_type (Optional[Literal[xy, latlon]], optional) – The coordinate type to search for, either ‘xy’ or ‘latlon’, must be set if providing either hdim1_coord or hdim2_coord parameters, by default None
- Returns:
First horzontal coordinate name, second horizontal coordinate name, and the coordinate type
- Return type:
Tuple[str, str, str]
- Raises:
ValueError – If coord_type is not set when either hdim1_coord or hdim2_coord are
ValueError – If no coordinates are found using the defaults for either xy or latlon