Skip to content

Fold the set_events call into evaluate_pdf #3

Description

@mjlarson

It might be more natural (and easier to work with) if the KingSpatialLikelihood.evaluate_pdf were to be able to call set_events itself. To do this, we'd need to

  • Set up a cache of source RA/dec
  • For each call to evaluate_pdf, take the events + source locations
  • On each call to set_events, check if the events have changed
  • If the events HAVE changed: empty the source RA/dec cache, empty the event pvalue cache, add the current source coordinates to the cache, refill the event pvalue cache, and store the current source index
  • If the events HAVE NOT changed and the source RA/dec combination EXISTS in the cache: update the source index
  • If the events HAVE NOT changed and the source RA/dec combination DOES NOT EXIST in the cache: calculate the event pvalue cache and update the source index.

There might have to be some way to ensure that we don't end up with crazy storage use. Is this a case where we should adopt scipy.sparse.sparse_array?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions