-
Notifications
You must be signed in to change notification settings - Fork 0
/
CompareData.m
108 lines (90 loc) · 2.58 KB
/
CompareData.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
close all
clear all
% Load map
MAP = shaperead('.\lig_txt\boundarys\bou2_4p.shp');
figure;
% Plot map
for i = 1:length(MAP)
plot(MAP(i).X,MAP(i).Y,'k');
hold on;
end
% Load and filter data
data = load("lig_txt/NewData2_T6_240317_RT.0.3_QZL.txt");
lat = data(:,2);
lon = data(:,3);
sq = data(:, 5);
idx = lat>10&lat<40&lon>100&lon<135;
lat = lat(idx);
lon = lon(idx);
sq1 = sq(idx);
scatter(lon, lat, 3, sq1, 'filled','y');
% Load and filter second data set
data = load("lig_txt/NewData2.txt");
lat = data(:,2);
lon = data(:,3);
h = data(:,4);
sq = data(:, 5);
idx = lat>10&lat<40&lon>100&lon<135;
lat = lat(idx);
lon = lon(idx);
h = h(idx);
sq2 = sq(idx);
% Plot second data set
scatter(lon, lat, 3, sq2, 'filled','r');
% Send request and decode response
request = matlab.net.http.RequestMessage;
% uri = matlab.net.URI('http://222.195.83.28:18000/getHistoricalDataApi/20240304T160000/20240305T160000/str');
uri = matlab.net.URI('http://222.195.83.28:18000/getHistoricalDataApi/20240323T010000/20240323T013000/str');
% uri = matlab.net.URI('http://112.26.166.27:18000/getHistoricalLocationData/3/20240323093300/20240323145600?tag=240317_RT.0.4');
response = sendRequest(uri,request);
data = jsondecode(response.Body.Data);
% Extract and plot data from response
lat = [];
lon = [];
sqo = [];
for i = 1:size(data)
lat = [lat,str2double(data{i}{2})];
lon = [lon,str2double(data{i}{3})];
sqo = [sqo,str2double(data{i}{5})];
end
idx = lat>10&lat<40&lon>100&lon<135;
lat = lat(idx);
lon = lon(idx);
sqo = sqo(idx);
scatter(lon, lat, 3, 'filled', 'g')
% Send request and decode response
request = matlab.net.http.RequestMessage;
uri = matlab.net.URI('http://112.26.166.27:18000/getHistoricalLocationData/3/20240323090000/20240323093000?tag=240317_RT.0.3');
response = sendRequest(uri,request);
data = response.Body.Data;
% Extract and plot data from response
lat = [];
lon = [];
sqoJX = [];
for i = 1:size(data)
lat = [lat,str2double(data{i}{2})];
lon = [lon,str2double(data{i}{3})];
sqoJX = [sqoJX,str2double(data{i}{5})];
end
idx = lat>10&lat<40&lon>100&lon<135;
lat = lat(idx);
lon = lon(idx);
sqoJX = sqoJX(idx);
scatter(lon, lat, 3, 'filled', 'k')
% Set plot properties
title('定位结果对比');
axis equal;
xlim([100 135]);
ylim([10 40])
%% Plot histograms
figure;
hold on;
histogram(sq1, 0:0.025:2.5, 'FaceColor', 'b');
histogram(sq2, 0:0.025:2, 'FaceColor', 'r');
histogram(sqo/6, 0:0.025:2, 'FaceColor', 'g');
histogram(sqoJX, 0:0.025:2, 'FaceColor', 'k');
% Set histogram properties
legend('T5_GPU+OP2', 'USTC');
title('定位结果对比');
xlabel('定位误差');
ylabel('定位点数');