-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmars_height_anomaly_ell_Perseverance.m
65 lines (57 loc) · 1.22 KB
/
mars_height_anomaly_ell_Perseverance.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
clc
clear
datnum = importdata('mars_Perseverance.gdf',' ',36);
dat = datnum.textdata;
num = datnum.data;
la=num(:,1);
fi=num(:,2);
dat1=num(:,3);
lamin=min(la);
lamax=max(la);
fimin=min(fi);
fimax=max(fi);
la1=la(1);la2=la(2);
i=0;
while la1==la2
i=i+1;
la2=la(2+i);
end
fi1=fi(1);fi2=fi(2);
j=0;
while fi1==fi2
j=j+1;
fi2=fi(2+j);
end
dla=abs(la1-la2);
dfi=abs(fi1-fi2);
frows=abs(floor((fimax-fimin)/dfi+1.5));
lcols=abs(floor((lamax-lamin)/dla+1.5));
n=1;
for i=frows:-1:1
for j=1:lcols
if n <= length(la)
if la(n) < 180
X(i,j)=la(n);
else
X(i,j)=la(n)-360;
end
Y(i,j)=fi(n);
Z(i,j) = dat1(n);
n=n+1;
end
end
end
[c,h]=contourf(X,Y,Z,2.8925281E+02:0.20549788888:3.2624243E+02);
clabel(c,h);
hold on
# Perseverance position on Mars
sz = 40;
scatter(77.4508, 18.4447,sz,'MarkerEdgeColor','black',...
'MarkerFaceColor','white',...
'LineWidth',1.5);
colorbar
h = colorbar;
ylabel(h, 'Meter');
title('Plotting Height Anomaly on Ellipsoidal Grids Where the Perseverance Rover Is');
ylabel('Latitude');
xlabel('Longitude');