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

Allow the static background in EBSD metadata to be a dask array in EBSD.remove_static_background() #399

Closed
hakonanes opened this issue Jul 9, 2021 · 0 comments · Fixed by #413
Labels
bug Something isn't working
Milestone

Comments

@hakonanes
Copy link
Member

When the static background is a dask array, I get this error when calling s.remove_static_background():

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/tmp/ipykernel_131261/2987853041.py in <module>
----> 1 s.remove_static_background()

~/kode/kikuchipy/kikuchipy/signals/ebsd.py in remove_static_background(self, operation, relative, static_bg, scale_bg)
    506                 md = self.metadata
    507                 ebsd_node = metadata_nodes("ebsd")
--> 508                 static_bg = da.from_array(
    509                     md.get_item(ebsd_node + ".static_background"), chunks="auto"
    510                 )

~/miniconda3/envs/kp-dev/lib/python3.8/site-packages/dask/array/core.py in from_array(x, chunks, name, lock, asarray, fancy, getitem, meta, inline_array)
   3097     """
   3098     if isinstance(x, Array):
-> 3099         raise ValueError(
   3100             "Array is already a dask array. Use 'asarray' or " "'rechunk' instead."
   3101         )

ValueError: Array is already a dask array. Use 'asarray' or 'rechunk' instead.
@hakonanes hakonanes added the bug Something isn't working label Jul 9, 2021
@hakonanes hakonanes added this to the v0.4.1 milestone Jul 9, 2021
@hakonanes hakonanes modified the milestones: v0.4.1, v0.5.0 Aug 19, 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