-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_pull_terrain_profile_rev1.m
More file actions
70 lines (45 loc) · 1.63 KB
/
init_pull_terrain_profile_rev1.m
File metadata and controls
70 lines (45 loc) · 1.63 KB
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
clear;
clc;
close all;
app=NaN(1);
format shortG
folder1='C:\Local Matlab Data'; %%%%%%%Change this to where you put this matlab file
cd(folder1)
addpath(folder1)
pause(0.1)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Get Terrain Profile
tic;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Test to Check ITM/Terrain
NET.addAssembly(fullfile('C:\USGS', 'SEADLib.dll')); %%%%%%Where the SEADLib.dll is located
itmp=ITMAcs.ITMP2P;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Transmitter
TxLat = 34.147;
TxLon = -117.63;
TxHtm = 30 ; %%%%%meters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Receiver
RxLat = 35.427;
RxLon = -116.89;
RxHtm = 73; %%%%%%%%meters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Terrain Profile
USGS3Secp = TerrainPcs.USGS;
CoordTx = TerrainPcs.Geolocation(TxLat,TxLon);
CoordRx = TerrainPcs.Geolocation(RxLat,RxLon);
USGS3Secp.TerrainDataPath= "C:\USGS";
Elev=double(USGS3Secp.GetPathElevation(CoordTx,CoordRx,90,true)); %%%%%%%%%This is the "z" equivalent
%%%%%%%Need to then get the distance array --> track2 or just calculate the
%%%%%%%distance and divide by the number of element in Elev
temp_dist_km=deg2km(distance(TxLat,TxLon,RxLat,RxLon));
guess_num_steps=temp_dist_km*1000/90;
length(Elev)
r=linspace(0,temp_dist_km*1000,length(Elev)); %%%%%%%%X distance is in meters
close all;
figure;
hold on;
plot(r/1000,Elev,'-k')
xlabel('Distance [km]')
ylabel('Elevation [m]')
title('Terrain Profile')
grid on;
filename1=strcat('Example_Terrain_Profile.png');
%saveas(gcf,char(filename1))
'Done'