def N_chi2(flux, fluxerr, fluxmod, mask=None):
    """ compute the non-reduced chi2 between data with uncertainties and
        perfectly known models

    Parameters
    ----------
    flux:    np.ndarray[float, ndim=1]
        array of fluxes

    fluxerr: np.ndarray[float, ndim=1]
        array of flux errors

    fluxmod: np.ndarray[float, ndim=2]
        array of modeled fluxes (nfilters , nmodels)

    mask:    np.ndarray[bool, ndim=1]
        mask array to apply during the calculations mask.shape = flux.shape

    Returns
    -------
    chi2:    np.ndarray[float, ndim=1]
        array of chi2 values (nmodels)
    """
    if mask is None:
        temp = flux[(None), :] - fluxmod
        _e = fluxerr
    else:
        _m = ~mask.astype(bool)
        temp = flux[_m]
        temp = temp[(None), :] - fluxmod[:, (_m)]
        _e = fluxerr[_m]
    for j in range(len(_e)):
        if _e[j] > 0:
            temp[:, (j)] /= _e[j]
    return (temp ** 2).sum(axis=1)
