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

feat: improve default values for auto phase. close #1093 #1099

Merged
merged 3 commits into from May 20, 2021

Conversation

jobo322
Copy link
Member

@jobo322 jobo322 commented May 19, 2021

No description provided.

magnitudeMode: false,
minRegSize: 30,
maxDistanceToJoin: 256,
minRegSize: 10,
Copy link
Member

Choose a reason for hiding this comment

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

Could you change the variable name ? Is this minResionSize ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I could

Copy link
Member Author

Choose a reason for hiding this comment

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

So, we will need to wait for the new release of ml-spectra-processing

minRegSize: 30,
maxDistanceToJoin: 256,
minRegSize: 10,
maxDistanceToJoin: 128,
Copy link
Member

Choose a reason for hiding this comment

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

Should this option not be dependant from the number of points in the spectrum ? We have spectra with 1k points and some with 256k points.

Copy link
Member Author

Choose a reason for hiding this comment

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

It should be tested because I believe it does not relate with the resolution of the spectrum, it is closer to how much noise has the spectrum, but I put a bigger cutoff for noise, I think we could test with those parameters to check if it works for most cases.

minRegSize: 10,
maxDistanceToJoin: 128,
magnitudeMode: true,
factorNoise: 5,
};

export function apply(datum1D, options = {}) {
if (!isApplicable(datum1D)) {
throw new Error('phaseCorrection not applicable on this data');
}
options = Object.assign({}, defaultOptions, options);
Copy link
Member

Choose a reason for hiding this comment

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

Please use the new syntax
options = {...defaultOptions, ...options}

Copy link
Member

Choose a reason for hiding this comment

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

you can also directly pass the spread to the function call: reimAutoPhaseCorrection(datum1D.data, {...defaultOptions, ...options})

Copy link
Member Author

Choose a reason for hiding this comment

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

you are just right, options is used just this once.

@hamed-musallam hamed-musallam merged commit a2d67a4 into master May 20, 2021
@hamed-musallam hamed-musallam deleted the fixAutoPhase branch May 20, 2021 09:00
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.

None yet

4 participants