Geoshow with MLT instead of longitude
16 views (last 30 days)
Show older comments
Mathan
on 17 Dec 2023
Commented: Austin M. Weber
on 8 Feb 2024
Hi all,
I was trying plot energy distribution of ions as a Latitude-magnetic local time (MLT) plot above Antartica.
I have the data in Latitude-MLT co-ordinates so wanted to overplot this on top of something similar to a geoplot with coaslines outlined as well. This is what I have tried:
all_data = load('struct.mat');
all_data = all_data.struct;
lat = all_data.lat;
mlt = all_data.mlt;
heat = all_data.heat;
load coastlines
worldmap([-90,-40],[-180,100])
sc = scatterm(lat,mlt,75,heat,'filled','s');
geoshow(coastlat,coastlon,"DisplayType","polygon", "FaceColor", 'none', "EdgeColor", 'k');
colormap('parula')
caxis([0 40000])
col = colorbar();
This would however give me a plot that looks like the above but I would like to have the plot with MLT as the label that runs from 0-24 instead of longitude running from -180 to +180. I believe this is because the worldmap and geoshow have co-ordinates as latitude and longitude but I do not know how to change the longitude values to MLT values so that the plot accurately reflects the MLT values.
Ideally, I am looking for something like the figures 1, 2, 3 in the attached sample_plots.zip (obtained from - http://vt.superdarn.org/plot/quickconvection). Those figures are Latitude-MLT plots with the Antartica coastlines overplotted on top as well. Additionally, as time passes Antartica should rotate in the Latitude-MLT co-ordinate grid as seen in those figures.
Thanks for any advice or help!
0 Comments
Accepted Answer
Austin M. Weber
on 8 Feb 2024
This does not completely resolve your problem, but it may be helpful to get you started:
% Load your data
all_data = load('struct.mat');
all_data = all_data.struct;
lat = all_data.lat;
mlt = all_data.mlt;
heat = all_data.heat;
% Plot your data in polar coordinates instead of geographic axes (because I
% do not think geographic axes support MLT)
figure(1)
polarscatter(mlt,lat,40,heat,"filled",'s',...
'MarkerFaceAlpha',0.6,...
'MarkerEdgeAlpha',0.01)
colormap('parula')
caxis([0 40000])
cb=colorbar;
thetaticklabels(cellstr(string(linspace(0,22,12))+"MLT")) % Change the "longitude" labels to MLT
pax=gca;
pax.RDir="reverse"; % Flip the inner tick marks so that 90 degrees South is at the origin
pax.RTickLabel = []; % Remove the inner tick labels
% Import coastline data for drawing Antarctica
load coastlines
% Find the index positions for Antartica in the coastline data sets
idx_180 = [find(-180 == coastlon,1,'first'),...
find(180 == coastlon,1,'first')];
% Extract the coordinates for the Antaractica coastline
polar_lon = coastlon(idx_180(1):idx_180(2));
polar_lat = coastlat(idx_180(1):idx_180(2));
% Add Antarctic coastline to the polar projection
hold on
pplt=polarplot(deg2rad(normalize(polar_lon,'Range',[0 360])),...
-polar_lat,'.'); % "longitude" must be in radians, and I normalized
% the data from 0 to 360 because otherwise the range is -180 to 180,
% which is not the degrees of a circle
pplt.Color = 'w';
hold off
______________________________________________________________________________________________________
The issue with what I've done above is that I do not know how magnetic local time works, so the label positions for 0MLT through 22MLT may not be where you expect them to be. Additionally, I am not certain whether the size of Antarctica is scaled correctly relative to your data. You may have to normalize polar_lat to a different range.
Hopefully you find this helpful.
2 Comments
Austin M. Weber
on 8 Feb 2024
Fantastic! I'm happy that my answer might be helpful. Best of luck with any future modifications!
-AMW
More Answers (0)
See Also
Categories
Find more on Geographic Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!