Skip to content

Commit 371b311

Browse files
cowsedAarC10
andauthored
Automatic Lookuptable generator for airbrakes (#374)
Co-authored-by: Aaron <30483634+AarC10@users.noreply.github.com>
1 parent 4469217 commit 371b311

10 files changed

Lines changed: 300 additions & 218 deletions

File tree

app/other/airbraker/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,26 @@ target_sources(app PRIVATE ${app_sources})
1414
AutocodeTypes(${CMAKE_SOURCE_DIR}/ac/types.yaml)
1515
AutocodeNetworkDefinitions()
1616
add_dependencies(app ac_types)
17+
18+
# Options for LUT Generator
19+
set(LUT_SCRIPT_PATH ${CMAKE_SOURCE_DIR}/tools/lut_to_c.py)
20+
set(LUT_DEFS_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lut_generated/quantile_lut_data.h)
21+
set(LUT_INPUT_PATH ${CMAKE_SOURCE_DIR}/data/quantile_luts/omen_lut.csv)
22+
23+
24+
# LUT Generator implementation
25+
get_filename_component(LUT_DEFS_OUTPUT_DIR ${LUT_DEFS_OUTPUT_PATH}
26+
DIRECTORY BASE_DIR ${APPLICATION_SOURCE_DIR})
27+
make_directory(${LUT_DEFS_OUTPUT_DIR})
28+
29+
30+
add_custom_command(
31+
OUTPUT ${LUT_DEFS_OUTPUT_PATH} ${LUT_DEFS_OUTPUT_DIR}
32+
COMMAND ${PYTHON_EXECUTABLE} ${LUT_SCRIPT_PATH} ${LUT_INPUT_PATH} > ${LUT_DEFS_OUTPUT_PATH}
33+
DEPENDS ${LOWER_PATH} ${UPPER_PATH} ${LUT_SCRIPT_PATH}
34+
VERBATIM
35+
COMMENT "Generating Quantile LUT C Defines"
36+
)
37+
38+
target_include_directories(app PRIVATE ${LUT_DEFS_OUTPUT_DIR})
39+
target_sources(app PRIVATE ${LUT_DEFS_OUTPUT_PATH})

app/other/airbraker/data/lut_to_c.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/other/airbraker/data/omen_quantile_luts/lower_bounds.csv

Lines changed: 0 additions & 101 deletions
This file was deleted.

app/other/airbraker/data/omen_quantile_luts/upper_bounds.csv

Lines changed: 0 additions & 101 deletions
This file was deleted.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
alt,vel_low,vel_high
2+
867.01848,253.54175,291.47107
3+
891.59405,251.74858,289.52725
4+
916.16962,249.94487,287.58351
5+
940.74519,248.14576,285.65471
6+
965.32076,246.35081,283.73989
7+
989.89633,244.56001,281.83824
8+
1014.4719,242.77285,279.94901
9+
1039.0475,240.98915,278.07167
10+
1063.623,239.2083,276.20492
11+
1088.1986,237.4304,274.34889
12+
1112.7742,235.65504,272.45391
13+
1137.3498,233.88198,270.65886
14+
1161.9253,232.11107,268.83062
15+
1186.5009,230.34172,266.9142
16+
1211.0765,228.57406,264.26293
17+
1235.652,226.80757,261.61481
18+
1260.2276,225.04208,258.98545
19+
1284.8032,223.2773,256.37436
20+
1309.3788,221.51295,253.78012
21+
1333.9543,219.74879,251.20258
22+
1358.5299,217.98485,248.64081
23+
1383.1055,216.22044,246.09382
24+
1407.681,214.45558,243.5611
25+
1432.2566,212.68979,241.04226
26+
1456.8322,210.92296,238.53619
27+
1481.4078,209.15492,236.04283
28+
1505.9833,207.38529,233.56113
29+
1530.5589,205.61364,231.09067
30+
1555.1345,203.84006,228.63104
31+
1579.71,202.06411,226.18148
32+
1604.2856,200.28534,223.74153
33+
1628.8612,198.50362,221.31067
34+
1653.4367,196.71882,218.88836
35+
1678.0123,194.9303,216.4741
36+
1702.5879,193.1381,214.06737
37+
1727.1635,191.34165,211.66772
38+
1751.739,189.54079,209.27459
39+
1776.3146,187.7351,206.88729
40+
1800.8902,185.92449,204.50563
41+
1825.4657,184.10826,202.1289
42+
1850.0413,182.28622,199.75661
43+
1874.6169,180.45825,197.38838
44+
1899.1925,178.62364,195.02351
45+
1923.768,176.78218,192.66152
46+
1948.3436,174.93338,190.30201
47+
1972.9192,173.0769,187.94414
48+
1997.4947,171.21241,185.58777
49+
2022.0703,169.33918,183.23198
50+
2046.6459,167.45706,180.87639
51+
2071.2215,165.56544,178.52031
52+
2095.797,163.66384,176.1632
53+
2120.3726,161.75188,173.80435
54+
2144.9482,159.82871,171.44325
55+
2169.5237,157.89406,169.07916
56+
2194.0993,155.94725,166.71137
57+
2218.6749,153.98759,164.33925
58+
2243.2504,152.01447,161.96197
59+
2267.826,150.02723,159.57885
60+
2292.4016,148.0251,157.18896
61+
2316.9772,146.00741,154.79154
62+
2341.5527,143.97321,152.38579
63+
2366.1283,141.92176,149.97063
64+
2390.7039,139.85204,147.54516
65+
2415.2794,137.76319,145.1084
66+
2439.855,135.65413,142.6591
67+
2464.4306,133.52379,140.19618
68+
2489.0062,131.37085,137.71851
69+
2513.5817,129.19425,135.22466
70+
2538.1573,126.99243,132.71321
71+
2562.7329,124.76401,130.18263
72+
2587.3084,122.50742,127.63134
73+
2611.884,120.22078,125.05766
74+
2636.4596,117.9024,122.4595
75+
2661.0352,115.55012,119.83491
76+
2685.6107,113.16169,117.18153
77+
2710.1863,110.73463,114.49691
78+
2734.7619,108.26623,111.77836
79+
2759.3374,105.75338,109.02271
80+
2783.913,103.19278,106.22676
81+
2808.4886,100.58066,103.38664
82+
2833.0642,97.912689,100.46243
83+
2857.6397,95.1433,97.533965
84+
2882.2153,92.362493,94.534817
85+
2906.7909,89.49722,91.470709
86+
2931.3664,86.552105,88.334684
87+
2955.942,83.518962,85.11829
88+
2980.5176,80.387709,81.713558
89+
3005.0931,77.098433,78.357844
90+
3029.6687,73.731937,74.833976
91+
3054.2443,70.224398,71.174808
92+
3078.8199,66.55217,67.35942
93+
3103.3954,62.603969,63.282926
94+
3127.971,58.506744,59.059845
95+
3152.5466,54.131211,54.567525
96+
3177.1221,49.261821,49.597911
97+
3201.6977,44.068081,44.307369
98+
3226.2733,38.010178,38.170477
99+
3250.8489,30.815712,30.910311
100+
3275.4244,21.69938,21.740438
101+
3300,-6.0758263,-6.0873227

0 commit comments

Comments
 (0)