Discussion:
Plotting Radar Data
(too old to reply)
Jana Houser
2010-09-21 17:54:19 UTC
Permalink
Hello,
Is there an easy way to plot polar data that are not just line data? I work with radar data that are collected in the polar coordinate system, with 0 degrees being north, 90 degrees being east, etc. I have data for the azimuth angle (theta), and the range location (R), for reflectivity and velocity data. In other words, each element of the reflectivity and velocity matrices are associated with an azimuth vector and radius matrix. How do I plot the reflectivity and velocity data on a polar plot?
Thanks!
Walter Roberson
2010-09-21 18:12:02 UTC
Permalink
Post by Jana Houser
Is there an easy way to plot polar data that are not just line data?
Not really.
Post by Jana Houser
I work with radar data that are collected in the polar coordinate system,
with 0 degrees being north, 90 degrees being east, etc. I have data for
the azimuth angle (theta), and the range location (R), for reflectivity
and velocity data. In other words, each element of the reflectivity and
velocity matrices are associated with an azimuth vector and radius
matrix. How do I plot the reflectivity and velocity data on a polar plot?
Find (or set a limit for) the maximum range and polar() a point in to
existence at that range. The "hold on". As long as hold is on, subsequent
polar() commands will not attempt to redraw the grid. You can then polar()
individual points on to the plot, with either the markercolor or markersize
varied to indicate reflectivity.

Indicating velocity would seem to be more difficult. Traditional non-polar
velocity plots often use quiver() to mark a vector field. Unfortunately,
though, a straight line velocity that does not happen to be directly towards
or away from the radar would translate in to a curved path on a polar plot,
which people would probably find difficult to interpret, and drawing the arrow
heads would be ... interesting...

If you do choose to use quiver() and ignore the fact that straight lines on
polar plots are somewhat of a contradiction, then you could take advantage of
the fact that what polar() *really* does is create a fully cartesian axes and
does polar to cartesian conversions on the input data and draws the lines in
cartesian space. You can retrieve the XData and YData of a line returned by
polar(), and if it was only a single theta and R pair that you submitted,
those XData and YData would correspond to the cartesian coordinates at which
you would draw your quiver() .
Jana Houser
2010-09-21 20:50:08 UTC
Permalink
I should specify that the velocity data are radial velocity, meaning that it's just the component of the wind vector that is toward or away from the radar. I do not need to plot these data as vectors, I am only interested in a standard color plot based on the values of the data.
Post by Walter Roberson
Post by Jana Houser
Is there an easy way to plot polar data that are not just line data?
Not really.
Post by Jana Houser
I work with radar data that are collected in the polar coordinate system,
with 0 degrees being north, 90 degrees being east, etc. I have data for
the azimuth angle (theta), and the range location (R), for reflectivity
and velocity data. In other words, each element of the reflectivity and
velocity matrices are associated with an azimuth vector and radius
matrix. How do I plot the reflectivity and velocity data on a polar plot?
Find (or set a limit for) the maximum range and polar() a point in to
existence at that range. The "hold on". As long as hold is on, subsequent
polar() commands will not attempt to redraw the grid. You can then polar()
individual points on to the plot, with either the markercolor or markersize
varied to indicate reflectivity.
Indicating velocity would seem to be more difficult. Traditional non-polar
velocity plots often use quiver() to mark a vector field. Unfortunately,
though, a straight line velocity that does not happen to be directly towards
or away from the radar would translate in to a curved path on a polar plot,
which people would probably find difficult to interpret, and drawing the arrow
heads would be ... interesting...
If you do choose to use quiver() and ignore the fact that straight lines on
polar plots are somewhat of a contradiction, then you could take advantage of
the fact that what polar() *really* does is create a fully cartesian axes and
does polar to cartesian conversions on the input data and draws the lines in
cartesian space. You can retrieve the XData and YData of a line returned by
polar(), and if it was only a single theta and R pair that you submitted,
those XData and YData would correspond to the cartesian coordinates at which
you would draw your quiver() .
Walter Roberson
2010-09-21 21:29:16 UTC
Permalink
Post by Jana Houser
I should specify that the velocity data are radial velocity, meaning
that it's just the component of the wind vector that is toward or away
from the radar. I do not need to plot these data as vectors, I am only
interested in a standard color plot based on the values of the data.
Your reflectivity data is separate from your velocity data, they just both
happen to be polar, and you want to plot both on the same graph?

You mentioned "a standard color plot based on the values of the data". How
would you like to distinguish between a point that indicated reflectivity and
a point that indicated velocity? Different color ranges for the two different
kinds of data?


In an application such as this, it would seem likely that there are already
semi-standards about which values should be associated with which colors? You
probably do not, for example, want code that would scale the coloring
according to the maximum value that happened to be on the plot at a given time.

If the translation from velocity to color is discretized rather than "shading"
between adjacent colors depending on how close to the range endpoints that one
was, then create a table of boundary velocities, start it with 0 and end it
with inf, and then use

[counts, indices] = histc(velocities, boundaryvalues);

You can then throw away the counts, but for point K, velocity(K) falls in to
color bin # indices(K) .

If this is the kind of representation you are using, then rather than plotting
one point at a time,

polar(theta(K), R(K), 'MarkerEdgeColor', velocitycolors(K,:))

you could instead simultaneously plot all of the points with the same velocity
color:

numvelcols = size(velocitycolors,1);
for L = 1:numvelcols
if counts(L)
thesematches = indices == L;
polar( theta(thesematches), R(thesematches), 'o' 'MarkerEdgeColor',
velocitycolors(L,:) );
end
end
Jana Houser
2010-09-23 15:50:21 UTC
Permalink
Post by Walter Roberson
Post by Jana Houser
I should specify that the velocity data are radial velocity, meaning
that it's just the component of the wind vector that is toward or away
from the radar. I do not need to plot these data as vectors, I am only
interested in a standard color plot based on the values of the data.
Your reflectivity data is separate from your velocity data, they just both
happen to be polar, and you want to plot both on the same graph?
You mentioned "a standard color plot based on the values of the data". How
would you like to distinguish between a point that indicated reflectivity and
a point that indicated velocity? Different color ranges for the two different
kinds of data?
In an application such as this, it would seem likely that there are already
semi-standards about which values should be associated with which colors? You
probably do not, for example, want code that would scale the coloring
according to the maximum value that happened to be on the plot at a given time.
If the translation from velocity to color is discretized rather than "shading"
between adjacent colors depending on how close to the range endpoints that one
was, then create a table of boundary velocities, start it with 0 and end it
with inf, and then use
[counts, indices] = histc(velocities, boundaryvalues);
You can then throw away the counts, but for point K, velocity(K) falls in to
color bin # indices(K) .
If this is the kind of representation you are using, then rather than plotting
one point at a time,
polar(theta(K), R(K), 'MarkerEdgeColor', velocitycolors(K,:))
you could instead simultaneously plot all of the points with the same velocity
numvelcols = size(velocitycolors,1);
for L = 1:numvelcols
if counts(L)
thesematches = indices == L;
polar( theta(thesematches), R(thesematches), 'o' 'MarkerEdgeColor',
velocitycolors(L,:) );
end
end
I do not want to plot them both at the same time, on the same figure. Radars collect data in polar coordinates naturally. They scan azimuthally and send out pulses simultaneously that record data at different range points. The color specification doesn't matter. I just want something that's going to show me the velocities magnitudes and reflectivity magnitudes over the space the radar's scanning.
Walter Roberson
2010-09-23 16:19:28 UTC
Permalink
Post by Jana Houser
I do not want to plot them both at the same time, on the same figure.
Radars collect data in polar coordinates naturally. They scan
azimuthally and send out pulses simultaneously that record data at
different range points. The color specification doesn't matter. I just
want something that's going to show me the velocities magnitudes and
reflectivity magnitudes over the space the radar's scanning.
Okay, then, the algorithm I showed using histc to convert velocities
into color indices sounds like it should work for you -- provided, that
is, that you want to represent velocity by color and not by some other
notation (e.g., labeling each point)
Jana Houser
2010-09-23 19:27:19 UTC
Permalink
Post by Walter Roberson
Post by Jana Houser
I do not want to plot them both at the same time, on the same figure.
Radars collect data in polar coordinates naturally. They scan
azimuthally and send out pulses simultaneously that record data at
different range points. The color specification doesn't matter. I just
want something that's going to show me the velocities magnitudes and
reflectivity magnitudes over the space the radar's scanning.
Okay, then, the algorithm I showed using histc to convert velocities
into color indices sounds like it should work for you -- provided, that
is, that you want to represent velocity by color and not by some other
notation (e.g., labeling each point)
Thank you everyone for your efforts in helping. I have figured out how to do this on my own. I had to specify a polar grid that had the same radial and azimuthal spacing as the data, then I plotted the data to that grid. Here is an excerpt from my code for the relevant parts:

%The radial velocity data are stored in cells named 'vr{}'. The number of cells corresponds to the number of elevation angles.

r_min = range{1}(1,1); %Distance in m to first range gate
delr= range{1}(1,2)-range{1}(1,1); %Distance in m between consecutive range gates
num_gates=data(1,9); %Total number of range gates (i.e. the number of radial data points)

%Create grid space (x2, y2) for each elevation angle and plot the velocity
%data for each angle.

for i=1:num_els %num_els is the number of elevation angles
az_set=Az_by_el{i}; %Feed azimuth data for each elevation angle iteratively to az_set
el_rad=el_tracker(i); %Determine the elevation angle of the ith cells
%Create the polar grid with units of km
[r,az_rad] = meshgrid(((0:num_gates-1)*delr+r_min)/1e3,az_set/180*pi);
x2 = r*cos(el_rad).*sin(az_rad);
y2 = r*cos(el_rad).*cos(az_rad);

% Plot images for each elevation angle.
figure(i);
pcolor(x2,y2,vr{i})
caxis([-15 15])
shading flat
colorbar
xlabel('Zonal Distance (km)')
ylabel('Meridional Distance (km)')
title(['Radial velocity (m/s) at ' num2str(el_tracker(i)) ' degrees'])
end
Shaun
2010-09-21 19:04:05 UTC
Permalink
I am not sure I am reading your problem correctly, but this might help..??

http://www.mathworks.com/matlabcentral/newsreader/view_thread/243095#624605

Shaun
Walter Roberson
2010-09-21 19:17:42 UTC
Permalink
Post by Jana Houser
Is there an easy way to plot polar data that are not just line data?
See also the File Exchange contribution,
http://www.mathworks.com/matlabcentral/fileexchange/28780-radar-like-plot
Stavros Keppas
2015-06-01 19:08:08 UTC
Permalink
Post by Jana Houser
Hello,
Is there an easy way to plot polar data that are not just line data? I work with radar data that are collected in the polar coordinate system, with 0 degrees being north, 90 degrees being east, etc. I have data for the azimuth angle (theta), and the range location (R), for reflectivity and velocity data. In other words, each element of the reflectivity and velocity matrices are associated with an azimuth vector and radius matrix. How do I plot the reflectivity and velocity data on a polar plot?
Thanks!
Hello,

I use IGOR, but unfortunatelly there are not so many IGOR users.

I work on weather radars, but this is my 1st year as a PhD student. Is there anyone that know how to plot a vertical section of a radar dataset?

A radar dataset is in polar system and I need to convert it in a cartesian system. Actually, what I do is to create a new matrix, in which I calculate for every cell the beam range and the height in degrees (theta). Then I take the value from the initial dataset that exists in the cell with specific theta and range and I put it into the new matrix.

Even if my technique seems to be reasonable, the results that I get are not reasonable at all.

Even if there is someone who has a code in matlab for this, I would like to take a look at it.

Thank you
Stavros Keppas
2015-06-01 19:11:09 UTC
Permalink
Post by Jana Houser
Hello,
Is there an easy way to plot polar data that are not just line data? I work with radar data that are collected in the polar coordinate system, with 0 degrees being north, 90 degrees being east, etc. I have data for the azimuth angle (theta), and the range location (R), for reflectivity and velocity data. In other words, each element of the reflectivity and velocity matrices are associated with an azimuth vector and radius matrix. How do I plot the reflectivity and velocity data on a polar plot?
Thanks!
gjfjdjd

Loading...