-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSPHARMparameterization2mesh.m
73 lines (60 loc) · 1.5 KB
/
SPHARMparameterization2mesh.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
function answer = spharmparameterization2mesh(varargin)
% Oct. 11, 2022 R.F.Murphy fix argument handling for non-deployed
if isdeployed
filename_deployed = is_deployed(varargin{1});
load(filename_deployed);
% this reads in param_output
load(model_path);
else
param_output = varargin{1};
options = varargin{2};
end
%set default options
if ~isfield(options, 'figtitle')
options.figtitle = [];
end
if ~isfield(options, 'plot')
options.plot = 0;
end
if ~isfield(options, 'dpi')
options.dpi = 150;
end
if ~isfield(options, 'filename')
options.filename = [];
end
if ~isfield(options,'meshtype.type')
options.meshtype.type = 'triangular';
end
if ~isfield(options,'meshtype.nPhi')
options.meshtype.nPhi = 64;
end
if ~isfield(options,'meshtype.nTheta')
options.meshtype.nTheta = 32;
end
if ~isfield(options,'nVertices')
options.nVertices = 4002;
end
%%%%%%%%%%%%%%%%%%%%%
deg = param_output.deg;
fvec = param_output.fvec;
meshtype = options.meshtype;
plot = options.plot;
figtitle = options.figtitle;
filename = options.filename;
dpi = options.dpi;
[Zvert, fs] = spharm2meshfigure(deg,fvec,meshtype,plot,figtitle,filename,dpi);
mesh_out = [];
mesh_out.Zvert = Zvert;
mesh_out.fs = fs;
disp('saving mesh...');
% output_dir = join([options.output_dir, '/mesh_output.mat']);
save(options.output_filepath, 'mesh_out');
if exist( [options.output_filepath(1:end-3) 'mat'], 'file' )
answer = true;
else
answer = false;
end
if isdeployed
close all
end
end