def loadtxt(fn, **kwargs):
    """Study the text data file fn. Call numpys loadtxt with keyword
    arguments based on the study.

    Return data returned from numpy `loadtxt <http://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html#numpy-loadtxt>`.

    kwargs: keyword arguments accepted by numpys loadtxt. Any keyword
    arguments provided will take precedence over the ones resulting
    from the study.

    Set the module attribute PP to the instance of PatternPull used.

    """
    global PP
    PP = PatternPull(fn)
    txtargs = PP.loadtxtargs()
    txtargs.update(kwargs)      # Let kwargs dominate.
    return np.loadtxt(fn, **txtargs)