Skip to content

Bad-by-dropout channels sometimes ignored during Reference #97

@a-hurst

Description

@a-hurst

As mentioned in #93 (specifically this comment), both PREP and PyPREP don't flag bad-by-dropout channels as bad or unusable on the first pass before average referencing. The problem with this is that after average referencing, the dropout regions in any bad-by-dropout channels likely aren't going to be completely flat anymore, so they're unable to be detected unless the bad-by-correlation detector manages to flag them.

To fix this, it seems like initial bad-by-dropout channels should be added to the initial noisy channels state here unless matlab_strict is True:

pyprep/pyprep/reference.py

Lines 219 to 230 in 3625b26

# Initialize channels to permanently flag as bad during referencing
noisy = {
"bad_by_nan": noisy_detector.bad_by_nan,
"bad_by_flat": noisy_detector.bad_by_flat,
"bad_by_deviation": [],
"bad_by_hf_noise": [],
"bad_by_correlation": [],
"bad_by_SNR": [],
"bad_by_dropout": [],
"bad_by_ransac": [],
"bad_all": [],
}

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions