Skip to content

Commit

Permalink
codespell
Browse files Browse the repository at this point in the history
  • Loading branch information
schwehr committed Mar 18, 2024
1 parent 37986af commit f3ccd01
Show file tree
Hide file tree
Showing 24 changed files with 89 additions and 89 deletions.
16 changes: 8 additions & 8 deletions VERSIONS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Release date: 2019.10.06
New Features
------------

* Support for ECOSTRESS spectral library (supercedes ASTER library).
* Support for ECOSTRESS spectral library (supersedes ASTER library).

* Accept "mask" and "bg" keywords in `imshow` and `get_rgb` (affects color
scaling).
Expand Down Expand Up @@ -189,7 +189,7 @@ Bug Fixes
* Fixed a bug that potentially produced incorrect results in `map_class_ids`
(issue #53).

* Removed unecessary import that cause python3 compatibility error in
* Removed unnecessary import that cause python3 compatibility error in
`aviris.open` (issue #54).

* Removed `has_key` call breaking python3 compatibility (issue #56).
Expand Down Expand Up @@ -439,7 +439,7 @@ Performance Improvements
------------------------

* PerceptronClassifier is roughly an order of magnitude faster due to better
use of numpy. Inputs are now scaled and weights are initialized withing the
use of numpy. Inputs are now scaled and weights are initialized within the
data limits, which usually results in fewer iterations for convergence.

================================================================================
Expand Down Expand Up @@ -490,7 +490,7 @@ New Features
Performance Improvements
------------------------

* Significant speedup for sevaral algorithms using ndarray inputs:
* Significant speedup for several algorithms using ndarray inputs:

* 14x speedup for GMCL

Expand Down Expand Up @@ -528,7 +528,7 @@ Changes
Bug Fixes
---------

* Exception occured when *bands* argument was not provided to `imshow`.
* Exception occurred when *bands* argument was not provided to `imshow`.

* *stretch_all* parameter for `get_rgb` was sometimes being used when set to
False or 0 (because it was not None).
Expand Down Expand Up @@ -572,7 +572,7 @@ Changes
* If present, image band info is saved when `envi.save_image` is called.

* Allow calling :func:`~spectral.oi.envi.create_image` using keyword args
instead of ENVI-specific header paramter names.
instead of ENVI-specific header parameter names.

* `save_rgb` automatically determines the output file type, based on the
filename extension.
Expand Down Expand Up @@ -748,7 +748,7 @@ Release date: 2012.07.15

- Bug Fixes

- Fixed a bug in several deprecation warnings that caused infinte recursion.
- Fixed a bug in several deprecation warnings that caused infinite recursion.

- Fixed mismatch in parameter names in kmeans_ndarray.

Expand Down Expand Up @@ -796,7 +796,7 @@ Release date: 2011.01.17
- :meth:`spectral.kmeans` will accept a :exc:`KeyboardInterrupt` exception
(i.e., CTRL-C) and return the results as of the previous iteration.

- Documention is now online via Sphinx.
- Documentation is now online via Sphinx.

- Changes

Expand Down
22 changes: 11 additions & 11 deletions spectral/algorithms/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def iterator_ij(mask, index=None):
If `index` is not defined, iteration is performed over all non-zero
elements. If `index` is defined, iteration is performed over all
coordinates for whch `mask[i,j] == index`.
coordinates for which `mask[i,j] == index`.
'''

if mask.ndim != 2:
Expand Down Expand Up @@ -271,7 +271,7 @@ def cov_avg(image, mask, weighted=True):
`mask` (integer-valued ndarray):
Elements specify the classes associated with pixels in `image`.
All pixels associeted with non-zero elements of `mask` will be
All pixels associated with non-zero elements of `mask` will be
used in the covariance calculation.
`weighted` (bool, default True):
Expand Down Expand Up @@ -1174,7 +1174,7 @@ def ndvi(data, red, nir):

def bdist(class1, class2):
'''
Calulates the Bhattacharyya distance between two classes.
Calculates the Bhattacharyya distance between two classes.
USAGE: bd = bdist(class1, class2)
Expand All @@ -1201,7 +1201,7 @@ def bdist(class1, class2):

def bdist_terms(a, b):
'''
Calulate the linear and quadratic terms of the Bhattacharyya distance
Calculate the linear and quadratic terms of the Bhattacharyya distance
between two classes.
USAGE: (linTerm, quadTerm) = bDistanceTerms(a, b)
Expand Down Expand Up @@ -1438,7 +1438,7 @@ def noise_from_diffs(X, direction='lowerright'):
`X` (np.ndarray):
The data from which to estimage noise statistics. `X` should have
The data from which to estimate noise statistics. `X` should have
shape `(nrows, ncols, nbands`).
`direction` (str, default "lowerright"):
Expand Down Expand Up @@ -1495,7 +1495,7 @@ def __init__(self, signal, noise, napc):
`napc` (:class:`~spectral.PrincipalComponents`):
Noise-Adjusted Pricipal Components
Noise-Adjusted Principal Components
'''
self.signal = signal
self.noise = noise
Expand Down Expand Up @@ -1592,7 +1592,7 @@ def reduce(self, X, **kwargs):
Threshold signal-to-noise ratio (SNR) to retain.
Returns a verions of `X` with reduced dimensionality.
Returns a versions of `X` with reduced dimensionality.
Note that calling this method is equivalent to calling the
`get_reduction_transform` method with same keyword and applying the
Expand Down Expand Up @@ -1725,13 +1725,13 @@ def ppi(X, niters, threshold=0, centered=False, start=None, display=0,
An optional array of initial purity indices. This can be used to
continue computing PPI values after a previous call to `ppi` (i.e.,
set `start` equal to the return value from a previou call to `ppi`.
set `start` equal to the return value from a previous call to `ppi`.
This should be an integer-valued array whose dimensions are equal
to the first two dimensions of `X`.
`display` (integer):
If set to a postive integer, a :class:`~spectral.graphics.spypylab.ImageView`
If set to a positive integer, a :class:`~spectral.graphics.spypylab.ImageView`
window will be opened and dynamically display PPI values as the
function iterates. The value specifies the number of PPI iterations
between display updates. It is recommended to use a value around
Expand All @@ -1751,7 +1751,7 @@ def ppi(X, niters, threshold=0, centered=False, start=None, display=0,
These keywords will be passed to the image display and only have an
effect if the `display` argument is nonzero.
This function can be interruped with a KeyboardInterrupt (ctrl-C), in which
This function can be interrupted with a KeyboardInterrupt (ctrl-C), in which
case, the most recent value of the PPI array will be returned. This can be
used in conjunction with the `display` argument to view the progression of
the PPI values until they appear stable, then terminate iteration using
Expand Down Expand Up @@ -1920,7 +1920,7 @@ def smacc(spectra, min_endmembers=None, max_residual_norm=float('Inf')):
for k in range(len(Fs)):
t = On * Fs[k][q[n]]
# This is not so important for the algorithm itself.
# These values correpond to values where On == 0.0, and these
# These values correspond to values where On == 0.0, and these
# will be zeroed out below. But to avoid divide-by-zero warning
# we set small values instead of zero.
t[t == 0.0] = 1e-10
Expand Down
2 changes: 1 addition & 1 deletion spectral/algorithms/classifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class PerceptronClassifier(Perceptron, SupervisedClassifier):
'''A multi-layer perceptron classifier with backpropagation learning.
Multi-layer perceptrons often require many (i.e., thousands) of iterations
through the traning data to converge on a solution. Therefore, it is not
through the training data to converge on a solution. Therefore, it is not
recommended to attempt training a network on full-dimensional hyperspectral
data or even on a full set of image pixels. It is likely preferable to
first train the network on a subset of the data, then retrain the network
Expand Down
4 changes: 2 additions & 2 deletions spectral/algorithms/clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def kmeans(image, nclusters=10, max_iterations=20, **kwargs):
`class_map` (:class:`numpy.ndarray`):
An `MxN` array whos values are the indices of the cluster for the
An `MxN` array who's values are the indices of the cluster for the
corresponding element of `image`.
`centers` (:class:`numpy.ndarray`):
Expand Down Expand Up @@ -250,7 +250,7 @@ def kmeans_ndarray(image, nclusters=10, max_iterations=20, **kwargs):
`class_map` (:class:`numpy.ndarray`):
An `MxN` array whos values are the indices of the cluster for the
An `MxN` array who's values are the indices of the cluster for the
corresponding element of `image`.
`centers` (:class:`numpy.ndarray`):
Expand Down
16 changes: 8 additions & 8 deletions spectral/algorithms/continuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Continuum is defined as convex hull of spectrum.
Continuum is removed from spectra by dividing spectra by its continuum.
That results in values between 0 and 1, where absorption bands are expressed as
drops below 1. It is usefull for comparing and classification based on
drops below 1. It is useful for comparing and classification based on
absorption bands and indifferent to scale.
References:
Expand Down Expand Up @@ -239,13 +239,13 @@ def continuum_points(spectrum, bands, mode='convex'):
1d :class:`numpy.ndarray`, holding band values of spectra.
Length of `bands` should be the same as `spectrum`.
Note that bands should be sorted in ascending order (which is often
not the case with AVIRIS), otherwise unexpected results could occure.
not the case with AVIRIS), otherwise unexpected results could occur.
`mode` (string, default 'convex'):
Default mode is 'convex' which returns convex upper hull of the
spectrum. Another supported mode is 'segmented' which builds
segmented upper hull. This is usefull to identify more detailed
segmented upper hull. This is useful to identify more detailed
contour of the spectrum, but without strong absorption bands.
Returns:
Expand Down Expand Up @@ -286,13 +286,13 @@ def spectral_continuum(spectra, bands, mode='convex', out=None):
1d :class:`numpy.ndarray`, holding band values of spectra.
Length of `bands` should be the same as last dimension of `spectra`.
Note that bands should be sorted in ascending order (which is often
not the case with AVIRIS), otherwise unexpected results could occure.
not the case with AVIRIS), otherwise unexpected results could occur.
`mode` (string, default 'convex'):
Default mode is 'convex' which returns convex upper hull of the
spectrum. Another supported mode is 'segmented' which builds
segmented upper hull. This is usefull to identify more detailed
segmented upper hull. This is useful to identify more detailed
contour of the spectrum, but without strong absorption bands.
`out` (:class:`numpy.ndarray`, default None):
Expand All @@ -313,7 +313,7 @@ def spectral_continuum(spectra, bands, mode='convex', out=None):
def remove_continuum(spectra, bands, mode='convex', out=None):
'''Returns spectra with continuum removed.
Continuum is defined as convex hull of spectra. Continuum is removed from
spectra by deviding spectra by its continuum.
spectra by dividing spectra by its continuum.
Arguments:
Expand All @@ -327,13 +327,13 @@ def remove_continuum(spectra, bands, mode='convex', out=None):
1d :class:`numpy.ndarray`, holding band values of spectra.
Length of `bands` should be the same as last dimension of `spectra`.
Note that bands should be sorted in ascending order (which is often
not the case with AVIRIS), otherwise unexpected results could occure.
not the case with AVIRIS), otherwise unexpected results could occur.
`mode` (string, default 'convex'):
Default mode is 'convex' which removes convex upper hull of the
spectrum. Another supported mode is 'segmented' which removes
segmented upper hull. This is usefull to identify two or more small
segmented upper hull. This is useful to identify two or more small
features instead of one large feature.
`out` (:class:`numpy.ndarray`, default None):
Expand Down
12 changes: 6 additions & 6 deletions spectral/algorithms/detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def matched_filter(X, target, background=None, window=None, cov=None):
Must have the form (`inner`, `outer`), where the two values
specify the widths (in pixels) of inner and outer windows centered
about the pixel being evaulated. Both values must be odd integers.
about the pixel being evaluated. Both values must be odd integers.
The background mean and covariance will be estimated from pixels
in the outer window, excluding pixels within the inner window. For
example, if (`inner`, `outer`) = (5, 21), then the number of
Expand Down Expand Up @@ -319,7 +319,7 @@ def rx(X, background=None, window=None, cov=None):
Must have the form (`inner`, `outer`), where the two values
specify the widths (in pixels) of inner and outer windows centered
about the pixel being evaulated. Both values must be odd integers.
about the pixel being evaluated. Both values must be odd integers.
The background mean and covariance will be estimated from pixels
in the outer window, excluding pixels within the inner window. For
example, if (`inner`, `outer`) = (5, 21), then the number of
Expand Down Expand Up @@ -407,7 +407,7 @@ def __init__(self, target, background=None, **kwargs):
`vectorize` (bool, default True):
Specifies whether the __call__ method should attempt to vectorize
operations. This typicall results in faster computation but will
operations. This typically results in faster computation but will
consume more memory.
'''
for k in kwargs:
Expand Down Expand Up @@ -564,7 +564,7 @@ def ace(X, target, background=None, window=None, cov=None, **kwargs):
The return value will be an ndarray with shape (R, C).
A length-D sequence (e.g., list or tuple) of length-B ndarrays.
In this case, the detector will be applied seperately to each of
In this case, the detector will be applied separately to each of
the `D` targets. This is equivalent to calling the function
sequentially for each target and stacking the results but is
much faster. The return value will be an ndarray with shape
Expand All @@ -580,7 +580,7 @@ def ace(X, target, background=None, window=None, cov=None, **kwargs):
Must have the form (`inner`, `outer`), where the two values
specify the widths (in pixels) of inner and outer windows centered
about the pixel being evaulated. Both values must be odd integers.
about the pixel being evaluated. Both values must be odd integers.
The background mean and covariance will be estimated from pixels
in the outer window, excluding pixels within the inner window. For
example, if (`inner`, `outer`) = (5, 21), then the number of
Expand Down Expand Up @@ -615,7 +615,7 @@ def ace(X, target, background=None, window=None, cov=None, **kwargs):
`vectorize` (bool, default True):
Specifies whether the function should attempt to vectorize
operations. This typicall results in faster computation but will
operations. This typically results in faster computation but will
consume more memory.
Returns numpy.ndarray:
Expand Down
2 changes: 1 addition & 1 deletion spectral/algorithms/perceptron.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, shape, k=1.0, weights=None):
def randomize_weights(self):
'''Randomizes the layer weight matrix.
The bias weight will be in the range [0, 1). The remaining weights will
correspond to a vector with unit length and uniform random orienation.
correspond to a vector with unit length and uniform random orientation.
'''
self.weights = 1. - 2. * np.random.rand(*self.shape)
for row in self.weights:
Expand Down
8 changes: 4 additions & 4 deletions spectral/algorithms/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def map_window(func, image, window, rslice=(None,), cslice=(None,),
`border` (string, default "shift"):
Indicates how to handles windows near the edge of the window. If
the value is "shift", the window dimensions will alway be
the value is "shift", the window dimensions will always be
`(width, height)` but near the image border the pixel being
iterated will be offset from the center of the window. If set to
"clip", window regions falling outside the image border will be
Expand Down Expand Up @@ -331,7 +331,7 @@ def map_outer_window_stats(func, image, inner, outer, dim_out=1, cov=None,


class WindowedGaussianBackgroundMapper(object):
'''A class for procucing window statistics with an inner exclusion window.
'''A class for producing window statistics with an inner exclusion window.
'''
def __init__(self, inner, outer, function=None, cov=None, dim_out=None,
dtype=None):
Expand All @@ -341,11 +341,11 @@ def __init__(self, inner, outer, function=None, cov=None, dim_out=None,
`inner` (integer or 2-tuple of integers):
Width and heigth of inner window, in pixels.
Width and height of inner window, in pixels.
`outer` (integer or 2-tuple of integers):
Width and heigth of outer window, in pixels. Dimensions must
Width and height of outer window, in pixels. Dimensions must
be greater than inner window
`function` (callable object):
Expand Down
2 changes: 1 addition & 1 deletion spectral/algorithms/spymath.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_histogram_cdf_points(data, cdf_vals, ignore=None, mask=None):
`ignore` (numeric, default `None`):
A scalar value that should be ignored when computing histogram
points (e.g., a value that indicates bad data). If this valus is
points (e.g., a value that indicates bad data). If this value is
not specified, all data are used.
Return value:
Expand Down
4 changes: 2 additions & 2 deletions spectral/algorithms/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, A, **kwargs):
An (J,K) array to be applied to length-K targets.
Keyword Argments:
Keyword Arguments:
`pre` (scalar or length-K sequence):
Expand All @@ -58,7 +58,7 @@ def __init__(self, A, **kwargs):
self._post = kwargs.get('post', None)
A = np.array(A, copy=True)
if A.ndim == 0:
# Do not know input/ouput dimensions
# Do not know input/output dimensions
self._A = A
(self.dim_out, self.dim_in) = (None, None)
else:
Expand Down
Loading

0 comments on commit f3ccd01

Please sign in to comment.