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

projection bug #95

Closed
jpcastell opened this issue Jul 21, 2016 · 4 comments
Closed

projection bug #95

jpcastell opened this issue Jul 21, 2016 · 4 comments

Comments

@jpcastell
Copy link

When taking a cut from a 2d data set using the projection menu there is a small axis bug.
In a xy,Counts type plot if you take a slice along x for a particular y you can run into an error.

say you take y[1] and the entire x range. This works fine. If you take x[5] to the end; also fine.
you get an axis size error when you shorten x from the x[max]. This will still plot however you will not be able to fit the data as len(Counts) no longer equals len(x).

x will have one extra element causing the fit function to fail.

@rayosborn
Copy link
Contributor

Did your 2D dataset contain bin boundaries rather than centers? I reproduced the problem when the length of the x-axis was (number of x-pixels+1) but not when they were equal.

@jpcastell
Copy link
Author

I used the bins I defined for the histogram2d function.

On Jul 22, 2016 12:09 AM, "Ray Osborn" notifications@github.com wrote:

Did your 2D dataset contain bin boundaries rather than centers? I
reproduced the problem when the length of the x-axis was (number of
x-pixels+1) but not when they were equal.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#95 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGeipZuqKSXOX6edZd2iaW2LCFfIYQr9ks5qX-4IgaJpZM4JR0yA
.

@rayosborn
Copy link
Contributor

NeXus, and therefore NeXpy, allows axes to be stored as bin boundaries rather than bin centers, i.e., with one more value than the signal array. I believe I have fixed the fit function failure by ensuring that the axes are converted to bin centers when the FitDialog is initiated. What to return from the Projection Menu is more subtle, and I'm still working on that. I think it is appropriate to maintain bin boundaries where possible, because the translation from centers back to boundaries is not necessarily unique. However, the existing Projection Menu wasn't consistent in what it returned, so I am trying to fix that now. Hopefully, there will be a new release soon with both fixes.

@rayosborn
Copy link
Contributor

I believe this is fixed in the master branch. Reopen if necessary.

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