9.sql 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. create sequence if not exists calc_header_adjustment_seq;
  2. create table if not exists calc_header_adjustment
  3. (
  4. id integer not null primary key default nextval('public.calc_header_adjustment_seq'),
  5. measurment_type_id integer not null,
  6. header varchar(100) not null,
  7. description text not null,
  8. values integer[] not null
  9. );
  10. create unique index ix_calc_header_adjustment_header_type on calc_header_adjustment(measurment_type_id, header);
  11. insert into calc_header_adjustment(measurment_type_id, header, description, values)
  12. values (1, 'table2', 'Заголовок для Таблицы № 2 (ДМК)', array[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50]),
  13. (2, 'table2','Заголовок для Таблицы № 2 (ВР)', array[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50]),
  14. (2, 'table3', 'Заголовок для Таблицы № 3 (ВР)', array[40,50,60,70,80,90,100,110,120,130,140,150]);
  15. create sequence if not exists calc_height_adjustment_seq;
  16. create table if not exists calc_height_adjustment
  17. (
  18. id integer primary key not null default nextval('public.calc_height_adjustment_seq'),
  19. height integer not null,
  20. measurment_type_id integer not null
  21. );insert into calc_height_adjustment(height, measurment_type_id)
  22. values(200,1),(400,1),(800,1),(1200,1),(1600,1),(2000,1),(2400,1),(3000,1),(4000,1),
  23. (200,2),(400,2),(800,2),(1200,2),(1600,2),(2000,2),(2400,2),(3000,2),(4000,2);
  24. create sequence if not exists calc_temperature_height_adjustment_seq;
  25. create table if not exists calc_temperature_height_adjustment
  26. (
  27. id integer primary key not null default nextval('public.calc_temperature_height_adjustment_seq'),
  28. calc_height_id integer not null,
  29. calc_temperature_header_id integer not null,
  30. positive_values numeric[],
  31. negative_values numeric[]
  32. );
  33. insert into calc_temperature_height_adjustment(calc_height_id, calc_temperature_header_id, positive_values, negative_values)
  34. values
  35. (10,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[ -1, -2, -3, -4, -5, -6, -7, -8, -8, -9, -20, -29, -39, -49]),
  36. (11,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -3, -4, -5, -6, -6, -7, -8, -9, -19, -29, -38, -48]),
  37. (12,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -3, -4, -5, -6, -6, -7, -7, -8, -18, -28, -37, -46]),
  38. (13,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -3, -4, -4, -5, -5, -6, -7, -8, -17, -26, -35, -44]),
  39. (14,1,array[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -3, -3, -4, -4, -5, -6, -7, -7, -17, -25, -34, -42]),
  40. (15,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -3, -3, -4, -4, -5, -6, -6, -7, -16, -24, -32, -40]),
  41. (16,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -2, -3, -4, -4, -5, -5, -6, -7, -15, -23, -31, -38]),
  42. (17,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -2, -3, -4, -4, -4, -5, -5, -6, -15, -22, -30, -37]),
  43. (18,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[ -1, -2, -2, -3, -4, -4, -4, -4, -5, -6, -14, -20, -27, -34]);
  44. insert into calc_temperature_height_adjustment(calc_height_id, calc_temperature_header_id, positive_values, negative_values)
  45. values
  46. (1,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[ -1, -2, -3, -4, -5, -6, -7, -8, -8, -9, -20, -29, -39, -49]),
  47. (2,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -3, -4, -5, -6, -6, -7, -8, -9, -19, -29, -38, -48]),
  48. (3,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -3, -4, -5, -6, -6, -7, -7, -8, -18, -28, -37, -46]),
  49. (4,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -3, -4, -4, -5, -5, -6, -7, -8, -17, -26, -35, -44]),
  50. (5,1,array[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -3, -3, -4, -4, -5, -6, -7, -7, -17, -25, -34, -42]),
  51. (6,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -3, -3, -4, -4, -5, -6, -6, -7, -16, -24, -32, -40]),
  52. (7,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -2, -3, -4, -4, -5, -5, -6, -7, -15, -23, -31, -38]),
  53. (8,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[-1, -2, -2, -3, -4, -4, -4, -5, -5, -6, -15, -22, -30, -37]),
  54. (9,1,array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 30, 30], array[ -1, -2, -2, -3, -4, -4, -4, -4, -5, -6, -14, -20, -27, -34]);
  55. create sequence calc_wind_speed_height_adjustment_seq;
  56. drop table if exists calc_wind_speed_height_adjustment;
  57. create table calc_wind_speed_height_adjustment
  58. (
  59. id integer not null primary key default nextval('public.calc_wind_speed_height_adjustment_seq'),
  60. calc_height_id integer not null,
  61. values integer[] not null,
  62. delta integer not null
  63. );
  64. insert into calc_wind_speed_height_adjustment(calc_height_id, values, delta)
  65. values
  66. (10, array[3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 12], 0),
  67. (11, array[4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], 1),
  68. (12, array[4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16], 2),
  69. (13, array[4, 5, 7, 8, 8, 9, 11, 12, 13, 15, 15, 16], 2),
  70. (14, array[4, 6, 7, 8, 9, 10, 11, 13, 14, 15, 17, 17], 3),
  71. (15, array[4, 6, 7, 8, 9, 10, 11, 13, 14, 16, 17, 18], 3),
  72. (16, array[4, 6, 8, 9, 9, 10, 12, 14, 15, 16, 18, 19], 3),
  73. (17, array[5, 6, 8, 9, 10, 11, 12, 14, 15, 17, 18, 19], 4),
  74. (18, array[5, 6, 8, 9, 10, 11, 12, 14, 16, 18, 19, 20],4)
  75. ;drop type if exists temperature_adjustment cascade;
  76. create type temperature_adjustment as
  77. (
  78. calc_height_id integer,
  79. height integer,
  80. temperature_deviation integer
  81. );
  82. drop type if exists wind_direction_adjustment cascade;
  83. create type wind_direction_adjustment as
  84. (
  85. calc_height_id integer,
  86. height integer,
  87. wind_speed_deviation integer,
  88. wind_deviation integer
  89. );
  90. create or replace procedure public.temp_dev_calc(
  91. in pmt_measurement_type_id integer,
  92. in pmt_temperature numeric(8,2),
  93. inout pmt_adjustments public.temperature_adjustment[]
  94. )
  95. language 'plpgsql'
  96. as $body$
  97. declare
  98. var_row record;
  99. var_index integer;
  100. var_header_adj integer[];
  101. var_right_index integer;
  102. var_left_index integer;
  103. var_header_index integer;
  104. var_dev integer;
  105. var_table integer[];
  106. var_adj public.temperature_adjustment;
  107. var_table_row text;
  108. begin
  109. if not exists (
  110. select 1
  111. from public.calc_height_adjustment as t1
  112. inner join public.calc_temperature_height_adjustment as t2
  113. on t2.calc_height_id = t1.id
  114. where t1.measurment_type_id = pmt_measurement_type_id
  115. ) then
  116. raise exception 'недостаточно данных';
  117. end if; raise notice '| высота | поправка |';
  118. raise notice '|----------|-----------|'; for var_row in
  119. select t2.*, t1.height
  120. from public.calc_height_adjustment as t1
  121. inner join public.calc_temperature_height_adjustment as t2
  122. on t2.calc_height_id = t1.id
  123. where t1.measurment_type_id = pmt_measurement_type_id
  124. loop
  125. var_index := pmt_temperature::integer;
  126. var_header_adj := (select values from public.calc_header_adjustment
  127. where id = var_row.calc_temperature_header_id and header = 'table2');
  128. if array_length(var_header_adj, 1) = 0 then
  129. raise exception 'высота % - некорректные параметры', var_row.height;
  130. end if; if array_length(var_header_adj, 1) < var_index then
  131. raise exception 'высота % - некорректные параметры', var_row.height;
  132. end if;
  133. var_right_index := abs(var_index % 10);
  134. var_header_index := abs(var_index) - var_right_index;
  135. if pmt_temperature >= 0 then
  136. var_table := var_row.positive_values;
  137. else
  138. var_table := var_row.negative_values;
  139. end if; if var_header_index = 0 then
  140. var_header_index := 1;
  141. end if; var_left_index := var_header_adj[var_header_index];
  142. if var_left_index = 0 then
  143. var_left_index := 1;
  144. end if;
  145. var_dev := var_table[var_left_index] + var_table[var_right_index]; select '|' || lpad(var_row.height::text, 10, ' ') || '|' || lpad(var_dev::text, 11, ' ') || '|'
  146. into var_table_row; raise notice '%', var_table_row; var_adj.calc_height_id := var_row.calc_height_id;
  147. var_adj.height := var_row.height;
  148. var_adj.temperature_deviation := var_dev;
  149. pmt_adjustments := array_append(pmt_adjustments, var_adj);
  150. end loop; raise notice '|----------|-----------|';
  151. end;
  152. $body$;
  153. create or replace procedure public.calculate_wind_speed_deviation(
  154. in pmt_bullet_speed numeric,
  155. in pmt_measurement_type_id integer,
  156. inout pmt_adjustments public.wind_direction_adjustment[]
  157. )
  158. language 'plpgsql'
  159. as $body$
  160. declare
  161. var_row record;
  162. var_index integer;
  163. var_adj public.wind_direction_adjustment;
  164. var_header_adj integer[];
  165. var_header_index integer;
  166. var_table integer[];
  167. var_dev integer;
  168. var_table_row text;
  169. begin
  170. if coalesce(pmt_bullet_speed, -1) < 0 then
  171. raise exception 'некорректные параметры. pmt_bullet_speed=%', pmt_bullet_speed;
  172. end if; if not exists (
  173. select 1 from public.calc_height_adjustment
  174. where measurment_type_id = pmt_measurement_type_id
  175. ) then
  176. raise exception '% отсутствуют значения высот', pmt_measurement_type_id;
  177. end if;
  178. var_index := (pmt_bullet_speed / 10)::integer - 4;
  179. if var_index < 0 then
  180. var_index := 1;
  181. end if;
  182. var_header_adj := (select values from public.calc_header_adjustment
  183. where header = 'table3'
  184. and measurment_type_id = pmt_measurement_type_id);
  185. if array_length(var_header_adj, 1) = 0 then
  186. raise exception 'некорректные данные';
  187. end if; if array_length(var_header_adj, 1) < var_index then
  188. raise exception 'некорректные данные';
  189. end if; raise notice '| высота | поправка |';
  190. raise notice '|----------|-----------|'; for var_row in
  191. select t1.height, t2.*
  192. from calc_height_adjustment as t1
  193. inner join public.calc_wind_speed_height_adjustment as t2
  194. on t2.calc_height_id = t1.id
  195. where t1.measurment_type_id = pmt_measurement_type_id
  196. loop
  197. var_header_index := abs(var_index % 10);
  198. var_table := var_row.values;
  199. var_dev := var_table[var_header_index]; select '|' || lpad(var_row.height::text, 10, ' ') || '|' || lpad(var_dev::text, 11, ' ') || '|'
  200. into var_table_row; raise notice '%', var_table_row; var_adj.calc_height_id := var_row.calc_height_id;
  201. var_adj.height := var_row.height;
  202. var_adj.wind_speed_deviation := var_dev;
  203. var_adj.wind_deviation := var_row.delta;
  204. pmt_adjustments := array_append(pmt_adjustments, var_adj);
  205. end loop; raise notice '|----------|-----------|';
  206. end;
  207. $body$;
  208. create or replace procedure public.calculate_wind_direction_deviation(
  209. in pmt_wind_direction numeric,
  210. in pmt_measurement_type_id integer,
  211. inout pmt_adjustments public.wind_direction_adjustment[]
  212. )
  213. language 'plpgsql'
  214. as $body$
  215. declare
  216. var_row record;
  217. var_adj public.wind_direction_adjustment;
  218. begin
  219. for var_row in
  220. select t1.height, t2.*
  221. from calc_height_adjustment as t1
  222. inner join public.calc_wind_speed_height_adjustment as t2
  223. on t2.calc_height_id = t1.id
  224. where t1.measurment_type_id = pmt_measurement_type_id
  225. loop
  226. var_adj.calc_height_id := var_row.calc_height_id;
  227. var_adj.height := var_row.height;
  228. var_adj.wind_speed_deviation := var_row.delta;
  229. var_adj.wind_deviation := pmt_wind_direction + var_row.delta;
  230. pmt_adjustments := array_append(pmt_adjustments, var_adj);
  231. end loop;
  232. end;
  233. $body$;
  234. do $$
  235. declare
  236. var_temperature_adjustments public.temperature_adjustment[];
  237. var_wind_speed_adjustments public.wind_direction_adjustment[];
  238. var_wind_direction_adjustments public.wind_direction_adjustment[];
  239. begin
  240. raise notice 'расчет отклонений температуры для ветрового ружья';
  241. call public.temp_dev_calc(
  242. pmt_measurement_type_id => 2,
  243. pmt_temperature => 3.0,
  244. pmt_adjustments => var_temperature_adjustments
  245. );
  246. raise notice 'отклонение температуры: %', var_temperature_adjustments;
  247. raise notice 'расчет средней скорости ветра для ветрового ружья';
  248. call public.calculate_wind_speed_deviation(
  249. pmt_bullet_speed => 14.0,
  250. pmt_measurement_type_id => 2,
  251. pmt_adjustments => var_wind_speed_adjustments
  252. );
  253. raise notice 'скорость ветра: %', var_wind_speed_adjustments;
  254. raise notice 'расчет среднего направления ветра для ветрового ружья';
  255. call public.calculate_wind_direction_deviation(
  256. pmt_wind_direction => 45.0,
  257. pmt_measurement_type_id => 2,
  258. pmt_adjustments => var_wind_direction_adjustments
  259. );
  260. raise notice 'среднее направление ветра: %', var_wind_direction_adjustments;
  261. end $$;create or replace procedure public.temp_dev_calc_dmk(
  262. in pmt_measurement_type_id integer,
  263. in pmt_temperature numeric(8,2),
  264. inout pmt_adjustments public.temperature_adjustment[]
  265. )
  266. language 'plpgsql'
  267. as $body$
  268. declare
  269. var_row record;
  270. var_index integer;
  271. var_header_adj integer[];
  272. var_right_index integer;
  273. var_left_index integer;
  274. var_header_index integer;
  275. var_dev integer;
  276. var_table integer[];
  277. var_adj public.temperature_adjustment;
  278. var_table_row text;
  279. begin
  280. if not exists (
  281. select 1
  282. from public.calc_height_adjustment as t1
  283. inner join public.calc_temperature_height_adjustment as t2
  284. on t2.calc_height_id = t1.id
  285. where t1.measurment_type_id = pmt_measurement_type_id
  286. ) then
  287. raise exception 'недостаточно данных';
  288. end if; raise notice '| высота | поправка |';
  289. raise notice '|----------|-----------|'; for var_row in
  290. select t2.*, t1.height
  291. from public.calc_height_adjustment as t1
  292. inner join public.calc_temperature_height_adjustment as t2
  293. on t2.calc_height_id = t1.id
  294. where t1.measurment_type_id = pmt_measurement_type_id
  295. loop
  296. var_index := pmt_temperature::integer;
  297. var_header_adj := (select values from public.calc_header_adjustment
  298. where id = var_row.calc_temperature_header_id and header = 'table2');
  299. if array_length(var_header_adj, 1) = 0 then
  300. raise exception 'высота % - некорректные данные', var_row.height;
  301. end if; if array_length(var_header_adj, 1) < var_index then
  302. raise exception 'высота % - некорректные данные', var_row.height;
  303. end if;
  304. var_right_index := abs(var_index % 10);
  305. var_header_index := abs(var_index) - var_right_index;
  306. if pmt_temperature >= 0 then
  307. var_table := var_row.positive_values;
  308. else
  309. var_table := var_row.negative_values;
  310. end if; if var_header_index = 0 then
  311. var_header_index := 1;
  312. end if; var_left_index := var_header_adj[var_header_index];
  313. if var_left_index = 0 then
  314. var_left_index := 1;
  315. end if;
  316. var_dev := var_table[var_left_index] + var_table[var_right_index]; select '|' || lpad(var_row.height::text, 10, ' ') || '|' || lpad(var_dev::text, 11, ' ') || '|'
  317. into var_table_row; raise notice '%', var_table_row; var_adj.calc_height_id := var_row.calc_height_id;
  318. var_adj.height := var_row.height;
  319. var_adj.temperature_deviation := var_dev;
  320. pmt_adjustments := array_append(pmt_adjustments, var_adj);
  321. end loop; raise notice '|----------|-----------|';
  322. end;
  323. $body$;
  324. create or replace procedure public.calculate_wind_speed_deviation_dmk(
  325. in pmt_ground_wind_speed numeric,
  326. in pmt_measurement_type_id integer,
  327. inout pmt_adjustments public.wind_direction_adjustment[]
  328. )
  329. language 'plpgsql'
  330. as $body$
  331. declare
  332. var_row record;
  333. var_index integer;
  334. var_adj public.wind_direction_adjustment;
  335. var_header_adj integer[];
  336. var_header_index integer;
  337. var_table integer[];
  338. var_dev integer;
  339. var_table_row text;
  340. begin
  341. if coalesce(pmt_ground_wind_speed, -1) < 0 then
  342. raise exception 'некорректные данные. pmt_ground_wind_speed=%', pmt_ground_wind_speed;
  343. end if; if not exists (
  344. select 1 from public.calc_height_adjustment
  345. where measurment_type_id = pmt_measurement_type_id
  346. ) then
  347. raise exception '% - не найдены значения высот в таблице', pmt_measurement_type_id;
  348. end if;
  349. var_index := (pmt_ground_wind_speed / 10)::integer - 4;
  350. if var_index < 0 then
  351. var_index := 1;
  352. end if;
  353. var_header_adj := (select values from public.calc_header_adjustment
  354. where header = 'table3'
  355. and measurment_type_id = pmt_measurement_type_id);
  356. if array_length(var_header_adj, 1) = 0 then
  357. raise exception 'некорректные данные';
  358. end if; if array_length(var_header_adj, 1) < var_index then
  359. raise exception 'некорректные данные';
  360. end if; raise notice '| высота | поправка |';
  361. raise notice '|----------|-----------|'; for var_row in
  362. select t1.height, t2.*
  363. from calc_height_adjustment as t1
  364. inner join public.calc_wind_speed_height_adjustment as t2
  365. on t2.calc_height_id = t1.id
  366. where t1.measurment_type_id = pmt_measurement_type_id
  367. loop
  368. var_header_index := abs(var_index % 10);
  369. var_table := var_row.values;
  370. var_dev := var_table[var_header_index]; select '|' || lpad(var_row.height::text, 10, ' ') || '|' || lpad(var_dev::text, 11, ' ') || '|'
  371. into var_table_row; raise notice '%', var_table_row; var_adj.calc_height_id := var_row.calc_height_id;
  372. var_adj.height := var_row.height;
  373. var_adj.wind_speed_deviation := var_dev;
  374. var_adj.wind_deviation := var_row.delta;
  375. pmt_adjustments := array_append(pmt_adjustments, var_adj);
  376. end loop; raise notice '|----------|-----------|';
  377. end;
  378. $body$;
  379. create or replace procedure public.calculate_wind_direction_deviation_dmk(
  380. in pmt_wind_direction numeric,
  381. in pmt_measurement_type_id integer,
  382. inout pmt_adjustments public.wind_direction_adjustment[]
  383. )
  384. language 'plpgsql'
  385. as $body$
  386. declare
  387. var_row record;
  388. var_adj public.wind_direction_adjustment;
  389. begin
  390. for var_row in
  391. select t1.height, t2.*
  392. from calc_height_adjustment as t1
  393. inner join public.calc_wind_speed_height_adjustment as t2
  394. on t2.calc_height_id = t1.id
  395. where t1.measurment_type_id = pmt_measurement_type_id
  396. loop
  397. var_adj.calc_height_id := var_row.calc_height_id;
  398. var_adj.height := var_row.height;
  399. var_adj.wind_speed_deviation := var_row.delta;
  400. var_adj.wind_deviation := pmt_wind_direction + var_row.delta;
  401. pmt_adjustments := array_append(pmt_adjustments, var_adj);
  402. end loop;
  403. end;
  404. $body$;
  405. do $$
  406. declare
  407. var_temperature_adjustments public.temperature_adjustment[];
  408. var_wind_speed_adjustments public.wind_direction_adjustment[];
  409. var_wind_direction_adjustments public.wind_direction_adjustment[];
  410. begin
  411. raise notice 'расчет отклонений температуры для дмк';
  412. call public.temp_dev_calc_dmk(
  413. pmt_measurement_type_id => 1,
  414. pmt_temperature => 3.0,
  415. pmt_adjustments => var_temperature_adjustments
  416. );
  417. raise notice 'отклонение температуры: %', var_temperature_adjustments;
  418. raise notice 'расчет средней скорости ветра для дмк';
  419. call public.calculate_wind_speed_deviation_dmk(
  420. pmt_ground_wind_speed => 14.0,
  421. pmt_measurement_type_id => 1,
  422. pmt_adjustments => var_wind_speed_adjustments
  423. );
  424. raise notice 'средняя скорость ветра: %', var_wind_speed_adjustments;
  425. raise notice 'расчет среднего направления ветра для дмк';
  426. call public.calculate_wind_direction_deviation_dmk(
  427. pmt_wind_direction => 45.0,
  428. pmt_measurement_type_id => 1,
  429. pmt_adjustments => var_wind_direction_adjustments
  430. );
  431. raise notice 'среднее направление ветра: %', var_wind_direction_adjustments;
  432. end $$;