Skip to content

Commit

Permalink
Merge pull request #211 from micasense/fix-alignment
Browse files Browse the repository at this point in the history
Fixe some alignment issues
  • Loading branch information
sebc06 authored Feb 9, 2024
2 parents d1cb6f9 + bafaa56 commit c8c24dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
20 changes: 6 additions & 14 deletions Alignment v2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
"cell_type": "code",
"execution_count": null,
"id": "7426068b",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"import os, glob\n",
Expand All @@ -55,10 +53,10 @@
"# imagePath = Path(\"./data/REDEDGE-MX-DUAL\")\n",
"\n",
"# # these will return lists of image paths as strings \n",
"# imageNames = list(imagePath.glob('IMG_0007_*.tif'))\n",
"# imageNames = list(imagePath.glob('IMG_0431_*.tif'))\n",
"# imageNames = [x.as_posix() for x in imageNames]\n",
"\n",
"# panelNames = list(imagePath.glob('IMG_0001_*.tif'))\n",
"# panelNames = list(imagePath.glob('IMG_0000_*.tif'))\n",
"# panelNames = [x.as_posix() for x in panelNames]\n",
"\n",
"# imagePath = Path(\"./data/REDEDGE-MX\")\n",
Expand Down Expand Up @@ -316,9 +314,7 @@
"cell_type": "code",
"execution_count": null,
"id": "12c2a278",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"# from micasense.imageutils import brovey_pan_sharpen,radiometric_pan_sharpen\n",
Expand Down Expand Up @@ -449,9 +445,7 @@
"cell_type": "code",
"execution_count": null,
"id": "8626c90b",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"# figsize=(30,23) # use this size for full-image-resolution display\n",
Expand Down Expand Up @@ -771,9 +765,7 @@
"cell_type": "code",
"execution_count": null,
"id": "c0250872",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"x_band = red_band\n",
Expand Down
4 changes: 2 additions & 2 deletions Alignment-10Band.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"paneCap = None\n",
"\n",
"imagePath = os.path.join('.','data','REDEDGE-MX-DUAL')\n",
"imageNames = glob.glob(os.path.join(imagePath,'IMG_0007_*.tif'))\n",
"panelNames = glob.glob(os.path.join(imagePath,'IMG_0001_*.tif'))\n",
"imageNames = glob.glob(os.path.join(imagePath,'IMG_0431_*.tif'))\n",
"panelNames = glob.glob(os.path.join(imagePath,'IMG_0000_*.tif'))\n",
"\n",
"# Allow this code to align both radiance and reflectance images; bu excluding\n",
"# a definition for panelNames above, radiance images will be used\n",
Expand Down
4 changes: 2 additions & 2 deletions micasense/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_item(self, item, index=None):
val = self.exif[0][item]
if index is not None:
try:
if isinstance(val, pytz.unicode):
if isinstance(val, unicode):
val = val.encode('ascii', 'ignore')
except NameError:
# throws on python 3 where unicode is undefined
Expand All @@ -84,7 +84,7 @@ def size(self, item):
"""get the size (length) of a metadata item"""
val = self.get_item(item)
try:
if isinstance(val, pytz.unicode):
if isinstance(val, unicode):
val = val.encode('ascii', 'ignore')
except NameError:
# throws on python 3 where unicode is undefined
Expand Down

0 comments on commit c8c24dc

Please sign in to comment.