nens / threedigrid

grid administration for 3Di models
Other
9 stars 0 forks source link

Output time steps in results_3di.nc are messed up if start time is not 0 #245

Closed leendertvanwolfswinkel closed 1 month ago

leendertvanwolfswinkel commented 1 month ago

Same data as in #243

If I do

from pprint import pprint
pprint([float(interval) for interval in (results_admin.nodes.timestamps[1:-1] - results_admin.nodes.timestamps[0:-2])])

I would expect a list of values close to 60 (because that was the hydro_output_time_step I requested), but I get:

[1800.9608154296875,
 1.00048828125,
 1.0003662109375,
 1.00048828125,
 1.00048828125,
 1.0003662109375,
 1.0003662109375,
 1.00048828125,
 1.0003662109375,
 1.00048828125,
 1.00048828125,
 1.0003662109375,
 1.0003662109375,
 1.00048828125,
 1.0003662109375,
 1.0003662109375,
 1.00048828125,
 1.00048828125,
 1.0003662109375,
 1.00048828125,
 1.00048828125,
 1.0003662109375,
 1.0006103515625,
 1.0003662109375,
 1.0003662109375,
 1.0006103515625,
 1.0003662109375,
 1.0003662109375,
 1.00048828125,
 1.00048828125,
 31.0130615234375,
 59.0245361328125,
 60.024169921875,
 60.0245361328125,
 60.024169921875,
 60.02392578125,
 60.024169921875,
 60.023681640625,
 60.023681640625,
 60.02294921875,
 60.022216796875,
 60.022216796875,
 60.0224609375,
 60.022216796875,
 60.022216796875,
 60.021728515625,
 60.021728515625,
 60.020751953125,
 60.0205078125,
 60.021484375,
 60.0205078125,
 60.021240234375,
 60.021240234375,
 60.021484375,
 60.021484375,
 60.021484375,
 60.021240234375,
 60.021728515625]
jpprins1 commented 1 month ago
ipdb> results_admin.netcdf_file['time'][:]
array([   0.    , 1800.9608, 1801.9613, 1802.9617, 1803.9622, 1804.9626,
       1805.963 , 1806.9634, 1807.9639, 1808.9642, 1809.9647, 1810.9652,
       1811.9656, 1812.966 , 1813.9664, 1814.9668, 1815.9672, 1816.9677,
       1817.9681, 1818.9685, 1819.969 , 1820.9695, 1821.9698, 1822.9705,
       1823.9708, 1824.9712, 1825.9718, 1826.9722, 1827.9725, 1828.973 ,
       1829.9735, 1860.9866, 1920.0111, 1980.0353, 2040.0598, 2100.084 ,
       2160.108 , 2220.132 , 2280.1558, 2340.1794, 2400.2024, 2460.2246,
       2520.2468, 2580.2693, 2640.2915, 2700.3137, 2760.3354, 2820.3572,
       2880.378 , 2940.3984, 3000.42  , 3060.4404, 3120.4617, 3180.483 ,
       3240.5044, 3300.526 , 3360.5474, 3420.5686, 3480.5903, 3540.6108],
      dtype=float32
daanvaningen commented 1 month ago

I will look into it