Instruction:
Can you generate the documentation for the following Python 3 function
def binglookup(w1i, w2i):
    K = {'0.06': {'0.02': ['-25.58', '-8.996'], '0.06': ['-9.043', '-9.043'], '0.04': ['-13.14', '-9.019']}, '0.22': {'0.08': ['-6.944', '-2.644'], '0.02': ['-25.63', '-2.712'], '0.20': ['-2.649', '-2.354'], '0.06': ['-9.027', '-2.673'], '0.04': ['-13.17', '-2.695'], '0.14': ['-4.071', '-2.521'], '0.16': ['-3.518', '-2.470'], '0.10': ['-5.658', '-2.609'], '0.12': ['-4.757', '-2.568'], '0.18': ['-3.053', '-2.414'], '0.22': ['-2.289', '-2.289']}, '0.46': {'0.02': ['-25.12', '-0.250'], '0.08': ['-6.215', '0.000'], '0.06': ['-8.371', '-0.090'], '0.04': ['-12.58', '-0.173']}, '0.44': {'0.08': ['-6.305', '-0.186'], '0.02': ['-25.19', '-0.418'], '0.06': ['-8.454', '-0.270'], '0.04': ['-12.66', '-0.347'], '0.10': ['-4.955', '-0.097'], '0.12': ['-3.992', '0.000']}, '0.42': {'0.08': ['-6.388', '-0.374'], '0.02': ['-25.5', '-0.589'], '0.06': ['-8.532', '-0.452'], '0.04': ['-12.73', '-0.523'], '0.14': ['-3.349', '-0.104'], '0.16': ['-2.741', '0.000'], '0.10': ['-5.045', '-0.290'], '0.12': ['-4.089', '-0.200']}, '0.40': {'0.08': ['-6.466', '-0.564'], '0.02': ['-25.31', '-0.762'], '0.20': ['-1.874', '-0.000'], '0.06': ['-8.604', '-0.636'], '0.04': ['-12.80', '-0.702'], '0.14': ['-3.446', '-0.312'], '0.16': ['-2.845', '-0.215'], '0.10': ['-5.126', '-0.486'], '0.12': ['-4.179', '-0.402'], '0.18': ['-2.330', '-0.111']}, '0.08': {'0.02': ['-25.6', '-6.977'], '0.08': ['-7.035', '-7.035'], '0.06': ['-9.065', '-7.020'], '0.04': ['-13.16', '-6.999']}, '0.28': {'0.08': ['-6.827', '-1.828'], '0.28': ['-1.106', '-1.106'], '0.02': ['-25.57', '-1.939'], '0.20': ['-2.441', '-1.458'], '0.26': ['-1.406', '-1.203'], '0.24': ['-1.724', '-1.294'], '0.06': ['-8.928', '-1.871'], '0.04': ['-13.09', '-1.908'], '0.14': ['-3.906', '-1.665'], '0.16': ['-3.338', '-1.601'], '0.10': ['-5.523', '-1.779'], '0.12': ['-4.606', '-1.725'], '0.18': ['-2.859', '-1.532'], '0.22': ['-2.066', '-1.378']}, '0.02': {'0.02': ['-25.55', '-25.55']}, '0.26': {'0.08': ['-6.870', '-2.078'], '0.02': ['-25.59', '-2.175'], '0.20': ['-2.515', '-1.735'], '0.26': ['-1.497', '-1.497'], '0.24': ['-1.809', '-1.582'], '0.06': ['-8.96 6', '-2.117'], '0.04': ['-13.12', '-2.149'], '0.14': ['-3.965', '-1.929'], '0.16': ['-3.403', '-1.869'], '0.10': ['-5.573', '-2.034'], '0.12': ['-4.661', '-1.984'], '0.18': ['-2.928', '-1.805'], '0.22': ['-2.1 46', '-1.661']}, '0.20': {'0.08': ['-6.974', '-2.973'], '0.02': ['-25.64', '-3.025'], '0.20': ['-2.709', '-2.709'], '0.06': ['-9.05', '-2.997'], '0.04': ['-13.18', '-3.014'], '0.14': ['-4.118', '-2.863'], '0.1 6': ['-3.570', '-2.816'], '0.10': ['-5.694', '-2.942'], '0.12': ['-4.799', '-2.905'], '0.18': ['-3.109', '-2.765']}, '0.04': {'0.02': ['-25.56', '-13.09'], '0.04': ['-13.11', '-13.11']}, '0.14': {'0.08': ['-7.  033', '-4.294'], '0.02': ['-25.64', '-4.295'], '0.06': ['-9.087', '-4.301'], '0.04': ['-13.20', '-4.301'], '0.14': ['-4.231', '-4.231'], '0.10': ['-5.773', '-4.279'], '0.12': ['-4.896', '-4.258']}, '0.16': {'0 .08': ['-7.019', '-3.777'], '0.02': ['-25.65', '-3.796'], '0.06': ['-9.081', '-3.790'], '0.04': ['-13.20', '-3.796'], '0.14': ['-4.198', '-3.697'], '0.16': ['-3.659', '-3.659'], '0.10': ['-5.752', '-3.756'], ' 0.12': ['-4.868', '-3.729']}, '0.10': {'0.02': ['-25.62', '-5.760'],
                                                                                '0.08': ['-7.042', '-5.798'], '0.06': ['-9.080', '-5.791'], '0.10': ['-5.797', '-5.797'], '0.04': ['-13.18', '-5.777']}, '0.12': {'0.08': [' -7.041', '-4.941'], '0.02': ['-25.63', '-4.923'], '0.06': ['-9.087', '-4.941'], '0.04': ['-13.19', '-4.934'], '0.10': ['-5.789', '-4.933'], '0.12': ['-4.917', '-4.917']}, '0.18': {'0.08': ['-6.999', '-3.345'], '0.02': ['-25.65', '-3.381'], '0.06': ['-9.068', '-3.363'], '0.04': ['-13.19', '-3.375'], '0.14': ['-4.160', '-3.249'], '0.16': ['-3.616', '-3.207'], '0.10': ['-5.726', '-3.319'], '0.12': ['-4.836', '-3.287'], '0.18': ['-3.160', '-3.160']}, '0.38': {'0.08': ['-6.539', '-0.757'], '0.02': ['-25.37', '-0.940'], '0.20': ['-1.986', '-0.231'], '0.24': ['-1.202', '0.000'], '0.06': ['-8.670', '-0.824'], '0.04': ['-12.86', '-0.885'], '0.14': ['-3.536', '-0.522'], '0.16': ['-2.941', '-0.432'], '0.10': ['-5.207', '-0.684'], '0.12': ['-4.263', '-0.606'], '0.18': ['-2.434', '-0.335'], '0.22': ['-1.579', '-0.120']}, '0.36': {'0.08': ['-6.606', '-9.555'], '0.28': ['-0.642', '0.000'], '0.02': ['-25.42', '-1.123'], '0.20': ['-2.089', '-0.464'], '0.26': ['-0.974', '-0.129'], '0.24': ['-1.322', '-0.249'], '0.06': ['-8.731', '-1.017'], '0.04': ['-12.91', '-1.073'], '0.14': ['-3.620', '-0.736'], '0.16': ['-3.032', '-0.651'], '0.10': ['-5.280', '-0.887'], '0.12': ['-4.342', '-0.814'], '0.18': ['-2.531', '-0.561'], '0.22': ['-1.690', '-0.360']}, '0.34 ': {'0.08': ['-6.668', '-1.159'], '0.28': ['-0.771', '-0.269'], '0.02': ['-25.46', '-1.312'], '0.20': ['-2.186', '-0.701'], '0.26': ['-1.094', '-0.389'], '0.24': ['-1.433', '-0.500'], '0.06': ['-8.788', '-1.21 6'], '0.32': ['-0.152', '0.000'], '0.04': ['-12.96', '-1.267'], '0.30': ['-0.459', '-0.140'], '0.14': ['-3.699', '-0.955'], '0.16': ['-3.116', '-0.876'], '0.10': ['-5.348', '-1.096'], '0.12': ['-4.415', '-1.02 8'], '0.18': ['-2.621', '-0.791'], '0.22': ['-1.794', '-0.604']}, '0.32': {'0.08': ['-6.725', '-1.371'], '0.28': ['-0.891', '-0.541'], '0.02': ['-25.50', '-1.510'], '0.20': ['-2.277', '-0.944'], '0.26': ['-1.2 06', '-0.653'], '0.24': ['-1.537', '-0.756'], '0.06': ['-8.839', '-1.423'], '0.32': ['-0.292', '-0.292'], '0.04': ['-13.01', '-1.470'], '0.30': ['-0.588', '-0.421'], '0.14': ['-3.773', '-1.181'], '0.16': ['-3.  195', '-1.108'], '0.10': ['-5.411', '-1.313'], '0.12': ['-4.484', '-1.250'], '0.18': ['-2.706', '-1.028'], '0.22': ['-1.891', '-0.853']}, '0.30': {'0.08': ['-6.778', '-1.596'], '0.28': ['-1.002', '-0.819'], '0 .02': ['-25.54', '-1.718'], '0.20': ['-2.361', '-1.195'], '0.26': ['-1.309', '-0.923'], '0.24': ['-1.634', '-1.020'], '0.06': ['-8.886', '-1.641'], '0.04': ['-13.05', '-1.682'], '0.30': ['-0.708', '-0.708'], ' 0.14': ['-3.842', '-1.417'], '0.16': ['-3.269', '-1.348'], '0.10': ['-5.469', '-1.540'], '0.12': ['-4.547', '-1.481'], '0.18': ['-2.785', '-1.274'], '0.22': ['-1.981', '-1.110']}, '0.24': {'0.08': ['-6.910', ' -2.349'], '0.02': ['-25.61', '-2.431'], '0.20': ['-2.584', '-2.032'], '0.24': ['-1.888', '-1.888'], '0.06': ['-8.999', '-2.382'], '0.04': ['-23.14', '-2.410'], '0.14': ['-4.021', '-2.212'], '0.16': ['-3.463', '-2.157'], '0.10': ['-5.618', '-2.309'], '0.12': ['-4.711', '-2.263'], '0.18': ['-2.993', '-2.097'], '0.22': ['-2.220', '-1.963']}}
    w1, w2 = 0., 0.
    wstart, incr = 0.01, 0.02
    if w1i < wstart:
        w1 = '%4.2f' % (wstart + old_div(incr, 2.))
    if w2i < wstart:
        w2 = '%4.2f' % (wstart + old_div(incr, 2.))
    wnext = wstart + incr
    while wstart < 0.5:
        if w1i >= wstart and w1i < wnext:
            w1 = '%4.2f' % (wstart + old_div(incr, 2.))
        if w2i >= wstart and w2i < wnext:
            w2 = '%4.2f' % (wstart + old_div(incr, 2.))
        wstart += incr
        wnext += incr
    k1, k2 = float(K[w2][w1][0]), float(K[w2][w1][1])
    return k1, k2

Response: A binglookup function that returns a list of bingham statistics for the given window.


Instruction:
How would you implement a function in Python 3 that
spits out the cdf for data to file

Response:
def cdfout(data, file):
    """
    spits out the cdf for data to file
    """
    f = open(file, "w")
    data.sort()
    for j in range(len(data)):
        y = old_div(float(j), float(len(data)))
        out = str(data[j]) + ' ' + str(y) + '\n'
        f.write(out)
    f.close()


Instruction:
Write a Python 3 script to
calculate the Bingham mean and associated statistical parameters from a nested list of dec inc intensity and intensity.

Response:
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


Instruction:
Write a Python 3 script to
flip lower hemisphere data to upper hemisphere data

Response:
def doflip(dec, inc):
    """
    flips lower hemisphere data to upper hemisphere
    """
    if inc < 0:
        inc = -inc
        dec = (dec + 180.) % 360.
    return dec, inc


Instruction:
Can you generate a brief explanation for the following Python 3 code
def doincfish(inc):
    rad, SCOi, SSOi = old_div(np.pi, 180.), 0., 0.  # some definitions
    abinc = []
    for i in inc:
        abinc.append(abs(i))
    MI, std = gausspars(abinc)  # get mean inc and standard deviation
    fpars = {}
    N = len(inc)  # number of data
    fpars['n'] = N
    fpars['ginc'] = MI
    if MI < 30:
        fpars['inc'] = MI
        fpars['k'] = 0
        fpars['alpha95'] = 0
        fpars['csd'] = 0
        fpars['r'] = 0
        print('WARNING: mean inc < 30, returning gaussian mean')
        return fpars
    for i in inc:  # sum over all incs (but take only positive inc)
        coinc = (90. - abs(i)) * rad
        SCOi += np.cos(coinc)
        SSOi += np.sin(coinc)
    Oo = (90.0 - MI) * rad  # first guess at mean
    SCFlag = -1  # sign change flag
    epsilon = float(N) * np.cos(Oo)  # RHS of zero equations
    epsilon += (np.sin(Oo)**2 - np.cos(Oo)**2) * SCOi
    epsilon -= 2. * np.sin(Oo) * np.cos(Oo) * SSOi
    while SCFlag < 0:  # loop until cross zero
        if MI > 0:
            Oo -= (.01 * rad)  # get steeper
        if MI < 0:
            Oo += (.01 * rad)  # get shallower
        prev = epsilon
        epsilon = float(N) * np.cos(Oo)  # RHS of zero equations
        epsilon += (np.sin(Oo)**2. - np.cos(Oo)**2.) * SCOi
        epsilon -= 2. * np.sin(Oo) * np.cos(Oo) * SSOi
        if abs(epsilon) > abs(prev):
            MI = -1 * MI  # reverse direction
        if epsilon * prev < 0:
            SCFlag = 1  # changed sign
    S, C = 0., 0.  # initialize for summation
    for i in inc:
        coinc = (90. - abs(i)) * rad
        S += np.sin(Oo - coinc)
        C += np.cos(Oo - coinc)
    k = old_div((N - 1.), (2. * (N - C)))
    Imle = 90. - (old_div(Oo, rad))
    fpars["inc"] = Imle
    fpars["r"], R = 2. * C - N, 2 * C - N
    fpars["k"] = k
    f = fcalc(2, N - 1)
    a95 = 1. - (0.5) * (old_div(S, C))**2 - (old_div(f, (2. * C * k)))
#    b=20.**(1./(N-1.)) -1.
#    a=1.-b*(N-R)/R
#    a95=np.arccos(a)*180./np.pi
    csd = old_div(81., np.sqrt(k))
    fpars["alpha95"] = a95
    fpars["csd"] = csd
    return fpars

Response: This function calculates the fisher mean inc from inc only data and returns the dictionary of the n - th data in the order they appear in the order they appear in the data.


Instruction:
Implement a Python 3 function for
getting the Kent parameters for data

Response:
def dokent(data, NN):
    """
    gets Kent  parameters for data
    Parameters
    ___________________
    data :  nested pairs of [Dec,Inc]
    NN  : normalization
        NN is the number of data for Kent ellipse
        NN is 1 for Kent ellipses of bootstrapped mean directions

    Return
    kpars 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
    """
    X, kpars = [], {}
    N = len(data)
    if N < 2:
        return kpars
#
#  get fisher mean and convert to co-inclination (theta)/dec (phi) in radians
#
    fpars = fisher_mean(data)
    pbar = fpars["dec"] * np.pi / 180.
    tbar = (90. - fpars["inc"]) * np.pi / 180.
#
#   initialize matrices
#
    H = [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]
    w = [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]
    b = [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]
    gam = [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]
    xg = []
#
#  set up rotation matrix H
#
    H = [[np.cos(tbar) * np.cos(pbar), -np.sin(pbar), np.sin(tbar) * np.cos(pbar)], [np.cos(tbar)
                                                                                * np.sin(pbar), np.cos(pbar), np.sin(pbar) * np.sin(tbar)], [-np.sin(tbar), 0., np.cos(tbar)]]
#
#  get cartesian coordinates of data
#
    for rec in data:
        X.append(dir2cart([rec[0], rec[1], 1.]))
#
#   put in T matrix
#
    T = Tmatrix(X)
    for i in range(3):
        for j in range(3):
            T[i][j] = old_div(T[i][j], float(NN))
#
# compute B=H'TH
#
    for i in range(3):
        for j in range(3):
            for k in range(3):
                w[i][j] += T[i][k] * H[k][j]
    for i in range(3):
        for j in range(3):
            for k in range(3):
                b[i][j] += H[k][i] * w[k][j]
#
# choose a rotation w about North pole to diagonalize upper part of B
#
    psi = 0.5 * np.arctan(2. * b[0][1] / (b[0][0] - b[1][1]))
    w = [[np.cos(psi), -np.sin(psi), 0],
         [np.sin(psi), np.cos(psi), 0], [0., 0., 1.]]
    for i in range(3):
        for j in range(3):
            gamtmp = 0.
            for k in range(3):
                gamtmp += H[i][k] * w[k][j]
            gam[i][j] = gamtmp
    for i in range(N):
        xg.append([0., 0., 0.])
        for k in range(3):
            xgtmp = 0.
            for j in range(3):
                xgtmp += gam[j][k] * X[i][j]
            xg[i][k] = xgtmp
# compute asymptotic ellipse parameters
#
    xmu, sigma1, sigma2 = 0., 0., 0.
    for i in range(N):
        xmu += xg[i][2]
        sigma1 = sigma1 + xg[i][0]**2
        sigma2 = sigma2 + xg[i][1]**2
    xmu = old_div(xmu, float(N))
    sigma1 = old_div(sigma1, float(N))
    sigma2 = old_div(sigma2, float(N))
    g = -2.0 * np.log(0.05) / (float(NN) * xmu**2)
    if np.sqrt(sigma1 * g) < 1:
        eta = np.arcsin(np.sqrt(sigma1 * g))
    if np.sqrt(sigma2 * g) < 1:
        zeta = np.arcsin(np.sqrt(sigma2 * g))
    if np.sqrt(sigma1 * g) >= 1.:
        eta = old_div(np.pi, 2.)
    if np.sqrt(sigma2 * g) >= 1.:
        zeta = old_div(np.pi, 2.)
#
#  convert Kent parameters to directions,angles
#
    kpars["dec"] = fpars["dec"]
    kpars["inc"] = fpars["inc"]
    kpars["n"] = NN
    ZDir = cart2dir([gam[0][1], gam[1][1], gam[2][1]])
    EDir = cart2dir([gam[0][0], gam[1][0], gam[2][0]])
    kpars["Zdec"] = ZDir[0]
    kpars["Zinc"] = ZDir[1]
    kpars["Edec"] = EDir[0]
    kpars["Einc"] = EDir[1]
    if kpars["Zinc"] < 0:
        kpars["Zinc"] = -kpars["Zinc"]
        kpars["Zdec"] = (kpars["Zdec"] + 180.) % 360.
    if kpars["Einc"] < 0:
        kpars["Einc"] = -kpars["Einc"]
        kpars["Edec"] = (kpars["Edec"] + 180.) % 360.
    kpars["Zeta"] = zeta * 180. / np.pi
    kpars["Eta"] = eta * 180. / np.pi
    return kpars


Instruction:
Can you implement a function in Python 3 that
returns a new nparray object with principal components from a list of dec inc directions.

Response:
def doprinc(data):
    """
    Gets principal components from data in form of a list of [dec,inc] data.

    Parameters
    ----------
    data : nested list of dec, inc directions

    Returns
    -------
    ppars : dictionary with the principal components
        dec : principal directiion declination
        inc : principal direction inclination
        V2dec : intermediate eigenvector declination
        V2inc : intermediate eigenvector inclination
        V3dec : minor eigenvector declination
        V3inc : minor eigenvector inclination
        tau1 : major eigenvalue
        tau2 : intermediate eigenvalue
        tau3 : minor eigenvalue
        N  : number of points
        Edir : elongation direction [dec, inc, length]
    """
    ppars = {}
    rad = old_div(np.pi, 180.)
    X = dir2cart(data)
    # for rec in data:
    #    dir=[]
    #    for c in rec: dir.append(c)
    #    cart= (dir2cart(dir))
    #    X.append(cart)
#   put in T matrix
#
    T = np.array(Tmatrix(X))
#
#   get sorted evals/evects
#
    t, V = tauV(T)
    Pdir = cart2dir(V[0])
    ppars['Edir'] = cart2dir(V[1])  # elongation direction
    dec, inc = doflip(Pdir[0], Pdir[1])
    ppars['dec'] = dec
    ppars['inc'] = inc
    ppars['N'] = len(data)
    ppars['tau1'] = t[0]
    ppars['tau2'] = t[1]
    ppars['tau3'] = t[2]
    Pdir = cart2dir(V[1])
    dec, inc = doflip(Pdir[0], Pdir[1])
    ppars['V2dec'] = dec
    ppars['V2inc'] = inc
    Pdir = cart2dir(V[2])
    dec, inc = doflip(Pdir[0], Pdir[1])
    ppars['V3dec'] = dec
    ppars['V3inc'] = inc
    return ppars


Instruction:
Implement a function in Python 3 to
rotate points on a globe by an Euler pole rotation using method of Cox and Hart 1986, box 7-3. Parameters ---------- EP : Euler pole list [lat,lon,angle] Lats : list of latitudes of points to be rotated Lons : list of longitudes of points to be rotated Returns _________ RLats : rotated latitudes RLons : rotated longitudes

Response:
def pt_rot(EP, Lats, Lons):
    """
    Rotates points on a globe by an Euler pole rotation using method of
    Cox and Hart 1986, box 7-3.

    Parameters
    ----------
    EP : Euler pole list [lat,lon,angle]
    Lats : list of latitudes of points to be rotated
    Lons : list of longitudes of points to be rotated

    Returns
    _________
    RLats : rotated latitudes
    RLons : rotated longitudes
    """
# gets user input of Rotation pole lat,long, omega for plate and converts
# to radians
    E = dir2cart([EP[1], EP[0], 1.])  # EP is pole lat,lon omega
    omega = EP[2] * np.pi / 180.  # convert to radians
    RLats, RLons = [], []
    for k in range(len(Lats)):
        if Lats[k] <= 90.:  # peel off delimiters
            # converts to rotation pole to cartesian coordinates
            A = dir2cart([Lons[k], Lats[k], 1.])
# defines cartesian coordinates of the pole A
            R = [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]
            R[0][0] = E[0] * E[0] * (1 - np.cos(omega)) + np.cos(omega)
            R[0][1] = E[0] * E[1] * (1 - np.cos(omega)) - E[2] * np.sin(omega)
            R[0][2] = E[0] * E[2] * (1 - np.cos(omega)) + E[1] * np.sin(omega)
            R[1][0] = E[1] * E[0] * (1 - np.cos(omega)) + E[2] * np.sin(omega)
            R[1][1] = E[1] * E[1] * (1 - np.cos(omega)) + np.cos(omega)
            R[1][2] = E[1] * E[2] * (1 - np.cos(omega)) - E[0] * np.sin(omega)
            R[2][0] = E[2] * E[0] * (1 - np.cos(omega)) - E[1] * np.sin(omega)
            R[2][1] = E[2] * E[1] * (1 - np.cos(omega)) + E[0] * np.sin(omega)
            R[2][2] = E[2] * E[2] * (1 - np.cos(omega)) + np.cos(omega)
# sets up rotation matrix
            Ap = [0, 0, 0]
            for i in range(3):
                for j in range(3):
                    Ap[i] += R[i][j] * A[j]
# does the rotation
            Prot = cart2dir(Ap)
            RLats.append(Prot[1])
            RLons.append(Prot[0])
        else:  # preserve delimiters
            RLats.append(Lats[k])
            RLons.append(Lons[k])
    return RLats, RLons


Instruction:
How would you explain what the following Python 3 function does
def dread(infile, cols):
    data = []
    f = open(infile, "r")
    for line in f.readlines():
        tmp = line.split()
        rec = (tmp[0], float(tmp[cols[0]]), float(tmp[cols[1]]), float(tmp[cols[2]]),
               float(tmp[cols[3]]))
        data.append(rec)
    f.close()
    return data

Response: reads in specimen tr dec inc int into data [.


Instruction:
Write a Python 3 script for
generating a random draw from a Fisher distribution with mean declination and inclination of 90 with a specified kappa

Response:
def fshdev(k):
    """
    Generate a random draw from a Fisher distribution with mean declination
    of 0 and inclination of 90 with a specified kappa.

    Parameters
    ----------
    k : kappa (precision parameter) of the distribution
        k can be a single number or an array of values

    Returns
    ----------
    dec, inc : declination and inclination of random Fisher distribution draw
               if k is an array, dec, inc are returned as arrays, otherwise, single values
    """
    k = np.array(k)
    if len(k.shape) != 0:
        n = k.shape[0]
    else:
        n = 1
    R1 = random.random(size=n)
    R2 = random.random(size=n)
    L = np.exp(-2 * k)
    a = R1 * (1 - L) + L
    fac = np.sqrt(-np.log(a)/(2 * k))
    inc = 90. - np.degrees(2 * np.arcsin(fac))
    dec = np.degrees(2 * np.pi * R2)
    if n == 1:
        return dec[0], inc[0]  # preserve backward compatibility
    else:
        return dec, inc


Instruction:
Implement a function in Python 3 to
get Lowe's power spectrum from gauss coefficients Parameters _________ data : nested list of [[l,m,g,h],...] as from pmag.unpack() Returns _______ Ls : list of degrees (l) Rs : power at degree l

Response:
def lowes(data):
    """
    gets Lowe's power spectrum  from gauss coefficients

    Parameters
    _________
    data : nested list of [[l,m,g,h],...] as from pmag.unpack()

    Returns
    _______
    Ls : list of degrees (l)
    Rs : power at  degree l

    """
    lmax = data[-1][0]
    Ls = list(range(1, lmax+1))
    Rs = []
    recno = 0
    for l in Ls:
        pow = 0
        for m in range(0, l + 1):
            pow += (l + 1) * ((1e-3 * data[recno][2])
                              ** 2 + (1e-3 * data[recno][3])**2)
            recno += 1
        Rs.append(pow)
    return Ls, Rs


Instruction:
Can you tell what is the following Python 3 function doing
def magnetic_lat(inc):
    rad = old_div(np.pi, 180.)
    paleo_lat = old_div(np.arctan(0.5 * np.tan(inc * rad)), rad)
    return paleo_lat

Response: returns magnetic latitude from inclination


Instruction:
Given the following Python 3 function, write the documentation
def Dir_anis_corr(InDir, AniSpec):
    Dir = np.zeros((3), 'f')
    Dir[0] = InDir[0]
    Dir[1] = InDir[1]
    Dir[2] = 1.
    chi, chi_inv = check_F(AniSpec)
    if chi[0][0] == 1.:
        return Dir  # isotropic
    X = dir2cart(Dir)
    M = np.array(X)
    H = np.dot(M, chi_inv)
    return cart2dir(H)

Response: returns corrected Dec Inc


Instruction:
How would you code a function in Python 3 to
take the 6 element 's' vector and the Dec,Inc, Int 'Dir' data, performs simple anisotropy correction. returns corrected Dec, Inc, Int

Response:
def doaniscorr(PmagSpecRec, AniSpec):
    """
    takes the 6 element 's' vector and the Dec,Inc, Int 'Dir' data,
    performs simple anisotropy correction. returns corrected Dec, Inc, Int
    """
    AniSpecRec = {}
    for key in list(PmagSpecRec.keys()):
        AniSpecRec[key] = PmagSpecRec[key]
    Dir = np.zeros((3), 'f')
    Dir[0] = float(PmagSpecRec["specimen_dec"])
    Dir[1] = float(PmagSpecRec["specimen_inc"])
    Dir[2] = float(PmagSpecRec["specimen_int"])
# check if F test passes!  if anisotropy_sigma available
    chi, chi_inv = check_F(AniSpec)
    if chi[0][0] == 1.:  # isotropic
        cDir = [Dir[0], Dir[1]]  # no change
        newint = Dir[2]
    else:
        X = dir2cart(Dir)
        M = np.array(X)
        H = np.dot(M, chi_inv)
        cDir = cart2dir(H)
        Hunit = [old_div(H[0], cDir[2]), old_div(H[1], cDir[2]), old_div(
            H[2], cDir[2])]  # unit vector parallel to Banc
        Zunit = [0, 0, -1.]  # unit vector parallel to lab field
        Hpar = np.dot(chi, Hunit)  # unit vector applied along ancient field
        Zpar = np.dot(chi, Zunit)  # unit vector applied along lab field
        # intensity of resultant vector from ancient field
        HparInt = cart2dir(Hpar)[2]
        # intensity of resultant vector from lab field
        ZparInt = cart2dir(Zpar)[2]
        newint = Dir[2] * ZparInt / HparInt
        if cDir[0] - Dir[0] > 90:
            cDir[1] = -cDir[1]
            cDir[0] = (cDir[0] - 180.) % 360.
    AniSpecRec["specimen_dec"] = '%7.1f' % (cDir[0])
    AniSpecRec["specimen_inc"] = '%7.1f' % (cDir[1])
    AniSpecRec["specimen_int"] = '%9.4e' % (newint)
    AniSpecRec["specimen_correction"] = 'c'
    if 'magic_method_codes' in list(AniSpecRec.keys()):
        methcodes = AniSpecRec["magic_method_codes"]
    else:
        methcodes = ""
    if methcodes == "":
        methcodes = "DA-AC-" + AniSpec['anisotropy_type']
    if methcodes != "":
        methcodes = methcodes + ":DA-AC-" + AniSpec['anisotropy_type']
    if chi[0][0] == 1.:  # isotropic
        # indicates anisotropy was checked and no change necessary
        methcodes = methcodes + ':DA-AC-ISO'
    AniSpecRec["magic_method_codes"] = methcodes.strip(":")
    return AniSpecRec


Instruction:
Can you create a Python 3 function that
functions to calculate the Watson Vw test statistic.

Response:
def vfunc(pars_1, pars_2):
    """
    Calculate the Watson Vw test statistic. Calculated as 2*(Sw-Rw)

    Parameters
    ----------
    pars_1 : dictionary of Fisher statistics from population 1
    pars_2 : dictionary of Fisher statistics from population 2

    Returns
    -------
    Vw : Watson's Vw statistic
    """
    cart_1 = dir2cart([pars_1["dec"], pars_1["inc"], pars_1["r"]])
    cart_2 = dir2cart([pars_2['dec'], pars_2['inc'], pars_2["r"]])
    Sw = pars_1['k'] * pars_1['r'] + pars_2['k'] * pars_2['r']  # k1*r1+k2*r2
    xhat_1 = pars_1['k'] * cart_1[0] + pars_2['k'] * cart_2[0]  # k1*x1+k2*x2
    xhat_2 = pars_1['k'] * cart_1[1] + pars_2['k'] * cart_2[1]  # k1*y1+k2*y2
    xhat_3 = pars_1['k'] * cart_1[2] + pars_2['k'] * cart_2[2]  # k1*z1+k2*z2
    Rw = np.sqrt(xhat_1**2 + xhat_2**2 + xhat_3**2)
    return 2 * (Sw - Rw)


Instruction:
Implement a function in Python 3 to
convert a pole position to a direction

Response:
def vgp_di(plat, plong, slat, slong):
    """
    Converts a pole position (pole latitude, pole longitude) to a direction
    (declination, inclination) at a given location (slat, slong) assuming a
    dipolar field.

    Parameters
    ----------
    plat : latitude of pole (vgp latitude)
    plong : longitude of pole (vgp longitude)
    slat : latitude of site
    slong : longitude of site

    Returns
    ----------
    dec,inc : tuple of declination and inclination
    """
    plong = plong % 360
    slong = slong % 360
    signdec = 1.
    delphi = abs(plong - slong)
    if delphi != 0:
        signdec = (plong - slong) / delphi
    if slat == 90.:
        slat = 89.99
    thetaS = np.radians(90. - slat)
    thetaP = np.radians(90. - plat)
    delphi = np.radians(delphi)
    cosp = np.cos(thetaS) * np.cos(thetaP) + np.sin(thetaS) * \
        np.sin(thetaP) * np.cos(delphi)
    thetaM = np.arccos(cosp)
    cosd = old_div((np.cos(thetaP) - np.cos(thetaM) *
                    np.cos(thetaS)), (np.sin(thetaM) * np.sin(thetaS)))
    C = abs(1. - cosd**2)
    if C != 0:
        dec = -np.arctan(cosd/np.sqrt(abs(C))) + (np.pi/2.)
    else:
        dec = np.arccos(cosd)
    if -np.pi < signdec * delphi and signdec < 0:
        dec = 2. * np.pi - dec  # checking quadrant
    if signdec * delphi > np.pi:
        dec = 2. * np.pi - dec
    dec = np.degrees(dec) % 360.
    inc = np.degrees(np.arctan2(2. * np.cos(thetaM), np.sin(thetaM)))
    return dec, inc


Instruction:
Can you create a Python 3 function that
calculates the Watson s V statistic for two sets of directions Dir1 and Dir2.

Response:
def watsonsV(Dir1, Dir2):
    """
    calculates Watson's V statistic for two sets of directions
    """
    counter, NumSims = 0, 500
#
# first calculate the fisher means and cartesian coordinates of each set of Directions
#
    pars_1 = fisher_mean(Dir1)
    pars_2 = fisher_mean(Dir2)
#
# get V statistic for these
#
    V = vfunc(pars_1, pars_2)
#
# do monte carlo simulation of datasets with same kappas, but common mean
#
    Vp = []  # set of Vs from simulations
    print("Doing ", NumSims, " simulations")
    for k in range(NumSims):
        counter += 1
        if counter == 50:
            print(k + 1)
            counter = 0
        Dirp = []
# get a set of N1 fisher distributed vectors with k1, calculate fisher stats
        for i in range(pars_1["n"]):
            Dirp.append(fshdev(pars_1["k"]))
        pars_p1 = fisher_mean(Dirp)
# get a set of N2 fisher distributed vectors with k2, calculate fisher stats
        Dirp = []
        for i in range(pars_2["n"]):
            Dirp.append(fshdev(pars_2["k"]))
        pars_p2 = fisher_mean(Dirp)
# get the V for these
        Vk = vfunc(pars_p1, pars_p2)
        Vp.append(Vk)
#
# sort the Vs, get Vcrit (95th one)
#
    Vp.sort()
    k = int(.95 * NumSims)
    return V, Vp[k]


Instruction:
Can you generate the documentation for the following Python 3 function
def dimap(D, I):
    try:
        D = float(D)
        I = float(I)
    except TypeError:  # is an array
        return dimap_V(D, I)
# DEFINE FUNCTION VARIABLES
    # initialize equal area projection x,y
    XY = [0., 0.]

# GET CARTESIAN COMPONENTS OF INPUT DIRECTION
    X = dir2cart([D, I, 1.])

# CHECK IF Z = 1 AND ABORT
    if X[2] == 1.0:
        return XY                       # return [0,0]

# TAKE THE ABSOLUTE VALUE OF Z
    if X[2] < 0:
        # this only works on lower hemisphere projections
        X[2] = -X[2]

# CALCULATE THE X,Y COORDINATES FOR THE EQUAL AREA PROJECTION
    # from Collinson 1983
    R = old_div(np.sqrt(1. - X[2]), (np.sqrt(X[0]**2 + X[1]**2)))
    XY[1], XY[0] = X[0] * R, X[1] * R

# RETURN XY[X,Y]
    return XY

Response: Function to map directions to x y pairs in equal area projection


Instruction:
How would you code a function in Python 3 to
function TO MAP DECLINATION, INCLINATIONS INTO EQUAL AREA PROJECTION, X,Y Usage: dimap_V(D, I) D and I are both numpy arrays

Response:
def dimap_V(D, I):
    """
    FUNCTION TO MAP DECLINATION, INCLINATIONS INTO EQUAL AREA PROJECTION, X,Y

    Usage:     dimap_V(D, I)
        D and I are both numpy arrays

    """
# GET CARTESIAN COMPONENTS OF INPUT DIRECTION
    DI = np.array([D, I]).transpose()
    X = dir2cart(DI).transpose()
# CALCULATE THE X,Y COORDINATES FOR THE EQUAL AREA PROJECTION
    # from Collinson 1983
    R = np.sqrt(1. - abs(X[2]))/(np.sqrt(X[0]**2 + X[1]**2))
    XY = np.array([X[1] * R, X[0] * R]).transpose()

# RETURN XY[X,Y]
    return XY


Instruction:
Explain what the following Python 3 code does
def getmeths(method_type):
    meths = []
    if method_type == 'GM':
        meths.append('GM-PMAG-APWP')
        meths.append('GM-ARAR')
        meths.append('GM-ARAR-AP')
        meths.append('GM-ARAR-II')
        meths.append('GM-ARAR-NI')
        meths.append('GM-ARAR-TF')
        meths.append('GM-CC-ARCH')
        meths.append('GM-CC-ARCHMAG')
        meths.append('GM-C14')
        meths.append('GM-FOSSIL')
        meths.append('GM-FT')
        meths.append('GM-INT-L')
        meths.append('GM-INT-S')
        meths.append('GM-ISO')
        meths.append('GM-KAR')
        meths.append('GM-PMAG-ANOM')
        meths.append('GM-PMAG-POL')
        meths.append('GM-PBPB')
        meths.append('GM-RATH')
        meths.append('GM-RBSR')
        meths.append('GM-RBSR-I')
        meths.append('GM-RBSR-MA')
        meths.append('GM-SMND')
        meths.append('GM-SMND-I')
        meths.append('GM-SMND-MA')
        meths.append('GM-CC-STRAT')
        meths.append('GM-LUM-TH')
        meths.append('GM-UPA')
        meths.append('GM-UPB')
        meths.append('GM-UTH')
        meths.append('GM-UTHHE')
    else:
        pass
    return meths

Response: returns a list of all available MagIC method codes available for a given type


Instruction:
Make a summary of the following Python 3 code
def first_up(ofile, Rec, file_type):
    keylist = []
    pmag_out = open(ofile, 'a')
    outstring = "tab \t" + file_type + "\n"
    pmag_out.write(outstring)
    keystring = ""
    for key in list(Rec.keys()):
        keystring = keystring + '\t' + key
        keylist.append(key)
    keystring = keystring + '\n'
    pmag_out.write(keystring[1:])
    pmag_out.close()
    return keylist

Response: writes the first up of a MagIC template file


Instruction:
How would you explain what the following Python 3 function does
def get_age(Rec, sitekey, keybase, Ages, DefaultAge):
    site = Rec[sitekey]
    gotone = 0
    if len(Ages) > 0:
        for agerec in Ages:
            if agerec["er_site_name"] == site:
                if "age" in list(agerec.keys()) and agerec["age"] != "":
                    Rec[keybase + "age"] = agerec["age"]
                    gotone = 1
                if "age_unit" in list(agerec.keys()):
                    Rec[keybase + "age_unit"] = agerec["age_unit"]
                if "age_sigma" in list(agerec.keys()):
                    Rec[keybase + "age_sigma"] = agerec["age_sigma"]
    if gotone == 0 and len(DefaultAge) > 1:
        sigma = 0.5 * (float(DefaultAge[1]) - float(DefaultAge[0]))
        age = float(DefaultAge[0]) + sigma
        Rec[keybase + "age"] = '%10.4e' % (age)
        Rec[keybase + "age_sigma"] = '%10.4e' % (sigma)
        Rec[keybase + "age_unit"] = DefaultAge[2]
    return Rec

Response: returns the age record for a given site


Instruction:
Make a summary of the following Python 3 code
def adjust_ages(AgesIn):
# get a list of age_units first
    age_units, AgesOut, factors, factor, maxunit, age_unit = [], [], [], 1, 1, "Ma"
    for agerec in AgesIn:
        if agerec[1] not in age_units:
            age_units.append(agerec[1])
            if agerec[1] == "Ga":
                factors.append(1e9)
                maxunit, age_unit, factor = 1e9, "Ga", 1e9
            if agerec[1] == "Ma":
                if maxunit == 1:
                    maxunit, age_unt, factor = 1e6, "Ma", 1e6
                factors.append(1e6)
            if agerec[1] == "Ka":
                factors.append(1e3)
                if maxunit == 1:
                    maxunit, age_unit, factor = 1e3, "Ka", 1e3
            if "Years" in agerec[1].split():
                factors.append(1)
    if len(age_units) == 1:  # all ages are of same type
        for agerec in AgesIn:
            AgesOut.append(agerec[0])
    elif len(age_units) > 1:
        for agerec in AgesIn:  # normalize all to largest age unit
            if agerec[1] == "Ga":
                AgesOut.append(agerec[0] * 1e9 / factor)
            if agerec[1] == "Ma":
                AgesOut.append(agerec[0] * 1e6 / factor)
            if agerec[1] == "Ka":
                AgesOut.append(agerec[0] * 1e3 / factor)
            if "Years" in agerec[1].split():
                if agerec[1] == "Years BP":
                    AgesOut.append(old_div(agerec[0], factor))
                if agerec[1] == "Years Cal BP":
                    AgesOut.append(old_div(agerec[0], factor))
                if agerec[1] == "Years AD (+/-)":
                    # convert to years BP first
                    AgesOut.append(old_div((1950 - agerec[0]), factor))
                if agerec[1] == "Years Cal AD (+/-)":
                    AgesOut.append(old_div((1950 - agerec[0]), factor))
    return AgesOut, age_unit

Response: Function to adjust ages to a common age_unit


Instruction:
Create a Python 3 function for
returning N uniformly distributed directions in order of dec and inc.

Response:
def get_unf(N=100):
    """
    Generates N uniformly distributed directions
    using the way described in Fisher et al. (1987).
    Parameters
    __________
    N : number of directions, default is 100

    Returns
    ______
    array of nested dec,inc pairs
    """
#
# get uniform directions  [dec,inc]
    z = random.uniform(-1., 1., size=N)
    t = random.uniform(0., 360., size=N)  # decs
    i = np.arcsin(z) * 180. / np.pi  # incs
    return np.array([t, i]).transpose()

# def get_unf(N): #Jeff's way
    """
     subroutine to retrieve N uniformly distributed directions
    """


Instruction:
Can you create a Python 3 function that
converts 6 element s list to 3 a matrix

Response:
def s2a(s):
    """
     convert 6 element "s" list to 3,3 a matrix (see Tauxe 1998)
    """
    a = np.zeros((3, 3,), 'f')  # make the a matrix
    for i in range(3):
        a[i][i] = s[i]
    a[0][1], a[1][0] = s[3], s[3]
    a[1][2], a[2][1] = s[4], s[4]
    a[0][2], a[2][0] = s[5], s[5]
    return a


Instruction:
How would you explain what the following Python 3 function does
def a2s(a):
    s = np.zeros((6,), 'f')  # make the a matrix
    for i in range(3):
        s[i] = a[i][i]
    s[3] = a[0][1]
    s[4] = a[1][2]
    s[5] = a[0][2]
    return s

Response: convert 3 a matrix to 6 element list


Instruction:
Write a Python 3 script to
convert a string to a list of eigenvalues and eigenvectors and returns a tuple of the tau and the list of eigenvectors and directions

Response:
def doseigs(s):
    """
    convert s format for eigenvalues and eigenvectors

    Parameters
    __________
    s=[x11,x22,x33,x12,x23,x13] : the six tensor elements

    Return
    __________
        tau : [t1,t2,t3]
           tau is an list of eigenvalues in decreasing order:
        V : [[V1_dec,V1_inc],[V2_dec,V2_inc],[V3_dec,V3_inc]]
            is an list of the eigenvector directions
    """
#
    A = s2a(s)  # convert s to a (see Tauxe 1998)
    tau, V = tauV(A)  # convert to eigenvalues (t), eigenvectors (V)
    Vdirs = []
    for v in V:  # convert from cartesian to direction
        Vdir = cart2dir(v)
        if Vdir[1] < 0:
            Vdir[1] = -Vdir[1]
            Vdir[0] = (Vdir[0] + 180.) % 360.
        Vdirs.append([Vdir[0], Vdir[1]])
    return tau, Vdirs


Instruction:
Can you generate a brief explanation for the following Python 3 code
def doeigs_s(tau, Vdirs):
    t = np.zeros((3, 3,), 'f')  # initialize the tau diagonal matrix
    V = []
    for j in range(3):
        t[j][j] = tau[j]  # diagonalize tau
    for k in range(3):
        V.append(dir2cart([Vdirs[k][0], Vdirs[k][1], 1.0]))
    V = np.transpose(V)
    tmp = np.dot(V, t)
    chi = np.dot(tmp, np.transpose(V))
    return a2s(chi)

Response: get elements of s from eigenvaulues


Instruction:
Make a summary of the following Python 3 code
def fcalc(col, row):
#
    if row > 200:
        row = 200
    if col > 20:
        col = 20
    ftest = np.array([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
                      [1, 161.469, 199.493, 215.737, 224.5, 230.066, 234.001, 236.772, 238.949, 240.496, 241.838,
                       242.968, 243.88, 244.798, 245.26, 245.956, 246.422, 246.89, 247.36, 247.596, 248.068],
                      [2, 18.5128, 18.9995, 19.1642, 19.2467, 19.2969, 19.3299, 19.3536, 19.371, 19.3852, 19.3963,
                       19.4043, 19.4122, 19.4186, 19.425, 19.4297, 19.4329, 19.4377, 19.4409, 19.4425, 19.4457],
                      [3, 10.1278, 9.5522, 9.2767, 9.1173, 9.0133, 8.9408, 8.8868, 8.8452, 8.8124, 8.7857,
                       8.7635, 8.7446, 8.7287, 8.715, 8.7028, 8.6923, 8.683, 8.6745, 8.667, 8.6602],
                      [4, 7.7087, 6.9444, 6.5915, 6.3882, 6.2561, 6.1631, 6.0943, 6.0411, 5.9988, 5.9644,
                       5.9359, 5.9117, 5.8912, 5.8733, 5.8578, 5.844, 5.8319, 5.8211, 5.8113, 5.8025],
                      [5, 6.608, 5.7861, 5.4095, 5.1922, 5.0503, 4.9503, 4.8759, 4.8184, 4.7725, 4.735,
                       4.7039, 4.6777, 4.6552, 4.6358, 4.6187, 4.6038, 4.5904, 4.5785, 4.5679, 4.5581],
                      [6, 5.9874, 5.1433, 4.757, 4.5337, 4.3874, 4.2838, 4.2067, 4.1468, 4.099, 4.06,
                       4.0275, 3.9999, 3.9764, 3.956, 3.9381, 3.9223, 3.9083, 3.8957, 3.8844, 3.8742],
                      [7, 5.5914, 4.7374, 4.3469, 4.1204, 3.9715, 3.866, 3.787, 3.7257, 3.6767, 3.6366,
                       3.603, 3.5747, 3.5504, 3.5292, 3.5107, 3.4944, 3.4799, 3.4669, 3.4552, 3.4445],
                      [8, 5.3177, 4.459, 4.0662, 3.8378, 3.6875, 3.5806, 3.5004, 3.4381, 3.3881, 3.3472,
                       3.313, 3.2839, 3.259, 3.2374, 3.2184, 3.2017, 3.1867, 3.1733, 3.1613, 3.1503],
                      [9, 5.1174, 4.2565, 3.8626, 3.6331, 3.4817, 3.3738, 3.2928, 3.2296, 3.1789, 3.1373,
                       3.1025, 3.0729, 3.0475, 3.0255, 3.0061, 2.989, 2.9737, 2.96, 2.9476, 2.9365],
                      [10, 4.9647, 4.1028, 3.7083, 3.4781, 3.3258, 3.2171, 3.1355, 3.0717, 3.0204, 2.9782,
                       2.9429, 2.913, 2.8872, 2.8648, 2.845, 2.8276, 2.812, 2.7981, 2.7855, 2.774],
                      [11, 4.8443, 3.9823, 3.5875, 3.3567, 3.2039, 3.0946, 3.0123, 2.948, 2.8962, 2.8536,
                       2.8179, 2.7876, 2.7614, 2.7386, 2.7186, 2.7009, 2.6851, 2.6709, 2.6581, 2.6464],
                      [12, 4.7472, 3.8853, 3.4903, 3.2592, 3.1059, 2.9961, 2.9134, 2.8486, 2.7964, 2.7534,
                       2.7173, 2.6866, 2.6602, 2.6371, 2.6169, 2.5989, 2.5828, 2.5684, 2.5554, 2.5436],
                      [13, 4.6672, 3.8055, 3.4106, 3.1791, 3.0255, 2.9153, 2.8321, 2.7669, 2.7144, 2.6711,
                       2.6347, 2.6037, 2.5769, 2.5536, 2.5331, 2.5149, 2.4987, 2.4841, 2.4709, 2.4589],
                      [14, 4.6001, 3.7389, 3.3439, 3.1122, 2.9582, 2.8477, 2.7642, 2.6987, 2.6458, 2.6021,
                       2.5655, 2.5343, 2.5073, 2.4837, 2.463, 2.4446, 2.4282, 2.4134, 2.4, 2.3879],
                      [15, 4.543, 3.6824, 3.2874, 3.0555, 2.9013, 2.7905, 2.7066, 2.6408, 2.5877, 2.5437,
                       2.5068, 2.4753, 2.4481, 2.4244, 2.4034, 2.3849, 2.3683, 2.3533, 2.3398, 2.3275],
                      [16, 4.494, 3.6337, 3.2389, 3.0069, 2.8524, 2.7413, 2.6572, 2.5911, 2.5377, 2.4935,
                       2.4564, 2.4247, 2.3973, 2.3733, 2.3522, 2.3335, 2.3167, 2.3016, 2.288, 2.2756],
                      [17, 4.4513, 3.5916, 3.1968, 2.9647, 2.81, 2.6987, 2.6143, 2.548, 2.4943, 2.4499,
                       2.4126, 2.3807, 2.3531, 2.329, 2.3077, 2.2888, 2.2719, 2.2567, 2.2429, 2.2303],
                      [18, 4.4139, 3.5546, 3.1599, 2.9278, 2.7729, 2.6613, 2.5767, 2.5102, 2.4563, 2.4117,
                       2.3742, 2.3421, 2.3143, 2.29, 2.2686, 2.2496, 2.2325, 2.2172, 2.2033, 2.1906],
                      [19, 4.3808, 3.5219, 3.1274, 2.8951, 2.7401, 2.6283, 2.5435, 2.4768, 2.4227, 2.378,
                       2.3402, 2.308, 2.28, 2.2556, 2.2341, 2.2149, 2.1977, 2.1823, 2.1683, 2.1555],
                      [20, 4.3512, 3.4928, 3.0984, 2.8661, 2.7109, 2.599, 2.514, 2.4471, 2.3928, 2.3479,
                       2.31, 2.2776, 2.2495, 2.2249, 2.2033, 2.184, 2.1667, 2.1511, 2.137, 2.1242],
                      [21, 4.3248, 3.4668, 3.0725, 2.8401, 2.6848, 2.5727, 2.4876, 2.4205, 2.3661, 2.3209,
                       2.2829, 2.2504, 2.2222, 2.1975, 2.1757, 2.1563, 2.1389, 2.1232, 2.109, 2.096],
                      [22, 4.3009, 3.4434, 3.0492, 2.8167, 2.6613, 2.5491, 2.4638, 2.3965, 2.3419, 2.2967,
                       2.2585, 2.2258, 2.1975, 2.1727, 2.1508, 2.1313, 2.1138, 2.098, 2.0837, 2.0707],
                      [23, 4.2794, 3.4221, 3.028, 2.7955, 2.64, 2.5276, 2.4422, 2.3748, 2.3201, 2.2747,
                       2.2364, 2.2036, 2.1752, 2.1503, 2.1282, 2.1086, 2.091, 2.0751, 2.0608, 2.0476],
                      [24, 4.2597, 3.4029, 3.0088, 2.7763, 2.6206, 2.5082, 2.4226, 2.3551, 2.3003, 2.2547,
                       2.2163, 2.1834, 2.1548, 2.1298, 2.1077, 2.088, 2.0703, 2.0543, 2.0399, 2.0267],
                      [25, 4.2417, 3.3852, 2.9913, 2.7587, 2.603, 2.4904, 2.4047, 2.3371, 2.2821, 2.2365,
                       2.1979, 2.1649, 2.1362, 2.1111, 2.0889, 2.0691, 2.0513, 2.0353, 2.0207, 2.0075],
                      [26, 4.2252, 3.369, 2.9752, 2.7426, 2.5868, 2.4741, 2.3883, 2.3205, 2.2655, 2.2197,
                       2.1811, 2.1479, 2.1192, 2.094, 2.0716, 2.0518, 2.0339, 2.0178, 2.0032, 1.9898],
                      [27, 4.21, 3.3542, 2.9603, 2.7277, 2.5719, 2.4591, 2.3732, 2.3053, 2.2501, 2.2043,
                       2.1656, 2.1323, 2.1035, 2.0782, 2.0558, 2.0358, 2.0179, 2.0017, 1.987, 1.9736],
                      [28, 4.196, 3.3404, 2.9467, 2.7141, 2.5581, 2.4453, 2.3592, 2.2913, 2.236, 2.1901,
                       2.1512, 2.1179, 2.0889, 2.0636, 2.0411, 2.021, 2.0031, 1.9868, 1.972, 1.9586],
                      [29, 4.1829, 3.3276, 2.9341, 2.7014, 2.5454, 2.4324, 2.3463, 2.2783, 2.2229, 2.1768,
                       2.1379, 2.1045, 2.0755, 2.05, 2.0275, 2.0074, 1.9893, 1.973, 1.9582, 1.9446],
                      [30, 4.1709, 3.3158, 2.9223, 2.6896, 2.5335, 2.4205, 2.3343, 2.2662, 2.2107, 2.1646,
                       2.1255, 2.0921, 2.0629, 2.0374, 2.0148, 1.9946, 1.9765, 1.9601, 1.9452, 1.9317],
                      [31, 4.1597, 3.3048, 2.9113, 2.6787, 2.5225, 2.4094, 2.3232, 2.2549, 2.1994, 2.1531,
                       2.1141, 2.0805, 2.0513, 2.0257, 2.003, 1.9828, 1.9646, 1.9481, 1.9332, 1.9196],
                      [32, 4.1491, 3.2945, 2.9011, 2.6684, 2.5123, 2.3991, 2.3127, 2.2444, 2.1888, 2.1425,
                       2.1033, 2.0697, 2.0404, 2.0147, 1.992, 1.9717, 1.9534, 1.9369, 1.9219, 1.9083],
                      [33, 4.1392, 3.2849, 2.8915, 2.6589, 2.5027, 2.3894, 2.303, 2.2346, 2.1789, 2.1325,
                       2.0933, 2.0596, 2.0302, 2.0045, 1.9817, 1.9613, 1.943, 1.9264, 1.9114, 1.8977],
                      [34, 4.13, 3.2759, 2.8826, 2.6499, 2.4936, 2.3803, 2.2938, 2.2253, 2.1696, 2.1231,
                       2.0838, 2.05, 2.0207, 1.9949, 1.972, 1.9516, 1.9332, 1.9166, 1.9015, 1.8877],
                      [35, 4.1214, 3.2674, 2.8742, 2.6415, 2.4851, 2.3718, 2.2852, 2.2167, 2.1608, 2.1143,
                       2.0749, 2.0411, 2.0117, 1.9858, 1.9629, 1.9424, 1.924, 1.9073, 1.8922, 1.8784],
                      [36, 4.1132, 3.2594, 2.8663, 2.6335, 2.4771, 2.3637, 2.2771, 2.2085, 2.1526, 2.1061,
                       2.0666, 2.0327, 2.0032, 1.9773, 1.9543, 1.9338, 1.9153, 1.8986, 1.8834, 1.8696],
                      [37, 4.1055, 3.2519, 2.8588, 2.6261, 2.4696, 2.3562, 2.2695, 2.2008, 2.1449, 2.0982,
                       2.0587, 2.0248, 1.9952, 1.9692, 1.9462, 1.9256, 1.9071, 1.8904, 1.8752, 1.8613],
                      [38, 4.0981, 3.2448, 2.8517, 2.619, 2.4625, 2.349, 2.2623, 2.1935, 2.1375, 2.0909,
                       2.0513, 2.0173, 1.9877, 1.9617, 1.9386, 1.9179, 1.8994, 1.8826, 1.8673, 1.8534],
                      [39, 4.0913, 3.2381, 2.8451, 2.6123, 2.4558, 2.3422, 2.2555, 2.1867, 2.1306, 2.0839,
                       2.0442, 2.0102, 1.9805, 1.9545, 1.9313, 1.9107, 1.8921, 1.8752, 1.8599, 1.8459],
                      [40, 4.0848, 3.2317, 2.8388, 2.606, 2.4495, 2.3359, 2.249, 2.1802, 2.124, 2.0773,
                       2.0376, 2.0035, 1.9738, 1.9476, 1.9245, 1.9038, 1.8851, 1.8682, 1.8529, 1.8389],
                      [41, 4.0786, 3.2257, 2.8328, 2.6, 2.4434, 2.3298, 2.2429, 2.174, 2.1178, 2.071,
                       2.0312, 1.9971, 1.9673, 1.9412, 1.9179, 1.8972, 1.8785, 1.8616, 1.8462, 1.8321],
                      [42, 4.0727, 3.2199, 2.8271, 2.5943, 2.4377, 2.324, 2.2371, 2.1681, 2.1119, 2.065,
                       2.0252, 1.991, 1.9612, 1.935, 1.9118, 1.8909, 1.8722, 1.8553, 1.8399, 1.8258],
                      [43, 4.067, 3.2145, 2.8216, 2.5888, 2.4322, 2.3185, 2.2315, 2.1625, 2.1062, 2.0593,
                       2.0195, 1.9852, 1.9554, 1.9292, 1.9059, 1.885, 1.8663, 1.8493, 1.8338, 1.8197],
                      [44, 4.0617, 3.2093, 2.8165, 2.5837, 2.4271, 2.3133, 2.2262, 2.1572, 2.1009, 2.0539,
                       2.014, 1.9797, 1.9499, 1.9236, 1.9002, 1.8794, 1.8606, 1.8436, 1.8281, 1.8139],
                      [45, 4.0566, 3.2043, 2.8115, 2.5787, 2.4221, 2.3083, 2.2212, 2.1521, 2.0958, 2.0487,
                       2.0088, 1.9745, 1.9446, 1.9182, 1.8949, 1.874, 1.8551, 1.8381, 1.8226, 1.8084],
                      [46, 4.0518, 3.1996, 2.8068, 2.574, 2.4174, 2.3035, 2.2164, 2.1473, 2.0909, 2.0438,
                       2.0039, 1.9695, 1.9395, 1.9132, 1.8898, 1.8688, 1.85, 1.8329, 1.8173, 1.8031],
                      [47, 4.0471, 3.1951, 2.8024, 2.5695, 2.4128, 2.299, 2.2118, 2.1427, 2.0862, 2.0391,
                       1.9991, 1.9647, 1.9347, 1.9083, 1.8849, 1.8639, 1.845, 1.8279, 1.8123, 1.798],
                      [48, 4.0426, 3.1907, 2.7981, 2.5653, 2.4085, 2.2946, 2.2074, 2.1382, 2.0817, 2.0346,
                       1.9946, 1.9601, 1.9301, 1.9037, 1.8802, 1.8592, 1.8402, 1.8231, 1.8075, 1.7932],
                      [49, 4.0384, 3.1866, 2.7939, 2.5611, 2.4044, 2.2904, 2.2032, 2.134, 2.0774, 2.0303,
                       1.9902, 1.9558, 1.9257, 1.8992, 1.8757, 1.8547, 1.8357, 1.8185, 1.8029, 1.7886],
                      [50, 4.0343, 3.1826, 2.79, 2.5572, 2.4004, 2.2864, 2.1992, 2.1299, 2.0734, 2.0261,
                       1.9861, 1.9515, 1.9214, 1.8949, 1.8714, 1.8503, 1.8313, 1.8141, 1.7985, 1.7841],
                      [51, 4.0303, 3.1788, 2.7862, 2.5534, 2.3966, 2.2826, 2.1953, 2.126, 2.0694, 2.0222,
                       1.982, 1.9475, 1.9174, 1.8908, 1.8673, 1.8462, 1.8272, 1.8099, 1.7942, 1.7798],
                      [52, 4.0266, 3.1752, 2.7826, 2.5498, 2.3929, 2.2789, 2.1916, 2.1223, 2.0656, 2.0184,
                       1.9782, 1.9436, 1.9134, 1.8869, 1.8633, 1.8422, 1.8231, 1.8059, 1.7901, 1.7758],
                      [53, 4.023, 3.1716, 2.7791, 2.5463, 2.3894, 2.2754, 2.1881, 2.1187, 2.062, 2.0147,
                       1.9745, 1.9399, 1.9097, 1.8831, 1.8595, 1.8383, 1.8193, 1.802, 1.7862, 1.7718],
                      [54, 4.0196, 3.1683, 2.7757, 2.5429, 2.3861, 2.272, 2.1846, 2.1152, 2.0585, 2.0112,
                       1.971, 1.9363, 1.9061, 1.8795, 1.8558, 1.8346, 1.8155, 1.7982, 1.7825, 1.768],
                      [55, 4.0162, 3.165, 2.7725, 2.5397, 2.3828, 2.2687, 2.1813, 2.1119, 2.0552, 2.0078,
                       1.9676, 1.9329, 1.9026, 1.876, 1.8523, 1.8311, 1.812, 1.7946, 1.7788, 1.7644],
                      [56, 4.0129, 3.1618, 2.7694, 2.5366, 2.3797, 2.2656, 2.1781, 2.1087, 2.0519, 2.0045,
                       1.9642, 1.9296, 1.8993, 1.8726, 1.8489, 1.8276, 1.8085, 1.7912, 1.7753, 1.7608],
                      [57, 4.0099, 3.1589, 2.7665, 2.5336, 2.3767, 2.2625, 2.1751, 2.1056, 2.0488, 2.0014,
                       1.9611, 1.9264, 1.896, 1.8693, 1.8456, 1.8244, 1.8052, 1.7878, 1.772, 1.7575],
                      [58, 4.0069, 3.1559, 2.7635, 2.5307, 2.3738, 2.2596, 2.1721, 2.1026, 2.0458, 1.9983,
                       1.958, 1.9233, 1.8929, 1.8662, 1.8424, 1.8212, 1.802, 1.7846, 1.7687, 1.7542],
                      [59, 4.0039, 3.1531, 2.7608, 2.5279, 2.371, 2.2568, 2.1693, 2.0997, 2.0429, 1.9954,
                       1.9551, 1.9203, 1.8899, 1.8632, 1.8394, 1.8181, 1.7989, 1.7815, 1.7656, 1.751],
                      [60, 4.0012, 3.1504, 2.7581, 2.5252, 2.3683, 2.254, 2.1665, 2.097, 2.0401, 1.9926,
                       1.9522, 1.9174, 1.887, 1.8603, 1.8364, 1.8151, 1.7959, 1.7784, 1.7625, 1.748],
                      [61, 3.9985, 3.1478, 2.7555, 2.5226, 2.3657, 2.2514, 2.1639, 2.0943, 2.0374, 1.9899,
                       1.9495, 1.9146, 1.8842, 1.8574, 1.8336, 1.8122, 1.793, 1.7755, 1.7596, 1.745],
                      [62, 3.9959, 3.1453, 2.753, 2.5201, 2.3631, 2.2489, 2.1613, 2.0917, 2.0348, 1.9872,
                       1.9468, 1.9119, 1.8815, 1.8547, 1.8308, 1.8095, 1.7902, 1.7727, 1.7568, 1.7422],
                      [63, 3.9934, 3.1428, 2.7506, 2.5176, 2.3607, 2.2464, 2.1588, 2.0892, 2.0322, 1.9847,
                       1.9442, 1.9093, 1.8789, 1.852, 1.8282, 1.8068, 1.7875, 1.77, 1.754, 1.7394],
                      [64, 3.9909, 3.1404, 2.7482, 2.5153, 2.3583, 2.244, 2.1564, 2.0868, 2.0298, 1.9822,
                       1.9417, 1.9068, 1.8763, 1.8495, 1.8256, 1.8042, 1.7849, 1.7673, 1.7514, 1.7368],
                      [65, 3.9885, 3.1381, 2.7459, 2.513, 2.356, 2.2417, 2.1541, 2.0844, 2.0274, 1.9798,
                       1.9393, 1.9044, 1.8739, 1.847, 1.8231, 1.8017, 1.7823, 1.7648, 1.7488, 1.7342],
                      [66, 3.9862, 3.1359, 2.7437, 2.5108, 2.3538, 2.2395, 2.1518, 2.0821, 2.0251, 1.9775,
                       1.937, 1.902, 1.8715, 1.8446, 1.8207, 1.7992, 1.7799, 1.7623, 1.7463, 1.7316],
                      [67, 3.9841, 3.1338, 2.7416, 2.5087, 2.3516, 2.2373, 2.1497, 2.0799, 2.0229, 1.9752,
                       1.9347, 1.8997, 1.8692, 1.8423, 1.8183, 1.7968, 1.7775, 1.7599, 1.7439, 1.7292],
                      [68, 3.9819, 3.1317, 2.7395, 2.5066, 2.3496, 2.2352, 2.1475, 2.0778, 2.0207, 1.973,
                       1.9325, 1.8975, 1.867, 1.84, 1.816, 1.7945, 1.7752, 1.7576, 1.7415, 1.7268],
                      [69, 3.9798, 3.1297, 2.7375, 2.5046, 2.3475, 2.2332, 2.1455, 2.0757, 2.0186, 1.9709,
                       1.9303, 1.8954, 1.8648, 1.8378, 1.8138, 1.7923, 1.7729, 1.7553, 1.7393, 1.7246],
                      [70, 3.9778, 3.1277, 2.7355, 2.5027, 2.3456, 2.2312, 2.1435, 2.0737, 2.0166, 1.9689,
                       1.9283, 1.8932, 1.8627, 1.8357, 1.8117, 1.7902, 1.7707, 1.7531, 1.7371, 1.7223],
                      [71, 3.9758, 3.1258, 2.7336, 2.5007, 2.3437, 2.2293, 2.1415, 2.0717, 2.0146, 1.9669,
                       1.9263, 1.8912, 1.8606, 1.8336, 1.8096, 1.7881, 1.7686, 1.751, 1.7349, 1.7202],
                      [72, 3.9739, 3.1239, 2.7318, 2.4989, 2.3418, 2.2274, 2.1397, 2.0698, 2.0127, 1.9649,
                       1.9243, 1.8892, 1.8586, 1.8316, 1.8076, 1.786, 1.7666, 1.7489, 1.7328, 1.7181],
                      [73, 3.9721, 3.1221, 2.73, 2.4971, 2.34, 2.2256, 2.1378, 2.068, 2.0108, 1.9631,
                       1.9224, 1.8873, 1.8567, 1.8297, 1.8056, 1.784, 1.7646, 1.7469, 1.7308, 1.716],
                      [74, 3.9703, 3.1204, 2.7283, 2.4954, 2.3383, 2.2238, 2.1361, 2.0662, 2.009, 1.9612,
                       1.9205, 1.8854, 1.8548, 1.8278, 1.8037, 1.7821, 1.7626, 1.7449, 1.7288, 1.714],
                      [75, 3.9685, 3.1186, 2.7266, 2.4937, 2.3366, 2.2221, 2.1343, 2.0645, 2.0073, 1.9595,
                       1.9188, 1.8836, 1.853, 1.8259, 1.8018, 1.7802, 1.7607, 1.7431, 1.7269, 1.7121],
                      [76, 3.9668, 3.117, 2.7249, 2.4921, 2.3349, 2.2204, 2.1326, 2.0627, 2.0055, 1.9577,
                       1.917, 1.8819, 1.8512, 1.8241, 1.8, 1.7784, 1.7589, 1.7412, 1.725, 1.7102],
                      [77, 3.9651, 3.1154, 2.7233, 2.4904, 2.3333, 2.2188, 2.131, 2.0611, 2.0039, 1.956,
                       1.9153, 1.8801, 1.8494, 1.8223, 1.7982, 1.7766, 1.7571, 1.7394, 1.7232, 1.7084],
                      [78, 3.9635, 3.1138, 2.7218, 2.4889, 2.3318, 2.2172, 2.1294, 2.0595, 2.0022, 1.9544,
                       1.9136, 1.8785, 1.8478, 1.8206, 1.7965, 1.7749, 1.7554, 1.7376, 1.7214, 1.7066],
                      [79, 3.9619, 3.1123, 2.7203, 2.4874, 2.3302, 2.2157, 2.1279, 2.0579, 2.0006, 1.9528,
                       1.912, 1.8769, 1.8461, 1.819, 1.7948, 1.7732, 1.7537, 1.7359, 1.7197, 1.7048],
                      [80, 3.9604, 3.1107, 2.7188, 2.4859, 2.3287, 2.2142, 2.1263, 2.0564, 1.9991, 1.9512,
                       1.9105, 1.8753, 1.8445, 1.8174, 1.7932, 1.7716, 1.752, 1.7342, 1.718, 1.7032],
                      [81, 3.9589, 3.1093, 2.7173, 2.4845, 2.3273, 2.2127, 2.1248, 2.0549, 1.9976, 1.9497,
                       1.9089, 1.8737, 1.8429, 1.8158, 1.7916, 1.77, 1.7504, 1.7326, 1.7164, 1.7015],
                      [82, 3.9574, 3.1079, 2.716, 2.483, 2.3258, 2.2113, 2.1234, 2.0534, 1.9962, 1.9482,
                       1.9074, 1.8722, 1.8414, 1.8143, 1.7901, 1.7684, 1.7488, 1.731, 1.7148, 1.6999],
                      [83, 3.956, 3.1065, 2.7146, 2.4817, 2.3245, 2.2099, 2.122, 2.052, 1.9947, 1.9468,
                       1.906, 1.8707, 1.8399, 1.8127, 1.7886, 1.7669, 1.7473, 1.7295, 1.7132, 1.6983],
                      [84, 3.9546, 3.1051, 2.7132, 2.4803, 2.3231, 2.2086, 2.1206, 2.0506, 1.9933, 1.9454,
                       1.9045, 1.8693, 1.8385, 1.8113, 1.7871, 1.7654, 1.7458, 1.728, 1.7117, 1.6968],
                      [85, 3.9532, 3.1039, 2.7119, 2.479, 2.3218, 2.2072, 2.1193, 2.0493, 1.9919, 1.944,
                       1.9031, 1.8679, 1.8371, 1.8099, 1.7856, 1.7639, 1.7443, 1.7265, 1.7102, 1.6953],
                      [86, 3.9519, 3.1026, 2.7106, 2.4777, 2.3205, 2.2059, 2.118, 2.048, 1.9906, 1.9426,
                       1.9018, 1.8665, 1.8357, 1.8085, 1.7842, 1.7625, 1.7429, 1.725, 1.7088, 1.6938],
                      [87, 3.9506, 3.1013, 2.7094, 2.4765, 2.3193, 2.2047, 2.1167, 2.0467, 1.9893, 1.9413,
                       1.9005, 1.8652, 1.8343, 1.8071, 1.7829, 1.7611, 1.7415, 1.7236, 1.7073, 1.6924],
                      [88, 3.9493, 3.1001, 2.7082, 2.4753, 2.318, 2.2034, 2.1155, 2.0454, 1.9881, 1.94,
                       1.8992, 1.8639, 1.833, 1.8058, 1.7815, 1.7598, 1.7401, 1.7223, 1.706, 1.691],
                      [89, 3.9481, 3.0988, 2.707, 2.4741, 2.3169, 2.2022, 2.1143, 2.0442, 1.9868, 1.9388,
                       1.8979, 1.8626, 1.8317, 1.8045, 1.7802, 1.7584, 1.7388, 1.7209, 1.7046, 1.6896],
                      [90, 3.9469, 3.0977, 2.7058, 2.4729, 2.3157, 2.2011, 2.1131, 2.043, 1.9856, 1.9376,
                       1.8967, 1.8613, 1.8305, 1.8032, 1.7789, 1.7571, 1.7375, 1.7196, 1.7033, 1.6883],
                      [91, 3.9457, 3.0965, 2.7047, 2.4718, 2.3146, 2.1999, 2.1119, 2.0418, 1.9844, 1.9364,
                       1.8955, 1.8601, 1.8292, 1.802, 1.7777, 1.7559, 1.7362, 1.7183, 1.702, 1.687],
                      [92, 3.9446, 3.0955, 2.7036, 2.4707, 2.3134, 2.1988, 2.1108, 2.0407, 1.9833, 1.9352,
                       1.8943, 1.8589, 1.828, 1.8008, 1.7764, 1.7546, 1.735, 1.717, 1.7007, 1.6857],
                      [93, 3.9435, 3.0944, 2.7025, 2.4696, 2.3123, 2.1977, 2.1097, 2.0395, 1.9821, 1.934,
                       1.8931, 1.8578, 1.8269, 1.7996, 1.7753, 1.7534, 1.7337, 1.7158, 1.6995, 1.6845],
                      [94, 3.9423, 3.0933, 2.7014, 2.4685, 2.3113, 2.1966, 2.1086, 2.0385, 1.981, 1.9329,
                       1.892, 1.8566, 1.8257, 1.7984, 1.7741, 1.7522, 1.7325, 1.7146, 1.6982, 1.6832],
                      [95, 3.9412, 3.0922, 2.7004, 2.4675, 2.3102, 2.1955, 2.1075, 2.0374, 1.9799, 1.9318,
                       1.8909, 1.8555, 1.8246, 1.7973, 1.7729, 1.7511, 1.7314, 1.7134, 1.6971, 1.682],
                      [96, 3.9402, 3.0912, 2.6994, 2.4665, 2.3092, 2.1945, 2.1065, 2.0363, 1.9789, 1.9308,
                       1.8898, 1.8544, 1.8235, 1.7961, 1.7718, 1.75, 1.7302, 1.7123, 1.6959, 1.6809],
                      [97, 3.9392, 3.0902, 2.6984, 2.4655, 2.3082, 2.1935, 2.1054, 2.0353, 1.9778, 1.9297,
                       1.8888, 1.8533, 1.8224, 1.7951, 1.7707, 1.7488, 1.7291, 1.7112, 1.6948, 1.6797],
                      [98, 3.9381, 3.0892, 2.6974, 2.4645, 2.3072, 2.1925, 2.1044, 2.0343, 1.9768, 1.9287,
                       1.8877, 1.8523, 1.8213, 1.794, 1.7696, 1.7478, 1.728, 1.71, 1.6936, 1.6786],
                      [99, 3.9371, 3.0882, 2.6965, 2.4636, 2.3062, 2.1916, 2.1035, 2.0333, 1.9758, 1.9277,
                       1.8867, 1.8513, 1.8203, 1.7929, 1.7686, 1.7467, 1.7269, 1.709, 1.6926, 1.6775],
                      [100, 3.9361, 3.0873, 2.6955, 2.4626, 2.3053, 2.1906, 2.1025, 2.0323, 1.9748, 1.9267,
                       1.8857, 1.8502, 1.8193, 1.7919, 1.7675, 1.7456, 1.7259, 1.7079, 1.6915, 1.6764],
                      [101, 3.9352, 3.0864, 2.6946, 2.4617, 2.3044, 2.1897, 2.1016, 2.0314, 1.9739, 1.9257,
                       1.8847, 1.8493, 1.8183, 1.7909, 1.7665, 1.7446, 1.7248, 1.7069, 1.6904, 1.6754],
                      [102, 3.9342, 3.0854, 2.6937, 2.4608, 2.3035, 2.1888, 2.1007, 2.0304, 1.9729, 1.9248,
                       1.8838, 1.8483, 1.8173, 1.7899, 1.7655, 1.7436, 1.7238, 1.7058, 1.6894, 1.6744],
                      [103, 3.9333, 3.0846, 2.6928, 2.4599, 2.3026, 2.1879, 2.0997, 2.0295, 1.972, 1.9238,
                       1.8828, 1.8474, 1.8163, 1.789, 1.7645, 1.7427, 1.7229, 1.7048, 1.6884, 1.6733],
                      [104, 3.9325, 3.0837, 2.692, 2.4591, 2.3017, 2.187, 2.0989, 2.0287, 1.9711, 1.9229,
                       1.8819, 1.8464, 1.8154, 1.788, 1.7636, 1.7417, 1.7219, 1.7039, 1.6874, 1.6723],
                      [105, 3.9316, 3.0828, 2.6912, 2.4582, 2.3009, 2.1861, 2.098, 2.0278, 1.9702, 1.922,
                       1.881, 1.8455, 1.8145, 1.7871, 1.7627, 1.7407, 1.7209, 1.7029, 1.6865, 1.6714],
                      [106, 3.9307, 3.082, 2.6903, 2.4574, 2.3, 2.1853, 2.0971, 2.0269, 1.9694, 1.9212,
                       1.8801, 1.8446, 1.8136, 1.7862, 1.7618, 1.7398, 1.72, 1.702, 1.6855, 1.6704],
                      [107, 3.9299, 3.0812, 2.6895, 2.4566, 2.2992, 2.1845, 2.0963, 2.0261, 1.9685, 1.9203,
                       1.8792, 1.8438, 1.8127, 1.7853, 1.7608, 1.7389, 1.7191, 1.7011, 1.6846, 1.6695],
                      [108, 3.929, 3.0804, 2.6887, 2.4558, 2.2984, 2.1837, 2.0955, 2.0252, 1.9677, 1.9195,
                       1.8784, 1.8429, 1.8118, 1.7844, 1.7599, 1.738, 1.7182, 1.7001, 1.6837, 1.6685],
                      [109, 3.9282, 3.0796, 2.6879, 2.455, 2.2976, 2.1828, 2.0947, 2.0244, 1.9669, 1.9186,
                       1.8776, 1.8421, 1.811, 1.7835, 1.7591, 1.7371, 1.7173, 1.6992, 1.6828, 1.6676],
                      [110, 3.9274, 3.0788, 2.6872, 2.4542, 2.2968, 2.1821, 2.0939, 2.0236, 1.9661, 1.9178,
                       1.8767, 1.8412, 1.8102, 1.7827, 1.7582, 1.7363, 1.7164, 1.6984, 1.6819, 1.6667],
                      [111, 3.9266, 3.0781, 2.6864, 2.4535, 2.2961, 2.1813, 2.0931, 2.0229, 1.9653, 1.917,
                       1.8759, 1.8404, 1.8093, 1.7819, 1.7574, 1.7354, 1.7156, 1.6975, 1.681, 1.6659],
                      [112, 3.9258, 3.0773, 2.6857, 2.4527, 2.2954, 2.1806, 2.0924, 2.0221, 1.9645, 1.9163,
                       1.8751, 1.8396, 1.8085, 1.7811, 1.7566, 1.7346, 1.7147, 1.6967, 1.6802, 1.665],
                      [113, 3.9251, 3.0766, 2.6849, 2.452, 2.2946, 2.1798, 2.0916, 2.0213, 1.9637, 1.9155,
                       1.8744, 1.8388, 1.8077, 1.7803, 1.7558, 1.7338, 1.7139, 1.6958, 1.6793, 1.6642],
                      [114, 3.9243, 3.0758, 2.6842, 2.4513, 2.2939, 2.1791, 2.0909, 2.0206, 1.963, 1.9147,
                       1.8736, 1.8381, 1.8069, 1.7795, 1.755, 1.733, 1.7131, 1.695, 1.6785, 1.6633],
                      [115, 3.9236, 3.0751, 2.6835, 2.4506, 2.2932, 2.1784, 2.0902, 2.0199, 1.9623, 1.914,
                       1.8729, 1.8373, 1.8062, 1.7787, 1.7542, 1.7322, 1.7123, 1.6942, 1.6777, 1.6625],
                      [116, 3.9228, 3.0744, 2.6828, 2.4499, 2.2925, 2.1777, 2.0895, 2.0192, 1.9615, 1.9132,
                       1.8721, 1.8365, 1.8054, 1.7779, 1.7534, 1.7314, 1.7115, 1.6934, 1.6769, 1.6617],
                      [117, 3.9222, 3.0738, 2.6821, 2.4492, 2.2918, 2.177, 2.0888, 2.0185, 1.9608, 1.9125,
                       1.8714, 1.8358, 1.8047, 1.7772, 1.7527, 1.7307, 1.7108, 1.6927, 1.6761, 1.6609],
                      [118, 3.9215, 3.0731, 2.6815, 2.4485, 2.2912, 2.1763, 2.0881, 2.0178, 1.9601, 1.9118,
                       1.8707, 1.8351, 1.804, 1.7765, 1.752, 1.7299, 1.71, 1.6919, 1.6754, 1.6602],
                      [119, 3.9208, 3.0724, 2.6808, 2.4479, 2.2905, 2.1757, 2.0874, 2.0171, 1.9594, 1.9111,
                       1.87, 1.8344, 1.8032, 1.7757, 1.7512, 1.7292, 1.7093, 1.6912, 1.6746, 1.6594],
                      [120, 3.9202, 3.0718, 2.6802, 2.4472, 2.2899, 2.175, 2.0868, 2.0164, 1.9588, 1.9105,
                       1.8693, 1.8337, 1.8026, 1.775, 1.7505, 1.7285, 1.7085, 1.6904, 1.6739, 1.6587],
                      [121, 3.9194, 3.0712, 2.6795, 2.4466, 2.2892, 2.1744, 2.0861, 2.0158, 1.9581, 1.9098,
                       1.8686, 1.833, 1.8019, 1.7743, 1.7498, 1.7278, 1.7078, 1.6897, 1.6732, 1.6579],
                      [122, 3.9188, 3.0705, 2.6789, 2.446, 2.2886, 2.1737, 2.0855, 2.0151, 1.9575, 1.9091,
                       1.868, 1.8324, 1.8012, 1.7736, 1.7491, 1.727, 1.7071, 1.689, 1.6724, 1.6572],
                      [123, 3.9181, 3.0699, 2.6783, 2.4454, 2.288, 2.1731, 2.0849, 2.0145, 1.9568, 1.9085,
                       1.8673, 1.8317, 1.8005, 1.773, 1.7484, 1.7264, 1.7064, 1.6883, 1.6717, 1.6565],
                      [124, 3.9176, 3.0693, 2.6777, 2.4448, 2.2874, 2.1725, 2.0842, 2.0139, 1.9562, 1.9078,
                       1.8667, 1.831, 1.7999, 1.7723, 1.7478, 1.7257, 1.7058, 1.6876, 1.6711, 1.6558],
                      [125, 3.9169, 3.0687, 2.6771, 2.4442, 2.2868, 2.1719, 2.0836, 2.0133, 1.9556, 1.9072,
                       1.866, 1.8304, 1.7992, 1.7717, 1.7471, 1.725, 1.7051, 1.6869, 1.6704, 1.6551],
                      [126, 3.9163, 3.0681, 2.6765, 2.4436, 2.2862, 2.1713, 2.083, 2.0126, 1.955, 1.9066,
                       1.8654, 1.8298, 1.7986, 1.771, 1.7464, 1.7244, 1.7044, 1.6863, 1.6697, 1.6544],
                      [127, 3.9157, 3.0675, 2.6759, 2.443, 2.2856, 2.1707, 2.0824, 2.0121, 1.9544, 1.906,
                       1.8648, 1.8291, 1.7979, 1.7704, 1.7458, 1.7237, 1.7038, 1.6856, 1.669, 1.6538],
                      [128, 3.9151, 3.0669, 2.6754, 2.4424, 2.285, 2.1701, 2.0819, 2.0115, 1.9538, 1.9054,
                       1.8642, 1.8285, 1.7974, 1.7698, 1.7452, 1.7231, 1.7031, 1.685, 1.6684, 1.6531],
                      [129, 3.9145, 3.0664, 2.6749, 2.4419, 2.2845, 2.1696, 2.0813, 2.0109, 1.9532, 1.9048,
                       1.8636, 1.828, 1.7967, 1.7692, 1.7446, 1.7225, 1.7025, 1.6843, 1.6677, 1.6525],
                      [130, 3.914, 3.0659, 2.6743, 2.4414, 2.2839, 2.169, 2.0807, 2.0103, 1.9526, 1.9042,
                       1.863, 1.8273, 1.7962, 1.7685, 1.744, 1.7219, 1.7019, 1.6837, 1.6671, 1.6519],
                      [131, 3.9134, 3.0653, 2.6737, 2.4408, 2.2834, 2.1685, 2.0802, 2.0098, 1.9521, 1.9037,
                       1.8624, 1.8268, 1.7956, 1.768, 1.7434, 1.7213, 1.7013, 1.6831, 1.6665, 1.6513],
                      [132, 3.9129, 3.0648, 2.6732, 2.4403, 2.2829, 2.168, 2.0796, 2.0092, 1.9515, 1.9031,
                       1.8619, 1.8262, 1.795, 1.7674, 1.7428, 1.7207, 1.7007, 1.6825, 1.6659, 1.6506],
                      [133, 3.9123, 3.0642, 2.6727, 2.4398, 2.2823, 2.1674, 2.0791, 2.0087, 1.951, 1.9026,
                       1.8613, 1.8256, 1.7944, 1.7668, 1.7422, 1.7201, 1.7001, 1.6819, 1.6653, 1.65],
                      [134, 3.9118, 3.0637, 2.6722, 2.4392, 2.2818, 2.1669, 2.0786, 2.0082, 1.9504, 1.902,
                       1.8608, 1.8251, 1.7939, 1.7662, 1.7416, 1.7195, 1.6995, 1.6813, 1.6647, 1.6494],
                      [135, 3.9112, 3.0632, 2.6717, 2.4387, 2.2813, 2.1664, 2.0781, 2.0076, 1.9499, 1.9015,
                       1.8602, 1.8245, 1.7933, 1.7657, 1.7411, 1.719, 1.6989, 1.6808, 1.6641, 1.6488],
                      [136, 3.9108, 3.0627, 2.6712, 2.4382, 2.2808, 2.1659, 2.0775, 2.0071, 1.9494, 1.901,
                       1.8597, 1.824, 1.7928, 1.7651, 1.7405, 1.7184, 1.6984, 1.6802, 1.6635, 1.6483],
                      [137, 3.9102, 3.0622, 2.6707, 2.4378, 2.2803, 2.1654, 2.077, 2.0066, 1.9488, 1.9004,
                       1.8592, 1.8235, 1.7922, 1.7646, 1.74, 1.7178, 1.6978, 1.6796, 1.663, 1.6477],
                      [138, 3.9098, 3.0617, 2.6702, 2.4373, 2.2798, 2.1649, 2.0766, 2.0061, 1.9483, 1.8999,
                       1.8586, 1.823, 1.7917, 1.7641, 1.7394, 1.7173, 1.6973, 1.6791, 1.6624, 1.6471],
                      [139, 3.9092, 3.0613, 2.6697, 2.4368, 2.2794, 2.1644, 2.0761, 2.0056, 1.9478, 1.8994,
                       1.8581, 1.8224, 1.7912, 1.7635, 1.7389, 1.7168, 1.6967, 1.6785, 1.6619, 1.6466],
                      [140, 3.9087, 3.0608, 2.6692, 2.4363, 2.2789, 2.1639, 2.0756, 2.0051, 1.9473, 1.8989,
                       1.8576, 1.8219, 1.7907, 1.763, 1.7384, 1.7162, 1.6962, 1.678, 1.6613, 1.646],
                      [141, 3.9083, 3.0603, 2.6688, 2.4359, 2.2784, 2.1634, 2.0751, 2.0046, 1.9469, 1.8984,
                       1.8571, 1.8214, 1.7901, 1.7625, 1.7379, 1.7157, 1.6957, 1.6775, 1.6608, 1.6455],
                      [142, 3.9078, 3.0598, 2.6683, 2.4354, 2.2779, 2.163, 2.0747, 2.0042, 1.9464, 1.8979,
                       1.8566, 1.8209, 1.7897, 1.762, 1.7374, 1.7152, 1.6952, 1.6769, 1.6603, 1.645],
                      [143, 3.9073, 3.0594, 2.6679, 2.435, 2.2775, 2.1625, 2.0742, 2.0037, 1.9459, 1.8975,
                       1.8562, 1.8204, 1.7892, 1.7615, 1.7368, 1.7147, 1.6946, 1.6764, 1.6598, 1.6444],
                      [144, 3.9068, 3.0589, 2.6675, 2.4345, 2.277, 2.1621, 2.0737, 2.0033, 1.9455, 1.897,
                       1.8557, 1.82, 1.7887, 1.761, 1.7364, 1.7142, 1.6941, 1.6759, 1.6592, 1.6439],
                      [145, 3.9064, 3.0585, 2.667, 2.4341, 2.2766, 2.1617, 2.0733, 2.0028, 1.945, 1.8965,
                       1.8552, 1.8195, 1.7882, 1.7605, 1.7359, 1.7137, 1.6936, 1.6754, 1.6587, 1.6434],
                      [146, 3.906, 3.0581, 2.6666, 2.4337, 2.2762, 2.1612, 2.0728, 2.0024, 1.9445, 1.8961,
                       1.8548, 1.819, 1.7877, 1.7601, 1.7354, 1.7132, 1.6932, 1.6749, 1.6582, 1.6429],
                      [147, 3.9055, 3.0576, 2.6662, 2.4332, 2.2758, 2.1608, 2.0724, 2.0019, 1.9441, 1.8956,
                       1.8543, 1.8186, 1.7873, 1.7596, 1.7349, 1.7127, 1.6927, 1.6744, 1.6578, 1.6424],
                      [148, 3.9051, 3.0572, 2.6657, 2.4328, 2.2753, 2.1604, 2.072, 2.0015, 1.9437, 1.8952,
                       1.8539, 1.8181, 1.7868, 1.7591, 1.7344, 1.7123, 1.6922, 1.6739, 1.6573, 1.6419],
                      [149, 3.9046, 3.0568, 2.6653, 2.4324, 2.2749, 2.1599, 2.0716, 2.0011, 1.9432, 1.8947,
                       1.8534, 1.8177, 1.7864, 1.7587, 1.734, 1.7118, 1.6917, 1.6735, 1.6568, 1.6414],
                      [150, 3.9042, 3.0564, 2.6649, 2.4319, 2.2745, 2.1595, 2.0711, 2.0006, 1.9428, 1.8943,
                       1.853, 1.8172, 1.7859, 1.7582, 1.7335, 1.7113, 1.6913, 1.673, 1.6563, 1.641],
                      [151, 3.9038, 3.056, 2.6645, 2.4315, 2.2741, 2.1591, 2.0707, 2.0002, 1.9424, 1.8939,
                       1.8526, 1.8168, 1.7855, 1.7578, 1.7331, 1.7109, 1.6908, 1.6726, 1.6558, 1.6405],
                      [152, 3.9033, 3.0555, 2.6641, 2.4312, 2.2737, 2.1587, 2.0703, 1.9998, 1.942, 1.8935,
                       1.8521, 1.8163, 1.785, 1.7573, 1.7326, 1.7104, 1.6904, 1.6721, 1.6554, 1.64],
                      [153, 3.903, 3.0552, 2.6637, 2.4308, 2.2733, 2.1583, 2.0699, 1.9994, 1.9416, 1.8931,
                       1.8517, 1.8159, 1.7846, 1.7569, 1.7322, 1.71, 1.6899, 1.6717, 1.6549, 1.6396],
                      [154, 3.9026, 3.0548, 2.6634, 2.4304, 2.2729, 2.1579, 2.0695, 1.999, 1.9412, 1.8926,
                       1.8513, 1.8155, 1.7842, 1.7565, 1.7318, 1.7096, 1.6895, 1.6712, 1.6545, 1.6391],
                      [155, 3.9021, 3.0544, 2.6629, 2.43, 2.2725, 2.1575, 2.0691, 1.9986, 1.9407, 1.8923,
                       1.8509, 1.8151, 1.7838, 1.7561, 1.7314, 1.7091, 1.6891, 1.6708, 1.654, 1.6387],
                      [156, 3.9018, 3.054, 2.6626, 2.4296, 2.2722, 2.1571, 2.0687, 1.9982, 1.9403, 1.8918,
                       1.8505, 1.8147, 1.7834, 1.7557, 1.7309, 1.7087, 1.6886, 1.6703, 1.6536, 1.6383],
                      [157, 3.9014, 3.0537, 2.6622, 2.4293, 2.2717, 2.1568, 2.0684, 1.9978, 1.94, 1.8915,
                       1.8501, 1.8143, 1.7829, 1.7552, 1.7305, 1.7083, 1.6882, 1.6699, 1.6532, 1.6378],
                      [158, 3.901, 3.0533, 2.6618, 2.4289, 2.2714, 2.1564, 2.068, 1.9974, 1.9396, 1.8911,
                       1.8497, 1.8139, 1.7826, 1.7548, 1.7301, 1.7079, 1.6878, 1.6695, 1.6528, 1.6374],
                      [159, 3.9006, 3.0529, 2.6615, 2.4285, 2.271, 2.156, 2.0676, 1.997, 1.9392, 1.8907,
                       1.8493, 1.8135, 1.7822, 1.7544, 1.7297, 1.7075, 1.6874, 1.6691, 1.6524, 1.637],
                      [160, 3.9002, 3.0525, 2.6611, 2.4282, 2.2706, 2.1556, 2.0672, 1.9967, 1.9388, 1.8903,
                       1.8489, 1.8131, 1.7818, 1.754, 1.7293, 1.7071, 1.687, 1.6687, 1.6519, 1.6366],
                      [161, 3.8998, 3.0522, 2.6607, 2.4278, 2.2703, 2.1553, 2.0669, 1.9963, 1.9385, 1.8899,
                       1.8485, 1.8127, 1.7814, 1.7537, 1.7289, 1.7067, 1.6866, 1.6683, 1.6515, 1.6361],
                      [162, 3.8995, 3.0518, 2.6604, 2.4275, 2.27, 2.155, 2.0665, 1.9959, 1.9381, 1.8895,
                       1.8482, 1.8124, 1.781, 1.7533, 1.7285, 1.7063, 1.6862, 1.6679, 1.6511, 1.6357],
                      [163, 3.8991, 3.0515, 2.6601, 2.4271, 2.2696, 2.1546, 2.0662, 1.9956, 1.9377, 1.8892,
                       1.8478, 1.812, 1.7806, 1.7529, 1.7282, 1.7059, 1.6858, 1.6675, 1.6507, 1.6353],
                      [164, 3.8987, 3.0512, 2.6597, 2.4268, 2.2693, 2.1542, 2.0658, 1.9953, 1.9374, 1.8888,
                       1.8474, 1.8116, 1.7803, 1.7525, 1.7278, 1.7055, 1.6854, 1.6671, 1.6503, 1.6349],
                      [165, 3.8985, 3.0508, 2.6594, 2.4264, 2.2689, 2.1539, 2.0655, 1.9949, 1.937, 1.8885,
                       1.8471, 1.8112, 1.7799, 1.7522, 1.7274, 1.7052, 1.685, 1.6667, 1.6499, 1.6345],
                      [166, 3.8981, 3.0505, 2.6591, 2.4261, 2.2686, 2.1536, 2.0651, 1.9945, 1.9367, 1.8881,
                       1.8467, 1.8109, 1.7795, 1.7518, 1.727, 1.7048, 1.6846, 1.6663, 1.6496, 1.6341],
                      [167, 3.8977, 3.0502, 2.6587, 2.4258, 2.2683, 2.1533, 2.0648, 1.9942, 1.9363, 1.8878,
                       1.8464, 1.8105, 1.7792, 1.7514, 1.7266, 1.7044, 1.6843, 1.6659, 1.6492, 1.6338],
                      [168, 3.8974, 3.0498, 2.6584, 2.4254, 2.268, 2.1529, 2.0645, 1.9939, 1.936, 1.8874,
                       1.846, 1.8102, 1.7788, 1.7511, 1.7263, 1.704, 1.6839, 1.6656, 1.6488, 1.6334],
                      [169, 3.8971, 3.0495, 2.6581, 2.4251, 2.2676, 2.1526, 2.0641, 1.9936, 1.9357, 1.8871,
                       1.8457, 1.8099, 1.7785, 1.7507, 1.7259, 1.7037, 1.6835, 1.6652, 1.6484, 1.633],
                      [170, 3.8967, 3.0492, 2.6578, 2.4248, 2.2673, 2.1523, 2.0638, 1.9932, 1.9353, 1.8868,
                       1.8454, 1.8095, 1.7781, 1.7504, 1.7256, 1.7033, 1.6832, 1.6648, 1.6481, 1.6326],
                      [171, 3.8965, 3.0488, 2.6575, 2.4245, 2.267, 2.152, 2.0635, 1.9929, 1.935, 1.8864,
                       1.845, 1.8092, 1.7778, 1.75, 1.7252, 1.703, 1.6828, 1.6645, 1.6477, 1.6323],
                      [172, 3.8961, 3.0485, 2.6571, 2.4242, 2.2667, 2.1516, 2.0632, 1.9926, 1.9347, 1.8861,
                       1.8447, 1.8088, 1.7774, 1.7497, 1.7249, 1.7026, 1.6825, 1.6641, 1.6473, 1.6319],
                      [173, 3.8958, 3.0482, 2.6568, 2.4239, 2.2664, 2.1513, 2.0628, 1.9923, 1.9343, 1.8858,
                       1.8443, 1.8085, 1.7771, 1.7493, 1.7246, 1.7023, 1.6821, 1.6638, 1.647, 1.6316],
                      [174, 3.8954, 3.0479, 2.6566, 2.4236, 2.266, 2.151, 2.0626, 1.9919, 1.934, 1.8855,
                       1.844, 1.8082, 1.7768, 1.749, 1.7242, 1.7019, 1.6818, 1.6634, 1.6466, 1.6312],
                      [175, 3.8952, 3.0476, 2.6563, 2.4233, 2.2658, 2.1507, 2.0622, 1.9916, 1.9337, 1.8852,
                       1.8437, 1.8078, 1.7764, 1.7487, 1.7239, 1.7016, 1.6814, 1.6631, 1.6463, 1.6309],
                      [176, 3.8948, 3.0473, 2.6559, 2.423, 2.2655, 2.1504, 2.0619, 1.9913, 1.9334, 1.8848,
                       1.8434, 1.8075, 1.7761, 1.7483, 1.7236, 1.7013, 1.6811, 1.6628, 1.646, 1.6305],
                      [177, 3.8945, 3.047, 2.6556, 2.4227, 2.2652, 2.1501, 2.0616, 1.991, 1.9331, 1.8845,
                       1.8431, 1.8072, 1.7758, 1.748, 1.7232, 1.7009, 1.6808, 1.6624, 1.6456, 1.6302],
                      [178, 3.8943, 3.0467, 2.6554, 2.4224, 2.2649, 2.1498, 2.0613, 1.9907, 1.9328, 1.8842,
                       1.8428, 1.8069, 1.7755, 1.7477, 1.7229, 1.7006, 1.6805, 1.6621, 1.6453, 1.6298],
                      [179, 3.8939, 3.0465, 2.6551, 2.4221, 2.2646, 2.1495, 2.0611, 1.9904, 1.9325, 1.8839,
                       1.8425, 1.8066, 1.7752, 1.7474, 1.7226, 1.7003, 1.6801, 1.6618, 1.645, 1.6295],
                      [180, 3.8936, 3.0462, 2.6548, 2.4218, 2.2643, 2.1492, 2.0608, 1.9901, 1.9322, 1.8836,
                       1.8422, 1.8063, 1.7749, 1.7471, 1.7223, 1.7, 1.6798, 1.6614, 1.6446, 1.6292],
                      [181, 3.8933, 3.0458, 2.6545, 2.4216, 2.264, 2.149, 2.0605, 1.9899, 1.9319, 1.8833,
                       1.8419, 1.806, 1.7746, 1.7468, 1.7219, 1.6997, 1.6795, 1.6611, 1.6443, 1.6289],
                      [182, 3.8931, 3.0456, 2.6543, 2.4213, 2.2638, 2.1487, 2.0602, 1.9896, 1.9316, 1.883,
                       1.8416, 1.8057, 1.7743, 1.7465, 1.7217, 1.6994, 1.6792, 1.6608, 1.644, 1.6286],
                      [183, 3.8928, 3.0453, 2.654, 2.421, 2.2635, 2.1484, 2.0599, 1.9893, 1.9313, 1.8827,
                       1.8413, 1.8054, 1.774, 1.7462, 1.7214, 1.6991, 1.6789, 1.6605, 1.6437, 1.6282],
                      [184, 3.8925, 3.045, 2.6537, 2.4207, 2.2632, 2.1481, 2.0596, 1.989, 1.9311, 1.8825,
                       1.841, 1.8051, 1.7737, 1.7459, 1.721, 1.6987, 1.6786, 1.6602, 1.6434, 1.6279],
                      [185, 3.8923, 3.0448, 2.6534, 2.4205, 2.263, 2.1479, 2.0594, 1.9887, 1.9308, 1.8822,
                       1.8407, 1.8048, 1.7734, 1.7456, 1.7208, 1.6984, 1.6783, 1.6599, 1.643, 1.6276],
                      [186, 3.892, 3.0445, 2.6531, 2.4202, 2.2627, 2.1476, 2.0591, 1.9885, 1.9305, 1.8819,
                       1.8404, 1.8045, 1.7731, 1.7453, 1.7205, 1.6981, 1.678, 1.6596, 1.6428, 1.6273],
                      [187, 3.8917, 3.0442, 2.6529, 2.4199, 2.2624, 2.1473, 2.0588, 1.9882, 1.9302, 1.8816,
                       1.8401, 1.8042, 1.7728, 1.745, 1.7202, 1.6979, 1.6777, 1.6593, 1.6424, 1.627],
                      [188, 3.8914, 3.044, 2.6526, 2.4197, 2.2621, 2.1471, 2.0586, 1.9879, 1.9299, 1.8814,
                       1.8399, 1.804, 1.7725, 1.7447, 1.7199, 1.6976, 1.6774, 1.659, 1.6421, 1.6267],
                      [189, 3.8912, 3.0437, 2.6524, 2.4195, 2.2619, 2.1468, 2.0583, 1.9877, 1.9297, 1.8811,
                       1.8396, 1.8037, 1.7722, 1.7444, 1.7196, 1.6973, 1.6771, 1.6587, 1.6418, 1.6264],
                      [190, 3.8909, 3.0435, 2.6521, 2.4192, 2.2617, 2.1466, 2.0581, 1.9874, 1.9294, 1.8808,
                       1.8393, 1.8034, 1.772, 1.7441, 1.7193, 1.697, 1.6768, 1.6584, 1.6416, 1.6261],
                      [191, 3.8906, 3.0432, 2.6519, 2.4189, 2.2614, 2.1463, 2.0578, 1.9871, 1.9292, 1.8805,
                       1.8391, 1.8032, 1.7717, 1.7439, 1.719, 1.6967, 1.6765, 1.6581, 1.6413, 1.6258],
                      [192, 3.8903, 3.043, 2.6516, 2.4187, 2.2611, 2.1461, 2.0575, 1.9869, 1.9289, 1.8803,
                       1.8388, 1.8029, 1.7714, 1.7436, 1.7188, 1.6964, 1.6762, 1.6578, 1.641, 1.6255],
                      [193, 3.8901, 3.0427, 2.6514, 2.4184, 2.2609, 2.1458, 2.0573, 1.9866, 1.9286, 1.88,
                       1.8385, 1.8026, 1.7712, 1.7433, 1.7185, 1.6961, 1.6759, 1.6575, 1.6407, 1.6252],
                      [194, 3.8899, 3.0425, 2.6512, 2.4182, 2.2606, 2.1456, 2.057, 1.9864, 1.9284, 1.8798,
                       1.8383, 1.8023, 1.7709, 1.7431, 1.7182, 1.6959, 1.6757, 1.6572, 1.6404, 1.6249],
                      [195, 3.8896, 3.0422, 2.6509, 2.418, 2.2604, 2.1453, 2.0568, 1.9861, 1.9281, 1.8795,
                       1.838, 1.8021, 1.7706, 1.7428, 1.7179, 1.6956, 1.6754, 1.657, 1.6401, 1.6247],
                      [196, 3.8893, 3.042, 2.6507, 2.4177, 2.2602, 2.1451, 2.0566, 1.9859, 1.9279, 1.8793,
                       1.8377, 1.8018, 1.7704, 1.7425, 1.7177, 1.6953, 1.6751, 1.6567, 1.6399, 1.6244],
                      [197, 3.8891, 3.0418, 2.6504, 2.4175, 2.26, 2.1448, 2.0563, 1.9856, 1.9277, 1.879,
                       1.8375, 1.8016, 1.7701, 1.7423, 1.7174, 1.6951, 1.6748, 1.6564, 1.6396, 1.6241],
                      [198, 3.8889, 3.0415, 2.6502, 2.4173, 2.2597, 2.1446, 2.0561, 1.9854, 1.9274, 1.8788,
                       1.8373, 1.8013, 1.7699, 1.742, 1.7172, 1.6948, 1.6746, 1.6562, 1.6393, 1.6238],
                      [199, 3.8886, 3.0413, 2.65, 2.417, 2.2595, 2.1444, 2.0558, 1.9852, 1.9272, 1.8785,
                       1.837, 1.8011, 1.7696, 1.7418, 1.7169, 1.6946, 1.6743, 1.6559, 1.6391, 1.6236],
                      [200, 3.8883, 3.041, 2.6497, 2.4168, 2.2592, 2.1441, 2.0556, 1.9849, 1.9269, 1.8783, 1.8368, 1.8008, 1.7694, 1.7415, 1.7166, 1.6943, 1.6741, 1.6557, 1.6388, 1.62]])
    return ftest[int(row)][int(col)]

Response: Calculates the F - test for a given set of degrees of freedom.


Instruction:
Can you generate the documentation for the following Python 3 function
def tcalc(nf, p):
#
    if p == .05:
        if nf > 2:
            t = 4.3027
        if nf > 3:
            t = 3.1824
        if nf > 4:
            t = 2.7765
        if nf > 5:
            t = 2.5706
        if nf > 6:
            t = 2.4469
        if nf > 7:
            t = 2.3646
        if nf > 8:
            t = 2.3060
        if nf > 9:
            t = 2.2622
        if nf > 10:
            t = 2.2281
        if nf > 11:
            t = 2.2010
        if nf > 12:
            t = 2.1788
        if nf > 13:
            t = 2.1604
        if nf > 14:
            t = 2.1448
        if nf > 15:
            t = 2.1315
        if nf > 16:
            t = 2.1199
        if nf > 17:
            t = 2.1098
        if nf > 18:
            t = 2.1009
        if nf > 19:
            t = 2.0930
        if nf > 20:
            t = 2.0860
        if nf > 21:
            t = 2.0796
        if nf > 22:
            t = 2.0739
        if nf > 23:
            t = 2.0687
        if nf > 24:
            t = 2.0639
        if nf > 25:
            t = 2.0595
        if nf > 26:
            t = 2.0555
        if nf > 27:
            t = 2.0518
        if nf > 28:
            t = 2.0484
        if nf > 29:
            t = 2.0452
        if nf > 30:
            t = 2.0423
        if nf > 31:
            t = 2.0395
        if nf > 32:
            t = 2.0369
        if nf > 33:
            t = 2.0345
        if nf > 34:
            t = 2.0322
        if nf > 35:
            t = 2.0301
        if nf > 36:
            t = 2.0281
        if nf > 37:
            t = 2.0262
        if nf > 38:
            t = 2.0244
        if nf > 39:
            t = 2.0227
        if nf > 40:
            t = 2.0211
        if nf > 41:
            t = 2.0195
        if nf > 42:
            t = 2.0181
        if nf > 43:
            t = 2.0167
        if nf > 44:
            t = 2.0154
        if nf > 45:
            t = 2.0141
        if nf > 46:
            t = 2.0129
        if nf > 47:
            t = 2.0117
        if nf > 48:
            t = 2.0106
        if nf > 49:
            t = 2.0096
        if nf > 50:
            t = 2.0086
        if nf > 51:
            t = 2.0076
        if nf > 52:
            t = 2.0066
        if nf > 53:
            t = 2.0057
        if nf > 54:
            t = 2.0049
        if nf > 55:
            t = 2.0040
        if nf > 56:
            t = 2.0032
        if nf > 57:
            t = 2.0025
        if nf > 58:
            t = 2.0017
        if nf > 59:
            t = 2.0010
        if nf > 60:
            t = 2.0003
        if nf > 61:
            t = 1.9996
        if nf > 62:
            t = 1.9990
        if nf > 63:
            t = 1.9983
        if nf > 64:
            t = 1.9977
        if nf > 65:
            t = 1.9971
        if nf > 66:
            t = 1.9966
        if nf > 67:
            t = 1.9960
        if nf > 68:
            t = 1.9955
        if nf > 69:
            t = 1.9949
        if nf > 70:
            t = 1.9944
        if nf > 71:
            t = 1.9939
        if nf > 72:
            t = 1.9935
        if nf > 73:
            t = 1.9930
        if nf > 74:
            t = 1.9925
        if nf > 75:
            t = 1.9921
        if nf > 76:
            t = 1.9917
        if nf > 77:
            t = 1.9913
        if nf > 78:
            t = 1.9908
        if nf > 79:
            t = 1.9905
        if nf > 80:
            t = 1.9901
        if nf > 81:
            t = 1.9897
        if nf > 82:
            t = 1.9893
        if nf > 83:
            t = 1.9890
        if nf > 84:
            t = 1.9886
        if nf > 85:
            t = 1.9883
        if nf > 86:
            t = 1.9879
        if nf > 87:
            t = 1.9876
        if nf > 88:
            t = 1.9873
        if nf > 89:
            t = 1.9870
        if nf > 90:
            t = 1.9867
        if nf > 91:
            t = 1.9864
        if nf > 92:
            t = 1.9861
        if nf > 93:
            t = 1.9858
        if nf > 94:
            t = 1.9855
        if nf > 95:
            t = 1.9852
        if nf > 96:
            t = 1.9850
        if nf > 97:
            t = 1.9847
        if nf > 98:
            t = 1.9845
        if nf > 99:
            t = 1.9842
        if nf > 100:
            t = 1.9840
        return t
#
    elif p == .01:
        if nf > 2:
            t = 9.9250
        if nf > 3:
            t = 5.8408
        if nf > 4:
            t = 4.6041
        if nf > 5:
            t = 4.0321
        if nf > 6:
            t = 3.7074
        if nf > 7:
            t = 3.4995
        if nf > 8:
            t = 3.3554
        if nf > 9:
            t = 3.2498
        if nf > 10:
            t = 3.1693
        if nf > 11:
            t = 3.1058
        if nf > 12:
            t = 3.0545
        if nf > 13:
            t = 3.0123
        if nf > 14:
            t = 2.9768
        if nf > 15:
            t = 2.9467
        if nf > 16:
            t = 2.9208
        if nf > 17:
            t = 2.8982
        if nf > 18:
            t = 2.8784
        if nf > 19:
            t = 2.8609
        if nf > 20:
            t = 2.8453
        if nf > 21:
            t = 2.8314
        if nf > 22:
            t = 2.8188
        if nf > 23:
            t = 2.8073
        if nf > 24:
            t = 2.7970
        if nf > 25:
            t = 2.7874
        if nf > 26:
            t = 2.7787
        if nf > 27:
            t = 2.7707
        if nf > 28:
            t = 2.7633
        if nf > 29:
            t = 2.7564
        if nf > 30:
            t = 2.7500
        if nf > 31:
            t = 2.7440
        if nf > 32:
            t = 2.7385
        if nf > 33:
            t = 2.7333
        if nf > 34:
            t = 2.7284
        if nf > 35:
            t = 2.7238
        if nf > 36:
            t = 2.7195
        if nf > 37:
            t = 2.7154
        if nf > 38:
            t = 2.7116
        if nf > 39:
            t = 2.7079
        if nf > 40:
            t = 2.7045
        if nf > 41:
            t = 2.7012
        if nf > 42:
            t = 2.6981
        if nf > 43:
            t = 2.6951
        if nf > 44:
            t = 2.6923
        if nf > 45:
            t = 2.6896
        if nf > 46:
            t = 2.6870
        if nf > 47:
            t = 2.6846
        if nf > 48:
            t = 2.6822
        if nf > 49:
            t = 2.6800
        if nf > 50:
            t = 2.6778
        if nf > 51:
            t = 2.6757
        if nf > 52:
            t = 2.6737
        if nf > 53:
            t = 2.6718
        if nf > 54:
            t = 2.6700
        if nf > 55:
            t = 2.6682
        if nf > 56:
            t = 2.6665
        if nf > 57:
            t = 2.6649
        if nf > 58:
            t = 2.6633
        if nf > 59:
            t = 2.6618
        if nf > 60:
            t = 2.6603
        if nf > 61:
            t = 2.6589
        if nf > 62:
            t = 2.6575
        if nf > 63:
            t = 2.6561
        if nf > 64:
            t = 2.6549
        if nf > 65:
            t = 2.6536
        if nf > 66:
            t = 2.6524
        if nf > 67:
            t = 2.6512
        if nf > 68:
            t = 2.6501
        if nf > 69:
            t = 2.6490
        if nf > 70:
            t = 2.6479
        if nf > 71:
            t = 2.6469
        if nf > 72:
            t = 2.6458
        if nf > 73:
            t = 2.6449
        if nf > 74:
            t = 2.6439
        if nf > 75:
            t = 2.6430
        if nf > 76:
            t = 2.6421
        if nf > 77:
            t = 2.6412
        if nf > 78:
            t = 2.6403
        if nf > 79:
            t = 2.6395
        if nf > 80:
            t = 2.6387
        if nf > 81:
            t = 2.6379
        if nf > 82:
            t = 2.6371
        if nf > 83:
            t = 2.6364
        if nf > 84:
            t = 2.6356
        if nf > 85:
            t = 2.6349
        if nf > 86:
            t = 2.6342
        if nf > 87:
            t = 2.6335
        if nf > 88:
            t = 2.6329
        if nf > 89:
            t = 2.6322
        if nf > 90:
            t = 2.6316
        if nf > 91:
            t = 2.6309
        if nf > 92:
            t = 2.6303
        if nf > 93:
            t = 2.6297
        if nf > 94:
            t = 2.6291
        if nf > 95:
            t = 2.6286
        if nf > 96:
            t = 2.6280
        if nf > 97:
            t = 2.6275
        if nf > 98:
            t = 2.6269
        if nf > 99:
            t = 2.6264
        if nf > 100:
            t = 2.6259
        return t
        return t
    else:
        return 0

Response: calculate t - table for nf degrees of freedom


Instruction:
Write a Python 3 script for
calculating average s sigma from list of s.

Response:
def sbar(Ss):
    """
    calculate average s,sigma from list of "s"s.
    """
    if type(Ss) == list:
        Ss = np.array(Ss)
    npts = Ss.shape[0]
    Ss = Ss.transpose()

    avd, avs = [], []
    # D=np.array([Ss[0],Ss[1],Ss[2],Ss[3]+0.5*(Ss[0]+Ss[1]),Ss[4]+0.5*(Ss[1]+Ss[2]),Ss[5]+0.5*(Ss[0]+Ss[2])]).transpose()
    D = np.array([Ss[0], Ss[1], Ss[2], Ss[3] + 0.5 * (Ss[0] + Ss[1]),
                  Ss[4] + 0.5 * (Ss[1] + Ss[2]), Ss[5] + 0.5 * (Ss[0] + Ss[2])])
    for j in range(6):
        avd.append(np.average(D[j]))
        avs.append(np.average(Ss[j]))
    D = D.transpose()
    # for s in Ss:
    #    print 'from sbar: ',s
    #    D.append(s[:]) # append a copy of s
    #    D[-1][3]=D[-1][3]+0.5*(s[0]+s[1])
    #    D[-1][4]=D[-1][4]+0.5*(s[1]+s[2])
    #    D[-1][5]=D[-1][5]+0.5*(s[0]+s[2])
    #    for j in range(6):
    #        avd[j]+=(D[-1][j])/float(npts)
    #        avs[j]+=(s[j])/float(npts)
#   calculate sigma
    nf = (npts - 1) * 6  # number of degrees of freedom
    s0 = 0
    Dels = (D - avd)**2
    s0 = np.sum(Dels)
    sigma = np.sqrt(s0/float(nf))
    return nf, sigma, avs


Instruction:
Implement a Python 3 function for
calculating the hext parameters for nf sigma and s

Response:
def dohext(nf, sigma, s):
    """
    calculates hext parameters for nf, sigma and s

    Parameters
    __________
    nf :  number of degrees of freedom (measurements - 6)
    sigma : the sigma of the measurements
    s : [x11,x22,x33,x12,x23,x13] - the six tensor elements

    Return
    hpars : dictionary of Hext statistics with keys:
        'F_crit' : critical value for anisotropy
        'F12_crit' : critical value for tau1>tau2, tau2>3
        'F' : value of F
        'F12' : value of F12
        'F23' : value of F23
        'v1_dec': declination of principal eigenvector
        'v1_inc': inclination of principal eigenvector
        'v2_dec': declination of major eigenvector
        'v2_inc': inclination of major eigenvector
        'v3_dec': declination of minor eigenvector
        'v3_inc': inclination of minor eigenvector
        't1': principal eigenvalue
        't2': major eigenvalue
        't3': minor eigenvalue
        'e12': angle of confidence ellipse of principal eigenvector in direction of major eigenvector
        'e23': angle of confidence ellipse of major eigenvector in direction of minor eigenvector
        'e13': angle of confidence ellipse of principal eigenvector in direction of minor eigenvector

    If working with data set with no sigmas and the average is desired, use nf,sigma,avs=pmag.sbar(Ss) as input

    """

#
    hpars = {}
    hpars['F_crit'] = '0'
    hpars['F12_crit'] = '0'
    hpars["F"] = 0
    hpars["F12"] = 0
    hpars["F23"] = 0
    hpars["v1_dec"] = -1
    hpars["v1_inc"] = -1
    hpars["v2_dec"] = -1
    hpars["v2_inc"] = -1
    hpars["v3_dec"] = -1
    hpars["v3_inc"] = -1
    hpars["t1"] = -1
    hpars["t2"] = -1
    hpars["t3"] = -1
    hpars["e12"] = -1
    hpars["e23"] = -1
    hpars["e13"] = -1
    if nf < 0 or sigma == 0:
        return hpars
    f = np.sqrt(2. * fcalc(2, nf))
    t2sum = 0
    tau, Vdir = doseigs(s)
    for i in range(3):
        t2sum += tau[i]**2
    chibar = old_div((s[0] + s[1] + s[2]), 3.)
    hpars['F_crit'] = '%s' % (fcalc(5, nf))
    hpars['F12_crit'] = '%s' % (fcalc(2, nf))
    hpars["F"] = 0.4 * (t2sum - 3 * chibar**2) / (sigma**2)
    hpars["F12"] = 0.5 * (old_div((tau[0] - tau[1]), sigma))**2
    hpars["F23"] = 0.5 * (old_div((tau[1] - tau[2]), sigma))**2
    hpars["v1_dec"] = Vdir[0][0]
    hpars["v1_inc"] = Vdir[0][1]
    hpars["v2_dec"] = Vdir[1][0]
    hpars["v2_inc"] = Vdir[1][1]
    hpars["v3_dec"] = Vdir[2][0]
    hpars["v3_inc"] = Vdir[2][1]
    hpars["t1"] = tau[0]
    hpars["t2"] = tau[1]
    hpars["t3"] = tau[2]
    hpars["e12"] = np.arctan(
        old_div((f * sigma), (2 * abs(tau[0] - tau[1])))) * 180. / np.pi
    hpars["e23"] = np.arctan(
        old_div((f * sigma), (2 * abs(tau[1] - tau[2])))) * 180. / np.pi
    hpars["e13"] = np.arctan(
        old_div((f * sigma), (2 * abs(tau[0] - tau[2])))) * 180. / np.pi
    return hpars


Instruction:
Can you implement a function in Python 3 that
makes a design matrix for an anisotropy experiment

Response:
def design(npos):
    """
     make a design matrix for an anisotropy experiment
    """
    if npos == 15:
        #
        # rotatable design of Jelinek for kappabridge (see Tauxe, 1998)
        #
        A = np.array([[.5, .5, 0, -1., 0, 0], [.5, .5, 0, 1., 0, 0], [1, .0, 0, 0, 0, 0], [.5, .5, 0, -1., 0, 0], [.5, .5, 0, 1., 0, 0], [0, .5, .5, 0, -1., 0], [0, .5, .5, 0, 1., 0], [0, 1., 0, 0, 0, 0],
                      [0, .5, .5, 0, -1., 0], [0, .5, .5, 0, 1., 0], [.5, 0, .5, 0, 0, -1.], [.5, 0, .5, 0, 0, 1.], [0, 0, 1., 0, 0, 0], [.5, 0, .5, 0, 0, -1.], [.5, 0, .5, 0, 0, 1.]])  # design matrix for 15 measurment positions
    elif npos == 6:
        A = np.array([[1., 0, 0, 0, 0, 0], [0, 1., 0, 0, 0, 0], [0, 0, 1., 0, 0, 0], [.5, .5, 0, 1., 0, 0], [
                     0, .5, .5, 0, 1., 0], [.5, 0, .5, 0, 0, 1.]])  # design matrix for 6 measurment positions

    else:
        print("measurement protocol not supported yet ")
        return
    B = np.dot(np.transpose(A), A)
    B = linalg.inv(B)
    B = np.dot(B, np.transpose(A))
    return A, B


Instruction:
Can you write a function in Python 3 where it
calculates least - squares matrix for 15 measurements from Jelinek [ 1976 ]

Response:
def dok15_s(k15):
    """
    calculates least-squares matrix for 15 measurements from Jelinek [1976]
    """
#
    A, B = design(15)  # get design matrix for 15 measurements
    sbar = np.dot(B, k15)  # get mean s
    t = (sbar[0] + sbar[1] + sbar[2])  # trace
    bulk = old_div(t, 3.)  # bulk susceptibility
    Kbar = np.dot(A, sbar)  # get best fit values for K
    dels = k15 - Kbar  # get deltas
    dels, sbar = old_div(dels, t), old_div(sbar, t)  # normalize by trace
    So = sum(dels**2)
    sigma = np.sqrt(old_div(So, 9.))  # standard deviation
    return sbar, sigma, bulk


Instruction:
Write a Python 3 function for
returning the cross product of two vectors v and w

Response:
def cross(v, w):
    """
     cross product of two vectors
    """
    x = v[1] * w[2] - v[2] * w[1]
    y = v[2] * w[0] - v[0] * w[2]
    z = v[0] * w[1] - v[1] * w[0]
    return [x, y, z]


Instruction:
Write a Python 3 script to
rotate s to az pl

Response:
def dosgeo(s, az, pl):
    """
    rotates  matrix a to az,pl returns  s
    Parameters
    __________
    s : [x11,x22,x33,x12,x23,x13] - the six tensor elements
    az : the azimuth of the specimen X direction
    pl : the plunge (inclination) of the specimen X direction

    Return
    s_rot : [x11,x22,x33,x12,x23,x13] - after rotation
    """
#
    a = s2a(s)  # convert to 3,3 matrix
#  first get three orthogonal axes
    X1 = dir2cart((az, pl, 1.))
    X2 = dir2cart((az + 90, 0., 1.))
    X3 = cross(X1, X2)
    A = np.transpose([X1, X2, X3])
    b = np.zeros((3, 3,), 'f')  # initiale the b matrix
    for i in range(3):
        for j in range(3):
            dum = 0
            for k in range(3):
                for l in range(3):
                    dum += A[i][k] * A[j][l] * a[k][l]
            b[i][j] = dum
    s_rot = a2s(b)  # afer rotation
    return s_rot


Instruction:
Can you generate a brief explanation for the following Python 3 code
def dostilt(s, bed_az, bed_dip):
    tau, Vdirs = doseigs(s)
    Vrot = []
    for evec in Vdirs:
        d, i = dotilt(evec[0], evec[1], bed_az, bed_dip)
        Vrot.append([d, i])
    s_rot = doeigs_s(tau, Vrot)
    return s_rot

Response: Rotates s tensor to stratigraphic coordinates


Instruction:
How would you explain what the following Python 3 function does
def apseudo(Ss, ipar, sigma):
#
    Is = random.randint(0, len(Ss) - 1, size=len(Ss))  # draw N random integers
    #Ss = np.array(Ss)
    if not ipar: # ipar == 0:
        BSs = Ss[Is]
    else:  # need to recreate measurement - then do the parametric stuffr
        A, B = design(6)  # get the design matrix for 6 measurementsa
        K, BSs = [], []
        for k in range(len(Ss)):
            K.append(np.dot(A, Ss[k][0:6]))
        Pars = np.random.normal(K, sigma)
        for k in range(len(Ss)):
            BSs.append(np.dot(B, Pars[k]))
    return np.array(BSs)

Response: draw a bootstrap sample of Ss