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

initial upsampfact tweak #638

Merged

Conversation

DiamonDinoia
Copy link
Collaborator

I implemented an heuristic to better choose upsampling factor between 1.25 and 2.00.

I gather the data using devel/wisdom.py then I analyze with devel/analyse_upsamp.py

With that I developed the cases that go in the c++ code.

@mreineck
Copy link
Collaborator

This goes far above and beyond what I originally had in mind, thanks!
One thing to keep in mind is that, for a given problem and accuracy, using oversampling factor 1.25 instead of 2.0 may decrease the overall accuracy of the result; this problem especially occurs with

  • accuracies close to the machine epsilon (so it's mostly a concern for single precision), and
  • increasing dimensionality

So whenever the benchmarks suggest to switch to 1.25 where the current code uses 2, some extra caution will be necessary.

Copy link
Collaborator

@ahbarnett ahbarnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I am in progress testing it out.
I had a question if type 3 with tol<1e-9 is requested, does it revert to upsampfac=2 ?
Best, Alex

}

// 2) Special-case for nufftType == 3
// TODO: maybe use the bandwidth here?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good - let's do it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should do it in setpts where nf is computed already for FFT sizes. Then choose 2.0 if FFT size will be small.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Postpone to another PR

Copy link
Collaborator

@ahbarnett ahbarnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to explain in 1-2 lines in CHANGELOG.
Also rerun FFT=DUCC and see if need to add #ifdef
THanks! Alex

@DiamonDinoia DiamonDinoia merged commit 30de078 into flatironinstitute:master Feb 27, 2025
126 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants