nmrium icon indicating copy to clipboard operation
nmrium copied to clipboard

Problem with spectra having discontinuous domain

Open andcastillo opened this issue 1 year ago • 3 comments

I have some spectra in .nmrium format with discontinuous x. When I full zoom out, it fill the gap with some points around the hole. If you zoom in around the zone, it shows the right flat zone.

case1 case2 toview.json

Use the attached file to reproduce the problem. I changed the extension to .json.

andcastillo avatar Jan 11 '24 09:01 andcastillo

Indeed currently NMRium expect to have a constant deltaX because we are reducing the number of points in order to increase display speed. So we need to discuss if this is an important feature and how to implement it.

lpatiny avatar Jan 11 '24 11:01 lpatiny

@andcastillo The culprit is likely https://github.com/mljs/spectra-processing/blob/14c0ddeecb8af069f98db44a54465c9f05edf5a2/src/xy/xyReduce.ts#L26 because we don't expect deltaX to change.

If you are able to improve the code without slowing it down you are welcome to make a PR.

lpatiny avatar Jan 11 '24 13:01 lpatiny

what do you think about split the discontinue spectrum into several continue spectra, in that way nmrium could manage correctly those ROIs

jobo322 avatar Jan 19 '24 13:01 jobo322