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

resampling issue #45

Open
qezlou opened this issue May 6, 2022 · 1 comment
Open

resampling issue #45

qezlou opened this issue May 6, 2022 · 1 comment

Comments

@qezlou
Copy link

qezlou commented May 6, 2022

Describe the bug
Hi Yu,

It happens a lot that I get this error when trying to resample a mesh, so I end up changing the final grid from the one I really need (not quite happy with that.)

Screenshot from 2022-05-06 10-51-58

Can we replace this with an interpolation or do you think it would be crazy ?

I should confess I do not quite understand how the current scheme is resampling.

Steps To Reproduce

Converting a mesh of shape (2089, 2089, 75) to (209,209,8)

Version

In [3]: print(pmesh.__version__)
0.1.56

I was actually using nbodykit, but the error seems more relevant to this package.

@rainwoodman
Copy link
Owner

rainwoodman commented May 9, 2022

Chatted offline and general undividing resample() is not very well supported. The current scheme of resample is to transform the image to fourier space, then zero pad / truncate, then transform back.

.downsample and .upsample does resample in real space(and does the interpolation you mentioned). There are 2 ways of interpolation, treating the source pixels as particles / treating the destination pixels as particles. One is downsample and the other is upsample, but I don't immediately recall which is which. :/

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

No branches or pull requests

2 participants