<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dobingham(di_block):
 """ Calculates the Bingham mean and associated statistical parameters from directions that are input as a di_block Parameters di_block : a nested list of [dec,inc] or [dec,inc,intensity] Returns ------- bpars : dictionary containing the Bingham mean and associated statistics dictionary keys dec : mean declination inc : mean inclination n : number of datapoints Eta : major ellipse Edec : declination of major ellipse axis Einc : inclination of major ellipse axis Zeta : minor ellipse Zdec : declination of minor ellipse axis Zinc : inclination of minor ellipse axis """

    control, X, bpars = [], [], {}
    N = len(di_block)
    if N < 2:
        return bpars
#
#  get cartesian coordinates
#
    for rec in di_block:
        X.append(dir2cart([rec[0], rec[1], 1.]))
#
#   put in T matrix
#
    T = np.array(Tmatrix(X))
    t, V = tauV(T)
    w1, w2, w3 = t[2], t[1], t[0]
    k1, k2 = binglookup(w1, w2)
    PDir = cart2dir(V[0])
    EDir = cart2dir(V[1])
    ZDir = cart2dir(V[2])
    if PDir[1] < 0:
        PDir[0] += 180.
        PDir[1] = -PDir[1]
    PDir[0] = PDir[0] % 360.
    bpars["dec"] = PDir[0]
    bpars["inc"] = PDir[1]
    bpars["Edec"] = EDir[0]
    bpars["Einc"] = EDir[1]
    bpars["Zdec"] = ZDir[0]
    bpars["Zinc"] = ZDir[1]
    bpars["n"] = N
#
#  now for Bingham ellipses.
#
    fac1, fac2 = -2 * N * (k1) * (w3 - w1), -2 * N * (k2) * (w3 - w2)
    sig31, sig32 = np.sqrt(old_div(1., fac1)), np.sqrt(old_div(1., fac2))
    bpars["Zeta"], bpars["Eta"] = 2.45 * sig31 * \
        180. / np.pi, 2.45 * sig32 * 180. / np.pi
    return bpars