Geoshow with MLT instead of longitude
조회 수: 15 (최근 30일)
이전 댓글 표시
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
채택된 답변
Austin M. Weber
2024년 2월 8일
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
Austin M. Weber
2024년 2월 8일
Fantastic! I'm happy that my answer might be helpful. Best of luck with any future modifications!
-AMW
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Geographic Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!