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

fix: round data to dataPoints reported #1685

Merged
merged 1 commit into from Aug 11, 2022
Merged

Conversation

jobo322
Copy link
Member

@jobo322 jobo322 commented Aug 9, 2022

close: #1635

@jobo322 jobo322 linked an issue Aug 9, 2022 that may be closed by this pull request
@netlify
Copy link

netlify bot commented Aug 9, 2022

Deploy Preview for nmrium ready!

Name Link
🔨 Latest commit 775fdd9
🔍 Latest deploy log https://app.netlify.com/sites/nmrium/deploys/62f2e129080aa900084629ad
😎 Deploy Preview https://deploy-preview-1685--nmrium.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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);
Copy link
Member

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 ?)

Copy link
Member

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.

Copy link
Member

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

Copy link
Member

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.

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 ?

Copy link
Member Author

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

Copy link
Member Author

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.

@lpatiny lpatiny merged commit f271ade into main Aug 11, 2022
@lpatiny lpatiny deleted the 1635-import-of-jeol-raw-data branch August 11, 2022 12:13
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.

Import of JEOL raw data
3 participants