-
Notifications
You must be signed in to change notification settings - Fork 84
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
Refactoring the Orientation Mapping Code #944
Comments
Probably a good start! Though I think there's quite a bit more to do than that to make it like I envisioned it.
Agreed though I think a change of API (which I think is necessary) would make this redundant.
Yes, I agree with this.
Not sure what you mean by this. Just a container for storing them together? What I personally had in mind and started doing before when I could find free time:
|
Maybe this is something to think about
Pretty much. That was the idea of the
Hmm yea probably. There is lots of good stuff there. We could use dask to make it run in parallel and it wouldn't be terribly hard to get it to work. The nice thing is that this doesn't really break the pyxem api, only the diff sims api so this part won't hold up a 1.0.0 release.
Yea so what I envision is a that the entire process would be lazy from end to end. hyperspy/hyperspy#3148 Allows us to make markers which are lazy and so potentially you could fit the data and then just look at a couple of diffraction patterns to see how it does without computing more than a chunk or two. The trick is to make it a process where you only have to compute the full orientation map once or twice. s # Lazy 4D STEM Data
template_lib # template library
match = s.orientation_map(template_library = template_lib, ...)
match # lazy orientation map
match_markers = match.as_markers() # lazy markers
s.plot() # plot lazily
s.add_markers(match_markers) # add the lazy orientation map That way you could continually run this chunk of code and adjust parameters while visualizing the data but you would only run the orientation mapping on a couple of chunks each time. Then when you are happy with the parameters you would just compute the whole thing. The other thing would be something like a Just looking at this function def index_dataset_with_template_rotation(
signal,
library,
phases=None,
n_best=1,
frac_keep=1.0,
n_keep=None,
delta_r=1.0,
delta_theta=1.0,
max_r=None,
intensity_transform_function=None, # this should be removed and the function called before
normalize_images=False,
normalize_templates=True,
chunks="auto", # "auto" rechecking by dask is particularly terrible so I would recommend against it
parallel_workers="auto", # set outside using dask
target="cpu",
scheduler="threads", # set outside using dask
precision=np.float64, # 32 bit float is probably enough It seems like things could be fair bit simpler as well. I also think that moving the function to using the
Yea we should do that :) I think from my end I am going to add in a little better gpu support for the |
Also, one could think about new classes for the objects (arrays and other information) contained in the current classes. For simulating geometrical (or kinematical) EBSD patterns with kikuchipy, we use a
Changes in diffsims doesn't affect pyxem only if the things returned by diffsims are the same. If what diffsims’ returns changes, this would necessitate changes in pyxem's API as well, right? |
So I've been thinking about how to best do this. Because we already have a 1a. Convert a
The action items for this would be:
|
Here is a little bit more detailed of a road map:
Ideally each of these points should be one PR if I do this properly... |
@din14970 I know that you had started some refactoring of the orientation mapping code but I would like to maybe pick some of that up.
Changes necessary for refactoring Orientation Mapping Code:
map
function for orientation mappingThe text was updated successfully, but these errors were encountered: