From 68292bdd5b75b12b6deb6522d5df8d5d5b52d4d0 Mon Sep 17 00:00:00 2001 From: RoryPTB <47696929+RoryPTB@users.noreply.github.com> Date: Thu, 14 Sep 2023 11:47:43 +0200 Subject: [PATCH] No BUFR file written for NIL report + updated test metadata + bug fix --- data/gts_data/station_list.csv | 136 ++++++++++++------------ data/wis2box_data/station_list.csv | 160 ++++++++++++++--------------- synop2bufr/__init__.py | 23 ++++- 3 files changed, 167 insertions(+), 152 deletions(-) diff --git a/data/gts_data/station_list.csv b/data/gts_data/station_list.csv index 2713dd4..a53ca86 100644 --- a/data/gts_data/station_list.csv +++ b/data/gts_data/station_list.csv @@ -1,69 +1,69 @@ station_name,wigos_station_identifier,traditional_station_identifier,facility_type,latitude,longitude,elevation,barometer_height,territory_name -"CABO SAN ANTONIO, PINAR DEL RIO",0-20000-0-78310,78310,Land (fixed),21.86666667,84.95,,,Cuba -PINAR DEL RIO,0-20000-0-78315,78315,Land (fixed),22.41666667,83.68333333,,,Cuba -"BAHIA HONDA, PINAR DEL RIO",0-20000-0-78318,78318,Land (fixed),22.91666667,83.16666667,,,Cuba -"BATABANO, LA HABANA",0-20000-0-78322,78322,Land (fixed),22.71666667,82.28333333,,,Cuba -"PUNTA DEL ESTE, ISLA DE LA JUVENTUD",0-20000-0-78324,78324,Land (fixed),21.55,82.53333333,,,Cuba -"CASA BLANCA, LA HABANA",0-20000-0-78325,78325,Land (fixed),23.16666667,82.35,,,Cuba -VARADERO,0-20000-0-78328,78328,Land (fixed),23.25,81.41666667,,,Cuba -"PLAYA GIRON, MATANZAS",0-20000-0-78333,78333,Land (fixed),22.06666667,81.03333333,,,Cuba -"CANTARRANA, CIENFUEGOS",0-20000-0-78344,78344,Land (fixed),21.91666667,80.16666667,,,Cuba -"JUCARO, CIEGO DE AVILA",0-20000-0-78345,78345,Land (fixed),21.61666667,78.85,,,Cuba -"CAIBARIEN, VILLA CLARA",0-20000-0-78348,78348,Land (fixed),22.51666667,79.45,,,Cuba -"SANCTI SPIRITUS, SANCTI SPIRITUS",0-20000-0-78349,78349,Land (fixed),21.93333333,79.45,,,Cuba -"SANTA CRUZ DEL SUR, CAMAGUEY",0-20000-0-78351,78351,Land (fixed),20.71666667,78,,,Cuba -"NUEVITAS, CAMAGUEY",0-20000-0-78353,78353,Land (fixed),21.53333333,77.25,,,Cuba -CAMAGUEY,0-20000-0-78355,78355,Land (fixed),21.4,77.85,,,Cuba -"PUERTO PADRE, LAS TUNAS",0-20000-0-78358,78358,Land (fixed),21.2,76.61666667,,,Cuba -"CABO CRUZ, GRANMA",0-20000-0-78360,78360,Land (fixed),19.85,77.23333333,,,Cuba -"CONTRAMAESTRE, SANTIAGO DE CUBA",0-20000-0-78363,78363,Land (fixed),20.28333333,76.25,,,Cuba -"PUNTA LUCRECIA, HOLGUIN",0-20000-0-78365,78365,Land (fixed),21.06666667,75.61666667,,,Cuba -"PUNTA DE MAISI, GUANTANAMO",0-20000-0-78369,78369,Land (fixed),20.25,74.15,,,Cuba -X,0-20000-0-78308,78308,Land (fixed),0,0,,,Cuba -X,0-20000-0-78309,78309,Land (fixed),0,0,,,Cuba -"SANTA LUCIA, PINAR DEL RIO",0-20000-0-78312,78312,Land (fixed),22.66666667,83.96666667,,,Cuba -"ISABEL RUBIO, PINAR DEL RIO",0-20000-0-78313,78313,Land (fixed),22.16666667,84.1,,,Cuba -"SAN JUAN Y MARTINEZ, PINAR DEL RIO",0-20000-0-78314,78314,Land (fixed),22.28333333,83.83333333,,,Cuba -"LA PALMA, PINAR DEL RIO",0-20000-0-78316,78316,Land (fixed),22.76666667,83.55,,,Cuba -"PASO REAL DE SAN DIEGO, PINAR DEL RIO",0-20000-0-78317,78317,Land (fixed),22.55,83.3,,,Cuba -"ARTEMISA, LA HABANA",0-20000-0-78319,78319,Land (fixed),22.8,82.75,,,Cuba -"GUIRA DE MELENA, LA HABANA",0-20000-0-78320,78320,Land (fixed),22.78333333,82.51666667,,,Cuba -"LA FE, ISLA DE LA JUVENTUD",0-20000-0-78321,78321,Land (fixed),21.73333333,82.76666667,,,Cuba -"GUINES, LA HABANA",0-20000-0-78323,78323,Land (fixed),22.85,82.03333333,,,Cuba -X,0-20000-0-78326,78326,Land (fixed),0,0,,,Cuba -"UNION DE REYES, MATANZAS",0-20000-0-78327,78327,Land (fixed),22.76666667,81.53333333,,,Cuba -"INDIO HATUEY, MATANZAS",0-20000-0-78329,78329,Land (fixed),22.81666667,81,,,Cuba -"JOVELLANOS, MATANZAS",0-20000-0-78330,78330,Land (fixed),22.78333333,81.18333333,,,Cuba -"JAGUEY GRANDE, MATANZAS",0-20000-0-78331,78331,Land (fixed),22.63333333,81.26666667,,,Cuba -"COLON, MATANZAS",0-20000-0-78332,78332,Land (fixed),22.68333333,80.93333333,,,Cuba -X,0-20000-0-78334,78334,Land (fixed),0,0,,,Cuba -"AGUADA DE PASAJEROS, CIENFUEGOS",0-20000-0-78335,78335,Land (fixed),22.38333333,80.85,,,Cuba -"TRINIDAD, SANCTI SPIRITUS",0-20000-0-78337,78337,Land (fixed),21.78333333,79.98333333,,,Cuba -"SAGUA LA GRANDE, VILLA CLARA",0-20000-0-78338,78338,Land (fixed),22.81666667,80.08333333,,,Cuba -"CAYO COCO, CIEGO DE AVILA",0-20000-0-78339,78339,Land (fixed),22.51666667,78.45,,,Cuba -"BAINOA, LA HABANA",0-20000-0-78340,78340,Land (fixed),23.03333333,81.91666667,,,Cuba -"EL JIBARO, SANCTI SPIRITUS",0-20000-0-78341,78341,Land (fixed),21.71666667,79.21666667,,,Cuba -"TOPES DE COLLANTES, SANCTI SPIRITUS",0-20000-0-78342,78342,Land (fixed),21.91666667,80.01666667,,,Cuba -"EL YABU, VILLA CLARA",0-20000-0-78343,78343,Land (fixed),22.43333333,79.98333333,,,Cuba -"VENEZUELA, CIEGO DE AVILA",0-20000-0-78346,78346,Land (fixed),21.78333333,78.78333333,,,Cuba -"CAMILO CIENFUEGOS, CIEGO DE AVILA",0-20000-0-78347,78347,Land (fixed),22.15,78.75,,,Cuba -"FLORIDA, CAMAGUEY",0-20000-0-78350,78350,Land (fixed),21.51666667,78.23333333,,,Cuba -"ESMERALDA, CAMAGUEY",0-20000-0-78352,78352,Land (fixed),21.85,78.11666667,,,Cuba -"PALO SECO, CAMAGUEY",0-20000-0-78354,78354,Land (fixed),21.13333333,77.31666667,,,Cuba -X,0-20000-0-78356,78356,Land (fixed),0,0,,,Cuba -"LAS TUNAS, LAS TUNAS",0-20000-0-78357,78357,Land (fixed),20.95,76.95,,,Cuba -"MANSANILLO, GRANMA",0-20000-0-78359,78359,Land (fixed),20.33333333,77.13333333,,,Cuba -"JUCARITO, GRANMA",0-20000-0-78361,78361,Land (fixed),20.66666667," 76.9000",,,Cuba -"LA JIQUIMA, HOLGUIN",0-20000-0-78362,78362,Land (fixed),20.93333333,76.53333333,,,Cuba -"UNIVERSIDAD, SANTIAGO DE CUBA",0-20000-0-78364,78364,Land (fixed),20.05,75.81666667,,,Cuba -"GRAN PIEDRA, SANTIAGO DE CUBA",0-20000-0-78366,78366,Land (fixed),20.03333333,75.63333333,,,Cuba -"GUANTANAMO, GUANTANAMO",0-20000-0-78368,78368,Land (fixed),20.13333333,75.23333333,,,Cuba -"GUARO, HOLGUIN",0-20000-0-78370,78370,Land (fixed),20.66666667,75.78333333,,,Cuba -"PINARES DE MAYARI, HOLGUIN",0-20000-0-78371,78371,Land (fixed),20.48333333,75.8,,,Cuba -X,0-20000-0-78372,78372,Land (fixed),0,0,,,Cuba -"SANTIAGO DE LAS VEGAS, CIUDAD HABANA",0-20000-0-78373,78373,Land (fixed),22.96666667,82.38333333,,,Cuba -"TAPASTE, LA HABANA",0-20000-0-78374,78374,Land (fixed),23.01666667,82.13333333,,,Cuba -"MELENA DEL SUR, LA HABANA",0-20000-0-78375,78375,Land (fixed),22.76666667,82.13333333,,,Cuba -"BAUTA, LA HABANA",0-20000-0-78376,78376,Land (fixed),22.96666667,22.96666667,,,Cuba -"VEGUITAS, GRANMA",0-20000-0-78377,78377,Land (fixed),20.31666667,76.88333333,,,Cuba -"VELASCO, HOLGUIN",0-20000-0-78378,78378,Land (fixed),21.08333333,76.3,,,Cuba +"CABO SAN ANTONIO, PINAR DEL RIO",0-20000-0-78310,78310,Land (fixed),21.86666667,84.95,1.32,,Cuba +PINAR DEL RIO,0-20000-0-78315,78315,Land (fixed),22.41666667,83.68333333,57.5,,Cuba +"BAHIA HONDA, PINAR DEL RIO",0-20000-0-78318,78318,Land (fixed),22.91666667,83.16666667,1.25,,Cuba +"BATABANO, LA HABANA",0-20000-0-78322,78322,Land (fixed),22.71666667,82.28333333,14.5,,Cuba +"PUNTA DEL ESTE, ISLA DE LA JUVENTUD",0-20000-0-78324,78324,Land (fixed),21.55,82.53333333,7.4,,Cuba +"CASA BLANCA, LA HABANA",0-20000-0-78325,78325,Land (fixed),23.16666667,82.35,48.5,,Cuba +VARADERO,0-20000-0-78328,78328,Land (fixed),23.25,81.41666667,5,,Cuba +"PLAYA GIRON, MATANZAS",0-20000-0-78333,78333,Land (fixed),22.06666667,81.03333333,3.1,,Cuba +"CANTARRANA, CIENFUEGOS",0-20000-0-78344,78344,Land (fixed),21.91666667,80.16666667,0,,Cuba +"JUCARO, CIEGO DE AVILA",0-20000-0-78345,78345,Land (fixed),21.61666667,78.85,0.9,,Cuba +"CAIBARIEN, VILLA CLARA",0-20000-0-78348,78348,Land (fixed),22.51666667,79.45,44.5,,Cuba +"SANCTI SPIRITUS, SANCTI SPIRITUS",0-20000-0-78349,78349,Land (fixed),21.93333333,79.45,95.2,,Cuba +"SANTA CRUZ DEL SUR, CAMAGUEY",0-20000-0-78351,78351,Land (fixed),20.71666667,78,4.8,,Cuba +"NUEVITAS, CAMAGUEY",0-20000-0-78353,78353,Land (fixed),21.53333333,77.25,16.5,,Cuba +CAMAGUEY,0-20000-0-78355,78355,Land (fixed),21.4,77.85,123,,Cuba +"PUERTO PADRE, LAS TUNAS",0-20000-0-78358,78358,Land (fixed),21.2,76.61666667,10.2,,Cuba +"CABO CRUZ, GRANMA",0-20000-0-78360,78360,Land (fixed),19.85,77.23333333,4.9,,Cuba +"CONTRAMAESTRE, SANTIAGO DE CUBA",0-20000-0-78363,78363,Land (fixed),20.28333333,76.25,114.3,,Cuba +"PUNTA LUCRECIA, HOLGUIN",0-20000-0-78365,78365,Land (fixed),21.06666667,75.61666667,0.4,,Cuba +"PUNTA DE MAISI, GUANTANAMO",0-20000-0-78369,78369,Land (fixed),20.25,74.15,9.6,,Cuba +X,0-20000-0-78308,78308,Land (fixed),0,0,231,,Cuba +X,0-20000-0-78309,78309,Land (fixed),0,0,26.2,,Cuba +"SANTA LUCIA, PINAR DEL RIO",0-20000-0-78312,78312,Land (fixed),22.66666667,83.96666667,22.7,,Cuba +"ISABEL RUBIO, PINAR DEL RIO",0-20000-0-78313,78313,Land (fixed),22.16666667,84.1,26.7,,Cuba +"SAN JUAN Y MARTINEZ, PINAR DEL RIO",0-20000-0-78314,78314,Land (fixed),22.28333333,83.83333333,25.4,,Cuba +"LA PALMA, PINAR DEL RIO",0-20000-0-78316,78316,Land (fixed),22.76666667,83.55,40.9,,Cuba +"PASO REAL DE SAN DIEGO, PINAR DEL RIO",0-20000-0-78317,78317,Land (fixed),22.55,83.3,45.2,,Cuba +"ARTEMISA, LA HABANA",0-20000-0-78319,78319,Land (fixed),22.8,82.75,173,,Cuba +"GUIRA DE MELENA, LA HABANA",0-20000-0-78320,78320,Land (fixed),22.78333333,82.51666667,11.3,,Cuba +"LA FE, ISLA DE LA JUVENTUD",0-20000-0-78321,78321,Land (fixed),21.73333333,82.76666667,31.8,,Cuba +"GUINES, LA HABANA",0-20000-0-78323,78323,Land (fixed),22.85,82.03333333,56.1,,Cuba +X,0-192-0-78326,78326,Land (fixed),0,0,44.5,,Cuba +"UNION DE REYES, MATANZAS",0-20000-0-78327,78327,Land (fixed),22.76666667,81.53333333,28.6,,Cuba +"INDIO HATUEY, MATANZAS",0-20000-0-78329,78329,Land (fixed),22.81666667,81,17.6,,Cuba +"JOVELLANOS, MATANZAS",0-20000-0-78330,78330,Land (fixed),22.78333333,81.18333333,25.1,,Cuba +"JAGUEY GRANDE, MATANZAS",0-20000-0-78331,78331,Land (fixed),22.63333333,81.26666667,11.2,,Cuba +"COLON, MATANZAS",0-20000-0-78332,78332,Land (fixed),22.68333333,80.93333333,39.1,,Cuba +"PALENQUE DE YATERAS, GUANTANAMO",0-192-0-78334,78334,Land (fixed),20.3675,74.95638889,438,,Cuba +"AGUADA DE PASAJEROS, CIENFUEGOS",0-20000-0-78335,78335,Land (fixed),22.38333333,80.8258,27.1,,Cuba +"TRINIDAD, SANCTI SPIRITUS",0-20000-0-78337,78337,Land (fixed),21.78333333,79.98333333,21.4,,Cuba +"SAGUA LA GRANDE, VILLA CLARA",0-20000-0-78338,78338,Land (fixed),22.81666667,80.08333333,10.9,,Cuba +"CAYO COCO, CIEGO DE AVILA",0-20000-0-78339,78339,Land (fixed),22.51666667,78.45,3.3,,Cuba +"BAINOA, LA HABANA",0-20000-0-78340,78340,Land (fixed),23.03333333,81.91666667,97.6,,Cuba +"EL JIBARO, SANCTI SPIRITUS",0-20000-0-78341,78341,Land (fixed),21.71666667,79.21666667,30.2,,Cuba +"TOPES DE COLLANTES, SANCTI SPIRITUS",0-20000-0-78342,78342,Land (fixed),21.91666667,80.01666667,759.9,,Cuba +"EL YABU, VILLA CLARA",0-20000-0-78343,78343,Land (fixed),22.43333333,79.98333333,115.3,,Cuba +"VENEZUELA, CIEGO DE AVILA",0-20000-0-78346,78346,Land (fixed),21.78333333,78.78333333,26.4,,Cuba +"CAMILO CIENFUEGOS, CIEGO DE AVILA",0-20000-0-78347,78347,Land (fixed),22.15,78.75,15.9,,Cuba +"FLORIDA, CAMAGUEY",0-20000-0-78350,78350,Land (fixed),21.51666667,78.23333333,57.5,,Cuba +"ESMERALDA, CAMAGUEY",0-20000-0-78352,78352,Land (fixed),21.85,78.11666667,35,,Cuba +"PALO SECO, CAMAGUEY",0-20000-0-78354,78354,Land (fixed),21.13333333,77.31666667,95.5,,Cuba +"JAMAL, GUANTANAMO",0-192-0-78356,78356,Land (fixed),20.2977777,74.44638888,48.3,,Cuba +"LAS TUNAS, LAS TUNAS",0-20000-0-78357,78357,Land (fixed),20.95,76.95,107.3,,Cuba +"MANSANILLO, GRANMA",0-192-0-78359,78359,Land (fixed),20.33333333,77.13333333,0.7,,Cuba +"JUCARITO, GRANMA",0-20000-0-78361,78361,Land (fixed),20.66666667," 76.9000",12.6,,Cuba +"LA JIQUIMA, HOLGUIN",0-20000-0-78362,78362,Land (fixed),20.93333333,76.53333333,112.6,,Cuba +"UNIVERSIDAD, SANTIAGO DE CUBA",0-20000-0-78364,78364,Land (fixed),20.05,75.81666667,0,,Cuba +"GRAN PIEDRA, SANTIAGO DE CUBA",0-20000-0-78366,78366,Land (fixed),20.03333333,75.63333333,998.3,,Cuba +"GUANTANAMO, GUANTANAMO",0-20000-0-78368,78368,Land (fixed),20.13333333,75.23333333,53.4,,Cuba +"GUARO, HOLGUIN",0-20000-0-78370,78370,Land (fixed),20.66666667,75.78333333,18.1,,Cuba +"PINARES DE MAYARI, HOLGUIN",0-20000-0-78371,78371,Land (fixed),20.48333333,75.8,645.4,,Cuba +"PEDAGOGICO, HOLGUIN",0-192-0-78372,78372,Land (fixed),20.885,76.22083333,149.4,,Cuba +"SANTIAGO DE LAS VEGAS, CIUDAD HABANA",0-20000-0-78373,78373,Land (fixed),22.96666667,82.38333333,75.8,,Cuba +"TAPASTE, LA HABANA",0-20000-0-78374,78374,Land (fixed),23.01666667,82.13333333,123.8,,Cuba +"MELENA DEL SUR, LA HABANA",0-20000-0-78375,78375,Land (fixed),22.76666667,82.13333333,22.1,,Cuba +"BAUTA, ARTEMISA",0-20000-0-78376,78376,Land (fixed),22.96666667,82.53777777,67.1,,Cuba +"VEGUITAS, GRANMA",0-20000-0-78377,78377,Land (fixed),20.31666667,76.88333333,20.4,,Cuba +"VELASCO, HOLGUIN",0-20000-0-78378,78378,Land (fixed),21.08333333,76.3,65.7,,Cuba diff --git a/data/wis2box_data/station_list.csv b/data/wis2box_data/station_list.csv index ef8dd50..a4bf8b2 100644 --- a/data/wis2box_data/station_list.csv +++ b/data/wis2box_data/station_list.csv @@ -1,80 +1,80 @@ -station_name,wigos_station_identifier,traditional_station_identifier,facility_type,latitude,longitude,elevation,territory_name,wmo_region -BONIFATI (16337-0),0-20000-0-16337,16337,Land (fixed),39.5847222222,15.8913888889,484,Italy,6 -DECIMOMANNU,0-20000-0-16546,16546,Land (fixed),39.3461111111,8.9675,29,Italy,6 -CAMPOBASSO,0-20000-0-16252,16252,Land (fixed),41.5636111111,14.655,793,Italy,6 -GRAZZANISE,0-20000-0-16253,16253,Land (fixed),41.0605555556,14.0788888889,9.19,Italy,6 -PRATICA DI MARE,0-20000-0-16245,16245,Land (fixed),41.6555555556,12.4480555556,12.3,Italy,6 -ILLIZI,0-20000-0-60640,60640,Land (fixed),26.71916,8.61722,542,Algeria,1 -SKIKDA,0-20000-0-60355,60355,Land (fixed),36.88178,6.93503,2,Algeria,1 -PIAN ROSA,0-20000-0-16052,16052,Land (fixed),45.935,7.7061111111,3480,Italy,6 -PRIZZI,0-20000-0-16434,16434,Land (fixed),37.7227777778,13.4280555556,1034,Italy,6 -DOBBIACO,0-20000-0-16033,16033,Land (fixed),46.73,12.22,1222,Italy,6 -CATANIA SIGONELLA,0-20000-0-16459,16459,Land (fixed),37.4055555556,14.9186111111,24,Italy,6 -BALAKA,0-454-2-AWSBALAKA,AWSBALAKA,Land (fixed),-14.983333,34.966666,618,Malawi,1 -MECHERIA,0-20000-0-60549,60549,Land (fixed),33.54581,-0.23527,1123.2,Algeria,1 -TERMOLI,0-20000-0-16232,16232,Land (fixed),42.0041666667,14.9963888889,16,Italy,6 -VIGNA DI VALLE,0-20000-0-16224,16224,Land (fixed),42.0802777778,12.2113888889,260,Italy,6 -HASSI-MESSAOUD,0-20000-0-60581,60581,Land (fixed),31.65861,6.14138,140,Algeria,1 -DJELFA,0-20000-0-60535,60535,Land (fixed),34.65361,3.28138,1180,Algeria,1 -PAGANELLA,0-20000-0-16022,16022,Land (fixed),46.1597222222,11.0341666667,2125,Italy,6 -MONTE S. ANGELO,0-20000-0-16258,16258,Land (fixed),41.7083333333,15.9477777778,838,Italy,6 -MALOMO,0-454-2-AWSMALOMO,AWSMALOMO,Land (fixed),-13.14202,33.83727,1088,Malawi,1 -TREVICO,0-20000-0-16263,16263,Land (fixed),41.0466666667,15.2327777778,1085,Italy,6 -EL-OUED,0-20000-0-60559,60559,Land (fixed),33.50618,6.78841,63,Algeria,1 -TIMIMOUN,0-20000-0-60607,60607,Land (fixed),29.24412,0.28385,312,Algeria,1 -CONCORDIA,0-20000-0-89625,89625,Land (fixed),-75.1016666667,123.4119444444,3233,Italy,7 -TOUGGOURT,0-20000-0-60555,60555,Land (fixed),33.07011,6.09208,87,Algeria,1 -MONTE SCURO,0-20000-0-16344,16344,Land (fixed),39.3305555556,16.3963888889,1669,Italy,6 -BATNA,0-20000-0-60468,60468,Land (fixed),35.76083,6.31972,821,Algeria,1 -ENNA,0-20000-0-16450,16450,Land (fixed),37.5680555556,14.2797222222,1000,Italy,6 -NAMITAMBO,0-454-2-AWSNAMITAMBO,AWSNAMITAMBO,Land (fixed),-15.84052,35.27428,806,Malawi,1 -TOLEZA,0-454-2-AWSTOLEZA,AWSTOLEZA,Land (fixed),-14.948,34.955,764,Malawi,1 -IN-GUEZZAM,0-20000-0-60690,60690,Land (fixed),19.56388,5.74887,399,Algeria,1 -BRIC DELLA CROCE,0-20000-0-16061,16061,Land (fixed),45.0333333333,7.7316666667,709,Italy,6 -TREVISO/ISTRANA,0-20000-0-16098,16098,Land (fixed),45.6838888889,12.1066666667,42,Italy,6 -KAYEREKERA,0-454-2-AWSKAYEREKERA,AWSKAYEREKERA,Land (fixed),-9.92951,33.67305,848,Malawi,1 -LOBI AWS,0-454-2-AWSLOBI,AWSLOBI,Land (fixed),-14.39528,34.07244,1288,Malawi,1 -CERVIA,0-20000-0-16148,16148,Land (fixed),44.2288888889,12.2919444444,6,Italy,6 -NKHOMA UNIVERSITY,0-454-2-AWSNKHOMA,AWSNKHOMA,Land (fixed),-14.04422,34.10468,1230,Malawi,1 -SAIDA,0-20000-0-60536,60536,Land (fixed),34.89186,0.15774,750,Algeria,1 -PASSO ROLLE,0-20000-0-16021,16021,Land (fixed),46.2977777778,11.7866666667,2004,Italy,6 -AREZZO,0-20000-0-16172,16172,Land (fixed),43.4597222222,11.8455555556,248,Italy,6 -CAPRI,0-20000-0-16294,16294,Land (fixed),40.5577777778,14.2019444444,160,Italy,6 -TARVISIO,0-20000-0-16040,16040,Land (fixed),46.5055555556,13.5861111111,777,Italy,6 -SETIF/AIN ARNAT,0-20000-0-60445,60445,Land (fixed),36.1666666667,5.3166666667,1009,Algeria,1 -JIJEL- ACHOUAT,0-20000-0-60351,60351,Land (fixed),36.79472,5.87722,8,Algeria,1 -MONTE ARGENTARIO,0-20000-0-16168,16168,Land (fixed),42.3869444444,11.1697222222,630.7,Italy,6 -CAPO CARBONARA,0-20000-0-16564,16564,Land (fixed),39.1038888889,9.5136111111,116,Italy,6 -ANNABA,0-20000-0-60360,60360,Land (fixed),36.822222,7.8025,5,Algeria,1 -BENI-ABBES,0-20000-0-60602,60602,Land (fixed),30.12846,-2.14953,510,Algeria,1 -FRONTONE,0-20000-0-16179,16179,Land (fixed),43.5169444444,12.7277777778,570,Italy,6 -FERRARA (16138-0),0-20000-0-16138,16138,Land (fixed),44.8155555556,11.6125,8,Italy,6 -TIARET,0-20000-0-60511,60511,Land (fixed),35.35542,1.46792,977,Algeria,1 -MASCARA-GHRISS,0-20000-0-60507,60507,Land (fixed),35.20666,0.1525,511,Algeria,1 -EL-BAYADH,0-20000-0-60550,60550,Land (fixed),33.71966,1.09484,1361,Algeria,1 -USTICA,0-20000-0-16400,16400,Land (fixed),38.7072222222,13.1772222222,242,Italy,6 -GROSSETO,0-20000-0-16206,16206,Land (fixed),42.7480555556,11.0588888889,5.4,Italy,6 -BENI OUNIF,0-12-0-08BECCN60577,60577,Land (fixed),32.05138,-1.26527,830,Algeria,1 -OCNA SUGATAG,0-20000-0-15015,15015,Land (fixed),47.7770616258,23.9404602638,503,Romania,6 -BOTOSANI,0-20000-0-15020,15020,Land (fixed),47.7356532437,26.6455501701,161,Romania,6 -IASI,0-20000-0-15090,15090,Land (fixed),47.163333333,27.6272222222,74.29,Romania,6 -CEAHLAU TOACA,0-20000-0-15108,15108,Land (fixed),46.9775099973,25.9499399749,1897,Romania,6 -CLUJ-NAPOCA,0-20000-0-15120,15120,Land (fixed),46.7777705044,23.5713052939,410,Romania,6 -BACAU,0-20000-0-15150,15150,Land (fixed),46.5577777778,26.8966666667,174,Romania,6 -MIERCUREA CIUC,0-20000-0-15170,15170,Land (fixed),46.3713166568,25.7726166755,661,Romania,6 -ARAD,0-20000-0-15200,15200,Land (fixed),46.1335163958,21.3536215174,116.59,Romania,6 -DEVA,0-20000-0-15230,15230,Land (fixed),45.8649230138,22.898806236,240,Romania,6 -SIBIU,0-20000-0-15260,15260,Land (fixed),45.79018,24.036245,450,Romania,6 -VARFU OMU,0-20000-0-15280,15280,Land (fixed),45.4457927989,25.456690976,2504,Romania,6 -CARANSEBES,0-20000-0-15292,15292,Land (fixed),45.41667,22.22917,241,Romania,6 -GALATI,0-20000-0-15310,15310,Land (fixed),45.4729181384,28.0323010582,69,Romania,6 -TULCEA,0-20000-0-15335,15335,Land (fixed),45.1905064849,28.8241607619,4.36,Romania,6 -RAMNICU VALCEA,0-20000-0-15346,15346,Land (fixed),45.0888211225,24.3628139123,237,Romania,6 -BUZAU,0-20000-0-15350,15350,Land (fixed),45.1326632857,26.8517319231,97,Romania,6 -SULINA,0-20000-0-15360,15360,Land (fixed),45.1623111,29.7268286,12.69,Romania,6 -DROBETA-TURNU SEVERIN,0-20000-0-15410,15410,Land (fixed),44.6264587019,22.6260737132,77,Romania,6 -BUCURESTI BANEASA,0-20000-0-15420,15420,Land (fixed),44.5104330044,26.0781904077,90,Romania,6 -CRAIOVA,0-20000-0-15450,15450,Land (fixed),44.3101404313,23.8669847441,192,Romania,6 -CALARASI,0-20000-0-15460,15460,Land (fixed),44.2057385289,27.3383080718,18.72,Romania,6 -ROSIORII DE VEDE,0-20000-0-15470,15470,Land (fixed),44.1072133362,24.9787400713,102.15,Romania,6 -CONSTANTA,0-20000-0-15480,15480,Land (fixed),44.2138143888,28.6455646839,12.8,Romania,6 +station_name,wigos_station_identifier,traditional_station_identifier,facility_type,latitude,longitude,elevation,barometer_height,territory_name,wmo_region +BONIFATI (16337-0),0-20000-0-16337,16337,Land (fixed),39.58472222,15.89138889,484,,Italy,6 +DECIMOMANNU,0-20000-0-16546,16546,Land (fixed),39.34611111,8.9675,29,,Italy,6 +CAMPOBASSO,0-20000-0-16252,16252,Land (fixed),41.56361111,14.655,793,,Italy,6 +GRAZZANISE,0-20000-0-16253,16253,Land (fixed),41.06055556,14.07888889,9.19,,Italy,6 +PRATICA DI MARE,0-20000-0-16245,16245,Land (fixed),41.65555556,12.44805556,12.3,,Italy,6 +ILLIZI,0-20000-0-60640,60640,Land (fixed),26.71916,8.61722,542,,Algeria,1 +SKIKDA,0-20000-0-60355,60355,Land (fixed),36.88178,6.93503,2,,Algeria,1 +PIAN ROSA,0-20000-0-16052,16052,Land (fixed),45.935,7.706111111,3480,,Italy,6 +PRIZZI,0-20000-0-16434,16434,Land (fixed),37.72277778,13.42805556,1034,,Italy,6 +DOBBIACO,0-20000-0-16033,16033,Land (fixed),46.73,12.22,1222,,Italy,6 +CATANIA SIGONELLA,0-20000-0-16459,16459,Land (fixed),37.40555556,14.91861111,24,,Italy,6 +BALAKA,0-454-2-AWSBALAKA,AWSBALAKA,Land (fixed),-14.983333,34.966666,618,,Malawi,1 +MECHERIA,0-20000-0-60549,60549,Land (fixed),33.54581,-0.23527,1123.2,,Algeria,1 +TERMOLI,0-20000-0-16232,16232,Land (fixed),42.00416667,14.99638889,16,,Italy,6 +VIGNA DI VALLE,0-20000-0-16224,16224,Land (fixed),42.08027778,12.21138889,260,,Italy,6 +HASSI-MESSAOUD,0-20000-0-60581,60581,Land (fixed),31.65861,6.14138,140,,Algeria,1 +DJELFA,0-20000-0-60535,60535,Land (fixed),34.65361,3.28138,1180,,Algeria,1 +PAGANELLA,0-20000-0-16022,16022,Land (fixed),46.15972222,11.03416667,2125,,Italy,6 +MONTE S. ANGELO,0-20000-0-16258,16258,Land (fixed),41.70833333,15.94777778,838,,Italy,6 +MALOMO,0-454-2-AWSMALOMO,AWSMALOMO,Land (fixed),-13.14202,33.83727,1088,,Malawi,1 +TREVICO,0-20000-0-16263,16263,Land (fixed),41.04666667,15.23277778,1085,,Italy,6 +EL-OUED,0-20000-0-60559,60559,Land (fixed),33.50618,6.78841,63,,Algeria,1 +TIMIMOUN,0-20000-0-60607,60607,Land (fixed),29.24412,0.28385,312,,Algeria,1 +CONCORDIA,0-20000-0-89625,89625,Land (fixed),-75.10166667,123.4119444,3233,,Italy,7 +TOUGGOURT,0-20000-0-60555,60555,Land (fixed),33.07011,6.09208,87,,Algeria,1 +MONTE SCURO,0-20000-0-16344,16344,Land (fixed),39.33055556,16.39638889,1669,,Italy,6 +BATNA,0-20000-0-60468,60468,Land (fixed),35.76083,6.31972,821,,Algeria,1 +ENNA,0-20000-0-16450,16450,Land (fixed),37.56805556,14.27972222,1000,,Italy,6 +NAMITAMBO,0-454-2-AWSNAMITAMBO,AWSNAMITAMBO,Land (fixed),-15.84052,35.27428,806,,Malawi,1 +TOLEZA,0-454-2-AWSTOLEZA,AWSTOLEZA,Land (fixed),-14.948,34.955,764,,Malawi,1 +IN-GUEZZAM,0-20000-0-60690,60690,Land (fixed),19.56388,5.74887,399,,Algeria,1 +BRIC DELLA CROCE,0-20000-0-16061,16061,Land (fixed),45.03333333,7.731666667,709,,Italy,6 +TREVISO/ISTRANA,0-20000-0-16098,16098,Land (fixed),45.68388889,12.10666667,42,,Italy,6 +KAYEREKERA,0-454-2-AWSKAYEREKERA,AWSKAYEREKERA,Land (fixed),-9.92951,33.67305,848,,Malawi,1 +LOBI AWS,0-454-2-AWSLOBI,AWSLOBI,Land (fixed),-14.39528,34.07244,1288,,Malawi,1 +CERVIA,0-20000-0-16148,16148,Land (fixed),44.22888889,12.29194444,6,,Italy,6 +NKHOMA UNIVERSITY,0-454-2-AWSNKHOMA,AWSNKHOMA,Land (fixed),-14.04422,34.10468,1230,,Malawi,1 +SAIDA,0-20000-0-60536,60536,Land (fixed),34.89186,0.15774,750,,Algeria,1 +PASSO ROLLE,0-20000-0-16021,16021,Land (fixed),46.29777778,11.78666667,2004,,Italy,6 +AREZZO,0-20000-0-16172,16172,Land (fixed),43.45972222,11.84555556,248,,Italy,6 +CAPRI,0-20000-0-16294,16294,Land (fixed),40.55777778,14.20194444,160,,Italy,6 +TARVISIO,0-20000-0-16040,16040,Land (fixed),46.50555556,13.58611111,777,,Italy,6 +SETIF/AIN ARNAT,0-20000-0-60445,60445,Land (fixed),36.16666667,5.316666667,1009,,Algeria,1 +JIJEL- ACHOUAT,0-20000-0-60351,60351,Land (fixed),36.79472,5.87722,8,,Algeria,1 +MONTE ARGENTARIO,0-20000-0-16168,16168,Land (fixed),42.38694444,11.16972222,630.7,,Italy,6 +CAPO CARBONARA,0-20000-0-16564,16564,Land (fixed),39.10388889,9.513611111,116,,Italy,6 +ANNABA,0-20000-0-60360,60360,Land (fixed),36.822222,7.8025,5,,Algeria,1 +BENI-ABBES,0-20000-0-60602,60602,Land (fixed),30.12846,-2.14953,510,,Algeria,1 +FRONTONE,0-20000-0-16179,16179,Land (fixed),43.51694444,12.72777778,570,,Italy,6 +FERRARA (16138-0),0-20000-0-16138,16138,Land (fixed),44.81555556,11.6125,8,,Italy,6 +TIARET,0-20000-0-60511,60511,Land (fixed),35.35542,1.46792,977,,Algeria,1 +MASCARA-GHRISS,0-20000-0-60507,60507,Land (fixed),35.20666,0.1525,511,,Algeria,1 +EL-BAYADH,0-20000-0-60550,60550,Land (fixed),33.71966,1.09484,1361,,Algeria,1 +USTICA,0-20000-0-16400,16400,Land (fixed),38.70722222,13.17722222,242,,Italy,6 +GROSSETO,0-20000-0-16206,16206,Land (fixed),42.74805556,11.05888889,5.4,,Italy,6 +BENI OUNIF,0-12-0-08BECCN60577,60577,Land (fixed),32.05138,-1.26527,830,,Algeria,1 +OCNA SUGATAG,0-20000-0-15015,15015,Land (fixed),47.77706163,23.94046026,503,,Romania,6 +BOTOSANI,0-20000-0-15020,15020,Land (fixed),47.73565324,26.64555017,161,,Romania,6 +IASI,0-20000-0-15090,15090,Land (fixed),47.16333333,27.62722222,74.29,,Romania,6 +CEAHLAU TOACA,0-20000-0-15108,15108,Land (fixed),46.97751,25.94993997,1897,,Romania,6 +CLUJ-NAPOCA,0-20000-0-15120,15120,Land (fixed),46.7777705,23.57130529,410,,Romania,6 +BACAU,0-20000-0-15150,15150,Land (fixed),46.55777778,26.89666667,174,,Romania,6 +MIERCUREA CIUC,0-20000-0-15170,15170,Land (fixed),46.37131666,25.77261668,661,,Romania,6 +ARAD,0-20000-0-15200,15200,Land (fixed),46.1335164,21.35362152,116.59,,Romania,6 +DEVA,0-20000-0-15230,15230,Land (fixed),45.86492301,22.89880624,240,,Romania,6 +SIBIU,0-20000-0-15260,15260,Land (fixed),45.79018,24.036245,450,,Romania,6 +VARFU OMU,0-20000-0-15280,15280,Land (fixed),45.4457928,25.45669098,2504,,Romania,6 +CARANSEBES,0-20000-0-15292,15292,Land (fixed),45.41667,22.22917,241,,Romania,6 +GALATI,0-20000-0-15310,15310,Land (fixed),45.47291814,28.03230106,69,,Romania,6 +TULCEA,0-20000-0-15335,15335,Land (fixed),45.19050648,28.82416076,4.36,,Romania,6 +RAMNICU VALCEA,0-20000-0-15346,15346,Land (fixed),45.08882112,24.36281391,237,,Romania,6 +BUZAU,0-20000-0-15350,15350,Land (fixed),45.13266329,26.85173192,97,,Romania,6 +SULINA,0-20000-0-15360,15360,Land (fixed),45.1623111,29.7268286,12.69,,Romania,6 +DROBETA-TURNU SEVERIN,0-20000-0-15410,15410,Land (fixed),44.6264587,22.62607371,77,,Romania,6 +BUCURESTI BANEASA,0-20000-0-15420,15420,Land (fixed),44.510433,26.07819041,90,,Romania,6 +CRAIOVA,0-20000-0-15450,15450,Land (fixed),44.31014043,23.86698474,192,,Romania,6 +CALARASI,0-20000-0-15460,15460,Land (fixed),44.20573853,27.33830807,18.72,,Romania,6 +ROSIORII DE VEDE,0-20000-0-15470,15470,Land (fixed),44.10721334,24.97874007,102.15,,Romania,6 +CONSTANTA,0-20000-0-15480,15480,Land (fixed),44.21381439,28.64556468,12.8,,Romania,6 diff --git a/synop2bufr/__init__.py b/synop2bufr/__init__.py index b3be619..7b8cb9d 100644 --- a/synop2bufr/__init__.py +++ b/synop2bufr/__init__.py @@ -348,7 +348,7 @@ def parse_synop(message: str, year: int, month: int) -> dict: # log a warning and set both values to None if A < D: LOGGER.warning(f"Reported dewpoint temperature {D} is greater than the reported air temperature {A}. Elements set to missing") # noqa - warning_msgs.append(f"Reported dewpoint temperature {D} is greater than the reported air temperature {A}. Elements set to missing") # noqa + warning_msgs.append(f"Reported dewpoint temperature {D} is greater than the reported air temperature {A}. Elements set to missing") # noqa output['air_temperature'] = None output['dewpoint_temperature'] = None @@ -1340,6 +1340,18 @@ def transform(data: str, metadata: str, year: int, # check we have data if message is None: continue + + # Check data is just a NIL report, if so warn the user and do + # not create an empty BUFR file + nil_pattern = r"^[A-Za-z]{4} \d{5} (\d{5}) [Nn][Il][Ll]$" + match = re.match(nil_pattern, message) + if match: + LOGGER.warning( + f"NIL report detected for station {match.group(1)}, no BUFR file created.") # noqa + warning_msgs.append( + f"NIL report detected for station {match.group(1)}, no BUFR file created.") # noqa + continue + # create dictionary to store / return result in result = dict() @@ -1444,7 +1456,8 @@ def transform(data: str, metadata: str, year: int, {"eccodes_key": f"#{idx+2}#heightOfBaseOfCloud", "value": f"data:cloud_height_s3_{idx+1}"} ] - mapping.update(s3_mappings[i] for i in range(4)) + for m in s3_mappings: + mapping.update(m) for idx in range(num_s4_clouds): # Based upon the station height metadata, the @@ -1480,8 +1493,10 @@ def transform(data: str, metadata: str, year: int, {"eccodes_key": f"#{idx+1}#cloudTopDescription", "value": f"data:cloud_top_s4_{idx+1}"} ] - mapping.update(s4_mappings[i] for i in range(4)) - except Exception: + for m in s4_mappings: + mapping.update(m) + except Exception as e: + LOGGER.error(e) LOGGER.error(f"Missing station height for station {tsi}") error_msgs.append( f"Missing station height for station {tsi}")