def calculatePVMismatch(stdpl, cellsx, cellsy, Gpoat):
    """ calls PVMismatch with all the pre-generated values on bifacial_radiance
    
    Example:
    PowerAveraged, PowerDetailed = def calculatePVMismatch(stdpl, cellsx, cellsy, Gpoat)

    """
    import pvmismatch
    import numpy as np
    if np.mean(Gpoat) < 0.001:
        PowerAveraged = 0
        PowerDetailed = 0
    else:
        if cellsx * cellsy == 72:
            cell_pos = pvmismatch.pvmismatch_lib.pvmodule.STD72
        elif cellsx * cellsy == 96:
            cell_pos = pvmismatch.pvmismatch_lib.pvmodule.STD96
        else:
            print(
                'Error. Only 72 and 96 cells modules supported at the moment. Change numcells to either of this options!'
                )
            return
        pvmod = pvmismatch.pvmismatch_lib.pvmodule.PVmodule(cell_pos=cell_pos)
        pvsys = pvmismatch.pvsystem.PVsystem(numberStrs=1, numberMods=1,
            pvmods=pvmod)
        G = np.array([Gpoat]).transpose()
        H = np.ones([1, cellsx])
        array_det = np.dot(G, H)
        array_avg = np.ones([cellsy, cellsx]) * np.mean(Gpoat)
        pvsys.setSuns({(0): {(0): [array_avg, stdpl]}})
        PowerAveraged = pvsys.Pmp
        pvsys.setSuns({(0): {(0): [array_det, stdpl]}})
        PowerDetailed = pvsys.Pmp
    return PowerAveraged, PowerDetailed
