Skip to content

Commit

Permalink
adding get_images function to matpyuda mast client
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Dixon authored and Stephen Dixon committed Aug 1, 2023
1 parent 4cc5f2a commit e7d7e51
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
23 changes: 21 additions & 2 deletions source/wrappers/matlab/pyuda_interface/+matpyuda/MastClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,24 @@
end
end

// function get_images(obj, signal, source, options)
function result = get_images(obj, signal, source, options)
arguments
obj
signal
source
options.first_frame = py.None
options.last_frame = py.None
options.stride = py.None
options.frame_number = py.None
options.header_only = py.None
options.rcc_calib_path = py.None
end

kwargs = py.dict(options);
pyobj = pyrun("r = client.get_images(signal, source, **kwargs)", "r", ...
client=obj.python_client, signal=signal, source=source, kwargs=kwargs);
result = obj.convert_pyuda_obj_to_matlab_type(pyobj);
end

function result = geometry(obj, signal, source, options)
arguments
Expand Down Expand Up @@ -88,6 +105,8 @@
atts = fieldnames(pyobj);
for i = 1: numel(atts)
name = atts{i};
s.(name) = matpyuda.get_attribute_value(pyobj.(name));
if py.hasattr(pyobj, name)
s.(name) = matpyuda.get_attribute_value(pyobj.(name));
end
end
end
7 changes: 4 additions & 3 deletions source/wrappers/matlab/pyuda_interface/TestMatpyudaMast.m
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ function test_get_video(testCase)
% client.server= "uda2.mast.l";
% client.set_property('get_meta', py.True);
%
% data = client.get_images("rgb", "47699", last_frame=0);
% % unimplemented
% verifyFail(testCase);
% data = client.get_images("rgb", "47125", last_frame=0);
% verifyEqual(testCase, size(data.frames(1).k), [480, 640]);
% verifyEqual(testCase, length(data.frame_times), 248);
% verifyEqual(testCase, data.filter, "(Da/SS)/C-CXRS/He-CXRS");
%end

0 comments on commit e7d7e51

Please sign in to comment.