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

Linear algebra error crashes detrender #30

Open
amcody opened this issue Jul 23, 2020 · 2 comments
Open

Linear algebra error crashes detrender #30

amcody opened this issue Jul 23, 2020 · 2 comments

Comments

@amcody
Copy link

amcody commented Jul 23, 2020

k2sc runs successfully on most of my light curves, but I am finding that for a percent or two of them, it returns an error in the section of gp.py that calls scipy.linalg.cho_factor.

k2sc/src/gp.py

Lines 83 to 84 in 33eedb9

self._K = self._K0 + self.kernel._pm[-1]**2 * identity(self._K0.shape[0])
self._L = sla.cho_factor(self._K)

The particular error message is numpy.linalg.LinAlgError: 943-th leading minor of the array is not positive definite
(though the number 943 changes from light curve to light curve), and it causes a fatal crash. I don't understand why this is happening, as the offending light curves do not have any obvious defects.

@amcody
Copy link
Author

amcody commented Aug 20, 2020

Update: I just noticed that the problem must be related to some changes that were implemented in the last year or so, because I'm now getting these crashes where I did not use to. In other words, I successfully ran k2sc on some "AMC format" files last year and output fits files. I am redoing them now because I found that the output cadences were wrong (16 bit vs 32 bit). But when I go to redo them, a small fraction fail and I'm stuck with the old output.

@benjaminpope
Copy link
Contributor

Hi @amcody,

I'm sorry I'm only getting to this now. Do you have an example where it braks? I can try and figure it out.

All the best,

Ben

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