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