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

Some corrections for MRAF in the package #65

Closed
ichristen opened this issue Oct 27, 2023 Discussed in #64 · 0 comments · Fixed by #69
Closed

Some corrections for MRAF in the package #65

ichristen opened this issue Oct 27, 2023 Discussed in #64 · 0 comments · Fixed by #69
Assignees
Labels
bug Something isn't working

Comments

@ichristen
Copy link
Collaborator

Discussed in #64

Originally posted by Shuyun1247 October 27, 2023
Hello,

I've been using your package, and it's been working great for me. However, I encountered some issues when using the MRAF method in your code, specifically when setting the signal region be a rectangular "null_region". I've identified some areas in algorithm.py that, upon modification, resolve these issues. Here are the changes I suggest:

  1. Modification in ijcam_to_knmslm function:
    In algorithms.py, find the definition of the function ijcam_to_knmslm. Before the affine transformation, add the line b = b.reshape(-1) to ensure the correct shape for b.

    Original:

    cp_img = cp.array(img, dtype=self.dtype)
    cp.abs(cp_img, out=cp_img)
    
    # Perform affine.
    ...

    Modified:

    cp_img = cp.array(img, dtype=self.dtype)
    cp.abs(cp_img, out=cp_img)
    
    b = b.reshape(-1)
    
    # Perform affine.
    ...
  2. Modification related to null_knm and null_region_knm:
    Find the following section in algorithms.py and modify it as follows to account for both null_knm and null_region_knm.

Original:

if self.null_knm is None:
 ...

Modified:

if self.null_knm is None and self.null_region_knm is None:
 ...
...

...

I'm not entirely sure if I was using the SpotHologram incorrectly, but after making these corrections, the method worked properly for both "null_vector" and "null_region" for us. I hope these suggestions are helpful. Let me know if you need any more details or if there are any concerns.

Thank you!

@ichristen ichristen self-assigned this Oct 27, 2023
@ichristen ichristen added the bug Something isn't working label Oct 27, 2023
@ichristen ichristen linked a pull request Jul 23, 2024 that will close this issue
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