Clear Filters
Clear Filters

How to measure phase speed in Hovmoller

13 views (last 30 days)
I have this Hovmoller plot of OLR anomalies with longitude x time, only showing the negative anomalies:
I want to know if theres a way to calculate the phase speed of this anomaly. That is, following the OLR minima over the time and then do a linear least square fit and obtain the quantity. Also, show the points and the fit in the same plot :)
Thank you, Ive been stucked with this for weeks
  4 Comments
Sam Chak
Sam Chak on 10 Oct 2023
Thank you, @Luis Jesús Olvera Lazcano. I'm looking forward to seeing your code in your answer. By the way, it is meaningful to help others, and it is absolutely fine to 'click-accept' your self-discovered solution.
Luis Jesús Olvera Lazcano
Im sorry for the wait @Sam Chak, Ive been busy these days. I will post my solution down below, thank you for your attention. Besides my own answer, @Shubham also brings another solution that might work for anyone else in the future.

Sign in to comment.

Accepted Answer

Shubham
Shubham on 9 Oct 2023
I understand that you want to calculate the phase speed of the anomalies.
You can try finding the minima points from the data. You can refer to the “islocalmin” function. The function returns a logical array representing the indices for the local minimum.
After extracting the minima points you can fit a linear curve between them. You can use the “polyfit” function to get a linear fit.
You can use the coefficients returned by the “polyfit” function and use them to show the points and the fit in the same plot.
For the phase speed you can try using the coefficient of the linear fit itself.
Hope this helps!!
  1 Comment
Luis Jesús Olvera Lazcano
Wow, this sounds like a more elegant solution!
I actually found myself the method to obtain the minima, as it requires some thresholds to calculate the phase speed correctly.
Nevertheless I appreciate your answer, Im looking forward to use it in the future!

Sign in to comment.

More Answers (1)

Luis Jesús Olvera Lazcano
My solution to obtain the phase speed of a wave in the OLR anomaly-field Hovmoller is as it follows:
for x=2:3
caso1 = hov_indico{x}(:,:); % cell containing x Hovmollers, i.e., 180 x 51: longitude x days
% longitude goes 2° per position, meaning: 180°, 178°W,...
long_step = 31:2:91; % doing a 2 step longitude. Starting point of the wave is 31: 60°W
for i=long_step
j = squeeze(caso1(i,:));
if min(j)>-5 % if the minimum of the vector is higher than -5 W/m^2
break
else
[k(long_step==i), idx(long_step==i)] = min(j); % k Obtains the longitudinal minimum value
% and idx gets the position of the minimum
longitude(long_step==i)=lon(i); % captures the position of the longitudinal minimums
% if idx(long_step==i)-idx(long_step==(i-5))<=-2 % condicional para evitar que el ciclo
if idx(long_step==i)<idx(long_step==(i-10))
% condition to avoid that the cycle captures minimum values
% that are days below the i-step, i.e., avoid capturing
% minimum of previous days
idx(long_step==i)=[]; % if the condition is true, then the last input of the cycle
% is empty and the cycle breaks
longitude(long_step==i)=[];
k(long_step==i)=[];
break
end
end
end
tiempos = t_in(1,idx); % vector containing only the days that have minimum, same length as longitude vector
p = polyfit(longitude,tiempos,1); % polyfit to find the slope, i.e., the phase speed
phase_speed{2:3==x,1} = (1/p(1))*(111319.44/86400); % as the slope is y/x: days/longitude, divide 1 over the slope
% then multiply per 111319.44 meters/86400 seconds to obtain the phase speed in m/s
pv{2:3==x,1} = polyval(p,longitude); % evaluate the polyfit coefficients to obtain the fit
end
The resulting plot including the OLR anomalies and the polyval fit is:
having a phase speed of 4.7 m/s

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!