Skip to content

Commit

Permalink
Update orca2easyspin to read ORCA 6.0.0 files' g and A values (#350)
Browse files Browse the repository at this point in the history
* updated orca2easyspin.m and orca2easyspin_maintext.m to work with ORCA 6.0.0

* remove test disp() statements

* Fix loading of hyperfines for orca6

* fixes #349
  • Loading branch information
Liam-Twomey authored Sep 30, 2024
1 parent d656aa3 commit 8b15b79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions easyspin/orca2easyspin.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
else
% main ORCA output file
readmode = 'mainout';
mainOutputFile = fullfile(output_path,[output_name output_ext]);
binaryPropFile = fullfile(output_path,[output_name output_ext '.prop']);
textPropFile = fullfile(output_path,[output_name '_property.txt']);
mainOutputFile = strcat(fullfile(output_path,output_name), output_ext);
binaryPropFile = strcat(fullfile(output_path,output_name), output_ext,'.prop');
textPropFile = strcat(fullfile(output_path,output_name),'_property.txt');
end
existMain = exist(mainOutputFile,'file');
existPropBin = exist(binaryPropFile,'file');
Expand Down
11 changes: 7 additions & 4 deletions easyspin/private/orca2easyspin_maintxt.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@
%------------------------------------------------------------------------
k = findheader('ELECTRONIC G-MATRIX',L,krange);
if ~isempty(k)
k = k+3;
if (~isempty(OrcaVersion)) && (OrcaVersion(1) == '6')
k = k+10;
else
k = k+3;
end
% read raw asymmetric g matrix
g_raw = readmatrix(L(k:k+2));
g_sym = (g_raw.'*g_raw)^(1/2);
Expand Down Expand Up @@ -225,7 +229,7 @@
if regexp(L{k},'^\s*Nucleus\s*')
iAtom = sscanf(L{k}(9:end),'%d',1)+1;
[~,qrefEl] = referenceisotope(Element{iAtom});
elseif regexp(L{k},'^\s*Raw HFC matrix')
elseif regexp(L{k},'^\s*(Raw HFC matrix|Total HFC matrix)')
if strncmp(L{k+1}(2:4),'---',3)
idx = k+2;
else
Expand Down Expand Up @@ -351,7 +355,6 @@

end


function M = readmatrix(L,startidx)
if nargin<2, startidx = 1; end
M(1,:) = sscanf(L{1}(startidx:end),'%f %f %f').';
Expand All @@ -362,7 +365,7 @@
function k = findheader(header,L,krange)
header_found = false;
for k = krange
if strcmp(L{k},header)
if strncmp(L{k},header,length(header))
header_found = true;
break
end
Expand Down

0 comments on commit 8b15b79

Please sign in to comment.