Skip to content

Commit

Permalink
Fixed pgc_pansharpen bug
Browse files Browse the repository at this point in the history
  • Loading branch information
clairecporter committed May 7, 2020
1 parent 7f67a53 commit e46adf7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pgc_pansharpen.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def _get_panchromatic_name(self):

def _get_image_info(self, src_image, spatial_ref):

if self.sensor == 'IK01' and "_msi_" in src_image:
src_image_name = src_image.replace("_msi_", "_blu_")
if self.sensor == 'IK01' and "_msi_" in src_image and not os.path.isfile(src_image):
src_image_name = os.path.basename(src_image).replace("_msi_", "_blu_")
src_image = os.path.join(self.srcdir, src_image_name)

ds = gdal.Open(src_image, gdalconst.GA_ReadOnly)
Expand Down Expand Up @@ -145,7 +145,6 @@ def _get_image_info(self, src_image, spatial_ref):
ysize = ds.RasterYSize
proj = ds.GetProjectionRef()
gtf = ds.GetGeoTransform()
print(gtf)

ulx = gtf[0] + 0 * gtf[1] + 0 * gtf[2]
uly = gtf[3] + 0 * gtf[4] + 0 * gtf[5]
Expand Down

0 comments on commit e46adf7

Please sign in to comment.