Skip to content

Commit

Permalink
Merge pull request #76 from developmentseed/develop
Browse files Browse the repository at this point in the history
version 0.6.3
  • Loading branch information
Scisco committed Apr 29, 2015
2 parents 97e2a7e + ca8a136 commit 87784f3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changes
=======

0.6.3 (2015-04-29)
------------------
- adjust lower rescaling bound, closes #66 for now
- better pixel math for #71
- update destination transform calculation for reprojection in polar regions

0.6.2 (2015-04-24)
------------------
- Updated readme
Expand Down
2 changes: 1 addition & 1 deletion landsat/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.6.2'
__version__ = '0.6.3'
18 changes: 10 additions & 8 deletions landsat/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,17 @@ def run(self, pansharpen=True):
crn = self._get_boundaries(src_data)

dst_shape = src_data['shape']
y_pixel = (max(crn['ul']['y'][1][0], crn['ur']['y'][1][0]) -
min(crn['lr']['y'][1][0], crn['ll']['y'][1][0])) / dst_shape[0]
x_pixel = (max(crn['lr']['x'][1][0], crn['ur']['x'][1][0]) -
min(crn['ul']['x'][1][0], crn['ll']['x'][1][0])) / dst_shape[1]

dst_transform = (min(crn['ul']['x'][1][0], crn['ll']['x'][1][0]),
dst_corner_ys = [crn[k]['y'][1][0] for k in crn.keys()]
dst_corner_xs = [crn[k]['x'][1][0] for k in crn.keys()]
y_pixel = abs(max(dst_corner_ys) -
min(dst_corner_ys)) / dst_shape[0]
x_pixel = abs(max(dst_corner_xs) -
min(dst_corner_xs)) / dst_shape[1]

dst_transform = (min(dst_corner_xs),
x_pixel,
0.0,
max(crn['ul']['y'][1][0], crn['ur']['y'][1][0]),
max(dst_corner_ys),
0.0,
-y_pixel)
# Delete crn since no longer needed
Expand Down Expand Up @@ -171,7 +173,7 @@ def run(self, pansharpen=True):

for i, band in enumerate(new_bands):
# Color Correction
band = self._color_correction(band, self.bands[i], 0.1, cloud_cover)
band = self._color_correction(band, self.bands[i], 0, cloud_cover)

output.write_band(i+1, img_as_ubyte(band))

Expand Down

0 comments on commit 87784f3

Please sign in to comment.