Merge branch 'master' of https://github.com/isce-framework/isce2 into UAVSAR
commit
3dc6c727e4
|
@ -1053,12 +1053,20 @@ class Orbit(Component):
|
|||
return tguess, rng
|
||||
|
||||
|
||||
def exportToC(self):
|
||||
def exportToC(self, reference=None):
|
||||
from isceobj.Util import combinedlibmodule
|
||||
orb = []
|
||||
|
||||
###Continue usage as usual if no reference is provided
|
||||
###This wont break the old interface but could cause
|
||||
###issues at midnight crossing
|
||||
if reference is None:
|
||||
reference = self.minTime()
|
||||
|
||||
refEpoch = reference.replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
|
||||
for sv in self._stateVectors:
|
||||
tim = DTU.seconds_since_midnight(sv.getTime())
|
||||
tim = (sv.getTime() - refEpoch).total_seconds()
|
||||
pos = sv.getPosition()
|
||||
vel = sv.getVelocity()
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ from isceobj import Constants as CN
|
|||
from iscesys.Component.Component import Component, Port
|
||||
from zerodop.geo2rdr import geo2rdr
|
||||
from iscesys.ImageUtil.ImageUtil import ImageUtil as IU
|
||||
from iscesys import DateTimeUtil as DTU
|
||||
from isceobj.Util import combinedlibmodule
|
||||
from isceobj.Util.Poly1D import Poly1D
|
||||
from isceobj.Util.Poly2D import Poly2D
|
||||
|
@ -243,7 +244,7 @@ class Geo2rdr(Component):
|
|||
azimuthOffAcc = self.azimuthOffsetImage.getImagePointer()
|
||||
|
||||
|
||||
cOrbit = self.orbit.exportToC()
|
||||
cOrbit = self.orbit.exportToC(reference=self.sensingStart)
|
||||
geo2rdr.setOrbit_Py(cOrbit)
|
||||
|
||||
#####Output cropped DEM for first band
|
||||
|
@ -393,7 +394,7 @@ class Geo2rdr(Component):
|
|||
geo2rdr.setDopplerAccessor_Py(self.polyDopplerAccessor)
|
||||
geo2rdr.setPRF_Py(float(self.prf))
|
||||
geo2rdr.setRadarWavelength_Py(float(self.radarWavelength))
|
||||
geo2rdr.setSensingStart_Py(float(self.sensingStart))
|
||||
geo2rdr.setSensingStart_Py(DTU.seconds_since_midnight(self.sensingStart))
|
||||
geo2rdr.setLength_Py(int(self.length))
|
||||
geo2rdr.setWidth_Py(int(self.width))
|
||||
geo2rdr.setNumberRangeLooks_Py(int(self.numberRangeLooks))
|
||||
|
@ -424,9 +425,7 @@ class Geo2rdr(Component):
|
|||
self.radarWavelength = float(var)
|
||||
|
||||
def setSensingStart(self,var):
|
||||
rtime = datetime.datetime.combine(var.date(), datetime.time(0,0,0))
|
||||
secs = (var - rtime).total_seconds()
|
||||
self.sensingStart = float(secs)
|
||||
self.sensingStart = var
|
||||
|
||||
def setLength(self,var):
|
||||
self.length = int(var)
|
||||
|
|
|
@ -34,6 +34,7 @@ from isceobj import Constants as CN
|
|||
from iscesys.Component.Component import Component, Port
|
||||
from zerodop.geozero import geozero
|
||||
from iscesys.ImageUtil.ImageUtil import ImageUtil as IU
|
||||
from iscesys import DateTimeUtil as DTU
|
||||
from isceobj.Util import combinedlibmodule
|
||||
from isceobj.Util.Poly1D import Poly1D
|
||||
import os
|
||||
|
@ -221,7 +222,7 @@ class Geocode(Component):
|
|||
complexFlag = self.inputImage.dataType.upper().startswith('C')
|
||||
nBands = self.inputImage.getBands()
|
||||
|
||||
cOrbit = self.orbit.exportToC()
|
||||
cOrbit = self.orbit.exportToC(reference=self.sensingStart)
|
||||
geozero.setOrbit_Py(cOrbit)
|
||||
|
||||
#####Output cropped DEM for first band
|
||||
|
@ -347,7 +348,7 @@ class Geocode(Component):
|
|||
geozero.setDopplerAccessor_Py(self.polyDopplerAccessor)
|
||||
geozero.setPRF_Py(float(self.prf))
|
||||
geozero.setRadarWavelength_Py(float(self.radarWavelength))
|
||||
geozero.setSensingStart_Py(float(self.sensingStart))
|
||||
geozero.setSensingStart_Py(DTU.seconds_since_midnight(self.sensingStart))
|
||||
geozero.setFirstLatitude_Py(float(self.firstLatitude))
|
||||
geozero.setFirstLongitude_Py(float(self.firstLongitude))
|
||||
geozero.setDeltaLatitude_Py(float(self.deltaLatitude))
|
||||
|
@ -392,9 +393,7 @@ class Geocode(Component):
|
|||
self.radarWavelength = float(var)
|
||||
|
||||
def setSensingStart(self,var):
|
||||
rtime = datetime.datetime.combine(var.date(), datetime.time(0,0,0))
|
||||
secs = (var - rtime).total_seconds()
|
||||
self.sensingStart = float(secs)
|
||||
self.sensingStart = var
|
||||
|
||||
def setFirstLatitude(self,var):
|
||||
self.firstLatitude = float(var)
|
||||
|
|
|
@ -120,7 +120,7 @@ class Topo(Component):
|
|||
|
||||
self.setState()
|
||||
|
||||
cOrbit = self.orbit.exportToC()
|
||||
cOrbit = self.orbit.exportToC(reference=self.sensingStart)
|
||||
topozero.setOrbit_Py(cOrbit)
|
||||
topozero.topo_Py(self.demAccessor, self.polyDopplerAccessor, self.slantRangeAccessor)
|
||||
combinedlibmodule.freeCOrbit(cOrbit)
|
||||
|
|
|
@ -98,10 +98,10 @@ def main(factoryFile,package,buildDir):
|
|||
# import isce
|
||||
import filecmp
|
||||
try:
|
||||
import imp
|
||||
import importlib
|
||||
factoryFile = os.path.abspath(factoryFile)
|
||||
mod = imp.find_module(factoryFile.replace('.py',''))
|
||||
factModule = imp.load_module(factoryFile.replace('.py',''),mod[0],mod[1],mod[2])
|
||||
mod = importlib.util.spec_from_file_location('.', factoryFile)
|
||||
factModule = mod.loader.load_module()
|
||||
factoriesInfo = factModule.getFactoriesInfo()
|
||||
nameList = []
|
||||
for k,v in factoriesInfo.items():
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
import os, imp, sys
|
||||
import os, sys
|
||||
import importlib
|
||||
import argparse
|
||||
import configparser
|
||||
|
||||
|
@ -21,7 +22,7 @@ class ConfigParser:
|
|||
# Setting up and reading config
|
||||
Config = configparser.ConfigParser()
|
||||
Config.optionxform = str
|
||||
Config.readfp(content)
|
||||
Config.read_file(content)
|
||||
|
||||
# Reading the function sequence followed by input parameters
|
||||
# followed by the function parameters
|
||||
|
@ -94,14 +95,12 @@ class ConfigParser:
|
|||
|
||||
# If any of the following calls raises an exception,
|
||||
# there's a problem we can't handle -- let the caller handle it.
|
||||
fp, pathname, description = imp.find_module(name)
|
||||
spec = importlib.util.find_spec(name)
|
||||
|
||||
try:
|
||||
return imp.load_module(name, fp, pathname, description)
|
||||
finally:
|
||||
# Since we may exit via an exception, close fp explicitly.
|
||||
if fp:
|
||||
fp.close()
|
||||
return spec.loader.load_module()
|
||||
except ImportError:
|
||||
print('module {} not found'.format(name))
|
||||
|
||||
# Check existence of the input file
|
||||
def check_if_files_exist(Files, ftype='input'):
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
import os, imp, sys
|
||||
import os, sys
|
||||
import importlib
|
||||
import argparse
|
||||
import configparser
|
||||
|
||||
|
@ -22,7 +23,7 @@ class ConfigParser:
|
|||
# Setting up and reading config
|
||||
Config = configparser.ConfigParser()
|
||||
Config.optionxform = str
|
||||
Config.readfp(content)
|
||||
Config.read_file(content)
|
||||
|
||||
# Reading the function sequence followed by input parameters
|
||||
# followed by the function parameters
|
||||
|
@ -157,14 +158,12 @@ class ConfigParser:
|
|||
|
||||
# If any of the following calls raises an exception,
|
||||
# there's a problem we can't handle -- let the caller handle it.
|
||||
fp, pathname, description = imp.find_module(name)
|
||||
spec = importlib.util.find_spec(name)
|
||||
|
||||
try:
|
||||
return imp.load_module(name, fp, pathname, description)
|
||||
finally:
|
||||
# Since we may exit via an exception, close fp explicitly.
|
||||
if fp:
|
||||
fp.close()
|
||||
return spec.loader.load_module()
|
||||
except ImportError:
|
||||
print('module {} not found'.format(name))
|
||||
|
||||
# Check existence of the input file
|
||||
def check_if_files_exist(Files, ftype='input'):
|
||||
|
|
Loading…
Reference in New Issue