9.sql 21 KB

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