Skip to content

Unclear return type in get_hpge_energy_peak_park_guess #621

@cVogl97

Description

@cVogl97

This concerns the following two functions:

-  pygama.pargen.survival_fractions.energy_guess
-  pygama.pargen.energy_cal.get_hpge_energy_peak_park_guess

There are cases where the gamma peak sigma estimation fails and get_hpge_energy_peak_park_guess returns an empty dictionary, see line 2009 in energy_cal.py. In those cases, the variable parguess in energy_guess is a dictionary (as opposed to a ValueView object), and iterating over it returns the dictionary keys, not their values. This causes np.isnan(guess) to return an error since guess is a string.

Ideally, this should be fixed by making sure get_hpge_energy_peak_park_guess always returns the same type. Alternatively, one could patch energy_guess.

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