diff --git a/tests/resources/meteo_fill_df.csv b/tests/resources/meteo_fill_df.csv new file mode 100644 index 0000000..38b168a --- /dev/null +++ b/tests/resources/meteo_fill_df.csv @@ -0,0 +1,193 @@ +datetime (UTC),text__°C__outdoor,tdp__°C__outdoor,pressure__Pa__outdoor,wind_speed__m/s__outdoor,100m_wind_speed__m/s__outdoor,rh__0-1__outdoor,gh__W/m²__outdoor,dni__W/m²__outdoor,dhi__W/m²__outdoor,surface_thermal_radiation__W/m²__outdoor,total_cloud_cover__0-1cloud__outdoor,total_precipitation__mm__outdoor +2009-07-11 00:00:00+00:00,8.43,5.74,100217.84,14.65,19.28,0.83,26.15,3.71,25.68,315.92,1.0,0.04 +2009-07-11 00:15:00+00:00,8.5225,5.775,100190.18,14.875,19.6675,0.8274999999999999,20.2225,2.7825,19.88,317.27250000000004,1.0,0.09 +2009-07-11 00:30:00+00:00,8.615,5.8100000000000005,100162.52,15.1,20.055,0.825,14.295,1.855,14.08,318.625,1.0,0.1399999999999999 +2009-07-11 00:45:00+00:00,8.7075,5.845,100134.86,15.325,20.4425,0.8225,8.3675,0.9275000000000002,8.280000000000001,319.9775,1.0,0.19 +2009-07-11 01:00:00+00:00,8.8,5.88,100107.2,15.55,20.83,0.82,2.44,0.0,2.48,321.33,1.0,0.24 +2009-07-11 01:15:00+00:00,8.8675,5.9475,100085.0125,15.6275,20.9875,0.82,1.83,0.0,1.86,324.2275,1.0,0.295 +2009-07-11 01:30:00+00:00,8.935,6.015000000000001,100062.825,15.705,21.145,0.82,1.22,0.0,1.24,327.125,1.0,0.35 +2009-07-11 01:45:00+00:00,9.002500000000001,6.0825000000000005,100040.6375,15.7825,21.3025,0.82,0.6099999999999999,0.0,0.6200000000000001,330.02250000000004,1.0,0.405 +2009-07-11 02:00:00+00:00,9.07,6.15,100018.45,15.86,21.46,0.82,0.0,0.0,0.0,332.92,1.0,0.46 +2009-07-11 02:15:00+00:00,9.1175,6.220000000000001,99995.3575,15.8625,21.465,0.82,0.0,0.0,0.0,334.0375,1.0,0.4875 +2009-07-11 02:30:00+00:00,9.165,6.29,99972.265,15.864999999999998,21.47,0.82,0.0,0.0,0.0,335.155,1.0,0.515 +2009-07-11 02:45:00+00:00,9.2125,6.359999999999999,99949.1725,15.8675,21.475,0.82,0.0,0.0,0.0,336.2725,1.0,0.5425 +2009-07-11 03:00:00+00:00,9.26,6.43,99926.08,15.87,21.48,0.82,0.0,0.0,0.0,337.39,1.0,0.57 +2009-07-11 03:15:00+00:00,9.2875,6.46,99915.785,15.945,21.5675,0.8225,0.0,0.0,0.0,339.7175,1.0,0.6124999999999999 +2009-07-11 03:30:00+00:00,9.315,6.49,99905.49,16.02,21.655,0.825,0.0,0.0,0.0,342.045,1.0,0.655 +2009-07-11 03:45:00+00:00,9.3425,6.52,99895.195,16.095000000000002,21.7425,0.8274999999999999,0.0,0.0,0.0,344.3725,1.0,0.6975 +2009-07-11 04:00:00+00:00,9.37,6.55,99884.9,16.17,21.83,0.83,0.0,0.0,0.0,346.7,1.0,0.74 +2009-07-11 04:15:00+00:00,9.385,6.57,99868.5675,16.1175,21.7375,0.83,0.0,0.0,0.0,347.115,1.0,0.7875 +2009-07-11 04:30:00+00:00,9.4,6.59,99852.235,16.065,21.645,0.83,0.0,0.0,0.0,347.53,1.0,0.835 +2009-07-11 04:45:00+00:00,9.415,6.609999999999999,99835.9025,16.012500000000003,21.5525,0.83,0.0,0.0,0.0,347.945,1.0,0.8825000000000001 +2009-07-11 05:00:00+00:00,9.43,6.63,99819.57,15.96,21.46,0.83,0.0,0.0,0.0,348.36,1.0,0.93 +2009-07-11 05:15:00+00:00,9.4175,6.6625,99799.145,15.7675,21.1775,0.8325,0.0,0.0,0.0,347.71750000000003,1.0,0.9575 +2009-07-11 05:30:00+00:00,9.405,6.695,99778.72,15.575,20.895,0.835,0.0,0.0,0.0,347.07500000000005,1.0,0.985 +2009-07-11 05:45:00+00:00,9.3925,6.7275,99758.295,15.3825,20.6125,0.8374999999999999,0.0,0.0,0.0,346.4325,1.0,1.0125 +2009-07-11 06:00:00+00:00,9.38,6.76,99737.87,15.19,20.33,0.84,0.0,0.0,0.0,345.79,1.0,1.04 +2009-07-11 06:15:00+00:00,9.3575,6.779999999999999,99715.675,15.1675,20.265,0.8425,0.0,0.0,0.0,346.365,1.0,1.215 +2009-07-11 06:30:00+00:00,9.335,6.8,99693.48,15.145,20.2,0.845,0.0,0.0,0.0,346.94,1.0,1.39 +2009-07-11 06:45:00+00:00,9.3125,6.82,99671.285,15.1225,20.135,0.8474999999999999,0.0,0.0,0.0,347.515,1.0,1.565 +2009-07-11 07:00:00+00:00,9.29,6.84,99649.09,15.1,20.07,0.85,0.0,0.0,0.0,348.09,1.0,1.74 +2009-07-11 07:15:00+00:00,9.255,6.83,99622.025,14.99,19.905,0.85,0.0,0.0,0.0,348.53,1.0,1.95 +2009-07-11 07:30:00+00:00,9.22,6.82,99594.96,14.88,19.74,0.85,0.0,0.0,0.0,348.97,1.0,2.16 +2009-07-11 07:45:00+00:00,9.185,6.81,99567.895,14.77,19.575,0.85,0.0,0.0,0.0,349.41,1.0,2.37 +2009-07-11 08:00:00+00:00,9.15,6.8,99540.83,14.66,19.41,0.85,0.0,0.0,0.0,349.85,1.0,2.58 +2009-07-11 08:15:00+00:00,9.11,6.797499999999999,99507.9625,14.42,19.085,0.8525,0.0,0.0,0.0,349.5625,1.0,2.6225 +2009-07-11 08:30:00+00:00,9.07,6.795,99475.095,14.18,18.76,0.855,0.0,0.0,0.0,349.275,1.0,2.665 +2009-07-11 08:45:00+00:00,9.03,6.7925,99442.2275,13.94,18.435,0.8574999999999999,0.0,0.0,0.0,348.9875,1.0,2.7075 +2009-07-11 09:00:00+00:00,8.99,6.79,99409.36,13.7,18.11,0.86,0.0,0.0,0.0,348.7,1.0,2.75 +2009-07-11 09:15:00+00:00,8.84,6.71,99393.7125,13.2475,17.54,0.865,0.0,0.0,0.0,348.895,1.0,2.675 +2009-07-11 09:30:00+00:00,8.690000000000001,6.63,99378.065,12.795,16.97,0.87,0.0,0.0,0.0,349.09000000000003,1.0,2.6 +2009-07-11 09:45:00+00:00,8.540000000000001,6.55,99362.4175,12.3425,16.4,0.875,0.0,0.0,0.0,349.285,1.0,2.5250000000000004 +2009-07-11 10:00:00+00:00,8.39,6.47,99346.77,11.89,15.83,0.88,0.0,0.0,0.0,349.48,1.0,2.45 +2009-07-11 10:15:00+00:00,8.305,6.515,99304.2875,11.18,14.9175,0.8875,0.0,0.0,0.0,349.4325,1.0,2.31 +2009-07-11 10:30:00+00:00,8.22,6.5600000000000005,99261.805,10.47,14.005,0.895,0.0,0.0,0.0,349.385,1.0,2.17 +2009-07-11 10:45:00+00:00,8.135000000000002,6.605,99219.3225,9.760000000000002,13.0925,0.9025,0.0,0.0,0.0,349.33750000000003,1.0,2.03 +2009-07-11 11:00:00+00:00,8.05,6.65,99176.84,9.05,12.18,0.91,0.0,0.0,0.0,349.29,1.0,1.89 +2009-07-11 11:15:00+00:00,7.9725,6.6825,99169.075,8.55,11.5475,0.9175,0.0,0.0,0.0,349.39,1.0,1.5924999999999998 +2009-07-11 11:30:00+00:00,7.895,6.715,99161.31,8.05,10.915,0.925,0.0,0.0,0.0,349.49,1.0,1.295 +2009-07-11 11:45:00+00:00,7.817500000000001,6.7475000000000005,99153.545,7.55,10.2825,0.9325,0.0,0.0,0.0,349.59000000000003,1.0,0.9975 +2009-07-11 12:00:00+00:00,7.74,6.78,99145.78,7.05,9.65,0.94,0.0,0.0,0.0,349.69,1.0,0.7 +2009-07-11 12:15:00+00:00,7.7,6.79,99133.9725,6.98,9.585,0.9425,0.0,0.0,0.0,348.355,1.0,0.585 +2009-07-11 12:30:00+00:00,7.66,6.800000000000001,99122.165,6.91,9.52,0.945,0.0,0.0,0.0,347.02,1.0,0.47 +2009-07-11 12:45:00+00:00,7.62,6.8100000000000005,99110.3575,6.84,9.455,0.9475,0.0,0.0,0.0,345.685,1.0,0.355 +2009-07-11 13:00:00+00:00,7.58,6.82,99098.55,6.77,9.39,0.95,0.0,0.0,0.0,344.35,1.0,0.24 +2009-07-11 13:15:00+00:00,7.57,6.825,99099.5675,6.8125,9.4375,0.95,0.0,0.0,0.0,344.6775,1.0,0.22 +2009-07-11 13:30:00+00:00,7.56,6.83,99100.585,6.855,9.485,0.95,0.0,0.0,0.0,345.005,1.0,0.2 +2009-07-11 13:45:00+00:00,7.55,6.835,99101.6025,6.8975,9.5325,0.95,0.0,0.0,0.0,345.33250000000004,1.0,0.18 +2009-07-11 14:00:00+00:00,7.54,6.84,99102.62,6.94,9.58,0.95,0.0,0.0,0.0,345.66,1.0,0.16 +2009-07-11 14:15:00+00:00,7.525,6.8225,99102.1175,6.925000000000001,9.54,0.95,0.0,0.0,0.0,340.9125,0.9875,0.125 +2009-07-11 14:30:00+00:00,7.51,6.805,99101.615,6.91,9.5,0.95,0.0,0.0,0.0,336.165,0.975,0.09 +2009-07-11 14:45:00+00:00,7.495,6.7875,99101.1125,6.895,9.46,0.95,0.0,0.0,0.0,331.4175,0.9625,0.0549999999999999 +2009-07-11 15:00:00+00:00,7.48,6.77,99100.61,6.88,9.42,0.95,0.0,0.0,0.0,326.67,0.95,0.02 +2009-07-11 15:15:00+00:00,7.4475,6.7075,99108.5775,6.6925,9.175,0.9475,0.0,0.0,0.0,319.59000000000003,0.7649999999999999,0.015 +2009-07-11 15:30:00+00:00,7.415,6.645,99116.545,6.505,8.93,0.945,0.0,0.0,0.0,312.51,0.58,0.01 +2009-07-11 15:45:00+00:00,7.3825,6.5825,99124.5125,6.3175,8.684999999999999,0.9425,0.0,0.0,0.0,305.43,0.395,0.005 +2009-07-11 16:00:00+00:00,7.35,6.52,99132.48,6.13,8.44,0.94,0.0,0.0,0.0,298.35,0.21,0.0 +2009-07-11 16:15:00+00:00,7.3225,6.44,99132.7275,6.1525,8.4525,0.9375,6.4975,0.0,3.5775,290.635,0.1925,0.0 +2009-07-11 16:30:00+00:00,7.295,6.359999999999999,99132.975,6.175,8.465,0.935,12.995,0.0,7.155,282.92,0.175,0.0 +2009-07-11 16:45:00+00:00,7.2675,6.28,99133.2225,6.1975,8.4775,0.9325,19.4925,0.0,10.7325,275.20500000000004,0.1575,0.0 +2009-07-11 17:00:00+00:00,7.24,6.2,99133.47,6.22,8.49,0.93,25.99,0.0,14.31,267.49,0.14,0.0 +2009-07-11 17:15:00+00:00,7.2275,6.1175,99141.86,6.41,8.7,0.925,50.1975,111.525,22.6275,263.7425,0.155,0.0 +2009-07-11 17:30:00+00:00,7.215,6.035,99150.25,6.6,8.91,0.92,74.405,223.05,30.945,259.995,0.17,0.0 +2009-07-11 17:45:00+00:00,7.202500000000001,5.952500000000001,99158.64,6.79,9.12,0.915,98.6125,334.57500000000005,39.2625,256.2475,0.185,0.0 +2009-07-11 18:00:00+00:00,7.19,5.87,99167.03,6.98,9.33,0.91,122.82,446.1,47.58,252.5,0.2,0.0 +2009-07-11 18:15:00+00:00,7.1975,5.815,99166.5575,7.11,9.475,0.9075,147.63,499.0925,48.5,252.2075,0.1625,0.0 +2009-07-11 18:30:00+00:00,7.205,5.76,99166.085,7.24,9.62,0.905,172.44,552.085,49.42,251.915,0.125,0.0 +2009-07-11 18:45:00+00:00,7.2125,5.705,99165.6125,7.37,9.765,0.9025,197.25,605.0775000000001,50.34,251.6225,0.0875,0.0 +2009-07-11 19:00:00+00:00,7.22,5.65,99165.14,7.5,9.91,0.9,222.06,658.07,51.26,251.33,0.05,0.0 +2009-07-11 19:15:00+00:00,7.225,5.630000000000001,99151.0225,7.5525,9.97,0.8975,236.5325,672.695,52.2675,251.23,0.0375,0.0 +2009-07-11 19:30:00+00:00,7.23,5.61,99136.905,7.605,10.03,0.895,251.005,687.32,53.275,251.13,0.025,0.0 +2009-07-11 19:45:00+00:00,7.235,5.59,99122.7875,7.6575,10.09,0.8925000000000001,265.4775,701.945,54.2825,251.03,0.0124999999999999,0.0 +2009-07-11 20:00:00+00:00,7.24,5.57,99108.67,7.71,10.15,0.89,279.95,716.57,55.29,250.93,0.0,0.0 +2009-07-11 20:15:00+00:00,7.245,5.5725,99087.475,7.792499999999999,10.2525,0.89,284.145,723.9200000000001,54.6875,250.8675,0.0,0.0 +2009-07-11 20:30:00+00:00,7.25,5.575,99066.28,7.875,10.355,0.89,288.34000000000003,731.27,54.085,250.805,0.0,0.0 +2009-07-11 20:45:00+00:00,7.255,5.577500000000001,99045.085,7.9575,10.4575,0.89,292.535,738.62,53.4825,250.7425,0.0,0.0 +2009-07-11 21:00:00+00:00,7.26,5.58,99023.89,8.04,10.56,0.89,296.73,745.97,52.88,250.68,0.0,0.0 +2009-07-11 21:15:00+00:00,7.25,5.525,99005.0925,8.2525,10.77,0.8875,288.62,736.7425000000001,52.7725,250.5525,0.0025,0.0 +2009-07-11 21:30:00+00:00,7.24,5.470000000000001,98986.295,8.465,10.98,0.885,280.51,727.515,52.665000000000006,250.425,0.005,0.0 +2009-07-11 21:45:00+00:00,7.229999999999999,5.415,98967.4975,8.6775,11.19,0.8825000000000001,272.40000000000003,718.2874999999999,52.557500000000005,250.2975,0.0075,0.0 +2009-07-11 22:00:00+00:00,7.22,5.36,98948.7,8.89,11.4,0.88,264.29,709.06,52.45,250.17,0.01,0.0 +2009-07-11 22:15:00+00:00,7.24,5.375,98928.6825,9.0075,11.575,0.88,245.865,689.0274999999999,50.6575,251.1025,0.03,0.0 +2009-07-11 22:30:00+00:00,7.26,5.390000000000001,98908.665,9.125,11.75,0.88,227.44,668.9949999999999,48.865,252.035,0.05,0.0 +2009-07-11 22:45:00+00:00,7.279999999999999,5.405,98888.6475,9.2425,11.925,0.88,209.015,648.9625,47.072500000000005,252.9675,0.0699999999999999,0.0 +2009-07-11 23:00:00+00:00,7.3,5.42,98868.63,9.36,12.1,0.88,190.59,628.93,45.28,253.9,0.09,0.0 +2009-07-11 23:15:00+00:00,7.33,5.45,98870.9975,9.5125,12.295,0.88,163.4225,568.2349999999999,42.0475,258.11,0.1149999999999999,0.0 +2009-07-11 23:30:00+00:00,7.359999999999999,5.48,98873.365,9.665,12.49,0.88,136.255,507.54,38.815,262.32,0.14,0.0 +2009-07-11 23:45:00+00:00,7.39,5.51,98875.7325,9.8175,12.685,0.88,109.0875,446.845,35.5825,266.53000000000003,0.165,0.0 +2009-07-12 00:00:00+00:00,7.42,5.54,98878.1,9.97,12.88,0.88,81.92,386.15,32.35,270.74,0.19,0.0 +2009-07-12 00:15:00+00:00,7.445,5.555,98869.655,10.155,13.1075,0.88,63.295,289.61249999999995,25.36,271.69,0.32,0.0025 +2009-07-12 00:30:00+00:00,7.47,5.57,98861.21,10.34,13.335,0.88,44.67,193.075,18.37,272.64,0.45,0.005 +2009-07-12 00:45:00+00:00,7.494999999999999,5.585,98852.765,10.525,13.5625,0.88,26.045,96.53750000000002,11.380000000000004,273.59000000000003,0.5800000000000001,0.0075 +2009-07-12 01:00:00+00:00,7.52,5.6,98844.32,10.71,13.79,0.88,7.42,0.0,4.39,274.54,0.71,0.01 +2009-07-12 01:15:00+00:00,7.529999999999999,5.6,98829.83,10.7825,13.8825,0.8775,5.565,0.0,3.2924999999999995,277.2875,0.7825,0.0175 +2009-07-12 01:30:00+00:00,7.539999999999999,5.6,98815.34,10.855,13.975,0.875,3.71,0.0,2.195,280.035,0.855,0.025 +2009-07-12 01:45:00+00:00,7.55,5.6,98800.85,10.9275,14.0675,0.8725,1.8550000000000004,0.0,1.0975,282.7825,0.9275,0.0325 +2009-07-12 02:00:00+00:00,7.56,5.6,98786.36,11.0,14.16,0.87,0.0,0.0,0.0,285.53,1.0,0.04 +2009-07-12 02:15:00+00:00,7.5625,5.6075,98775.825,11.01,14.1825,0.8725,0.0,0.0,0.0,285.12,0.9975,0.04 +2009-07-12 02:30:00+00:00,7.564999999999999,5.615,98765.29,11.02,14.205,0.875,0.0,0.0,0.0,284.71,0.995,0.04 +2009-07-12 02:45:00+00:00,7.5675,5.6225,98754.755,11.03,14.2275,0.8775,0.0,0.0,0.0,284.29999999999995,0.9925,0.04 +2009-07-12 03:00:00+00:00,7.57,5.63,98744.22,11.04,14.25,0.88,0.0,0.0,0.0,283.89,0.99,0.04 +2009-07-12 03:15:00+00:00,7.5725,5.63,98725.3725,11.12,14.345,0.88,0.0,0.0,0.0,282.9175,0.96,0.04 +2009-07-12 03:30:00+00:00,7.575,5.63,98706.525,11.2,14.44,0.88,0.0,0.0,0.0,281.945,0.93,0.04 +2009-07-12 03:45:00+00:00,7.577500000000001,5.63,98687.6775,11.28,14.535,0.88,0.0,0.0,0.0,280.9725,0.9,0.04 +2009-07-12 04:00:00+00:00,7.58,5.63,98668.83,11.36,14.63,0.88,0.0,0.0,0.0,280.0,0.87,0.04 +2009-07-12 04:15:00+00:00,7.5725,5.6225,98659.8075,11.51,14.7875,0.8775,0.0,0.0,0.0,283.44,0.86,0.045 +2009-07-12 04:30:00+00:00,7.564999999999999,5.615,98650.785,11.66,14.945,0.875,0.0,0.0,0.0,286.88,0.85,0.05 +2009-07-12 04:45:00+00:00,7.5575,5.6075,98641.7625,11.81,15.1025,0.8725,0.0,0.0,0.0,290.32,0.84,0.055 +2009-07-12 05:00:00+00:00,7.55,5.6,98632.74,11.96,15.26,0.87,0.0,0.0,0.0,293.76,0.83,0.06 +2009-07-12 05:15:00+00:00,7.5125,5.609999999999999,98624.2875,12.075,15.3625,0.875,0.0,0.0,0.0,294.6425,0.7749999999999999,0.0824999999999999 +2009-07-12 05:30:00+00:00,7.475,5.619999999999999,98615.835,12.19,15.465,0.88,0.0,0.0,0.0,295.525,0.72,0.105 +2009-07-12 05:45:00+00:00,7.4375,5.63,98607.3825,12.305,15.5675,0.885,0.0,0.0,0.0,296.4075,0.665,0.1275 +2009-07-12 06:00:00+00:00,7.4,5.64,98598.93,12.42,15.67,0.89,0.0,0.0,0.0,297.29,0.61,0.15 +2009-07-12 06:15:00+00:00,7.380000000000001,5.66,98588.1725,12.3825,15.6425,0.8925000000000001,0.0,0.0,0.0,296.885,0.5625,0.1475 +2009-07-12 06:30:00+00:00,7.36,5.68,98577.415,12.345,15.615,0.895,0.0,0.0,0.0,296.48,0.515,0.145 +2009-07-12 06:45:00+00:00,7.34,5.699999999999999,98566.6575,12.3075,15.5875,0.8975,0.0,0.0,0.0,296.07500000000005,0.4674999999999999,0.1425 +2009-07-12 07:00:00+00:00,7.32,5.72,98555.9,12.27,15.56,0.9,0.0,0.0,0.0,295.67,0.42,0.14 +2009-07-12 07:15:00+00:00,7.327500000000001,5.71,98551.23,12.31,15.6125,0.8975,0.0,0.0,0.0,290.635,0.4049999999999999,0.125 +2009-07-12 07:30:00+00:00,7.335,5.699999999999999,98546.56,12.35,15.665,0.895,0.0,0.0,0.0,285.6,0.39,0.11 +2009-07-12 07:45:00+00:00,7.342499999999999,5.69,98541.89,12.39,15.7175,0.8925000000000001,0.0,0.0,0.0,280.565,0.375,0.095 +2009-07-12 08:00:00+00:00,7.35,5.68,98537.22,12.43,15.77,0.89,0.0,0.0,0.0,275.53,0.36,0.08 +2009-07-12 08:15:00+00:00,7.3325,5.6825,98539.8075,12.445,15.795,0.8925000000000001,0.0,0.0,0.0,275.9,0.3525,0.08 +2009-07-12 08:30:00+00:00,7.314999999999999,5.6850000000000005,98542.395,12.46,15.82,0.895,0.0,0.0,0.0,276.27,0.345,0.08 +2009-07-12 08:45:00+00:00,7.2975,5.6875,98544.9825,12.475,15.845,0.8975,0.0,0.0,0.0,276.64,0.3375,0.08 +2009-07-12 09:00:00+00:00,7.28,5.69,98547.57,12.49,15.87,0.9,0.0,0.0,0.0,277.01,0.33,0.08 +2009-07-12 09:15:00+00:00,7.3075,5.5200000000000005,98519.62,12.49,15.8325,0.8875,0.0,0.0,0.0,275.1275,0.32,0.0725 +2009-07-12 09:30:00+00:00,7.335,5.35,98491.67,12.49,15.795,0.875,0.0,0.0,0.0,273.245,0.31,0.065 +2009-07-12 09:45:00+00:00,7.3625,5.18,98463.72,12.49,15.7575,0.8625,0.0,0.0,0.0,271.3625,0.3,0.0575 +2009-07-12 10:00:00+00:00,7.39,5.01,98435.77,12.49,15.72,0.85,0.0,0.0,0.0,269.48,0.29,0.05 +2009-07-12 10:15:00+00:00,7.377499999999999,4.9775,98432.5175,12.5225,15.7425,0.8474999999999999,0.0,0.0,0.0,272.105,0.295,0.045 +2009-07-12 10:30:00+00:00,7.365,4.945,98429.265,12.555,15.765,0.845,0.0,0.0,0.0,274.73,0.3,0.04 +2009-07-12 10:45:00+00:00,7.3525,4.9125,98426.0125,12.5875,15.7875,0.8425,0.0,0.0,0.0,277.355,0.305,0.035 +2009-07-12 11:00:00+00:00,7.34,4.88,98422.76,12.62,15.81,0.84,0.0,0.0,0.0,279.98,0.31,0.03 +2009-07-12 11:15:00+00:00,7.32,4.8575,98418.7975,12.715,15.915,0.84,0.0,0.0,0.0,279.89,0.31,0.0325 +2009-07-12 11:30:00+00:00,7.3,4.835,98414.835,12.81,16.02,0.84,0.0,0.0,0.0,279.8,0.31,0.035 +2009-07-12 11:45:00+00:00,7.279999999999999,4.8125,98410.8725,12.905,16.125,0.84,0.0,0.0,0.0,279.71000000000004,0.31,0.0375 +2009-07-12 12:00:00+00:00,7.26,4.79,98406.91,13.0,16.23,0.84,0.0,0.0,0.0,279.62,0.31,0.04 +2009-07-12 12:15:00+00:00,7.24,4.74,98401.955,13.145,16.4075,0.84,0.0,0.0,0.0,277.9475,0.3375,0.045 +2009-07-12 12:30:00+00:00,7.22,4.69,98397.0,13.29,16.585,0.84,0.0,0.0,0.0,276.275,0.365,0.05 +2009-07-12 12:45:00+00:00,7.199999999999999,4.64,98392.045,13.435,16.762500000000003,0.84,0.0,0.0,0.0,274.6025,0.3924999999999999,0.055 +2009-07-12 13:00:00+00:00,7.18,4.59,98387.09,13.58,16.94,0.84,0.0,0.0,0.0,272.93,0.42,0.06 +2009-07-12 13:15:00+00:00,7.12,4.592499999999999,98388.9625,13.5125,16.950000000000003,0.8425,0.0,0.0,0.0,272.0,0.43,0.075 +2009-07-12 13:30:00+00:00,7.0600000000000005,4.595,98390.835,13.445,16.96,0.845,0.0,0.0,0.0,271.07,0.44,0.09 +2009-07-12 13:45:00+00:00,7.0,4.5975,98392.7075,13.3775,16.97,0.8474999999999999,0.0,0.0,0.0,270.14,0.45,0.105 +2009-07-12 14:00:00+00:00,6.94,4.6,98394.58,13.31,16.98,0.85,0.0,0.0,0.0,269.21,0.46,0.12 +2009-07-12 14:15:00+00:00,6.8725000000000005,4.592499999999999,98395.3875,13.1025,16.77,0.8525,0.0,0.0,0.0,271.6625,0.5375,0.2225 +2009-07-12 14:30:00+00:00,6.805,4.585,98396.195,12.895,16.560000000000002,0.855,0.0,0.0,0.0,274.115,0.615,0.325 +2009-07-12 14:45:00+00:00,6.7375,4.577500000000001,98397.0025,12.6875,16.35,0.8574999999999999,0.0,0.0,0.0,276.5675,0.6925,0.4275 +2009-07-12 15:00:00+00:00,6.67,4.57,98397.81,12.48,16.14,0.86,0.0,0.0,0.0,279.02,0.77,0.53 +2009-07-12 15:15:00+00:00,6.72,4.525,98410.79,12.4425,16.05,0.855,0.0,0.0,0.0,279.41,0.6775,0.4275 +2009-07-12 15:30:00+00:00,6.77,4.48,98423.77,12.405,15.96,0.85,0.0,0.0,0.0,279.79999999999995,0.585,0.325 +2009-07-12 15:45:00+00:00,6.82,4.435,98436.75,12.3675,15.87,0.845,0.0,0.0,0.0,280.19,0.4925,0.2225 +2009-07-12 16:00:00+00:00,6.87,4.39,98449.73,12.33,15.78,0.84,0.0,0.0,0.0,280.58,0.4,0.12 +2009-07-12 16:15:00+00:00,6.8825,4.4075,98463.7575,12.24,15.775,0.84,5.885,0.0,2.9975,284.045,0.34,0.1 +2009-07-12 16:30:00+00:00,6.895,4.425,98477.785,12.15,15.77,0.84,11.77,0.0,5.995,287.51,0.28,0.08 +2009-07-12 16:45:00+00:00,6.9075,4.4425,98491.8125,12.06,15.765,0.84,17.655,0.0,8.9925,290.975,0.22,0.06 +2009-07-12 17:00:00+00:00,6.92,4.46,98505.84,11.97,15.76,0.84,23.54,0.0,11.99,294.44,0.16,0.04 +2009-07-12 17:15:00+00:00,6.9275,4.4625,98510.23,11.985,15.93,0.84,44.7075,93.815,20.04,289.4775,0.1625,0.0375 +2009-07-12 17:30:00+00:00,6.9350000000000005,4.465,98514.62,12.0,16.1,0.84,65.875,187.63,28.09,284.515,0.165,0.035 +2009-07-12 17:45:00+00:00,6.9425,4.467499999999999,98519.01,12.015,16.27,0.84,87.04249999999999,281.445,36.14,279.5525,0.1675,0.0325 +2009-07-12 18:00:00+00:00,6.95,4.47,98523.4,12.03,16.44,0.84,108.21,375.26,44.19,274.59,0.17,0.03 +2009-07-12 18:15:00+00:00,6.975,4.4025,98523.9525,12.11,16.462500000000002,0.835,127.5275,408.435,46.285,271.5,0.18,0.03 +2009-07-12 18:30:00+00:00,7.0,4.335,98524.505,12.19,16.485,0.83,146.845,441.61,48.38,268.41,0.19,0.03 +2009-07-12 18:45:00+00:00,7.025,4.2675,98525.0575,12.27,16.5075,0.825,166.1625,474.785,50.475,265.32,0.2,0.03 +2009-07-12 19:00:00+00:00,7.05,4.2,98525.61,12.35,16.53,0.82,185.48,507.96,52.57,262.23,0.21,0.03 +2009-07-12 19:15:00+00:00,7.0675,4.125,98523.865,12.3425,16.4675,0.815,202.89,536.255,54.175,262.2325,0.215,0.025 +2009-07-12 19:30:00+00:00,7.085,4.05,98522.12,12.335,16.405,0.81,220.3,564.55,55.78,262.235,0.22,0.02 +2009-07-12 19:45:00+00:00,7.1025,3.975,98520.375,12.3275,16.3425,0.805,237.71,592.845,57.385000000000005,262.2375,0.225,0.015 +2009-07-12 20:00:00+00:00,7.12,3.9,98518.63,12.32,16.28,0.8,255.12,621.14,58.99,262.24,0.23,0.01 +2009-07-12 20:15:00+00:00,7.1125,3.88,98499.2625,12.345,16.275000000000002,0.8,261.77250000000004,635.675,58.765,260.3375,0.2075,0.0125 +2009-07-12 20:30:00+00:00,7.105,3.86,98479.895,12.37,16.270000000000003,0.8,268.425,650.21,58.540000000000006,258.435,0.185,0.015 +2009-07-12 20:45:00+00:00,7.0975,3.84,98460.5275,12.395,16.265,0.8,275.0775,664.745,58.315000000000005,256.5325,0.1625,0.0175 +2009-07-12 21:00:00+00:00,7.09,3.82,98441.16,12.42,16.26,0.8,281.73,679.28,58.09,254.63,0.14,0.02 +2009-07-12 21:15:00+00:00,7.02,3.9575,98437.535,12.7,16.3125,0.81,275.545,675.115,57.9275,256.95,0.1775,0.025 +2009-07-12 21:30:00+00:00,6.949999999999999,4.095,98433.91,12.98,16.365000000000002,0.8200000000000001,269.36,670.95,57.765,259.27,0.215,0.03 +2009-07-12 21:45:00+00:00,6.88,4.2325,98430.285,13.26,16.4175,0.83,263.175,666.785,57.6025,261.59000000000003,0.2525,0.035 +2009-07-12 22:00:00+00:00,6.81,4.37,98426.66,13.54,16.47,0.84,256.99,662.62,57.44,263.91,0.29,0.04 +2009-07-12 22:15:00+00:00,6.807499999999999,4.365,98439.2525,13.505,16.4375,0.84,235.9425,627.6,55.785,263.35,0.3125,0.04 +2009-07-12 22:30:00+00:00,6.805,4.359999999999999,98451.845,13.47,16.405,0.84,214.895,592.5799999999999,54.13,262.79,0.3349999999999999,0.04 +2009-07-12 22:45:00+00:00,6.8025,4.355,98464.4375,13.435,16.3725,0.84,193.84750000000005,557.56,52.475,262.23,0.3575,0.04 +2009-07-12 23:00:00+00:00,6.8,4.35,98477.03,13.4,16.34,0.84,172.8,522.54,50.82,261.67,0.38,0.04 +2009-07-12 23:15:00+00:00,6.8,4.35,98477.03,13.4,16.34,0.84,172.8,522.54,50.82,261.67,0.38,0.04 +2009-07-12 23:30:00+00:00,6.8,4.35,98477.03,13.4,16.34,0.84,172.8,522.54,50.82,261.67,0.38,0.04 +2009-07-12 23:45:00+00:00,6.8,4.35,98477.03,13.4,16.34,0.84,172.8,522.54,50.82,261.67,0.38,0.04 diff --git a/tests/resources/oiko_mockup.csv b/tests/resources/oiko_mockup.csv new file mode 100644 index 0000000..9900bbb --- /dev/null +++ b/tests/resources/oiko_mockup.csv @@ -0,0 +1,73 @@ +datetime (UTC),"coordinates (lat,lon)",model (name),model elevation (surface),utc_offset (hrs),temperature,dewpoint_temperature,mean_sea_level_pressure,wind_speed,100m_wind_speed,relative_humidity,surface_solar_radiation,direct_normal_solar_radiation,surface_diffuse_solar_radiation,surface_thermal_radiation,total_cloud_cover,total_precipitation +2009-07-11 00:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,8.43,5.74,100217.84,14.65,19.28,0.83,26.15,3.71,25.68,315.92,1.0,0.04 +2009-07-11 01:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,8.8,5.88,100107.2,15.55,20.83,0.82,2.44,0.0,2.48,321.33,1.0,0.24 +2009-07-11 02:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,9.07,6.15,100018.45,15.86,21.46,0.82,0.0,0.0,0.0,332.92,1.0,0.46 +2009-07-11 03:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,9.26,6.43,99926.08,15.87,21.48,0.82,0.0,0.0,0.0,337.39,1.0,0.57 +2009-07-11 04:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,9.37,6.55,99884.9,16.17,21.83,0.83,0.0,0.0,0.0,346.7,1.0,0.74 +2009-07-11 05:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,9.43,6.63,99819.57,15.96,21.46,0.83,0.0,0.0,0.0,348.36,1.0,0.93 +2009-07-11 06:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,9.38,6.76,99737.87,15.19,20.33,0.84,0.0,0.0,0.0,345.79,1.0,1.04 +2009-07-11 07:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,9.29,6.84,99649.09,15.1,20.07,0.85,0.0,0.0,0.0,348.09,1.0,1.74 +2009-07-11 08:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,9.15,6.8,99540.83,14.66,19.41,0.85,0.0,0.0,0.0,349.85,1.0,2.58 +2009-07-11 09:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,8.99,6.79,99409.36,13.7,18.11,0.86,0.0,0.0,0.0,348.7,1.0,2.75 +2009-07-11 10:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,8.39,6.47,99346.77,11.89,15.83,0.88,0.0,0.0,0.0,349.48,1.0,2.45 +2009-07-11 11:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,8.05,6.65,99176.84,9.05,12.18,0.91,0.0,0.0,0.0,349.29,1.0,1.89 +2009-07-11 12:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.74,6.78,99145.78,7.05,9.65,0.94,0.0,0.0,0.0,349.69,1.0,0.7 +2009-07-11 13:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.58,6.82,99098.55,6.77,9.39,0.95,0.0,0.0,0.0,344.35,1.0,0.24 +2009-07-11 14:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.54,6.84,99102.62,6.94,9.58,0.95,0.0,0.0,0.0,345.66,1.0,0.16 +2009-07-11 15:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.48,6.77,99100.61,6.88,9.42,0.95,0.0,0.0,0.0,326.67,0.95,0.02 +2009-07-11 16:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.35,6.52,99132.48,6.13,8.44,0.94,0.0,0.0,0.0,298.35,0.21,0.0 +2009-07-11 17:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.24,6.2,99133.47,6.22,8.49,0.93,25.99,0.0,14.31,267.49,0.14,0.0 +2009-07-11 18:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.19,5.87,99167.03,6.98,9.33,0.91,122.82,446.1,47.58,252.5,0.2,0.0 +2009-07-11 19:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.22,5.65,99165.14,7.5,9.91,0.9,222.06,658.07,51.26,251.33,0.05,0.0 +2009-07-11 20:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.24,5.57,99108.67,7.71,10.15,0.89,279.95,716.57,55.29,250.93,0.0,0.0 +2009-07-11 21:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.26,5.58,99023.89,8.04,10.56,0.89,296.73,745.97,52.88,250.68,0.0,0.0 +2009-07-11 22:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.22,5.36,98948.7,8.89,11.4,0.88,264.29,709.06,52.45,250.17,0.01,0.0 +2009-07-11 23:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.3,5.42,98868.63,9.36,12.1,0.88,190.59,628.93,45.28,253.9,0.09,0.0 +2009-07-12 00:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.42,5.54,98878.1,9.97,12.88,0.88,81.92,386.15,32.35,270.74,0.19,0.0 +2009-07-12 01:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.52,5.6,98844.32,10.71,13.79,0.88,7.42,0.0,4.39,274.54,0.71,0.01 +2009-07-12 02:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.56,5.6,98786.36,11.0,14.16,0.87,0.0,0.0,0.0,285.53,1.0,0.04 +2009-07-12 03:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.57,5.63,98744.22,11.04,14.25,0.88,0.0,0.0,0.0,283.89,0.99,0.04 +2009-07-12 04:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.58,5.63,98668.83,11.36,14.63,0.88,0.0,0.0,0.0,280.0,0.87,0.04 +2009-07-12 05:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.55,5.6,98632.74,11.96,15.26,0.87,0.0,0.0,0.0,293.76,0.83,0.06 +2009-07-12 06:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.4,5.64,98598.93,12.42,15.67,0.89,0.0,0.0,0.0,297.29,0.61,0.15 +2009-07-12 07:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.32,5.72,98555.9,12.27,15.56,0.9,0.0,0.0,0.0,295.67,0.42,0.14 +2009-07-12 08:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.35,5.68,98537.22,12.43,15.77,0.89,0.0,0.0,0.0,275.53,0.36,0.08 +2009-07-12 09:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.28,5.69,98547.57,12.49,15.87,0.9,0.0,0.0,0.0,277.01,0.33,0.08 +2009-07-12 10:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.39,5.01,98435.77,12.49,15.72,0.85,0.0,0.0,0.0,269.48,0.29,0.05 +2009-07-12 11:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.34,4.88,98422.76,12.62,15.81,0.84,0.0,0.0,0.0,279.98,0.31,0.03 +2009-07-12 12:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.26,4.79,98406.91,13.0,16.23,0.84,0.0,0.0,0.0,279.62,0.31,0.04 +2009-07-12 13:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.18,4.59,98387.09,13.58,16.94,0.84,0.0,0.0,0.0,272.93,0.42,0.06 +2009-07-12 14:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.94,4.6,98394.58,13.31,16.98,0.85,0.0,0.0,0.0,269.21,0.46,0.12 +2009-07-12 15:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.67,4.57,98397.81,12.48,16.14,0.86,0.0,0.0,0.0,279.02,0.77,0.53 +2009-07-12 16:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.87,4.39,98449.73,12.33,15.78,0.84,0.0,0.0,0.0,280.58,0.4,0.12 +2009-07-12 17:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.92,4.46,98505.84,11.97,15.76,0.84,23.54,0.0,11.99,294.44,0.16,0.04 +2009-07-12 18:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.95,4.47,98523.4,12.03,16.44,0.84,108.21,375.26,44.19,274.59,0.17,0.03 +2009-07-12 19:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.05,4.2,98525.61,12.35,16.53,0.82,185.48,507.96,52.57,262.23,0.21,0.03 +2009-07-12 20:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.12,3.9,98518.63,12.32,16.28,0.8,255.12,621.14,58.99,262.24,0.23,0.01 +2009-07-12 21:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,7.09,3.82,98441.16,12.42,16.26,0.8,281.73,679.28,58.09,254.63,0.14,0.02 +2009-07-12 22:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.81,4.37,98426.66,13.54,16.47,0.84,256.99,662.62,57.44,263.91,0.29,0.04 +2009-07-12 23:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.8,4.35,98477.03,13.4,16.34,0.84,172.8,522.54,50.82,261.67,0.38,0.04 +2009-07-13 00:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.77,4.28,98462.28,13.02,15.86,0.84,81.69,395.43,30.0,276.67,0.22,0.04 +2009-07-13 01:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.75,4.32,98498.19,12.7,15.46,0.85,8.32,0.0,4.39,260.57,0.29,0.03 +2009-07-13 02:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.77,4.31,98499.79,12.61,15.35,0.84,0.0,0.0,0.0,269.84,0.26,0.03 +2009-07-13 03:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.76,4.27,98488.28,12.84,15.59,0.84,0.0,0.0,0.0,257.3,0.26,0.02 +2009-07-13 04:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.69,4.16,98496.28,12.89,15.65,0.84,0.0,0.0,0.0,262.61,0.21,0.02 +2009-07-13 05:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.57,4.05,98500.03,12.88,15.63,0.84,0.0,0.0,0.0,255.39,0.16,0.02 +2009-07-13 06:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.45,3.92,98518.08,12.94,15.69,0.84,0.0,0.0,0.0,265.38,0.33,0.02 +2009-07-13 07:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.29,3.84,98547.4,13.08,15.79,0.84,0.0,0.0,0.0,266.88,0.36,0.09 +2009-07-13 08:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.25,3.91,98580.17,13.25,15.94,0.85,0.0,0.0,0.0,261.04,0.58,0.14 +2009-07-13 09:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.32,3.72,98594.07,12.66,15.19,0.83,0.0,0.0,0.0,266.67,0.56,0.07 +2009-07-13 10:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.56,3.55,98532.58,12.26,14.79,0.81,0.0,0.0,0.0,261.44,0.34,0.04 +2009-07-13 11:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.59,3.51,98479.3,11.87,14.34,0.81,0.0,0.0,0.0,265.6,0.76,0.06 +2009-07-13 12:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.67,3.42,98446.81,11.13,13.44,0.8,0.0,0.0,0.0,285.23,1.0,0.04 +2009-07-13 13:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.71,3.47,98359.16,10.17,12.26,0.8,0.0,0.0,0.0,278.83,1.0,0.01 +2009-07-13 14:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.72,3.54,98272.03,9.29,11.13,0.8,0.0,0.0,0.0,288.09,1.0,0.01 +2009-07-13 15:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.61,3.63,98104.71,9.02,10.66,0.81,0.0,0.0,0.0,300.45,1.0,0.06 +2009-07-13 16:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.32,3.57,97900.64,9.07,10.48,0.83,0.0,0.0,0.0,310.95,1.0,0.21 +2009-07-13 17:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.0,3.55,97624.04,10.99,12.78,0.84,7.32,0.0,7.36,320.96,1.0,0.56 +2009-07-13 18:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,5.95,3.52,97257.15,12.34,14.87,0.84,19.86,0.0,19.9,325.53,1.0,1.21 +2009-07-13 19:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.12,3.98,96822.22,11.62,14.43,0.86,23.91,0.0,23.95,332.26,1.0,2.22 +2009-07-13 20:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,6.27,4.05,102956.61,10.74,13.27,0.86,21.99,0.0,22.03,333.86,1.0,3.2 +2009-07-13 21:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,5.93,3.65,102577.78,10.71,12.93,0.85,13.95,0.14,13.91,335.14,1.0,3.9 +2009-07-13 22:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,5.62,4.27,102421.59,12.97,15.71,0.91,11.12,3.27,10.13,335.18,1.0,4.14 +2009-07-13 23:00:00+00:00,"(-48.87667, -123.39333)",era5,0.03,-8.0,3.79,3.32,102610.26,16.62,22.86,0.97,10.5,4.66,9.4,333.57,1.0,3.61 diff --git a/tests/test_processing.py b/tests/test_processing.py index f6a6a24..c9438a7 100644 --- a/tests/test_processing.py +++ b/tests/test_processing.py @@ -1,5 +1,6 @@ import datetime as dt from pathlib import Path +from unittest.mock import patch import numpy as np import pandas as pd @@ -28,11 +29,50 @@ FillGapsAR, Interpolate, ExpressionCombine, + FillOikoMeteo, ) RESOURCES_PATH = Path(__file__).parent / "resources" +def mock_get_oikolab_df(**kwargs): + data = pd.read_csv( + Path(RESOURCES_PATH / "oiko_mockup.csv"), index_col=0, parse_dates=True + ) + data.index.freq = data.index.inferred_freq + + try: + param = kwargs["param"] + except KeyError: + param = [ + "temperature", + "dewpoint_temperature", + "mean_sea_level_pressure", + "wind_speed", + "100m_wind_speed", + "relative_humidity", + "surface_solar_radiation", + "direct_normal_solar_radiation", + "surface_diffuse_solar_radiation", + "surface_thermal_radiation", + "total_cloud_cover", + "total_precipitation", + ] + + start = kwargs["start"].strftime("%Y-%m-%d") + end = kwargs["end"].strftime("%Y-%m-%d") + return data.loc[ + start:end, + [ + "coordinates (lat,lon)", + "model (name)", + "model elevation (surface)", + "utc_offset (hrs)", + ] + + param, + ] + + class TestCustomTransformers: def test_pd_identity(self): df = pd.DataFrame( @@ -603,3 +643,37 @@ def test_combiner(self): res = combiner.fit_transform(test_df.copy()) assert res.shape == (3, 6) + + @patch("tide.processing.get_oikolab_df", side_effect=mock_get_oikolab_df) + def test_fill_oiko_meteo(self, mock_get_oikolab): + data = pd.read_csv( + RESOURCES_PATH / "meteo_fill_df.csv", parse_dates=True, index_col=0 + ) + + # dig holes + data_gap = data.copy() + data_gap.loc[ + "2009-07-11 02:00:00":"2009-07-11 05:00:00", "text__°C__outdoor" + ] = np.nan + data_gap.loc["2009-07-12 18:00:00"::, "text__°C__outdoor"] = np.nan + data_gap.loc[ + "2009-07-11 18:00:00":"2009-07-12 07:00:00", "gh__W/m²__outdoor" + ] = np.nan + + meteo_filler = FillOikoMeteo( + gaps_gte="4h", + lat=-48.87667, + lon=-123.39333, + param_map={ + "text__°C__outdoor": "temperature", + "gh__W/m²__outdoor": "surface_solar_radiation", + "rh__0-1__outdoor": "relative_humidity", + }, + ) + + meteo_filler.fit_transform(data_gap) + + pd.testing.assert_series_equal( + data["gh__W/m²__outdoor"], data_gap["gh__W/m²__outdoor"] + ) + assert float(data_gap["text__°C__outdoor"].isnull().sum()) == 13 diff --git a/tide/meteo.py b/tide/meteo.py index 07bc526..b895d40 100644 --- a/tide/meteo.py +++ b/tide/meteo.py @@ -2,9 +2,97 @@ import math import numpy as np +import pandas as pd +import requests from tide.math import cosd, sind +OIKOLAB_PARAM_MAP = { + "temperature": "temperature (degC)", + "dewpoint_temperature": "dewpoint_temperature (degC)", + "mean_sea_level_pressure": "mean_sea_level_pressure (Pa)", + "wind_speed": "wind_speed (m/s)", + "100m_wind_speed": "100m_wind_speed (m/s)", + "relative_humidity": "relative_humidity (0-1)", + "surface_solar_radiation": "surface_solar_radiation (W/m^2)", + "direct_normal_solar_radiation": "direct_normal_solar_radiation (W/m^2)", + "surface_diffuse_solar_radiation": "surface_diffuse_solar_radiation (W/m^2)", + "surface_thermal_radiation": "surface_thermal_radiation (W/m^2)", + "total_cloud_cover": "total_cloud_cover (0-1)", + "total_precipitation": "total_precipitation (mm of water equivalent)", +} + + +def get_oikolab_df( + lat: float, + lon: float, + start: pd.Timestamp | dt.datetime, + end: pd.Timestamp | dt.datetime, + api_key: str, + param: list[str] = None, + model: str = "era5", + freq: str = "H", +) -> pd.DataFrame: + """ + Retrieve weather data from the Oikolab API and return it as a pandas DataFrame. + + This function sends a request to the Oikolab weather API, fetches the specified + weather parameters for a given location and time range, and returns the data + in a pandas DataFRame. + + Parameters: + ----------- + lat : float + Latitude of the location. + lon : float + Longitude of the location. + start : pd.Timestamp | dt.datetime + Start date and time for the data request. + end : pd.Timestamp | dt.datetime + End date and time for the data request. + api_key : str + API key for authentication with the Oikolab service. + param : list[str], optional + List of weather parameters to retrieve. If None, the following parameters + will be fetched. Default is None. + ['temperature', 'dewpoint_temperature', 'mean_sea_level_pressure', + 'wind_speed', '100m_wind_speed', 'relative_humidity', + 'surface_solar_radiation', 'direct_normal_solar_radiation', + 'surface_diffuse_solar_radiation', 'surface_thermal_radiation', + 'total_cloud_cover', 'total_precipitation'] + model : str, optional + Weather model to use for data retrieval. Default is "era5". + freq : str, optional + Frequency of the data points. Default is "H" (hourly). + + See Oikolab API doc for further informations : https://docs.oikolab.com/references/ + """ + + param = list(OIKOLAB_PARAM_MAP.keys()) if param is None else param + + r = requests.get( + url="https://api.oikolab.com/weather", + params={ + "param": param, + "lat": lat, + "lon": lon, + "start": start.strftime("%Y-%m-%d"), + "end": end.strftime("%Y-%m-%d"), + "model": model, + "freq": freq, + "format": "csv", + }, + headers={"api-key": api_key}, + ) + + if not r.status_code == 200: + raise ValueError(f"Invalid request. Code:{r.status_code}") + + df = pd.read_csv(r.url, parse_dates=True, index_col=0) + df.index = df.index.tz_localize("UTC") + df.index.freq = df.index.inferred_freq + return df.rename(columns={OIKOLAB_PARAM_MAP[par]: par for par in param}) + def sun_position(date: dt.datetime, lat: float = 46.5, long: float = 6.5): """ diff --git a/tide/processing.py b/tide/processing.py index a3e0861..134bc36 100644 --- a/tide/processing.py +++ b/tide/processing.py @@ -1,3 +1,5 @@ +import os + import pandas as pd import numpy as np import datetime as dt @@ -14,9 +16,11 @@ get_outer_timestamps, check_and_return_dt_index_df, parse_request_to_col_names, + get_freq_delta_or_min_time_interval, ) from tide.regressors import SkSTLForecast from tide.classifiers import STLEDetector +from tide.meteo import get_oikolab_df MODEL_MAP = {"STL": SkSTLForecast} @@ -1124,7 +1128,6 @@ def fit(self, X: pd.Series | pd.DataFrame, y=None): self.model_ = MODEL_MAP[self.model_name] self.features_ = X.columns self.index_ = X.index - return self def transform(self, X: pd.Series | pd.DataFrame): @@ -1231,3 +1234,104 @@ def transform(self, X): ] else: return X + + +class FillOikoMeteo(BaseFiller, BaseProcessing): + """ + A processor that fills gaps using meteorological data from the Oikolab API. + + This class extends BaseFiller to provide functionality for + filtering gaps based onthere size. It fills them with corresponding + meteorological data retrieved from the Oikolab API. + + Attributes: + ----------- + lat : float + Latitude of the location for which to retrieve meteorological data. + lon : float + Longitude of the location for which to retrieve meteorological data. + param_map : dict[str, str] + Mapping of input columns to Oikolab API parameters. Oikolab parameters are : + 'temperature', 'dewpoint_temperature', 'mean_sea_level_pressure', + 'wind_speed', '100m_wind_speed', 'relative_humidity', + 'surface_solar_radiation', 'direct_normal_solar_radiation', + 'surface_diffuse_solar_radiation', 'surface_thermal_radiation', + 'total_cloud_cover', 'total_precipitation' + model : str + The meteorological model to use for data retrieval (default is "era5"). + env_oiko_api_key : str + The name of the environement variable that holds the Oikolab API key + (set during fitting). + + Example: + -------- + >>> filler = FillOikoMeteo(gaps_gte="1h", gaps_lte="24h", lat=43.47, lon=-1.51) + >>> filler.fit(X) + >>> X_filled = filler.transform(X) + + Notes: + ------ + - The class requires an Oikolab API key to be set as an environment + variable env_oiko_api_key. + - If param_map is not provided, all columns will be filled with temperature data. + This dumb behavior ensures the processing object is working with default values + to comply with scikit learn API recomandation. + - The class handles different frequencies of input data, interpolating or + resampling as needed. + """ + + def __init__( + self, + gaps_lte: str | pd.Timedelta | dt.timedelta = None, + gaps_gte: str | pd.Timedelta | dt.timedelta = None, + lat: float = 43.47, + lon: float = -1.51, + param_map: dict[str, str] = None, + model: str = "era5", + env_oiko_api_key: str = "OIKO_API_KEY", + ): + super().__init__(gaps_lte, gaps_gte) + self.lat = lat + self.lon = lon + self.param_map = param_map + self.model = model + self.env_oiko_api_key = env_oiko_api_key + + def fit(self, X, y=None): + X = check_and_return_dt_index_df(X) + if self.param_map is None: + # Dumb action fill everything with temperature + self.param_map = {col: "temperature" for col in X.columns} + self.api_key_ = os.getenv(self.env_oiko_api_key) + self.fitted_ = True + return self + + def transform(self, X: pd.Series | pd.DataFrame): + X = check_and_return_dt_index_df(X) + x_freq = get_freq_delta_or_min_time_interval(X) + check_is_fitted(self, attributes=["fitted_", "api_key_"]) + gaps_dict = self.get_gaps_dict_to_fill(X) + for col, idx_list in gaps_dict.items(): + for idx in idx_list: + end = ( + idx[-1] + if idx[-1] <= idx[-1].replace(hour=23, minute=0) + else idx[-1] + pd.Timedelta("1h") + ) + df = get_oikolab_df( + lat=self.lat, + lon=self.lon, + start=idx[0], + end=end, + api_key=self.api_key_, + param=[self.param_map[col]], + model=self.model, + ) + + ts = df[self.param_map[col]] + if x_freq < pd.Timedelta("1h"): + ts = ts.asfreq(x_freq).interpolate("linear") + elif x_freq > pd.Timedelta("1h"): + ts = ts.resample(x_freq).mean() + X.loc[idx, col] = ts.loc[idx] + return X