# Path: tests/helpers.py
# def aarc(actual, desired, rtol=1e-5, atol=1e-6):


import copy
import vip_hci as vip
from .helpers import np, parametrize, fixture
                          mask_center_px=15)


def algo_nmf(ds):
    return vip.psfsub.nmf(ds.cube, ds.angles, cube_ref=ds.cuberef, ncomp=30,
                          mask_center_px=15)


def algo_pca_annular_ardi(ds):
    return vip.psfsub.pca_annular(ds.cube, ds.angles, cube_ref=ds.cuberef, 
                                  ncomp=10)

def algo_pca_annular_rdi(ds):
    return vip.psfsub.pca_annular(ds.cube, ds.angles, cube_ref=ds.cuberef, 
                                  ncomp=30, delta_rot=100)

def algo_nmf_annular_ardi(ds):
    return vip.psfsub.nmf_annular(ds.cube, ds.angles, cube_ref=ds.cuberef, 
                                  ncomp=10)

def algo_nmf_annular_rdi(ds):
    return vip.psfsub.nmf_annular(ds.cube, ds.angles, cube_ref=ds.cuberef, 
                                  ncomp=30, delta_rot=100)

# ====== SNR map
def snrmap_fast(frame, ds):
    return vip.metrics.snrmap(frame, fwhm=ds.fwhm, approximated=True)


def snrmap(frame, ds):

# Path: tests/helpers.py
# def aarc(actual, desired, rtol=1e-5, atol=1e-6):


# Path: tests/test_pipeline_rdi.py
import copy
import vip_hci as vip
from .helpers import np, parametrize, fixture

                          mask_center_px=15)


def algo_nmf(ds):
    return vip.psfsub.nmf(ds.cube, ds.angles, cube_ref=ds.cuberef, ncomp=30,
                          mask_center_px=15)


def algo_pca_annular_ardi(ds):
    return vip.psfsub.pca_annular(ds.cube, ds.angles, cube_ref=ds.cuberef, 
                                  ncomp=10)

def algo_pca_annular_rdi(ds):
    return vip.psfsub.pca_annular(ds.cube, ds.angles, cube_ref=ds.cuberef, 
                                  ncomp=30, delta_rot=100)

def algo_nmf_annular_ardi(ds):
    return vip.psfsub.nmf_annular(ds.cube, ds.angles, cube_ref=ds.cuberef, 
                                  ncomp=10)

def algo_nmf_annular_rdi(ds):
    return vip.psfsub.nmf_annular(ds.cube, ds.angles, cube_ref=ds.cuberef, 
                                  ncomp=30, delta_rot=100)

# ====== SNR map
def snrmap_fast(frame, ds):
    return vip.metrics.snrmap(frame, fwhm=ds.fwhm, approximated=True)


def snrmap(frame, ds):

    return vip.metrics.snrmap(frame, fwhm=np.mean(ds.fwhm))