*Given the random redshiftArray and snTypeArray, generate a dictionary of k-correction polynomials (one for each filter) for every object.*

    **Key Arguments:**
        - ``log`` -- logger
        - ``redshiftArray`` -- the pre-generated redshift array
        - ``snTypesArray`` -- the pre-generated array of random sn types
        - ``snLightCurves`` -- yaml style dictionary of SN lightcurve info
        - ``pathToOutputDirectory`` -- path to the output directory (provided by the user)
        - ``plot`` -- generate plot?

    **Return:**
        - None

def build_kcorrection_array(
        log,
        redshiftArray,
        snTypesArray,
        snLightCurves,
        pathToOutputDirectory,
        plot=True):
    """
    *Given the random redshiftArray and snTypeArray, generate a dictionary of k-correction polynomials (one for each filter) for every object.*

    **Key Arguments:**
        - ``log`` -- logger
        - ``redshiftArray`` -- the pre-generated redshift array
        - ``snTypesArray`` -- the pre-generated array of random sn types
        - ``snLightCurves`` -- yaml style dictionary of SN lightcurve info
        - ``pathToOutputDirectory`` -- path to the output directory (provided by the user)
        - ``plot`` -- generate plot?

    **Return:**
        - None
    """
    ################ > IMPORTS ################
    ## STANDARD LIB ##
    ## THIRD PARTY ##
    import yaml
    import numpy as np
    ## LOCAL APPLICATION ##

    ################ >ACTION(S) ################
    dataDir = pathToOutputDirectory + "/k_corrections/"
    filters = ['g', 'r', 'i', 'z']
    fileName = pathToOutputDirectory + "/transient_light_curves.yaml"
    stream = file(fileName, 'r')
    generatedLCs = yaml.load(stream)
    models = generatedLCs.keys()
    kCorList = []

    for i in range(len(redshiftArray)):
        redshift = redshiftArray[i]
        kCorDict = {}
        for model in models:
            for ffilter in filters:
                filterDir = dataDir + model + "/" + ffilter
                strRed = "%0.3f" % (redshift,)
                fileName = filterDir + "/z" + \
                    str(strRed).replace(".", "pt") + "_poly.yaml"
                try:
                    stream = file(fileName, 'r')
                    yamlContent = yaml.load(stream)
                    # log.info('yamlContent %s' % (yamlContent,))
                    stream.close()
                    flatPoly = np.poly1d(yamlContent['polyCoeffs'])
                except:
                    flatPoly = None
                kCorDict[ffilter] = flatPoly
                kCorList.append(kCorDict)

    kCorArray = np.array(kCorList)
    return kCorArray