ECC-184: Create python example to read CSV and encode BUFR

This commit is contained in:
Shahram Najm 2015-11-10 20:45:59 +00:00
parent 5d58da9af0
commit 9afebc4ca1
4 changed files with 293 additions and 0 deletions

View File

@ -68,3 +68,14 @@ foreach( test ${tests} )
TEST_DEPENDS eccodes_get_gribs eccodes_get_tigge_gribs eccodes_get_bufrs
)
endforeach()
ecbuild_add_test( TARGET eccodes_p_make_flight_bufr_test
TYPE SCRIPT
DEPENDS ${ptools}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/make_flight_bufr.sh
CONDITION HAVE_PYTHON
ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE}
RESOURCES flight_data.csv
TEST_DEPENDS eccodes_get_bufrs
)

View File

@ -0,0 +1,186 @@
ymd,time,latitude,longitude,altitude,pressure,windSpeed,windDirection,temperature
20150101,05:30:00,51.75794 ,1.7008 ,2362,759.32 ,19.28 ,81.95 ,14.18
20150101,05:30:01,51.75738 ,1.7014 ,2369,758.64 ,19.71 ,81.24 ,14.17
20150101,05:30:02,51.75681 ,1.7020 ,2375,758.16 ,19.80 ,80.82 ,14.15
20150101,05:30:03,51.75624 ,1.7026 ,2382,757.66 ,19.84 ,80.84 ,14.13
20150101,05:30:04,51.75567 ,1.7031 ,2388,757.08 ,19.77 ,80.71 ,14.08
20150101,05:30:05,51.75511 ,1.7037 ,2395,756.60 ,19.79 ,80.55 ,14.08
20150101,05:30:06,51.75454 ,1.7043 ,2401,755.96 ,19.70 ,80.24 ,14.11
20150101,05:30:07,51.75398 ,1.7049 ,2406,755.26 ,19.77 ,80.21 ,14.08
20150101,05:33:41,51.61353 ,1.8529 ,2558,742.34 ,19.66 ,82.84 ,13.74
20150101,05:33:42,51.61281 ,1.8536 ,2558,742.30 ,19.54 ,82.59 ,13.76
20150101,05:33:43,51.61209 ,1.8543 ,2557,742.34 ,19.47 ,82.56 ,13.77
20150101,05:33:44,51.61137 ,1.8551 ,2557,742.42 ,19.61 ,82.47 ,13.78
20150101,05:33:45,51.61065 ,1.8558 ,2557,742.40 ,19.55 ,82.83 ,13.75
20150101,05:33:46,51.60994 ,1.8565 ,2557,742.34 ,19.72 ,82.40 ,13.75
20150101,05:33:47,51.60922 ,1.8573 ,2557,742.42 ,19.70 ,82.86 ,13.74
20150101,05:33:48,51.60851 ,1.8580 ,2558,742.42 ,19.72 ,83.18 ,13.74
20150101,05:33:49,51.60779 ,1.8588 ,2558,742.36 ,19.87 ,83.18 ,13.76
20150101,05:33:50,51.60707 ,1.8595 ,2558,742.24 ,19.87 ,82.71 ,13.76
20150101,05:33:51,51.60635 ,1.8602 ,2558,742.20 ,19.89 ,82.98 ,13.76
20150101,05:33:52,51.60564 ,1.8609 ,2558,742.26 ,19.74 ,82.40 ,13.79
20150101,05:33:53,51.60492 ,1.8617 ,2558,742.22 ,19.71 ,82.27 ,13.80
20150101,05:33:54,51.60420 ,1.8624 ,2558,742.20 ,19.51 ,82.61 ,13.84
20150101,05:33:55,51.60349 ,1.8631 ,2557,742.44 ,19.85 ,81.95 ,13.82
20150101,05:33:56,51.60277 ,1.8639 ,2556,742.32 ,19.61 ,82.23 ,13.78
20150101,05:33:57,51.60205 ,1.8646 ,2555,742.54 ,19.57 ,81.95 ,13.81
20150101,05:35:59,51.51433 ,1.9565 ,2553,742.30 ,18.21 ,81.25 ,14.45
20150101,05:36:00,51.51360 ,1.9572 ,2553,742.34 ,18.42 ,80.25 ,14.45
20150101,05:36:01,51.51288 ,1.9580 ,2553,742.40 ,18.38 ,79.72 ,14.43
20150101,05:36:02,51.51215 ,1.9588 ,2552,742.42 ,18.34 ,79.76 ,14.37
20150101,05:36:03,51.51142 ,1.9595 ,2552,742.48 ,18.38 ,80.23 ,14.34
20150101,05:36:04,51.51070 ,1.9603 ,2552,742.58 ,18.39 ,80.07 ,14.35
20150101,05:36:05,51.50997 ,1.9610 ,2551,742.42 ,18.29 ,80.05 ,14.35
20150101,05:36:06,51.50924 ,1.9618 ,2551,742.68 ,18.22 ,80.20 ,14.35
20150101,05:36:07,51.50852 ,1.9625 ,2551,742.54 ,18.21 ,80.20 ,14.35
20150101,05:36:08,51.50779 ,1.9633 ,2551,742.38 ,18.17 ,80.11 ,14.30
20150101,05:36:09,51.50706 ,1.9641 ,2551,742.60 ,18.20 ,80.35 ,14.27
20150101,05:36:10,51.50634 ,1.9648 ,2551,742.48 ,18.05 ,80.69 ,14.27
20150101,05:36:11,51.50561 ,1.9656 ,2551,742.58 ,18.03 ,80.87 ,14.27
20150101,05:36:12,51.50489 ,1.9664 ,2552,742.48 ,18.29 ,81.89 ,14.25
20150101,05:36:13,51.50416 ,1.9671 ,2552,742.52 ,18.14 ,82.59 ,14.31
20150101,05:36:14,51.50343 ,1.9679 ,2553,742.34 ,18.23 ,83.10 ,14.35
20150101,05:36:15,51.50271 ,1.9686 ,2553,742.28 ,18.56 ,84.18 ,14.31
20150101,05:36:16,51.50198 ,1.9694 ,2554,742.30 ,18.55 ,84.49 ,14.33
20150101,05:36:17,51.50126 ,1.9702 ,2554,742.24 ,18.72 ,84.70 ,14.37
20150101,05:36:18,51.50054 ,1.9709 ,2554,742.30 ,18.74 ,85.26 ,14.36
20150101,05:36:19,51.49981 ,1.9717 ,2554,742.12 ,18.80 ,85.39 ,14.37
20150101,05:36:20,51.49909 ,1.9724 ,2555,742.24 ,18.99 ,85.95 ,14.34
20150101,05:36:21,51.49837 ,1.9732 ,2555,742.24 ,19.02 ,86.23 ,14.32
20150101,05:36:22,51.49765 ,1.9739 ,2555,742.12 ,19.06 ,86.45 ,14.31
20150101,05:36:23,51.49693 ,1.9747 ,2554,742.16 ,19.12 ,86.76 ,14.28
20150101,05:36:24,51.49621 ,1.9754 ,2554,742.26 ,18.87 ,86.29 ,14.30
20150101,05:36:25,51.49549 ,1.9762 ,2554,742.26 ,19.11 ,85.92 ,14.26
20150101,05:36:26,51.49476 ,1.9769 ,2553,742.20 ,19.03 ,86.29 ,14.22
20150101,05:36:27,51.49405 ,1.9777 ,2553,742.34 ,19.18 ,86.32 ,14.20
20150101,05:36:28,51.49333 ,1.9784 ,2553,742.24 ,19.24 ,86.36 ,14.17
20150101,05:36:29,51.49260 ,1.9792 ,2553,742.32 ,19.29 ,85.54 ,14.20
20150101,05:36:30,51.49189 ,1.9799 ,2553,742.34 ,19.36 ,85.71 ,14.20
20150101,05:36:31,51.49117 ,1.9807 ,2554,742.38 ,19.39 ,85.95 ,14.19
20150101,05:36:32,51.49045 ,1.9814 ,2554,742.32 ,19.55 ,86.33 ,14.20
20150101,05:36:33,51.48973 ,1.9822 ,2554,742.22 ,19.52 ,85.98 ,14.21
20150101,05:36:34,51.48902 ,1.9829 ,2554,742.36 ,19.51 ,85.53 ,14.23
20150101,05:36:35,51.48830 ,1.9837 ,2554,742.20 ,19.34 ,85.73 ,14.26
20150101,05:36:36,51.48759 ,1.9844 ,2554,742.00 ,19.37 ,85.62 ,14.26
20150101,05:36:37,51.48688 ,1.9852 ,2554,742.24 ,19.40 ,85.86 ,14.27
20150101,05:36:38,51.48616 ,1.9859 ,2554,742.22 ,19.63 ,86.06 ,14.28
20150101,05:36:39,51.48545 ,1.9867 ,2553,742.26 ,19.95 ,85.89 ,14.27
20150101,05:36:40,51.48474 ,1.9874 ,2553,742.16 ,19.81 ,86.01 ,14.22
20150101,05:36:41,51.48403 ,1.9881 ,2553,742.34 ,19.32 ,87.45 ,14.22
20150101,05:36:42,51.48333 ,1.9889 ,2552,742.10 ,20.22 ,90.31 ,14.11
20150101,05:36:43,51.48262 ,1.9896 ,2552,742.50 ,19.74 ,89.33 ,14.24
20150101,05:36:44,51.48191 ,1.9904 ,2552,742.66 ,18.69 ,87.18 ,14.46
20150101,05:36:45,51.48121 ,1.9911 ,2552,742.38 ,19.41 ,89.47 ,14.41
20150101,05:36:46,51.48050 ,1.9919 ,2551,742.40 ,19.71 ,86.92 ,14.45
20150101,05:36:47,51.47980 ,1.9926 ,2551,742.48 ,18.47 ,86.49 ,14.40
20150101,05:36:48,51.47910 ,1.9933 ,2551,742.18 ,17.70 ,85.66 ,14.39
20150101,05:36:49,51.47840 ,1.9941 ,2551,742.58 ,17.84 ,89.68 ,14.39
20150101,05:36:50,51.47770 ,1.9948 ,2551,742.38 ,19.76 ,83.78 ,14.57
20150101,05:36:51,51.47700 ,1.9955 ,2551,742.24 ,18.98 ,83.07 ,14.39
20150101,05:36:52,51.47630 ,1.9963 ,2551,742.34 ,20.36 ,86.14 ,14.28
20150101,05:36:53,51.47560 ,1.9970 ,2552,742.08 ,20.66 ,84.28 ,14.20
20150101,05:36:54,51.47490 ,1.9978 ,2553,742.58 ,20.01 ,82.04 ,14.27
20150101,05:36:55,51.47420 ,1.9985 ,2553,742.04 ,20.43 ,80.02 ,14.13
20150101,05:36:56,51.47350 ,1.9992 ,2554,742.10 ,18.79 ,80.63 ,14.16
20150101,05:36:57,51.47280 ,2.0000 ,2555,741.98 ,17.62 ,82.50 ,14.08
20150101,05:36:58,51.47209 ,2.0007 ,2556,742.06 ,17.42 ,81.05 ,14.06
20150101,05:36:59,51.47139 ,2.0014 ,2557,742.16 ,16.87 ,83.43 ,13.97
20150101,05:37:00,51.47069 ,2.0022 ,2558,741.94 ,19.95 ,81.32 ,13.80
20150101,05:37:01,51.46999 ,2.0029 ,2557,741.52 ,19.05 ,90.09 ,13.45
20150101,05:37:02,51.46928 ,2.0036 ,2557,741.96 ,18.63 ,89.85 ,13.40
20150101,05:37:03,51.46858 ,2.0044 ,2556,741.94 ,18.00 ,90.13 ,13.29
20150101,05:37:04,51.46787 ,2.0051 ,2556,742.08 ,18.69 ,90.18 ,13.13
20150101,05:37:05,51.46717 ,2.0058 ,2555,742.12 ,19.07 ,88.68 ,13.15
20150101,05:37:06,51.46647 ,2.0066 ,2555,742.34 ,18.67 ,88.31 ,13.07
20150101,05:37:07,51.46577 ,2.0073 ,2555,742.38 ,18.84 ,88.24 ,13.04
20150101,05:37:08,51.46506 ,2.0080 ,2554,742.42 ,18.82 ,88.60 ,13.03
20150101,05:37:09,51.46437 ,2.0088 ,2554,742.36 ,19.10 ,88.56 ,12.99
20150101,05:37:10,51.46366 ,2.0095 ,2553,742.40 ,19.04 ,88.77 ,12.93
20150101,05:37:11,51.46296 ,2.0102 ,2553,742.46 ,18.96 ,89.76 ,12.90
20150101,05:37:12,51.46226 ,2.0110 ,2552,742.48 ,19.03 ,89.55 ,12.94
20150101,05:37:13,51.46156 ,2.0117 ,2552,742.40 ,18.97 ,89.18 ,12.89
20150101,05:37:14,51.46087 ,2.0124 ,2552,742.54 ,19.12 ,89.01 ,12.88
20150101,05:37:15,51.46017 ,2.0132 ,2552,742.48 ,19.18 ,89.28 ,12.95
20150101,05:37:16,51.45947 ,2.0139 ,2552,742.70 ,19.05 ,88.65 ,13.01
20150101,05:37:17,51.45878 ,2.0146 ,2552,742.40 ,19.49 ,88.38 ,13.04
20150101,05:37:18,51.45808 ,2.0154 ,2552,742.50 ,19.64 ,88.37 ,13.06
20150101,05:37:19,51.45739 ,2.0161 ,2552,742.30 ,19.56 ,87.36 ,13.11
20150101,05:37:20,51.45670 ,2.0168 ,2551,742.48 ,19.67 ,88.22 ,13.12
20150101,05:37:21,51.45600 ,2.0175 ,2551,742.42 ,19.66 ,87.64 ,13.14
20150101,05:37:22,51.45531 ,2.0183 ,2551,742.42 ,19.82 ,86.73 ,13.19
20150101,05:37:23,51.45462 ,2.0190 ,2551,742.66 ,19.97 ,86.84 ,13.24
20150101,05:37:24,51.45393 ,2.0197 ,2550,742.72 ,19.14 ,88.26 ,13.24
20150101,05:37:25,51.45324 ,2.0204 ,2550,742.68 ,19.32 ,87.69 ,13.28
20150101,05:37:26,51.45255 ,2.0212 ,2549,742.70 ,19.29 ,87.74 ,13.27
20150101,05:37:27,51.45186 ,2.0219 ,2549,742.58 ,19.31 ,87.45 ,13.34
20150101,05:37:28,51.45117 ,2.0226 ,2549,742.48 ,19.05 ,87.32 ,13.34
20150101,05:37:29,51.45048 ,2.0233 ,2548,742.54 ,19.06 ,86.75 ,13.36
20150101,05:37:30,51.44980 ,2.0241 ,2548,742.72 ,18.84 ,86.56 ,13.36
20150101,05:37:31,51.44911 ,2.0248 ,2548,742.56 ,19.01 ,86.95 ,13.35
20150101,05:37:32,51.44856 ,2.0254 ,2548,742.58 ,19.09 ,86.76 ,13.42
20150101,05:37:33,51.44774 ,2.0262 ,2549,742.48 ,19.02 ,86.02 ,13.46
20150101,05:37:34,51.44719 ,2.0268 ,2549,742.40 ,18.97 ,86.71 ,13.46
20150101,05:37:35,51.44637 ,2.0277 ,2549,742.52 ,19.03 ,86.81 ,13.50
20150101,05:37:36,51.44582 ,2.0282 ,2549,742.46 ,19.08 ,87.69 ,13.52
20150101,05:37:37,51.44500 ,2.0291 ,2549,742.60 ,18.94 ,87.25 ,13.57
20150101,05:37:38,51.44446 ,2.0297 ,2549,742.60 ,18.89 ,87.57 ,13.60
20150101,05:37:39,51.44377 ,2.0304 ,2549,742.66 ,18.89 ,88.48 ,13.57
20150101,05:37:40,51.44295 ,2.0312 ,2549,742.50 ,18.79 ,88.90 ,13.65
20150101,05:37:41,51.44241 ,2.0318 ,2549,742.40 ,19.04 ,88.92 ,13.67
20150101,05:37:42,51.44173 ,2.0325 ,2550,742.44 ,18.96 ,89.12 ,13.71
20150101,05:37:43,51.44105 ,2.0332 ,2550,742.34 ,19.05 ,88.92 ,13.75
20150101,05:37:44,51.44037 ,2.0340 ,2550,742.44 ,19.15 ,90.00 ,13.70
20150101,05:37:45,51.43969 ,2.0347 ,2550,742.44 ,18.94 ,89.15 ,13.78
20150101,05:37:46,51.43901 ,2.0354 ,2551,742.40 ,19.10 ,90.27 ,13.74
20150101,05:37:47,51.43833 ,2.0361 ,2552,742.34 ,19.45 ,90.77 ,13.74
20150101,05:37:48,51.43752 ,2.0369 ,2552,742.32 ,19.65 ,90.73 ,13.77
20150101,05:37:49,51.43698 ,2.0375 ,2553,742.22 ,19.68 ,90.82 ,13.79
20150101,05:37:50,51.43617 ,2.0383 ,2553,742.20 ,19.57 ,91.64 ,13.81
20150101,05:37:51,51.43563 ,2.0389 ,2554,742.14 ,19.45 ,91.21 ,13.87
20150101,05:37:52,51.43482 ,2.0398 ,2554,742.12 ,19.60 ,90.35 ,13.88
20150101,05:37:53,51.43428 ,2.0403 ,2554,742.10 ,18.98 ,90.66 ,13.90
20150101,05:37:54,51.43347 ,2.0412 ,2554,742.18 ,18.95 ,89.06 ,13.93
20150101,05:37:55,51.43293 ,2.0417 ,2554,742.16 ,18.98 ,87.92 ,13.93
20150101,05:37:56,51.43227 ,2.0424 ,2554,742.24 ,19.15 ,88.50 ,13.89
20150101,05:37:57,51.43159 ,2.0431 ,2554,742.20 ,18.86 ,88.21 ,13.91
20150101,05:37:58,51.43092 ,2.0438 ,2554,742.06 ,18.80 ,88.54 ,13.89
20150101,05:37:59,51.43025 ,2.0445 ,2554,742.10 ,18.98 ,89.64 ,13.89
20150101,05:38:00,51.42945 ,2.0454 ,2554,742.16 ,18.91 ,89.70 ,13.92
20150101,05:38:01,51.42891 ,2.0459 ,2555,742.14 ,18.91 ,89.12 ,13.91
20150101,05:38:02,51.42824 ,2.0466 ,2555,742.12 ,18.82 ,89.36 ,13.94
20150101,05:38:03,51.42758 ,2.0473 ,2555,742.02 ,18.56 ,89.75 ,13.93
20150101,05:38:04,51.42691 ,2.0480 ,2555,741.92 ,18.64 ,89.48 ,13.93
20150101,05:38:05,51.42624 ,2.0487 ,2556,742.12 ,18.72 ,89.02 ,13.94
20150101,05:38:06,51.42557 ,2.0494 ,2556,741.94 ,18.61 ,89.20 ,13.93
20150101,05:38:07,51.42490 ,2.0501 ,2556,741.98 ,18.80 ,89.66 ,13.95
20150101,05:38:08,51.42424 ,2.0508 ,2556,742.00 ,18.98 ,89.61 ,13.88
20150101,05:38:09,51.42344 ,2.0516 ,2556,741.86 ,18.71 ,89.60 ,13.87
20150101,05:38:10,51.42291 ,2.0522 ,2557,741.88 ,18.74 ,89.72 ,13.90
20150101,05:38:11,51.42224 ,2.0529 ,2557,741.86 ,18.61 ,90.03 ,13.94
20150101,05:45:15,51.15340 ,2.3331 ,3086,695.96 ,18.43 ,99.02 ,11.88
20150101,05:45:16,51.15277 ,2.3338 ,3085,695.94 ,18.38 ,99.05 ,11.92
20150101,05:45:17,51.15214 ,2.3344 ,3085,695.94 ,18.31 ,98.23 ,11.99
20150101,05:45:18,51.15151 ,2.3351 ,3085,695.98 ,18.77 ,98.64 ,11.94
20150101,05:45:19,51.15089 ,2.3357 ,3084,695.98 ,18.85 ,98.20 ,11.86
20150101,05:45:20,51.15025 ,2.3364 ,3084,696.04 ,18.69 ,98.27 ,11.86
20150101,05:45:21,51.14963 ,2.3371 ,3084,696.02 ,18.50 ,98.86 ,11.85
20150101,05:45:22,51.14899 ,2.3377 ,3084,696.16 ,18.60 ,97.66 ,11.89
20150101,05:45:23,51.14836 ,2.3384 ,3084,696.04 ,18.65 ,98.39 ,11.94
20150101,05:45:24,51.14773 ,2.3390 ,3083,696.14 ,18.33 ,99.42 ,12.00
20150101,05:45:25,51.14710 ,2.3397 ,3083,696.18 ,18.32 ,98.28 ,12.05
20150101,05:45:26,51.14647 ,2.3404 ,3083,696.18 ,18.54 ,97.09 ,12.05
20150101,05:45:27,51.14583 ,2.3410 ,3083,696.14 ,18.53 ,96.26 ,12.03
20150101,05:45:28,51.14520 ,2.3417 ,3082,696.24 ,18.54 ,96.85 ,11.98
20150101,05:45:29,51.14456 ,2.3424 ,3082,696.26 ,18.47 ,97.91 ,12.04
20150101,05:45:30,51.14392 ,2.3430 ,3082,696.16 ,18.49 ,97.83 ,12.07
20150101,05:45:31,51.14328 ,2.3437 ,3082,696.32 ,18.88 ,96.75 ,12.06
20150101,05:45:32,51.14264 ,2.3444 ,3082,696.28 ,18.78 ,97.59 ,12.04
20150101,05:45:33,51.14200 ,2.3450 ,3081,696.24 ,19.18 ,97.85 ,11.94
20150101,05:45:34,51.14137 ,2.3457 ,3081,696.18 ,19.32 ,98.90 ,11.89
20150101,05:45:35,51.14073 ,2.3464 ,3082,696.38 ,19.24 ,99.30 ,11.90
20150101,05:45:36,51.14009 ,2.3470 ,3082,696.32 ,19.42 ,99.04 ,11.95
20150101,05:45:37,51.13945 ,2.3477 ,3081,696.42 ,19.30 ,99.94 ,12.01
20150101,05:45:38,51.13881 ,2.3484 ,3081,696.42 ,19.02 ,99.29 ,12.08
20150101,05:45:39,51.13817 ,2.3490 ,3080,696.46 ,19.15 ,98.20 ,12.13
20150101,05:45:40,51.13753 ,2.3497 ,3079,696.52 ,19.25 ,98.24 ,12.11
20150101,05:45:41,51.13689 ,2.3504 ,3078,696.58 ,19.28 ,98.89 ,12.07
1 ymd time latitude longitude altitude pressure windSpeed windDirection temperature
2 20150101 05:30:00 51.75794 1.7008 2362 759.32 19.28 81.95 14.18
3 20150101 05:30:01 51.75738 1.7014 2369 758.64 19.71 81.24 14.17
4 20150101 05:30:02 51.75681 1.7020 2375 758.16 19.80 80.82 14.15
5 20150101 05:30:03 51.75624 1.7026 2382 757.66 19.84 80.84 14.13
6 20150101 05:30:04 51.75567 1.7031 2388 757.08 19.77 80.71 14.08
7 20150101 05:30:05 51.75511 1.7037 2395 756.60 19.79 80.55 14.08
8 20150101 05:30:06 51.75454 1.7043 2401 755.96 19.70 80.24 14.11
9 20150101 05:30:07 51.75398 1.7049 2406 755.26 19.77 80.21 14.08
10 20150101 05:33:41 51.61353 1.8529 2558 742.34 19.66 82.84 13.74
11 20150101 05:33:42 51.61281 1.8536 2558 742.30 19.54 82.59 13.76
12 20150101 05:33:43 51.61209 1.8543 2557 742.34 19.47 82.56 13.77
13 20150101 05:33:44 51.61137 1.8551 2557 742.42 19.61 82.47 13.78
14 20150101 05:33:45 51.61065 1.8558 2557 742.40 19.55 82.83 13.75
15 20150101 05:33:46 51.60994 1.8565 2557 742.34 19.72 82.40 13.75
16 20150101 05:33:47 51.60922 1.8573 2557 742.42 19.70 82.86 13.74
17 20150101 05:33:48 51.60851 1.8580 2558 742.42 19.72 83.18 13.74
18 20150101 05:33:49 51.60779 1.8588 2558 742.36 19.87 83.18 13.76
19 20150101 05:33:50 51.60707 1.8595 2558 742.24 19.87 82.71 13.76
20 20150101 05:33:51 51.60635 1.8602 2558 742.20 19.89 82.98 13.76
21 20150101 05:33:52 51.60564 1.8609 2558 742.26 19.74 82.40 13.79
22 20150101 05:33:53 51.60492 1.8617 2558 742.22 19.71 82.27 13.80
23 20150101 05:33:54 51.60420 1.8624 2558 742.20 19.51 82.61 13.84
24 20150101 05:33:55 51.60349 1.8631 2557 742.44 19.85 81.95 13.82
25 20150101 05:33:56 51.60277 1.8639 2556 742.32 19.61 82.23 13.78
26 20150101 05:33:57 51.60205 1.8646 2555 742.54 19.57 81.95 13.81
27 20150101 05:35:59 51.51433 1.9565 2553 742.30 18.21 81.25 14.45
28 20150101 05:36:00 51.51360 1.9572 2553 742.34 18.42 80.25 14.45
29 20150101 05:36:01 51.51288 1.9580 2553 742.40 18.38 79.72 14.43
30 20150101 05:36:02 51.51215 1.9588 2552 742.42 18.34 79.76 14.37
31 20150101 05:36:03 51.51142 1.9595 2552 742.48 18.38 80.23 14.34
32 20150101 05:36:04 51.51070 1.9603 2552 742.58 18.39 80.07 14.35
33 20150101 05:36:05 51.50997 1.9610 2551 742.42 18.29 80.05 14.35
34 20150101 05:36:06 51.50924 1.9618 2551 742.68 18.22 80.20 14.35
35 20150101 05:36:07 51.50852 1.9625 2551 742.54 18.21 80.20 14.35
36 20150101 05:36:08 51.50779 1.9633 2551 742.38 18.17 80.11 14.30
37 20150101 05:36:09 51.50706 1.9641 2551 742.60 18.20 80.35 14.27
38 20150101 05:36:10 51.50634 1.9648 2551 742.48 18.05 80.69 14.27
39 20150101 05:36:11 51.50561 1.9656 2551 742.58 18.03 80.87 14.27
40 20150101 05:36:12 51.50489 1.9664 2552 742.48 18.29 81.89 14.25
41 20150101 05:36:13 51.50416 1.9671 2552 742.52 18.14 82.59 14.31
42 20150101 05:36:14 51.50343 1.9679 2553 742.34 18.23 83.10 14.35
43 20150101 05:36:15 51.50271 1.9686 2553 742.28 18.56 84.18 14.31
44 20150101 05:36:16 51.50198 1.9694 2554 742.30 18.55 84.49 14.33
45 20150101 05:36:17 51.50126 1.9702 2554 742.24 18.72 84.70 14.37
46 20150101 05:36:18 51.50054 1.9709 2554 742.30 18.74 85.26 14.36
47 20150101 05:36:19 51.49981 1.9717 2554 742.12 18.80 85.39 14.37
48 20150101 05:36:20 51.49909 1.9724 2555 742.24 18.99 85.95 14.34
49 20150101 05:36:21 51.49837 1.9732 2555 742.24 19.02 86.23 14.32
50 20150101 05:36:22 51.49765 1.9739 2555 742.12 19.06 86.45 14.31
51 20150101 05:36:23 51.49693 1.9747 2554 742.16 19.12 86.76 14.28
52 20150101 05:36:24 51.49621 1.9754 2554 742.26 18.87 86.29 14.30
53 20150101 05:36:25 51.49549 1.9762 2554 742.26 19.11 85.92 14.26
54 20150101 05:36:26 51.49476 1.9769 2553 742.20 19.03 86.29 14.22
55 20150101 05:36:27 51.49405 1.9777 2553 742.34 19.18 86.32 14.20
56 20150101 05:36:28 51.49333 1.9784 2553 742.24 19.24 86.36 14.17
57 20150101 05:36:29 51.49260 1.9792 2553 742.32 19.29 85.54 14.20
58 20150101 05:36:30 51.49189 1.9799 2553 742.34 19.36 85.71 14.20
59 20150101 05:36:31 51.49117 1.9807 2554 742.38 19.39 85.95 14.19
60 20150101 05:36:32 51.49045 1.9814 2554 742.32 19.55 86.33 14.20
61 20150101 05:36:33 51.48973 1.9822 2554 742.22 19.52 85.98 14.21
62 20150101 05:36:34 51.48902 1.9829 2554 742.36 19.51 85.53 14.23
63 20150101 05:36:35 51.48830 1.9837 2554 742.20 19.34 85.73 14.26
64 20150101 05:36:36 51.48759 1.9844 2554 742.00 19.37 85.62 14.26
65 20150101 05:36:37 51.48688 1.9852 2554 742.24 19.40 85.86 14.27
66 20150101 05:36:38 51.48616 1.9859 2554 742.22 19.63 86.06 14.28
67 20150101 05:36:39 51.48545 1.9867 2553 742.26 19.95 85.89 14.27
68 20150101 05:36:40 51.48474 1.9874 2553 742.16 19.81 86.01 14.22
69 20150101 05:36:41 51.48403 1.9881 2553 742.34 19.32 87.45 14.22
70 20150101 05:36:42 51.48333 1.9889 2552 742.10 20.22 90.31 14.11
71 20150101 05:36:43 51.48262 1.9896 2552 742.50 19.74 89.33 14.24
72 20150101 05:36:44 51.48191 1.9904 2552 742.66 18.69 87.18 14.46
73 20150101 05:36:45 51.48121 1.9911 2552 742.38 19.41 89.47 14.41
74 20150101 05:36:46 51.48050 1.9919 2551 742.40 19.71 86.92 14.45
75 20150101 05:36:47 51.47980 1.9926 2551 742.48 18.47 86.49 14.40
76 20150101 05:36:48 51.47910 1.9933 2551 742.18 17.70 85.66 14.39
77 20150101 05:36:49 51.47840 1.9941 2551 742.58 17.84 89.68 14.39
78 20150101 05:36:50 51.47770 1.9948 2551 742.38 19.76 83.78 14.57
79 20150101 05:36:51 51.47700 1.9955 2551 742.24 18.98 83.07 14.39
80 20150101 05:36:52 51.47630 1.9963 2551 742.34 20.36 86.14 14.28
81 20150101 05:36:53 51.47560 1.9970 2552 742.08 20.66 84.28 14.20
82 20150101 05:36:54 51.47490 1.9978 2553 742.58 20.01 82.04 14.27
83 20150101 05:36:55 51.47420 1.9985 2553 742.04 20.43 80.02 14.13
84 20150101 05:36:56 51.47350 1.9992 2554 742.10 18.79 80.63 14.16
85 20150101 05:36:57 51.47280 2.0000 2555 741.98 17.62 82.50 14.08
86 20150101 05:36:58 51.47209 2.0007 2556 742.06 17.42 81.05 14.06
87 20150101 05:36:59 51.47139 2.0014 2557 742.16 16.87 83.43 13.97
88 20150101 05:37:00 51.47069 2.0022 2558 741.94 19.95 81.32 13.80
89 20150101 05:37:01 51.46999 2.0029 2557 741.52 19.05 90.09 13.45
90 20150101 05:37:02 51.46928 2.0036 2557 741.96 18.63 89.85 13.40
91 20150101 05:37:03 51.46858 2.0044 2556 741.94 18.00 90.13 13.29
92 20150101 05:37:04 51.46787 2.0051 2556 742.08 18.69 90.18 13.13
93 20150101 05:37:05 51.46717 2.0058 2555 742.12 19.07 88.68 13.15
94 20150101 05:37:06 51.46647 2.0066 2555 742.34 18.67 88.31 13.07
95 20150101 05:37:07 51.46577 2.0073 2555 742.38 18.84 88.24 13.04
96 20150101 05:37:08 51.46506 2.0080 2554 742.42 18.82 88.60 13.03
97 20150101 05:37:09 51.46437 2.0088 2554 742.36 19.10 88.56 12.99
98 20150101 05:37:10 51.46366 2.0095 2553 742.40 19.04 88.77 12.93
99 20150101 05:37:11 51.46296 2.0102 2553 742.46 18.96 89.76 12.90
100 20150101 05:37:12 51.46226 2.0110 2552 742.48 19.03 89.55 12.94
101 20150101 05:37:13 51.46156 2.0117 2552 742.40 18.97 89.18 12.89
102 20150101 05:37:14 51.46087 2.0124 2552 742.54 19.12 89.01 12.88
103 20150101 05:37:15 51.46017 2.0132 2552 742.48 19.18 89.28 12.95
104 20150101 05:37:16 51.45947 2.0139 2552 742.70 19.05 88.65 13.01
105 20150101 05:37:17 51.45878 2.0146 2552 742.40 19.49 88.38 13.04
106 20150101 05:37:18 51.45808 2.0154 2552 742.50 19.64 88.37 13.06
107 20150101 05:37:19 51.45739 2.0161 2552 742.30 19.56 87.36 13.11
108 20150101 05:37:20 51.45670 2.0168 2551 742.48 19.67 88.22 13.12
109 20150101 05:37:21 51.45600 2.0175 2551 742.42 19.66 87.64 13.14
110 20150101 05:37:22 51.45531 2.0183 2551 742.42 19.82 86.73 13.19
111 20150101 05:37:23 51.45462 2.0190 2551 742.66 19.97 86.84 13.24
112 20150101 05:37:24 51.45393 2.0197 2550 742.72 19.14 88.26 13.24
113 20150101 05:37:25 51.45324 2.0204 2550 742.68 19.32 87.69 13.28
114 20150101 05:37:26 51.45255 2.0212 2549 742.70 19.29 87.74 13.27
115 20150101 05:37:27 51.45186 2.0219 2549 742.58 19.31 87.45 13.34
116 20150101 05:37:28 51.45117 2.0226 2549 742.48 19.05 87.32 13.34
117 20150101 05:37:29 51.45048 2.0233 2548 742.54 19.06 86.75 13.36
118 20150101 05:37:30 51.44980 2.0241 2548 742.72 18.84 86.56 13.36
119 20150101 05:37:31 51.44911 2.0248 2548 742.56 19.01 86.95 13.35
120 20150101 05:37:32 51.44856 2.0254 2548 742.58 19.09 86.76 13.42
121 20150101 05:37:33 51.44774 2.0262 2549 742.48 19.02 86.02 13.46
122 20150101 05:37:34 51.44719 2.0268 2549 742.40 18.97 86.71 13.46
123 20150101 05:37:35 51.44637 2.0277 2549 742.52 19.03 86.81 13.50
124 20150101 05:37:36 51.44582 2.0282 2549 742.46 19.08 87.69 13.52
125 20150101 05:37:37 51.44500 2.0291 2549 742.60 18.94 87.25 13.57
126 20150101 05:37:38 51.44446 2.0297 2549 742.60 18.89 87.57 13.60
127 20150101 05:37:39 51.44377 2.0304 2549 742.66 18.89 88.48 13.57
128 20150101 05:37:40 51.44295 2.0312 2549 742.50 18.79 88.90 13.65
129 20150101 05:37:41 51.44241 2.0318 2549 742.40 19.04 88.92 13.67
130 20150101 05:37:42 51.44173 2.0325 2550 742.44 18.96 89.12 13.71
131 20150101 05:37:43 51.44105 2.0332 2550 742.34 19.05 88.92 13.75
132 20150101 05:37:44 51.44037 2.0340 2550 742.44 19.15 90.00 13.70
133 20150101 05:37:45 51.43969 2.0347 2550 742.44 18.94 89.15 13.78
134 20150101 05:37:46 51.43901 2.0354 2551 742.40 19.10 90.27 13.74
135 20150101 05:37:47 51.43833 2.0361 2552 742.34 19.45 90.77 13.74
136 20150101 05:37:48 51.43752 2.0369 2552 742.32 19.65 90.73 13.77
137 20150101 05:37:49 51.43698 2.0375 2553 742.22 19.68 90.82 13.79
138 20150101 05:37:50 51.43617 2.0383 2553 742.20 19.57 91.64 13.81
139 20150101 05:37:51 51.43563 2.0389 2554 742.14 19.45 91.21 13.87
140 20150101 05:37:52 51.43482 2.0398 2554 742.12 19.60 90.35 13.88
141 20150101 05:37:53 51.43428 2.0403 2554 742.10 18.98 90.66 13.90
142 20150101 05:37:54 51.43347 2.0412 2554 742.18 18.95 89.06 13.93
143 20150101 05:37:55 51.43293 2.0417 2554 742.16 18.98 87.92 13.93
144 20150101 05:37:56 51.43227 2.0424 2554 742.24 19.15 88.50 13.89
145 20150101 05:37:57 51.43159 2.0431 2554 742.20 18.86 88.21 13.91
146 20150101 05:37:58 51.43092 2.0438 2554 742.06 18.80 88.54 13.89
147 20150101 05:37:59 51.43025 2.0445 2554 742.10 18.98 89.64 13.89
148 20150101 05:38:00 51.42945 2.0454 2554 742.16 18.91 89.70 13.92
149 20150101 05:38:01 51.42891 2.0459 2555 742.14 18.91 89.12 13.91
150 20150101 05:38:02 51.42824 2.0466 2555 742.12 18.82 89.36 13.94
151 20150101 05:38:03 51.42758 2.0473 2555 742.02 18.56 89.75 13.93
152 20150101 05:38:04 51.42691 2.0480 2555 741.92 18.64 89.48 13.93
153 20150101 05:38:05 51.42624 2.0487 2556 742.12 18.72 89.02 13.94
154 20150101 05:38:06 51.42557 2.0494 2556 741.94 18.61 89.20 13.93
155 20150101 05:38:07 51.42490 2.0501 2556 741.98 18.80 89.66 13.95
156 20150101 05:38:08 51.42424 2.0508 2556 742.00 18.98 89.61 13.88
157 20150101 05:38:09 51.42344 2.0516 2556 741.86 18.71 89.60 13.87
158 20150101 05:38:10 51.42291 2.0522 2557 741.88 18.74 89.72 13.90
159 20150101 05:38:11 51.42224 2.0529 2557 741.86 18.61 90.03 13.94
160 20150101 05:45:15 51.15340 2.3331 3086 695.96 18.43 99.02 11.88
161 20150101 05:45:16 51.15277 2.3338 3085 695.94 18.38 99.05 11.92
162 20150101 05:45:17 51.15214 2.3344 3085 695.94 18.31 98.23 11.99
163 20150101 05:45:18 51.15151 2.3351 3085 695.98 18.77 98.64 11.94
164 20150101 05:45:19 51.15089 2.3357 3084 695.98 18.85 98.20 11.86
165 20150101 05:45:20 51.15025 2.3364 3084 696.04 18.69 98.27 11.86
166 20150101 05:45:21 51.14963 2.3371 3084 696.02 18.50 98.86 11.85
167 20150101 05:45:22 51.14899 2.3377 3084 696.16 18.60 97.66 11.89
168 20150101 05:45:23 51.14836 2.3384 3084 696.04 18.65 98.39 11.94
169 20150101 05:45:24 51.14773 2.3390 3083 696.14 18.33 99.42 12.00
170 20150101 05:45:25 51.14710 2.3397 3083 696.18 18.32 98.28 12.05
171 20150101 05:45:26 51.14647 2.3404 3083 696.18 18.54 97.09 12.05
172 20150101 05:45:27 51.14583 2.3410 3083 696.14 18.53 96.26 12.03
173 20150101 05:45:28 51.14520 2.3417 3082 696.24 18.54 96.85 11.98
174 20150101 05:45:29 51.14456 2.3424 3082 696.26 18.47 97.91 12.04
175 20150101 05:45:30 51.14392 2.3430 3082 696.16 18.49 97.83 12.07
176 20150101 05:45:31 51.14328 2.3437 3082 696.32 18.88 96.75 12.06
177 20150101 05:45:32 51.14264 2.3444 3082 696.28 18.78 97.59 12.04
178 20150101 05:45:33 51.14200 2.3450 3081 696.24 19.18 97.85 11.94
179 20150101 05:45:34 51.14137 2.3457 3081 696.18 19.32 98.90 11.89
180 20150101 05:45:35 51.14073 2.3464 3082 696.38 19.24 99.30 11.90
181 20150101 05:45:36 51.14009 2.3470 3082 696.32 19.42 99.04 11.95
182 20150101 05:45:37 51.13945 2.3477 3081 696.42 19.30 99.94 12.01
183 20150101 05:45:38 51.13881 2.3484 3081 696.42 19.02 99.29 12.08
184 20150101 05:45:39 51.13817 2.3490 3080 696.46 19.15 98.20 12.13
185 20150101 05:45:40 51.13753 2.3497 3079 696.52 19.25 98.24 12.11
186 20150101 05:45:41 51.13689 2.3504 3078 696.58 19.28 98.89 12.07

View File

@ -0,0 +1,72 @@
import numpy
import sys
from eccodes import *
csv_filename = sys.argv[1]
input_filename = sys.argv[2]
output_filename= sys.argv[3]
# Utility function to select a given column from matrix
def column(matrix, i):
return [row[i] for row in matrix]
fbufrin = open(input_filename, 'rb')
fbufrout = open(output_filename, 'wb')
print 'Using ecCodes version: ',codes_get_api_version()
colnames = ['ymd','time','latitude','longitude','altitude','pressure','windSpeed','windDirection','temperature'];
print 'Reading input CSV file: ', csv_filename
data = numpy.genfromtxt(csv_filename, delimiter=',', dtype=None, names=True)
ymd_column = data['ymd']
years = map(lambda x: int(str(x)[0:4]), ymd_column)
months = map(lambda x: int(str(x)[4:6]), ymd_column)
days = map(lambda x: int(str(x)[6:8]), ymd_column)
time_column = data['time']
hours = map(lambda x: int(str(x)[0:2]), time_column)
minutes = map(lambda x: int(str(x)[3:5]), time_column)
seconds = map(lambda x: int(str(x)[6:8]), time_column)
latitudes = data['latitude']
longitudes = data['longitude']
altitudes = data['altitude']
pressures = data['pressure']
windSpeeds = data['windSpeed']
windDirections = data['windDirection']
temperatures = data['temperature']
print 'Reading input BUFR file: ', input_filename
bufr = codes_bufr_new_from_file(fbufrin)
codes_set(bufr,'masterTablesVersionNumber',24);
codes_set(bufr,'localTablesVersionNumber',0);
codes_set(bufr,'compressedData',1);
codes_set(bufr,'numberOfSubsets',len(years));
unexpandedDescriptors=[301051, 4006,7002, 10004,12001, 11001, 11002, 11031, 11032, 11033, 20041];
codes_set_array(bufr,'unexpandedDescriptors',unexpandedDescriptors);
codes_set_double_array(bufr, 'year', years);
codes_set_double_array(bufr, 'month', months);
codes_set_double_array(bufr, 'day', days);
codes_set_double_array(bufr, 'hour', hours);
codes_set_double_array(bufr, 'minute', minutes);
codes_set_double_array(bufr, 'second', seconds);
codes_set_double_array(bufr, 'latitude', latitudes);
codes_set_double_array(bufr, 'longitude', longitudes);
codes_set_double_array(bufr, 'height', altitudes);
codes_set_double_array(bufr, 'pressure', pressures);
codes_set_double_array(bufr, 'windSpeed', windSpeeds);
codes_set_double_array(bufr, 'windDirection', windDirections);
codes_set_double_array(bufr, 'airTemperature', temperatures);
codes_set(bufr,'pack',1);
codes_write(bufr,fbufrout);
print 'Created output BUFR file: ',output_filename

View File

@ -0,0 +1,24 @@
#!/bin/sh
. ./include.sh
#-----------------------------------------------------
# Create a BUFR from flight data
#----------------------------------------------------
bufr_in=${data_dir}"/bufr/syno_1.bufr"
csv_in="flight_data.csv"
bufr_out="temp.make_flight_bufr.bufr"
#fRef=$f".header.ref"
#fRes=$f".header.test.p"
REDIRECT=/dev/null
$PYTHON $examples_src/make_flight_bufr.py $csv_in $bufr_in $bufr_out
#We compare output to the reference by ignoring the whitespaces
#diff -w $fRef $fRes
#Clean up
rm -f $bufr_out