Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
f0c65696
Commit
f0c65696
authored
Oct 15, 2016
by
Jan-Gerrit Richter
Browse files
changed spherical harmonics surf to work with new surf
parent
2db33dc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
applications/SphericalHarmonics/@itaSamplingSph/surf.m
View file @
f0c65696
...
...
@@ -13,60 +13,38 @@ function varargout = surf(this, varargin)
numArgIn
=
nargin
;
titleString
=
[];
% check if SH coefs are given
if
numel
(
varargin
{
1
})
>
0
&&
...
this
.
nPoints
~=
numel
(
varargin
{
1
})
&&
...
numel
(
this
.
Y
)
>
0
&&
...
size
(
this
.
Y
,
1
)
==
this
.
nPoints
uniformPlot
=
0
;
% this is the plot to a uniform sphere
if
numArgIn
==
3
&&
varargin
{
1
}
==
1
tmp
=
varargin
{
2
};
clear
varargin
varargin
{
1
}
=
tmp
;
clear
tmp
uniformPlot
=
1
;
numArgIn
=
2
;
end
if
numArgIn
==
2
% check if SH coefs are given
if
numel
(
varargin
{
1
})
>
0
&&
...
this
.
nPoints
~=
numel
(
varargin
{
1
})
&&
...
numel
(
this
.
Y
)
>
0
&&
...
size
(
this
.
Y
,
1
)
==
this
.
nPoints
ita_verbose_info
(
'This must be SH vector, transforming to spatial domain'
)
ita_verbose_info
(
'This must be SH vector, transforming to spatial domain'
)
% ita_verbose_info('TODO: all results are currenty mirrowed at the x-z axis, I think. Take care!!!',0)
nSHGrid
=
size
(
this
.
Y
,
2
);
nSHData
=
size
(
varargin
{
1
}(:),
1
);
if
nSHGrid
~=
nSHData
nSHGrid
=
size
(
this
.
Y
,
2
);
nSHData
=
size
(
varargin
{
1
}(:),
1
);
if
nSHGrid
~=
nSHData
% error('the spherical harmonics dimensions don''t fit');
% TODO make autofit
if
nSHGrid
>
nSHData
varargin
{
1
}
=
[
varargin
{
1
}(:);
zeros
(
nSHGrid
-
nSHData
,
1
)];
else
ita_verbose_info
(
'Insufficient grid, I cannot plot the full SH spectrum'
,
0
);
end
% TODO make autofit
if
nSHGrid
>
nSHData
varargin
{
1
}
=
[
varargin
{
1
}(:);
zeros
(
nSHGrid
-
nSHData
,
1
)];
else
ita_verbose_info
(
'Insufficient grid, I cannot plot the full SH spectrum'
,
0
);
end
% apply IDSHT:
varargin
{
1
}
=
this
.
Y
*
varargin
{
1
}(:);
if
size
(
this
.
Y
,
2
)
>
1
&&
~
all
(
isreal
(
this
.
Y
(:,
2
)))
&&
all
(
isreal
(
varargin
{
1
}))
% change to complex drawing mode, if complex base is used
varargin
{
1
}(
1
)
=
varargin
{
1
}(
1
)
+
1
i
*
eps
;
end
disp
([
'plotting SH-coefficients up to order '
num2str
(
this
.
nmax
)]);
nmaxVec
=
ceil
(
sqrt
(
nSHData
)
-
1
);
titleString
=
[
'Spherical Harmonics coefficients, nmax = '
num2str
(
nmaxVec
)
'/'
num2str
(
this
.
nmax
)
' (data/grid)'
];
end
% apply IDSHT:
varargin
{
1
}
=
this
.
Y
*
varargin
{
1
}(:);
if
size
(
this
.
Y
,
2
)
>
1
&&
~
all
(
isreal
(
this
.
Y
(:,
2
)))
&&
all
(
isreal
(
varargin
{
1
}))
% change to complex drawing mode, if complex base is used
varargin
{
1
}(
1
)
=
varargin
{
1
}(
1
)
+
1
i
*
eps
;
end
disp
([
'plotting SH-coefficients up to order '
num2str
(
this
.
nmax
)]);
nmaxVec
=
ceil
(
sqrt
(
nSHData
)
-
1
);
titleString
=
[
'Spherical Harmonics coefficients, nmax = '
num2str
(
nmaxVec
)
'/'
num2str
(
this
.
nmax
)
' (data/grid)'
];
end
if
uniformPlot
varargin
{
2
}
=
varargin
{
1
};
varargin
{
1
}
=
1
;
end
hFig
=
{
surf
@
itaCoordinates
(
this
,
varargin
{:})};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment