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

LFC fails with NaN #361

Closed
jrleeman opened this issue Mar 21, 2017 · 6 comments
Closed

LFC fails with NaN #361

jrleeman opened this issue Mar 21, 2017 · 6 comments
Labels
Area: Calc Pertains to calculations Type: Bug Something is not working like it should
Milestone

Comments

@jrleeman
Copy link
Contributor

When sending lfc data with NaNs (i.e. IA State), we get None as the result

@jrleeman jrleeman added this to the 0.5.0 milestone Mar 21, 2017
@dopplershift
Copy link
Member

But...masked arrays?

@jrleeman
Copy link
Contributor Author

Yep - it is fine with a toy example, but has issues with real data. Trying to isolate the issue.

@dopplershift dopplershift added Area: Calc Pertains to calculations Type: Bug Something is not working like it should labels Mar 21, 2017
@jrleeman
Copy link
Contributor Author

@jrleeman
Copy link
Contributor Author

Note to self/all - turns out it only fails if the masked point brackets the intersection. Trying to come up with a better implementation now.

@jrleeman
Copy link
Contributor Author

This needs cleaned up, but I'm thinking of a utility like this - still may have problems depending on where the masked points are. More testing and thinking to do there.

def next_non_masked_element(a, idx):
    if hasattr(a, 'mask'):
        next_idx = idx
        while ma.is_masked(a[next_idx]):
            if next_idx < (len(a)-1):
                next_idx += 1
            else:
                break
        if ma.is_masked(a[next_idx]):
            return None, None
        else:
            return next_idx, a[next_idx]

I don't like simply or'ing masks together and we will loose real data that can improve the estimate.

@jrleeman
Copy link
Contributor Author

A direct trickle down of #351 - closing and following the PR related to that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Calc Pertains to calculations Type: Bug Something is not working like it should
Projects
None yet
Development

No branches or pull requests

2 participants