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

BUG: vario_estimate alters field #179

Closed
MuellerSeb opened this issue Jun 9, 2021 · 0 comments · Fixed by #180
Closed

BUG: vario_estimate alters field #179

MuellerSeb opened this issue Jun 9, 2021 · 0 comments · Fixed by #180
Assignees
Labels
bug Something isn't working
Milestone

Comments

@MuellerSeb
Copy link
Member

Problem: gs.vario_estimate could alter the input field, when given as a numpy array with floats along with a trend function:

import numpy as np
import gstools as gs

trend = lambda a, b: a
x = y = t = np.array([1.0, 2.0, 3.0, 4.0])
gs.vario_estimate((x, y), t, trend=trend)
print(t)

results in

[0. 0. 0. 0.]

Although it should be [1. 2. 3. 4.]

To solve this, we need to set copy=True here:

field = np.ma.array(field, ndmin=2, dtype=np.double)

@MuellerSeb MuellerSeb added the bug Something isn't working label Jun 9, 2021
@MuellerSeb MuellerSeb added this to the 1.3.2 milestone Jun 9, 2021
@MuellerSeb MuellerSeb self-assigned this Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant