Skip to content
Snippets Groups Projects
Commit 23347811 authored by Stefan Schmiederer's avatar Stefan Schmiederer
Browse files

Small bugfixes around Taper utils.

parent bec87c94
No related branches found
No related tags found
No related merge requests found
function [status, msg, ver] = gtPythonCommand(args, use_fable, use_exec)
% GTPYTHONCOMMAND Calls python with the proper command
%
% If your python script can't be found although it should
% be known by the system, try full path and remove trailing
% newline char:
%
% [~, path_to_cmd] = system('which script.py');
% path_to_cmd = path_to_cmd(1:end-1);
%
%
% [status, msg, ver] = gtPythonCommand(args, [use_fable], [use_exec])
% -------------------------------------------------------------------
% INPUT:
......
function grain = gtTaperReadMapFile(pathtofiles,map_file,detector_par)
function grain = gtTaperReadMapFile(pathtofiles, map_file, detector_par)
% grain = gtTaperReadMapFile(pathtofiles,map_file,detector_par)
if ~exist(pathtofiles,'dir') || isempty(pathtofiles)
......@@ -9,7 +9,7 @@ if ~exist(fullfile(pathtofiles,map_file),'file')
disp(['file ' map_file ' does not exist...'])
return
end
if ~exist(fullfile(pathtofiles,detector_par),'file')
if ~exist(fullfile(pathtofiles, detector_par),'file')
disp(['file ' detector_par ' does not exist...'])
return
end
......@@ -23,11 +23,18 @@ output_gff = [map_file(1:end-4) '.gff'];
% ... U11 U12 U13 U21 U22 U23 U31 U32 U33
% ... eps11 eps22 eps33 eps23 eps13 eps12
% somehow unix command doesn't search system folders???
[~, pcmd] = system('which ubi_to_gff.py');
% unix command adds newline char. Why???
pcmd = pcmd(1:end-1);
disp(pcmd)
cdir = pwd;
cd(pathtofiles);
cmd=['ubi_to_gff.py ' map_file ' ' detector_par ' ' output_gff];
[~,msg]=gtPythonCommand(cmd, true); disp(msg)
cmd = [pcmd ' ' map_file ' ' detector_par ' ' output_gff];
disp(cmd)
[~,msg] = gtPythonCommand(cmd, true, true);
disp(msg)
fid = fopen(output_gff);
C = textscan(fid, '%*d %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f','Headerlines',1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment