diff --git a/isce2_topsapp/iono_proc.py b/isce2_topsapp/iono_proc.py index aaece72..13d082a 100644 --- a/isce2_topsapp/iono_proc.py +++ b/isce2_topsapp/iono_proc.py @@ -5,7 +5,6 @@ import datetime import os import shutil -import site from pathlib import Path from typing import Type, Union diff --git a/isce2_topsapp/localize_dem.py b/isce2_topsapp/localize_dem.py index f513f2f..25e0ddc 100644 --- a/isce2_topsapp/localize_dem.py +++ b/isce2_topsapp/localize_dem.py @@ -1,4 +1,3 @@ -import site import subprocess from pathlib import Path @@ -28,7 +27,7 @@ def tag_dem_xml_as_ellipsoidal(dem_path: Path) -> str: def fix_image_xml(isce_raster_path: str) -> str: - fix_cmd = [f'fixImageXml.py', + fix_cmd = ['fixImageXml.py', '-i', str(isce_raster_path), '--full'] diff --git a/isce2_topsapp/packaging_utils/isce_functions.py b/isce2_topsapp/packaging_utils/isce_functions.py index caec438..f3e4df7 100755 --- a/isce2_topsapp/packaging_utils/isce_functions.py +++ b/isce2_topsapp/packaging_utils/isce_functions.py @@ -5,7 +5,9 @@ from __future__ import division from builtins import str from builtins import range -from osgeo import gdal, ogr, osr +from osgeo import gdal, ogr + +import isce def data_loading(filename,out_data_type=None,data_band=None): @@ -209,11 +211,8 @@ def get_topsApp_data(topsapp_xml='topsApp'): ''' loading the topsapp xml file ''' - - import isce from topsApp import TopsInSAR import os - import pdb # prvide the full path and strip off any .xml if pressent topsapp_xml = os.path.splitext(os.path.abspath(topsapp_xml))[0] curdir = os.getcwd() @@ -228,7 +227,6 @@ def get_topsApp_data(topsapp_xml='topsApp'): return insar def get_isce_version_info(args): - import isce isce_version = isce.release_version if isce.release_svn_revision: isce_version = "ISCE version = " + isce_version + ", " + "SVN revision = " + isce.release_svn_revision @@ -442,8 +440,6 @@ def check_file_exist(infile): raise Exception(infile + " does not exist") def read_isce_product(xmlfile): - import os - import isce from iscesys.Component.ProductManager import ProductManager as PM # check if the file does exist @@ -622,6 +618,3 @@ def get_bbox(args): # return the polygon as a list of strings, which each poly a list argument geom_union_str = ["%s"%geom_union] return geom_union_str - - - diff --git a/isce2_topsapp/packaging_utils/makeGeocube.py b/isce2_topsapp/packaging_utils/makeGeocube.py index d76e9a7..356cbd5 100644 --- a/isce2_topsapp/packaging_utils/makeGeocube.py +++ b/isce2_topsapp/packaging_utils/makeGeocube.py @@ -2,20 +2,16 @@ from builtins import str from builtins import range from builtins import object -import math import numpy as np import os -import isce import argparse import h5py -import datetime import pyproj -import pdb import logging import shutil from time import time from functools import wraps -from joblib import Parallel, delayed, dump, load +from joblib import Parallel, delayed from pathlib import Path from pyproj import CRS diff --git a/isce2_topsapp/packaging_utils/nc_packaging.py b/isce2_topsapp/packaging_utils/nc_packaging.py index 1fa2a35..c990052 100755 --- a/isce2_topsapp/packaging_utils/nc_packaging.py +++ b/isce2_topsapp/packaging_utils/nc_packaging.py @@ -5,7 +5,6 @@ from builtins import range from builtins import object import argparse -import sys import json import logging import traceback @@ -13,12 +12,9 @@ import os from netCDF4 import Dataset import numpy as np -import isce -import osgeo from osgeo import gdal from osgeo import osr import collections.abc -import pdb log_format = "[%(asctime)s: %(levelname)s/%(funcName)s] %(message)s" logging.basicConfig(format=log_format, level=logging.INFO) diff --git a/isce2_topsapp/topsapp_proc.py b/isce2_topsapp/topsapp_proc.py index eea1b45..33735bf 100644 --- a/isce2_topsapp/topsapp_proc.py +++ b/isce2_topsapp/topsapp_proc.py @@ -1,5 +1,3 @@ -import os -import site import subprocess from pathlib import Path @@ -99,9 +97,8 @@ def topsapp_processing(*, with open('topsApp.xml', "w") as file: file.write(topsApp_xml) - tops_app_cmd = f'{isce_application_path}/topsApp.py' for step in tqdm(TOPSAPP_STEPS, desc='TopsApp Steps'): - step_cmd = f'{tops_app_cmd} --dostep={step}' + step_cmd = f'topsApp.py --dostep={step}' result = subprocess.run(step_cmd, shell=True) if result.returncode != 0: