From 7c7214c61a1d70edc234b6561c96209940e010a4 Mon Sep 17 00:00:00 2001 From: Helge <47348963+HJZollner@users.noreply.github.com> Date: Wed, 3 Aug 2022 09:09:00 -0400 Subject: [PATCH] [BUG FIX] - FID-A functions for multi-dim data - op_ppmref/op_autophase - Helge Zoellner Fixed FID-A functions to allow for multi-dimensional data with >1 sub-spectra. --- libraries/FID-A/processingTools/op_autophase.m | 10 +++++----- libraries/FID-A/processingTools/op_ppmref.m | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/FID-A/processingTools/op_autophase.m b/libraries/FID-A/processingTools/op_autophase.m index 520d935f..b5c88fd6 100644 --- a/libraries/FID-A/processingTools/op_autophase.m +++ b/libraries/FID-A/processingTools/op_autophase.m @@ -47,22 +47,22 @@ end dimNum=1; end - +in_sub = op_takesubspec(in,dimNum); %Zeropad the data if it hasn't already been done if ~in.flags.zeropadded - in_zp=op_zeropad(in,10); + in_zp=op_zeropad(in_sub,10); else - in_zp=in; + in_zp=in_sub; end %Narrow the frequency range: in_zp=op_freqrange(in_zp,ppmmin,ppmmax); %Find the ppm of the maximum peak magnitude within the given range: -ppmindex=find(abs(in_zp.specs(:,dimNum))==max(abs(in_zp.specs(:,dimNum)))); +ppmindex=find(abs(in_zp.specs(:))==max(abs(in_zp.specs(:)))); %now do automatic zero-order phase correction (Use Creatine Peak): -ph0=-phase(in_zp.specs(ppmindex,dimNum))*180/pi; +ph0=-phase(in_zp.specs(ppmindex))*180/pi; if length(ph0) > 1 ph0 = ph0(1); diff --git a/libraries/FID-A/processingTools/op_ppmref.m b/libraries/FID-A/processingTools/op_ppmref.m index 2235edb5..0eed09fc 100644 --- a/libraries/FID-A/processingTools/op_ppmref.m +++ b/libraries/FID-A/processingTools/op_ppmref.m @@ -40,16 +40,16 @@ else dimNum=1; end - +in_sub = op_takesubspec(in,dimNum); % %Zeropad the data if it hasn't already been done -if ~in.flags.zeropadded - in_zp=op_zeropad(in,4); +if ~in_sub.flags.zeropadded + in_zp=op_zeropad(in_sub,4); else - in_zp=in; + in_zp=in_sub; end %Find the ppm of the maximum peak magnitude within the given range: -ppmindex=find(abs(in_zp.specs(in_zp.ppm>ppmmin & in_zp.ppmppmmin & in_zp.ppmppmmin & in_zp.ppmppmmin & in_zp.ppmppmmin & in_zp.ppm