def METHOD_NAME(poni):
    """Convert a Geometry|PONI object to the geometry of Fit2D
    Please see the doc from Fit2dGeometry
    :param poni: azimuthal integrator, geometry or poni
    :return: same geometry as a Fit2dGeometry named-tuple
    """
    poni = PoniFile(poni)
    cos_tilt = cos(poni._rot1) * cos(poni._rot2)
    sin_tilt = sqrt(1.0 - cos_tilt * cos_tilt)
    tan_tilt = sin_tilt / cos_tilt
    # This is tilt plane rotation
    if sin_tilt == 0:
        # tilt plan rotation is undefined when there is no tilt!, does not matter
        cos_tilt = 1.0
        sin_tilt = 0.0
        cos_tpr = 1.0
        sin_tpr = 0.0
    else:
        cos_tpr = max(-1.0, min(1.0, -cos(poni._rot2) * sin(poni._rot1) / sin_tilt))
        sin_tpr = sin(poni._rot2) / sin_tilt
    directDist = 1.0e3 * poni._dist / cos_tilt
    tilt = degrees(acos(cos_tilt))
    if sin_tpr < 0:
        tpr = -degrees(acos(cos_tpr))
    else:
        tpr = degrees(acos(cos_tpr))
    centerX = (poni._poni2 + poni.dist * tan_tilt * cos_tpr) / poni.detector.pixel2
    if abs(tilt) < 1e-5:  # in degree
        centerY = (poni.poni1) / poni.detector.pixel1
    else:
        centerY = (poni._poni1 + poni.dist * tan_tilt * sin_tpr) / poni.detector.pixel1
    out = poni.detector.getFit2D()
    out["directDist"] = directDist
    out["centerX"] = centerX
    out["centerY"] = centerY
    out["tilt"] = tilt
    out["tiltPlanRotation"] = tpr
    out["detector"] = poni.detector
    out["pixelX"] = poni.detector.pixel2 * 1e6
    out["pixelY"] = poni.detector.pixel1 * 1e6
    out["splineFile"] = poni.detector.splineFile
    if poni.wavelength:
        out["wavelength"] = poni.wavelength * 1e10
    return Fit2dGeometry(**out)