Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Astroseismology 'seismology.estimate_deltanu();' not working properly #1405

Open
RandomNewz opened this issue Feb 11, 2024 · 1 comment
Open
Assignees

Comments

@RandomNewz
Copy link

While going with the tutorial for Astroseismology, I followed the tutorial with TIC 91961 (It doesn't have any stellar parameters).

Problem description

With the code seismology.estimate_deltanu(), I get an error, that it is messed up, which then correlates to me not getting any stellar parameters.

Example

ValueError: first array argument cannot be empty
That is the error that I receive

Expected behavior

I assume it is supposed to run normally, and then easily get the other parameters, which it hasn't

Environment

  • platform: Windows
  • lightkurve version: v2.4.2
  • installation method: pip
@Nschanche Nschanche self-assigned this Mar 6, 2024
@Nschanche
Copy link
Collaborator

Nschanche commented Mar 6, 2024

Hi @RandomNewz , I was able to recreate this issue using the TIC you specified. The problem seems to resolve if you modify the frequency range used to construct the periodogram. It looks like the issue is in utils.autocorrelate. In this, the periodogram power is indexed based on the frequency spacing, window width, and numax value. In this case, the index value goes beyond the periodogram power causing an error. The section that is breaking is below, along with a possible fix. I'm not sure if this will cause a problem elsewhere in the code, so I'm not putting in a PR at this point.

    x = int(numax / frequency_spacing)  # Find the index value of numax
    x0 = int(
        (periodogram.frequency[0].value / frequency_spacing)
    )  # Transform in case the index isn't from 0
    xt = x - x0

    # Could introduce xt low/high as a workaround
    # xt_low = max(0, xt-spread)
    # xt_high = min(len(periodogram.power)-1, xt+spread)

    p_sel = copy.deepcopy(
        # periodogram.power[xt_low : xt_high].value
        periodogram.power[xt - spread : xt + spread].value
    )  # Make the window selection
    ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants