hytools package
Subpackages
- hytools.correction package
- hytools.io package
- hytools.misc package
- hytools.transform package
Submodules
hytools.base module
HyTools: Hyperspectral image processing library Copyright (C) 2021 University of Wisconsin
Authors: Adam Chlus, Zhiwei Ye, Philip Townsend.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Base
TODO: Add corrections to ndi()
- class hytools.base.Decoder(*, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)[source]
Bases:
JSONDecoder
- class hytools.base.HyTools[source]
Bases:
objectHyTools file object
- cosine_i()[source]
Calculate the cosine of the solar incidence angle. Assumes path to required ancillary datasets have been specified.
- Returns
Cosine of solar incidence angle.
- Return type
cos_i numpy.ndarray
- create_bad_bands(bad_regions)[source]
Create bad bands mask, Good: True, bad : False.
- Parameters
bad_regions (list of lists) – start and end values of wavelength
as (regions considered bad. Wavelengths should be in the same units) –
ex (data units.) – [[350,400]…..[2450,2500]].
- Returns
None.
- gen_mask(masker, name, args=None)[source]
Generate mask using masking function which takes a HyTools object as an argument.
- get_anc(anc, radians=True, mask=None)[source]
Read ancillary datasets to memory.
- Parameters
anc (str) – Ancillary dataset name.
radians (bool, optional) – Convert angular measures to radians. Defaults to True.
- Returns
anc_data (numpy.ndarray)
- get_band(index, corrections=[], mask=None)[source]
- Parameters
index (int) – Zero-indexed band index.
mask (str) – Return masked values using named mask.
corrections (list) – Corrections to apply, will be applied in
listed. (order) –
- Returns
A 2D (lines x columns) array or 1D if masked.
- Return type
numpy.ndarray
- get_chunk(col_start, col_end, line_start, line_end, corrections=[], resample=False)[source]
- Parameters
col_start (int) – Chunk starting column.
col_end (int) – Noninclusive chunk ending column index.
line_start (int) – Chunk starting line.
line_end (int) – Noninclusive chunk ending line index.
corrections (list) – Corrections to apply, will be applied in
listed. (order) –
resample (bool) – Resample wavelengths. Defaults to False.
- Returns
Chunk array (line_end-line_start,col_end-col_start,bands).
- Return type
numpy.ndarray
- get_column(index, corrections=[], resample=False)[source]
- Parameters
index (int) – Zero-indexed column index.
- Returns
Column array (lines, bands).
- Return type
numpy.ndarray
- get_line(index, corrections=[], resample=False)[source]
- Parameters
index (int) – Zero-indexed line index.
- Returns
Line array (columns, bands).
- Return type
numpy.ndarray
- get_pixels(lines, columns, corrections=[], resample=False)[source]
- Parameters
lines (list) – List of zero-indexed line indices.
columns (list) – List of zero-indexed column indices.
- Returns
Pixel array (pixels,bands).
- Return type
numpy.ndarray
- get_wave(wave, corrections=[], mask=None)[source]
Return the band image corresponding to the input wavelength. If not an exact match the closest wavelength will be returned.
- Parameters
wave (float) – Wavelength in image units.
mask (str) – Return masked values using named mask.
- Returns
Band image array (line,columns).
- Return type
numpy.ndarray
- iterate(by, chunk_size=(100, 100), corrections=[], resample=False)[source]
Create data Iterator.
- Parameters
by (str) – Dimension along which to iterate: “line”,”column”,”band”,”chunk”.
chunk_size (tuple, optional) – Two dimensional chunk size (Y,X). Applies only when “chunk” selected. Defaults to (100,100).
- Returns
Data Iterator.
- Return type
Iterator class object
- load_data(mode='r')[source]
Load data object to memory.
- Parameters
mode (str, optional) – File read mode. Defaults to ‘r’.
offset (int, optional) – Offset in bytes. Defaults to 0.
- Returns
None.
- ndi(wave1=850, wave2=660, mask=None)[source]
- Calculate normalized difference index.
Defaults to NDVI. Assumes input wavelengths are in nanometers
- Parameters
wave1 (int,float) – Wavelength of first band. Defaults to 850.
wave2 (int,float) – Wavelength of second band. Defaults to 660.
mask (bool) – Mask data
- Return type
ndi numpy.ndarray
Module contents
HyTools: Hyperspectral image processing library Copyright (C) 2021 University of Wisconsin
Authors: Adam Chlus, Zhiwei Ye, Philip Townsend.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Initialize hytools