-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathload_wspr.m
More file actions
37 lines (30 loc) · 948 Bytes
/
load_wspr.m
File metadata and controls
37 lines (30 loc) · 948 Bytes
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
function crd_o = load_wspr(fname)
%% wspr_txt comes from http://wsprnet.org/drupal/wsprnet/spotquery
% fname = 'wspr.txt';
% [lat_t, lon_t, lat_r, lon_r] = load_wspr(fname);
%%
txt = asciiread(fname);
lat_t = [];
lon_t = [];
lat_r = [];
lon_r = [];
for l = 1:size(txt, 1)
crd = split(strip(txt(l, :)));
if len(crd) > 1
md_crd1 = upper(crd{1}(~isspace(crd{1})));
md_crd2 = upper(crd{2}(~isspace(crd{2})));
if length(md_crd1) == 6 && length(md_crd2) == 6
[la_t, lo_t] = maidenhead_to_ll(md_crd1);
[la_r, lo_r] = maidenhead_to_ll(md_crd2);
if la_t > 40 && la_r > 40
lat_t = [lat_t, la_t];
lon_t = [lon_t, lo_t];
lat_r = [lat_r, la_r];
lon_r = [lon_r, lo_r];
end
end
end
end
%%
%crd_o = sort([lat_t; lon_t; lat_r; lon_r], 2, 'descend');
crd_o = [lat_t; lon_t; lat_r; lon_r];