Skip to content

The single-backend bin and empty-epoch bugs in makegp_ecorr #99

@Wang-weiYu

Description

@Wang-weiYu

There are two potential bugs in makegp_ecorr: 1. the starting bin of pulsars which has only backend; 2. the empty-epoch crashing in ECORR noise
which is in

def makegp_ecorr(psr, noisedict={}, enterprise=False, scale=1.0, selection=selection_backend_flags, name='ecorrGP'):

  • The first one is for the first valid bin that we start to count.
    It has been mentioned in
    # TOAs that do not belong to this mask get index zero, which is ignored below.
    # This will fail if there's only one mask that covers all TOAs

In function makegp_ecorr, we first create masks to identify different backends, like

 masks = [np.array(backend_flags == backend) for backend in backends]

Then, we bin them like

bins = quantize(psr.toas * mask)

Because the we set the ToAs observed at different bins are False, which means 0,
we need to discard the first bin like

Umats.append(np.vstack([bins == i for i, cnt in zip(uniques[1:], counts[1:]) if cnt > 1]).T)

But, if one pulsar has only one backend needed to consider about ECORR noise,
there is no False / 0 in the bins. We need to consider about the fist bin.

  • The second one is for the empty-epoch problem.
    If we consider about the ECORR noise of backend backend_A in code and we consider about the case of enterprise = True, which means we need to consider about the bins that has more than two ToAs. This problem is also mentioned at ECORR and enterprise=True #96 . We might want to change the least number in bins we consider about. But, for now, if in backend_A, there is no ToAs are observed at the same time and we want to consider about the backend_A. It will arise an error.

I am preparing a PR to fix these in the PR.

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