-
Notifications
You must be signed in to change notification settings - Fork 24
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
fix: round data to dataPoints reported #1685
Conversation
✅ Deploy Preview for nmrium ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
for (let i = buffer.length - 1; i > 0; i -= 2) { | ||
re.push(buffer[i - 1]); | ||
im.push(buffer[i]); | ||
const re = new Float64Array(n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code change nothing right ? Just optimization ?
Could you also change the x variable so that it is a Float64Array ?
Could you also avoid the .map for data.im. We have a utility to multiply a xArray
Could you add a comment to this function. What is CSD ? (should this method be renamed ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I understood. It is the length of the array that is based on dimension.count and not on the buffer anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this code should be somewhere in the parser, not in nmrium
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree. @jobo322 why is this code not in nmr-parser ?
We have a lot of changes in the data structure in NMRium while the goal on nmr-parser is to avoid this seems to me.
nmrium/src/data/SpectraManager.ts
Lines 95 to 111 in 94e9d90
let converted = fromJEOL(jdf, {}); | |
converted = converted[0]; | |
let info = converted.description; | |
let metadata = info.metadata; | |
delete info.metadata; | |
info.acquisitionMode = 0; | |
info.experiment = info.dimension === 1 ? '1d' : '2d'; | |
info.type = 'NMR SPECTRUM'; | |
info.nucleus = info.nucleus[0]; | |
info.numberOfPoints = info.numberOfPoints[0]; | |
info.acquisitionTime = info.acquisitionTime[0]; | |
info.baseFrequency = info.baseFrequency[0]; | |
info.frequencyOffset = info.frequencyOffset[0]; | |
info.spectralWidthClipped = converted.application.spectralWidthClipped; | |
In nmr-load-save do we still plan to use nmr-parser ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nmr-load-save will export the nmrium format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I understood. It is the length of the array that is based on dimension.count and not on the buffer anymore.
@lpatiny yes, dimension.count could be bigger than buffer length (small difference), so the idea is to fill with zeros.
Is strange that count
and data length do not match, julien did use count
and he was working with a guy that understands JEOL data.
close: #1635