@@ -162,7 +162,7 @@ def loadMetadataOptical(indir):
162
162
info .YSize = trans [5 ]
163
163
164
164
nameString = os .path .basename (DS .GetDescription ())
165
- info .time = float ( nameString .split ('_' )[3 ])
165
+ info .time = nameString .split ('_' )[3 ]
166
166
167
167
info .numberOfLines = DS .RasterYSize
168
168
info .numberOfSamples = DS .RasterXSize
@@ -226,8 +226,8 @@ def runGeogrid(info, info1, dem, dhdx, dhdy, vx, vy, srx, sry, csminx, csminy, c
226
226
227
227
def runGeogridOptical (info , info1 , dem , dhdx , dhdy , vx , vy , srx , sry , csminx , csminy , csmaxx , csmaxy , ssm ):
228
228
'''
229
- Wire and run geogrid.
230
- '''
229
+ Wire and run geogrid.
230
+ '''
231
231
232
232
from components .contrib .geo_autoRIFT .geogrid import GeogridOptical
233
233
# from geogrid import GeogridOptical
@@ -238,7 +238,13 @@ def runGeogridOptical(info, info1, dem, dhdx, dhdy, vx, vy, srx, sry, csminx, cs
238
238
obj .startingY = info .startingY
239
239
obj .XSize = info .XSize
240
240
obj .YSize = info .YSize
241
- obj .repeatTime = (info1 .time - info .time ) * 24.0 * 3600.0
241
+ from datetime import date
242
+ import numpy as np
243
+ d0 = date (np .int (info .time [0 :4 ]),np .int (info .time [4 :6 ]),np .int (info .time [6 :8 ]))
244
+ d1 = date (np .int (info1 .time [0 :4 ]),np .int (info1 .time [4 :6 ]),np .int (info1 .time [6 :8 ]))
245
+ date_dt_base = d1 - d0
246
+ obj .repeatTime = np .abs (date_dt_base .total_seconds ())
247
+ # obj.repeatTime = (info1.time - info.time) * 24.0 * 3600.0
242
248
obj .numberOfLines = info .numberOfLines
243
249
obj .numberOfSamples = info .numberOfSamples
244
250
obj .nodata_out = - 32767
0 commit comments