def latitude_from_cross_section(cross):
    """Calculate the latitude of points in a cross-section.

    Parameters
    ----------
    cross : `xarray.DataArray`
        The input DataArray of a cross-section from which to obtain latitudes.

    Returns
    -------
    latitude : `xarray.DataArray`
        Latitude of points

    """
    y = cross.metpy.y
    if CFConventionHandler.check_axis(y, 'lat'):
        return y
    else:
        import cartopy.crs as ccrs
        latitude = ccrs.Geodetic().transform_points(cross.metpy.cartopy_crs,
                                                    cross.metpy.x.values,
                                                    y.values)[..., 1]
        latitude = xr.DataArray(latitude, coords=y.coords, dims=y.dims,
                                attrs={'units': 'degrees_north'})
        return latitude
def latitude_from_cross_section ( cross ) : y = cross . metpy . y if CFConventionHandler . check_axis ( y , 'lat' ) : return y else : import cartopy . crs as ccrs latitude = ccrs . Geodetic ( ) . transform_points ( cross . metpy . cartopy_crs , cross . metpy . x . values , y . values ) [ ... , 1 ] latitude = xr . DataArray ( latitude , coords = y . coords , dims = y . dims , attrs = { 'units' : 'degrees_north' } ) return latitude
Calculate the latitude of points in a cross-section.

    Parameters
    ----------
    cross : `xarray.DataArray`
        The input DataArray of a cross-section from which to obtain latitudes.

    Returns
    -------
    latitude : `xarray.DataArray`
        Latitude of points