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

[BUG FIX] - FID-A functions for multi-dim data - op_ppmref/op_autopha… #484

Merged
merged 1 commit into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions libraries/FID-A/processingTools/op_autophase.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions libraries/FID-A/processingTools/op_ppmref.m
Original file line number Diff line number Diff line change
Expand Up @@ -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.ppm<ppmmax,dimNum))==max(abs(in_zp.specs(in_zp.ppm>ppmmin & in_zp.ppm<ppmmax,dimNum))));
ppmindex=find(abs(in_zp.specs(in_zp.ppm>ppmmin & in_zp.ppm<ppmmax))==max(abs(in_zp.specs(in_zp.ppm>ppmmin & in_zp.ppm<ppmmax))));
ppmrange=in_zp.ppm(in_zp.ppm>ppmmin & in_zp.ppm<ppmmax);
ppmmax=ppmrange(ppmindex);

Expand Down