Skip to content

[BUG] Monitoring example #340

@ValentinCassayre

Description

@ValentinCassayre

I've been reviewing the monitoring code (step 3) and believe there is a typo in this line supposed to filter CCFs corresponding to the right component (cc_comp) and with enough windows in the substack (cc_ngood) :

indx = np.where( (cc_comp.lower() == comp.lower()) & cc_ngood==1 )[0]

The second argument (cc_ngood==1) doesn't make any sense as parenthesis are missing around it. Instead of checking where the stacks are made from one window which would be indx = np.where( (cc_comp.lower() == comp.lower()) & (cc_ngood==1) )[0] it does a bitwise operation on cc_ngood and return true for all odd numbers in cc_ngood (so it indeed does exclude 0s).

If this was it I would have made a pull request but I also don't understand the condition in the first place. From what i understood cc_ngood contains for each substack the number of windows used. In this example it is set to 24 : config.substack_windows = 24 (no overlap). Therefore cc_ngood is an array of integers between 0 and 24 and we would like to keep the substack close to 24 windows for instance (cc_ngood==24) or (cc_ngood>=24*.8) if we want to set a threshold.

Original code removing odd values in cc_ngood
Image

Keeping only maxed substacks (cc_ngood==24)
Image

Keeping substacks with 80% values (cc_ngood>=24*.8)
Image

Of course here the value is config.substack_windows (24) but when there is an overlap the value is probably config.substack_windows * config.cc_len // config.step. Tell me if this was a typo or if it was intended and cc_ngood has a deeper meaning.

Thank you, I would love to contribute to the project when I'll understand it more.
Valentin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions