Skip to content

Commit 09fa392

Browse files
authored
Merge pull request leiyangleon#4 from leiyangleon/update_v1.0.7
update Geogrid to v1.0.7
2 parents 0c9f3c8 + 761e243 commit 09fa392

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

testGeogridOptical.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,13 @@ def runGeogrid(info, info1, dem, dhdx, dhdy, vx, vy, srx, sry, csminx, csminy, c
119119
obj.startingY = info.startingY
120120
obj.XSize = info.XSize
121121
obj.YSize = info.YSize
122-
obj.repeatTime = (info1.time - info.time) * 24.0 * 3600.0
122+
from datetime import date
123+
import numpy as np
124+
d0 = date(np.int(info.time[0:4]),np.int(info.time[4:6]),np.int(info.time[6:8]))
125+
d1 = date(np.int(info1.time[0:4]),np.int(info1.time[4:6]),np.int(info1.time[6:8]))
126+
date_dt_base = d1 - d0
127+
obj.repeatTime = np.abs(date_dt_base.total_seconds())
128+
# obj.repeatTime = (info1.time - info.time) * 24.0 * 3600.0
123129
obj.numberOfLines = info.numberOfLines
124130
obj.numberOfSamples = info.numberOfSamples
125131
obj.nodata_out = -32767

testGeogrid_ISCE.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def loadMetadataOptical(indir):
162162
info.YSize = trans[5]
163163

164164
nameString = os.path.basename(DS.GetDescription())
165-
info.time = float(nameString.split('_')[3])
165+
info.time = nameString.split('_')[3]
166166

167167
info.numberOfLines = DS.RasterYSize
168168
info.numberOfSamples = DS.RasterXSize
@@ -226,8 +226,8 @@ def runGeogrid(info, info1, dem, dhdx, dhdy, vx, vy, srx, sry, csminx, csminy, c
226226

227227
def runGeogridOptical(info, info1, dem, dhdx, dhdy, vx, vy, srx, sry, csminx, csminy, csmaxx, csmaxy, ssm):
228228
'''
229-
Wire and run geogrid.
230-
'''
229+
Wire and run geogrid.
230+
'''
231231

232232
from components.contrib.geo_autoRIFT.geogrid import GeogridOptical
233233
# from geogrid import GeogridOptical
@@ -238,7 +238,13 @@ def runGeogridOptical(info, info1, dem, dhdx, dhdy, vx, vy, srx, sry, csminx, cs
238238
obj.startingY = info.startingY
239239
obj.XSize = info.XSize
240240
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
242248
obj.numberOfLines = info.numberOfLines
243249
obj.numberOfSamples = info.numberOfSamples
244250
obj.nodata_out = -32767

0 commit comments

Comments
 (0)