Skip to content

LCFitter.fit_position fails with LCEmpiricalFourier #2013

Description

@fcotizelati

LCFitter.fit_position() currently fails with an LCEmpiricalFourier template for two reasons:

  1. SciPy passes a one-element array to set_overall_phase(), causing NumPy 2.x to raise:
    ValueError: setting an array element with a sequence

  2. After converting the phase to a scalar, it fails because LCEmpiricalFourier does not implement the first- and second-order derivatives required by fit_position():
    NotImplementedError: No derivative function found for this object.

Suggested fix:

  • explicitly convert the optimizer phase to a scalar;
  • implement analytic first- and second-order derivatives for LCEmpiricalFourier;
  • add a test running LCFitter.fit_position() with an empirical Fourier template.

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