Skip to content
Snippets Groups Projects
Commit 67c0a983 authored by Andrew King's avatar Andrew King Committed by Nicola Vigano
Browse files

Nicola's modification to GtThreshold to use file locking on sample.mat when using OAR


Signed-off-by: default avatarAndrew King <andrew.king@esrf.fr>
parent 9225cf02
No related branches found
No related tags found
No related merge requests found
......@@ -21,9 +21,13 @@ classdef GtThreshold < handle
obj.conf = parse_pv_pairs(obj.conf, rej_params);
end
function [defaults, sample] = generateDefaults(obj)
function [defaults, sample] = generateDefaults(obj, fileTable)
samplefile = fullfile(obj.param.acq.dir, '4_grains', 'sample.mat');
sample = GtSample.loadFromFile(samplefile);
if (exist('fileTable', 'var'))
sample = GtSample.loadFromLockedFile(fileTable, samplefile);
else
sample = GtSample.loadFromFile(samplefile);
end
defaults = [];
defaults.percentile = obj.param.rec.percentile2;
......@@ -38,7 +42,11 @@ classdef GtThreshold < handle
function [varargout] = batchThreshold(obj, phaseID, firstID, lastID, percentile)
% GTTHRESHOLD/BATCHTHRESHOLD
[defaults, sample] = obj.generateDefaults();
global GT_DB
gtDBConnect(GT_DB.host, GT_DB.user, GT_DB.password, GT_DB.name);
filetable = [obj.param.acq.name '_filetable'];
[defaults, sample] = obj.generateDefaults(filetable);
if (exist('percentile', 'var'))
obj.param.rec.percentile2 = percentile;
......@@ -117,10 +125,7 @@ classdef GtThreshold < handle
end
if (~obj.conf.verbose), fprintf('(%04d..%04d) Done.\n', firstID, lastID); end
global GT_DB
disp('Now writing to sample.mat')
gtDBConnect(GT_DB.host, GT_DB.user, GT_DB.password, GT_DB.name);
filetable = [obj.param.acq.name '_filetable'];
samplefile = fullfile(obj.param.acq.dir, '4_grains', 'sample.mat');
sample.mergeToFile(filetable, samplefile, 'sample');
......
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