Skip to content

Commit

Permalink
Checked that wavelet reconstruction was giving correct results
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Henry Colligan IV committed May 16, 2019
1 parent 07d4f83 commit 4ff2c56
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 1 addition & 2 deletions WaveletTransform.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
v_wind_reconstructed = constant_coef*sum(windowed_v_wavelet ./ sqrt(windowed_scales)');
v_wind_inverted = real(v_wind_reconstructed);
u_wind_inverted = real(u_wind_reconstructed);
v_wind_hilbert_transformed = complex(v_wind_reconstructed);

v_wind_hilbert_transformed = complex(v_wind_reconstructed);
end

function [a, b, c, d] = clipWindowedTransformToValue(obj, windowedWaveletTransform, localMaxRow, localMaxCol)
Expand Down
11 changes: 9 additions & 2 deletions estimateParametersFromWavePacket.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@
P = 2*(mean(u.*v));
Q = 2*mean(u.*vWavePacketHilbertTransformed);
degreeOfPolarization = sqrt((P^2 + Q^2 + D^2)) / I;
theta = 0.5 * atan(P / D);
axialRatio = cot(0.5*asin(Q/(degreeOfPolarization*I)));
if Q < 0.05 || P < 0.05 || degreeOfPolarization < 0.5 || degreeOfPolarization > 1
theta = 0;
axialRatio = 0;
degreeOfPolarization = 0;
return;
else
theta = 0.5 * atan(P / D);
axialRatio = cot(0.5*asin(Q/(degreeOfPolarization*I)));
end
end

4 changes: 2 additions & 2 deletions filterWavePacketCandidates.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
goodMaximaRows = zeros('like', localMaximaRows);
goodMaximaCols = zeros('like', localMaximaCols);
k = 0;
for i=1:size(localMaximaRows)
for i=1:size(localMaximaRows, 1)
% first, clip the local maxima to 1/4Smax.
currentMaxRow = localMaximaRows(i);
currentMaxCol = localMaximaCols(i);
Expand All @@ -21,7 +21,7 @@
oneQuarterMaxWindow = WindowedWaveletTransform(row_index_1, row_index_2, col_index_1, col_index_2);
[uInverted, vInverted, vHilbertTransformed] = waveletTransform.invertWindowedTransform(oneQuarterMaxWindow);
[theta, axialRatio, degreeOfPolarization] = estimateParametersFromWavePacket(uInverted, vInverted, vHilbertTransformed);
if theta == 0 && axialRatio == 0 && degreeOfPolarization == 0
if theta == 0 || axialRatio == 0 || degreeOfPolarization == 0
%fprintf("Wave packet did not satisfy critera\n");
continue;
end
Expand Down

0 comments on commit 4ff2c56

Please sign in to comment.