-
Notifications
You must be signed in to change notification settings - Fork 4
/
make_sample_data.py
52 lines (43 loc) · 1.69 KB
/
make_sample_data.py
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
import numpy as np
number_of_receivers = 20
number_of_rays = 100
# limits within which receiver locations will be randomly selected
receiver_min_lon = 1.0 # in degrees
receiver_max_lon = 1.1
receiver_min_lat = 2.3
receiver_max_lat = 2.4
receiver_min_alt = -1000 # in meters
receiver_max_alt = 2000
save_file_name = 'sample_input_data.txt'
min_azimuth = 0 # deg
max_azimuth = 360
min_elevation = 30
max_elevation = 90
receiver_number_list = np.arange(number_of_receivers) + 1
receiver_lon_list = np.random.uniform(receiver_min_lon, receiver_max_lon,
number_of_receivers)
receiver_lat_list = np.random.uniform(receiver_min_lat, receiver_max_lat,
number_of_receivers)
receiver_alt_list = np.random.uniform(receiver_min_alt, receiver_max_alt,
number_of_receivers)
data_order_index = np.random.choice(np.arange(number_of_receivers),
number_of_rays)
receiver_number = receiver_number_list[data_order_index]
receiver_lon = receiver_lon_list[data_order_index]
receiver_lat = receiver_lat_list[data_order_index]
receiver_alt = receiver_alt_list[data_order_index]
azimuth = np.random.uniform(min_azimuth, max_azimuth, number_of_rays)
elevation = np.arcsin(np.random.uniform(
np.sin(min_elevation*np.pi/180), np.sin(max_elevation*np.pi/180),
number_of_rays)) * 180/np.pi
data = np.column_stack((receiver_number, receiver_lon))
data = np.column_stack((data, receiver_lat))
data = np.column_stack((
receiver_number,
receiver_lon,
receiver_lat,
receiver_alt,
azimuth,
elevation
))
np.savetxt(save_file_name, data, delimiter=' ')