Skip to content

Commit

Permalink
drop no longer necessary isce imports; remove some unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jhkennedy committed Feb 28, 2024
1 parent 3b19f48 commit b3baff5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 26 deletions.
1 change: 0 additions & 1 deletion isce2_topsapp/iono_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import datetime
import os
import shutil
import site
from pathlib import Path
from typing import Type, Union

Expand Down
3 changes: 1 addition & 2 deletions isce2_topsapp/localize_dem.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import site
import subprocess
from pathlib import Path

Expand Down Expand Up @@ -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']
Expand Down
13 changes: 3 additions & 10 deletions isce2_topsapp/packaging_utils/isce_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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()
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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



6 changes: 1 addition & 5 deletions isce2_topsapp/packaging_utils/makeGeocube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions isce2_topsapp/packaging_utils/nc_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@
from builtins import range
from builtins import object
import argparse
import sys
import json
import logging
import traceback
from collections import OrderedDict
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)
Expand Down
5 changes: 1 addition & 4 deletions isce2_topsapp/topsapp_proc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os
import site
import subprocess
from pathlib import Path

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b3baff5

Please sign in to comment.