Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spectral/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from __future__ import absolute_import, division, print_function, unicode_literals

__version__ = '0.22.2'
__version__ = '0.22.3'

import sys
if sys.byteorder == 'little':
Expand Down
3 changes: 1 addition & 2 deletions spectral/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,4 @@ class SpySettings:
[100, 0, 100],
[200, 0, 200],
[0, 100, 100],
[0, 200, 200]], np.int)

[0, 200, 200]], np.int8)
6 changes: 3 additions & 3 deletions spectral/graphics/colorscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ def __init__(self, levels, colors, num_tics=0):
if type(levels) in (list, tuple):
levels = [float(x) for x in levels]
elif isinstance(levels, np.ndarray):
levels = levels.astype(np.float)
levels = levels.astype(float)

self.span = levels[-1] - levels[0]
self.max = levels[-1]
self.min = levels[0]
self.tics = np.linspace(self.min, self.max, num_tics)
self.colorTics = np.zeros((len(self.tics), 3), np.int)
self.colorTics = np.zeros((len(self.tics), 3), int)
self.size = len(self.tics)
self.bgColor = np.array([0, 0, 0])

Expand All @@ -71,7 +71,7 @@ def __init__(self, levels, colors, num_tics=0):
dcolor = colors[j] - colors[j - 1]
dlevel = levels[j] - levels[j - 1]
self.colorTics[i] = (colors[j - 1] + (self.tics[i] - levels[j - 1])
/ dlevel * dcolor).astype(np.int)
/ dlevel * dcolor).astype(int)

def __call__(self, val):
'''Returns the scale color associated with the given value.'''
Expand Down
8 changes: 4 additions & 4 deletions spectral/graphics/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ def get_rgb_meta(source, bands=None, **kwargs):
# Pick the first, middle, and last bands
n = source.shape[-1]
bands = [0, n // 2, n - 1]
rgb = source.read_bands(bands).astype(np.float)
rgb = source.read_bands(bands).astype(float)
meta['bands'] = bands
else:
# It should be a numpy array
Expand All @@ -587,7 +587,7 @@ def get_rgb_meta(source, bands=None, **kwargs):
# first, middle, & last bands.
bands = [0, s[2] / 2, s[2] - 1]

rgb = np.take(source, bands, 2).astype(np.float)
rgb = np.take(source, bands, 2).astype(float)
if rgb.ndim == 2:
rgb = rgb[:, :, np.newaxis]
meta['bands'] = bands
Expand All @@ -614,14 +614,14 @@ def get_rgb_meta(source, bands=None, **kwargs):
scale.set_range(min(rgb.ravel()), max(rgb.ravel()))
rgb3 = np.zeros((s[0], s[1], 3), int)
rgb3 = np.apply_along_axis(scale, 2, rgb)
rgb = rgb3.astype(np.float) / 255.
rgb = rgb3.astype(float) / 255.
return (_fill_mask(rgb, mask, bg), meta)
else:
# Only one band of data to display but still need to determine how
# to scale the data values
meta['mode'] = 'monochrome'
monochrome = True
rgb = np.repeat(rgb, 3, 2).astype(np.float)
rgb = np.repeat(rgb, 3, 2).astype(float)

# Perform any requested color enhancements.

Expand Down
2 changes: 1 addition & 1 deletion spectral/graphics/ndwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def __init__(self, data, parent, id, *args, **kwargs):

self.data = data
self.classes = kwargs.get('classes',
np.zeros(data.shape[:-1], np.int))
np.zeros(data.shape[:-1], int))
self.features = kwargs.get('features', list(range(6)))
self.labels = kwargs.get('labels', list(range(data.shape[-1])))
self.max_menu_class = int(np.max(self.classes.ravel() + 1))
Expand Down
4 changes: 2 additions & 2 deletions spectral/io/spyfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@ def tile_image(im, nrows, ncols):
contains nrows lists, each of which contains
ncols SubImage objects.
'''
x = (np.array(list(range(nrows + 1))) * float(im.nrows) / nrows).astype(np.int)
y = (np.array(list(range(ncols + 1))) * float(im.ncols) / ncols).astype(np.int)
x = (np.array(list(range(nrows + 1))) * float(im.nrows) / nrows).astype(int)
y = (np.array(list(range(ncols + 1))) * float(im.ncols) / ncols).astype(int)
x[-1] = im.nrows
y[-1] = im.ncols

Expand Down