7. Tutorial: batch

hs_process.batch extends the functionality of the core modules of hs_process (segment, spatial_mod, and spec_mod) so that image processing can run via a relatively straightforward script without end user interaction.

The overall goal of the batch module is to implement many post-processing steps across many datacubes via an easy-to-use API. It was designed to save all data products (intermediate or final) to disk. Any unwanted files must be manually deleted by the user.


7.1. Sample data

Sample imagery captured from a Resonon Pika II VIS-NIR line scanning imager and ancillary sample files can be downloaded from this link.

Before trying this tutorial on your own machine, please download the sample files and place into a local directory of your choosing (and do not change the file names). Indicate the location of your sample files by modifying data_dir:

[1]:
data_dir = r'F:\\nigo0024\Documents\hs_process_demo'

7.2. Confirm your environment

Before trying the tutorials, be sure hs_process and its dependencies are properly installed. If you installed in a virtual environment, first check we are indeed using the Python instance that was installed with the virtual environment:

[2]:
import sys

print('Python install location: {0}'.format(sys.executable))
Python install location: C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\python.exe

The spec folder that contains python.exe tells me that the activated Python instance is indeed in the spec environment, just as I intend. If you created a virtual environment, but your python.exe is not in the envs\spec directory, you either did not properly create your virtual environment or you are not pointing to the correct Python installation in your IDE (e.g., Spyder, Jupyter notebook, etc.).


7.3. batch.cube_to_spectra

Calculates the mean and standard deviation for each cube in fname_list and writes the result to a “.spec” file. [API]

Note: The following batch example builds on the results of the `spatial_mod.crop_many_gdf tutorial <tutorial_spatial_mod.html#spatial_mod.crop_many_gdf>`__. Please complete the `spatial_mod.crop_many_gdf <tutorial_spatial_mod.html#spatial_mod.crop_many_gdf>`__ example to be sure your directory (i.e., base_dir) is populated with multiple hyperspectral datacubes. The following example will be using datacubes located in the following directory: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf

Load and initialize the batch module, checking to be sure the directory exists.

[3]:
import os
from hs_process import batch

base_dir = os.path.join(data_dir, 'spatial_mod', 'crop_many_gdf')
print(os.path.isdir(base_dir))
hsbatch = batch(base_dir, search_ext='.bip')  # searches for all files in ``base_dir`` with a ".bip" file extension
True

Use batch.cube_to_spectra to calculate the mean and standard deviation across all pixels for each of the datacubes in base_dir.

[4]:
hsbatch.cube_to_spectra(base_dir=base_dir, geotiff=False, out_force=True)
Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1011-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1011-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1012-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1012-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1013-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1013-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1014-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1014-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1015-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1015-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1016-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1016-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1017-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1017-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1018-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1018-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_611-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_611-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_612-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_612-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_613-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_613-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_614-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_614-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_615-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_615-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_616-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_616-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_617-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_617-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_618-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_618-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_711-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_711-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_712-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_712-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_713-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_713-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_714-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_714-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_715-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_715-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_716-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_716-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_717-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_717-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_718-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_718-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_811-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_811-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_812-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_812-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_813-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_813-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_814-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_814-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_815-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_815-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_816-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_816-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_817-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_817-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_818-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_818-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_911-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_911-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_912-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_912-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_913-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_913-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_914-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_914-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_915-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_915-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_916-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_916-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_917-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_917-cube-to-spec-mean.spec

Calculating mean spectra: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\Wells_rep2_20180628_16h56m_pika_gige_7_plot_918-crop-many-gdf.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\cube_to_spec\Wells_rep2_20180628_16h56m_pika_gige_7_plot_918-cube-to-spec-mean.spec

Use `seaborn <https://seaborn.pydata.org/index.html>`__ to visualize the spectra of plots 1011, 1012, and 1013. Notice how hsbatch.io.name_plot is utilized to retrieve the plot ID, and how the “history” tag is referenced from the metadata to determine the number of pixels whose reflectance was averaged to create the mean spectra. Also remember that pixels across the original input image likely represent a combination of soil, vegetation, and shadow.

[5]:
import seaborn as sns
import re

fname_list = [os.path.join(data_dir, 'spatial_mod', 'crop_many_gdf', 'cube_to_spec', 'Wells_rep2_20180628_16h56m_pika_gige_7_plot_1011-cube-to-spec-mean.spec'),
              os.path.join(data_dir, 'spatial_mod', 'crop_many_gdf', 'cube_to_spec', 'Wells_rep2_20180628_16h56m_pika_gige_7_plot_1012-cube-to-spec-mean.spec'),
              os.path.join(data_dir, 'spatial_mod', 'crop_many_gdf', 'cube_to_spec', 'Wells_rep2_20180628_16h56m_pika_gige_7_plot_1013-cube-to-spec-mean.spec')]

colors = ['red', 'green', 'blue']

for fname, color in zip(fname_list, colors):
    hsbatch.io.read_spec(fname)
    meta_bands = list(hsbatch.io.tools.meta_bands.values())
    data = hsbatch.io.spyfile_spec.load().flatten() * 100
    hist = hsbatch.io.spyfile_spec.metadata['history']
    pix_n = re.search('<pixel number: (.*)>', hist).group(1)
    ax = sns.lineplot(x=meta_bands, y=data, color=color, label='Plot '+hsbatch.io.name_plot+' (n='+pix_n+')')

ax.set_xlabel('Wavelength (nm)', weight='bold')
ax.set_ylabel('Reflectance (%)', weight='bold')
ax.set_title(r'API Example: `batch.cube_to_spectra`', weight='bold')
[5]:
Text(0.5, 1.0, 'API Example: `batch.cube_to_spectra`')
_images/tutorial_batch_9_1.png

7.4. batch.segment_band_math

Batch processing tool to perform band math on multiple datacubes in the same way. batch.segment_band_math is typically used prior to batch.segment_create_mask to generate the images/directory required for the masking process. [API]

Note: The following batch example builds on the results of the `spatial_mod.crop_many_gdf tutorial <tutorial_spatial_mod.html#spatial_mod.crop_many_gdf>`__. Please complete the `spatial_mod.crop_many_gdf <tutorial_spatial_mod.html#spatial_mod.crop_many_gdf>`__ example to be sure your directory (i.e., base_dir) is populated with multiple hyperspectral datacubes. The following example will be using datacubes located in the following directory: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf

Load and initialize the batch module, checking to be sure the directory exists.

[6]:
import os
from hs_process import batch

base_dir = os.path.join(data_dir, 'spatial_mod', 'crop_many_gdf')
print(os.path.isdir(base_dir))
hsbatch = batch(base_dir, search_ext='.bip')  # searches for all files in ``base_dir`` with a ".bip" file extension
True

Use batch.segment_band_math to compute the MCARI2 (Modified Chlorophyll Absorption Ratio Index Improved; Haboudane et al., 2004) spectral index for each of the datacubes in base_dir. See Harris Geospatial_ for more information about the MCARI2 spectral index and references to other spectral indices.

[7]:
folder_name = 'band_math_mcari2-800-670-550'  # folder name can be modified to be more descriptive in what type of band math is being performed
method = 'mcari2'  # must be one of "ndi", "ratio", "derivative", or "mcari2"
wl1 = 800
wl2 = 670
wl3 = 550
hsbatch.segment_band_math(base_dir=base_dir, folder_name=folder_name,
                          name_append='band-math', geotiff=True,
                          method=method, wl1=wl1, wl2=wl2, wl3=wl3,
                          plot_out=True, out_force=True)
Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1011-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1012-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1013-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1014-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1015-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1016-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1017-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1018-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_611-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_612-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_613-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_614-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_615-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_616-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_617-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_618-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_711-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_712-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_713-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_714-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_715-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_716-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_717-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_718-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_811-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_812-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_813-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_814-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_815-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_816-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_817-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_818-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_911-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_912-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_913-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_914-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_915-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_916-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_917-band-math-mcari2-800-670-550.bip



Bands used (``b1``): [198]
Bands used (``b2``): [135]
Bands used (``b3``): [77]

Wavelengths used (``b1``): [799.0016]
Wavelengths used (``b2``): [669.6752]
Wavelengths used (``b3``): [550.6128]

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:2702: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig, ax = plt.subplots()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550\Wells_rep2_20180628_16h56m_pika_gige_7_plot_918-band-math-mcari2-800-670-550.bip


_images/tutorial_batch_13_41.png
_images/tutorial_batch_13_42.png
_images/tutorial_batch_13_43.png
_images/tutorial_batch_13_44.png
_images/tutorial_batch_13_45.png
_images/tutorial_batch_13_46.png
_images/tutorial_batch_13_47.png
_images/tutorial_batch_13_48.png
_images/tutorial_batch_13_49.png
_images/tutorial_batch_13_50.png
_images/tutorial_batch_13_51.png
_images/tutorial_batch_13_52.png
_images/tutorial_batch_13_53.png
_images/tutorial_batch_13_54.png
_images/tutorial_batch_13_55.png
_images/tutorial_batch_13_56.png
_images/tutorial_batch_13_57.png
_images/tutorial_batch_13_58.png
_images/tutorial_batch_13_59.png
_images/tutorial_batch_13_60.png
_images/tutorial_batch_13_61.png
_images/tutorial_batch_13_62.png
_images/tutorial_batch_13_63.png
_images/tutorial_batch_13_64.png
_images/tutorial_batch_13_65.png
_images/tutorial_batch_13_66.png
_images/tutorial_batch_13_67.png
_images/tutorial_batch_13_68.png
_images/tutorial_batch_13_69.png
_images/tutorial_batch_13_70.png
_images/tutorial_batch_13_71.png
_images/tutorial_batch_13_72.png
_images/tutorial_batch_13_73.png
_images/tutorial_batch_13_74.png
_images/tutorial_batch_13_75.png
_images/tutorial_batch_13_76.png
_images/tutorial_batch_13_77.png
_images/tutorial_batch_13_78.png
_images/tutorial_batch_13_79.png
_images/tutorial_batch_13_80.png

batch.segment_band_math creates a new folder in base_dir (in this case the new directory is F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550), which contains several data products.

The first is band-math-stats.csv: a spreadsheet containing summary statistics for each of the image cubes that were processed via batch.segment_band_math; stats include pixel count, mean, standard deviation, median, and percentiles across all image pixels.

[8]:
import pandas as pd

pd.read_csv(os.path.join(data_dir, 'spatial_mod', 'crop_many_gdf', 'band_math_mcari2-800-670-550', 'band-math-stats.csv'))
[8]:
fname plot_id count mean std_dev median pctl_10th pctl_25th pctl_50th pctl_75th pctl_90th pctl_95th
0 F:\\nigo0024\Documents\hs_process_demo\spatial... 1011 3391 0.622999 0.154441 0.647932 0.400957 0.526855 0.647932 0.743904 0.802663 0.825942
1 F:\\nigo0024\Documents\hs_process_demo\spatial... 1012 4902 0.627408 0.137226 0.651605 0.432411 0.545338 0.651605 0.732981 0.783473 0.806512
2 F:\\nigo0024\Documents\hs_process_demo\spatial... 1013 4902 0.483455 0.170385 0.491520 0.244630 0.349948 0.491520 0.626670 0.698892 0.737506
3 F:\\nigo0024\Documents\hs_process_demo\spatial... 1014 4902 0.582990 0.175643 0.618471 0.315483 0.473933 0.618471 0.727224 0.779835 0.804277
4 F:\\nigo0024\Documents\hs_process_demo\spatial... 1015 4902 0.582303 0.161018 0.597912 0.351104 0.461747 0.597912 0.716367 0.782069 0.809144
5 F:\\nigo0024\Documents\hs_process_demo\spatial... 1016 4902 0.610922 0.141988 0.632506 0.416628 0.514711 0.632506 0.723370 0.777661 0.803735
6 F:\\nigo0024\Documents\hs_process_demo\spatial... 1017 4902 0.535699 0.189333 0.550865 0.263800 0.386807 0.550865 0.698782 0.775264 0.804146
7 F:\\nigo0024\Documents\hs_process_demo\spatial... 1018 4771 0.461022 0.203118 0.467969 0.177923 0.294047 0.467969 0.629451 0.730637 0.772134
8 F:\\nigo0024\Documents\hs_process_demo\spatial... 611 4509 0.656765 0.147861 0.688531 0.438843 0.566915 0.688531 0.769568 0.822617 0.846559
9 F:\\nigo0024\Documents\hs_process_demo\spatial... 612 4902 0.616951 0.168515 0.648011 0.367709 0.517278 0.648011 0.749566 0.809077 0.835821
10 F:\\nigo0024\Documents\hs_process_demo\spatial... 613 4902 0.553968 0.175042 0.569500 0.303841 0.428101 0.569500 0.696116 0.773253 0.808112
11 F:\\nigo0024\Documents\hs_process_demo\spatial... 614 4902 0.597483 0.171152 0.631154 0.339392 0.496289 0.631154 0.729858 0.790967 0.821224
12 F:\\nigo0024\Documents\hs_process_demo\spatial... 615 4902 0.673210 0.145662 0.709712 0.462546 0.587136 0.709712 0.782980 0.831123 0.852142
13 F:\\nigo0024\Documents\hs_process_demo\spatial... 616 4902 0.643378 0.154725 0.669742 0.416074 0.538374 0.669742 0.771166 0.825665 0.845516
14 F:\\nigo0024\Documents\hs_process_demo\spatial... 617 4902 0.656940 0.139822 0.683504 0.458762 0.569568 0.683503 0.764074 0.817668 0.843806
15 F:\\nigo0024\Documents\hs_process_demo\spatial... 618 4428 0.387672 0.203790 0.370099 0.118169 0.225142 0.370099 0.543578 0.684901 0.737255
16 F:\\nigo0024\Documents\hs_process_demo\spatial... 711 4420 0.668268 0.146896 0.698327 0.450712 0.592763 0.698327 0.779889 0.829517 0.850028
17 F:\\nigo0024\Documents\hs_process_demo\spatial... 712 4902 0.559168 0.174761 0.581612 0.306548 0.433534 0.581612 0.701241 0.775299 0.804926
18 F:\\nigo0024\Documents\hs_process_demo\spatial... 713 4902 0.607665 0.154029 0.629656 0.385508 0.495919 0.629656 0.730492 0.793064 0.821173
19 F:\\nigo0024\Documents\hs_process_demo\spatial... 714 4902 0.643979 0.145662 0.669699 0.433602 0.555764 0.669699 0.757467 0.811623 0.834519
20 F:\\nigo0024\Documents\hs_process_demo\spatial... 715 4902 0.676225 0.131577 0.701983 0.491954 0.595112 0.701983 0.777706 0.823654 0.845295
21 F:\\nigo0024\Documents\hs_process_demo\spatial... 716 4902 0.647595 0.154707 0.674044 0.427830 0.551009 0.674044 0.770835 0.825209 0.845347
22 F:\\nigo0024\Documents\hs_process_demo\spatial... 717 4902 0.595904 0.175812 0.622344 0.338291 0.468473 0.622344 0.742585 0.808163 0.835378
23 F:\\nigo0024\Documents\hs_process_demo\spatial... 718 4572 0.598879 0.170721 0.619992 0.350020 0.484726 0.619992 0.737969 0.804381 0.833905
24 F:\\nigo0024\Documents\hs_process_demo\spatial... 811 4637 0.600566 0.166630 0.628951 0.349802 0.491700 0.628951 0.731163 0.794902 0.823018
25 F:\\nigo0024\Documents\hs_process_demo\spatial... 812 4902 0.605677 0.167928 0.632154 0.364169 0.489403 0.632154 0.743962 0.802737 0.827457
26 F:\\nigo0024\Documents\hs_process_demo\spatial... 813 4902 0.431073 0.243523 0.409112 0.114352 0.218758 0.409112 0.649587 0.776116 0.823458
27 F:\\nigo0024\Documents\hs_process_demo\spatial... 814 4902 0.496507 0.195254 0.503804 0.226004 0.337406 0.503804 0.660399 0.756241 0.794438
28 F:\\nigo0024\Documents\hs_process_demo\spatial... 815 4902 0.538546 0.178378 0.565725 0.279082 0.401758 0.565725 0.684339 0.755182 0.786442
29 F:\\nigo0024\Documents\hs_process_demo\spatial... 816 4902 0.518513 0.186971 0.538671 0.247172 0.376761 0.538671 0.673496 0.753916 0.789712
30 F:\\nigo0024\Documents\hs_process_demo\spatial... 817 4902 0.557158 0.204835 0.588147 0.257992 0.390317 0.588147 0.735475 0.807100 0.831925
31 F:\\nigo0024\Documents\hs_process_demo\spatial... 818 4671 0.417009 0.216439 0.424725 0.113556 0.226294 0.424725 0.601759 0.702425 0.746479
32 F:\\nigo0024\Documents\hs_process_demo\spatial... 911 4262 0.641003 0.132834 0.660313 0.461422 0.563003 0.660314 0.740143 0.797024 0.821450
33 F:\\nigo0024\Documents\hs_process_demo\spatial... 912 4902 0.591976 0.154626 0.617426 0.370280 0.490372 0.617426 0.714179 0.769401 0.798577
34 F:\\nigo0024\Documents\hs_process_demo\spatial... 913 4902 0.313236 0.216132 0.248242 0.078397 0.127170 0.248242 0.485217 0.660092 0.709468
35 F:\\nigo0024\Documents\hs_process_demo\spatial... 914 4902 0.584457 0.191869 0.623407 0.284599 0.456739 0.623407 0.741876 0.805188 0.832602
36 F:\\nigo0024\Documents\hs_process_demo\spatial... 915 4902 0.617625 0.151444 0.649946 0.396214 0.529203 0.649946 0.733026 0.785895 0.812817
37 F:\\nigo0024\Documents\hs_process_demo\spatial... 916 4902 0.578913 0.170426 0.605810 0.330164 0.461928 0.605810 0.716162 0.783080 0.813501
38 F:\\nigo0024\Documents\hs_process_demo\spatial... 917 4902 0.585673 0.173812 0.606694 0.336443 0.455709 0.606694 0.731889 0.800069 0.827321
39 F:\\nigo0024\Documents\hs_process_demo\spatial... 918 4773 0.600146 0.163870 0.629006 0.366870 0.488297 0.629006 0.730423 0.791783 0.820695

Second is a geotiff file for each of the image cubes after the band math processing. This can be opened in QGIS to visualize in a spatial reference system, or can be opened using any software that supports floating point .tif files.

band-math-mcari2-tif

Third is the band math raster saved in the .hdr file format. Note that the data conained here should be the same as in the .tif file, so it’s a matter of preference as to what may be more useful. This single band .hdr can also be opend in QGIS.

Fourth is a histogram of the band math data contained in the image. The histogram illustrates the 90th percentile value, which may be useful in the segmentation step (e.g., see `batch.segment_create_mask <tutorial_batch.html#batch.segment_create_mask>`__).

band-math-mcari2


7.5. batch.segment_create_mask

Batch processing tool to create a masked array on many datacubes. batch.segment_create_mask is typically used after batch.segment_band_math to mask all the datacubes in a directory based on the result of the band math process. [API]

Note: The following batch example builds on the results of the `spatial_mod.crop_many_gdf tutorial <tutorial_spatial_mod.html#spatial_mod.crop_many_gdf>`__ and and `batch.segment_band_math <tutorial_batch.html#batch.segment_band_math>`__. Please complete both the spatial_mod.crop_many_gdf and batch.segment_band_math tutorial examples to be sure your directories (i.e., base_dir, and mask_dir) are populated with image files. The following example will be using datacubes located in: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf based on MCARI2 images located in: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\band_math_mcari2-800-670-550

Load and initialize the batch module, ensuring base_dir is a valid directory

[9]:
import os
from hs_process import batch

base_dir = os.path.join(data_dir, 'spatial_mod', 'crop_many_gdf')
print(os.path.isdir(base_dir))
hsbatch = batch(base_dir, search_ext='.bip')  # searches for all files in ``base_dir`` with a ".bip" file extension
True

There must be a single-band image that will be used to determine which datacube pixels are to be masked (determined via the mask_dir parameter). Point to the directory that contains the MCARI2 images.

[10]:
mask_dir = os.path.join(base_dir, 'band_math_mcari2-800-670-550')
print(os.path.isdir(mask_dir))
True

Indicate how the MCARI2 images should be used to determine which hyperspectal pixels are to be masked. The available parameters for controlling this are mask_thresh, mask_percentile, and mask_side. We will mask out all pixels that fall below the MCARI2 90th percentile.

[11]:
mask_percentile = 90
mask_side = 'lower'

Finally, indicate the folder to save the masked datacubes and perform the batch masking via batch.segment_create_mask

[12]:
folder_name = 'mask_mcari2_90th'
hsbatch.segment_create_mask(base_dir=base_dir, mask_dir=mask_dir,
                            folder_name=folder_name,
                            name_append='mask-mcari2-90th', geotiff=True,
                            mask_percentile=mask_percentile,
                            mask_side=mask_side)
Processing 40 files. If this is not what is expected, please check if files have already undergone processing. If existing files should be overwritten, be sure to set the ``out_force`` parameter.

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1011-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1011-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\spectral\io\spyfile.py:252: NaNValueWarning: Image data contains NaN values.
  warnings.warn('Image data contains NaN values.', NaNValueWarning)
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1012-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1012-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1013-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1013-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1014-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1014-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1015-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1015-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1016-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1016-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1017-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1017-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\spectral\io\spyfile.py:252: NaNValueWarning: Image data contains NaN values.
  warnings.warn('Image data contains NaN values.', NaNValueWarning)
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1018-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_1018-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_611-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_611-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\spectral\io\spyfile.py:252: NaNValueWarning: Image data contains NaN values.
  warnings.warn('Image data contains NaN values.', NaNValueWarning)
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_612-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_612-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_613-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_613-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_614-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_614-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_615-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_615-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_616-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_616-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_617-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_617-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\spectral\io\spyfile.py:252: NaNValueWarning: Image data contains NaN values.
  warnings.warn('Image data contains NaN values.', NaNValueWarning)
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_618-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_618-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_711-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_711-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\spectral\io\spyfile.py:252: NaNValueWarning: Image data contains NaN values.
  warnings.warn('Image data contains NaN values.', NaNValueWarning)
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_712-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_712-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_713-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_713-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_714-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_714-mask-mcari2-90th-spec-mean.spec
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()

Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_715-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_715-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_716-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_716-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_717-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_717-mask-mcari2-90th-spec-mean.spec

C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\spectral\io\spyfile.py:252: NaNValueWarning: Image data contains NaN values.
  warnings.warn('Image data contains NaN values.', NaNValueWarning)
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\spectral\io\spyfile.py:252: NaNValueWarning: Image data contains NaN values.
  warnings.warn('Image data contains NaN values.', NaNValueWarning)
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_718-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_718-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_811-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_811-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_812-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_812-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_813-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_813-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_814-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_814-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_815-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_815-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_816-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_816-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_817-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_817-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_818-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_818-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\spectral\io\spyfile.py:252: NaNValueWarning: Image data contains NaN values.
  warnings.warn('Image data contains NaN values.', NaNValueWarning)
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\spectral\io\spyfile.py:252: NaNValueWarning: Image data contains NaN values.
  warnings.warn('Image data contains NaN values.', NaNValueWarning)
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_911-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_911-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_912-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_912-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_913-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_913-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_914-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_914-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_915-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_915-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_916-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_916-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_917-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_917-mask-mcari2-90th-spec-mean.spec


Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_918-mask-mcari2-90th.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\Wells_rep2_20180628_16h56m_pika_gige_7_plot_918-mask-mcari2-90th-spec-mean.spec


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
_images/tutorial_batch_24_42.png

batch.segment_create_mask creates a new folder in base_dir named according to the folder_name parameter (in this case the new directory is F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th) which contains several data products.

The first is mask-stats.csv: a spreadsheet containing the band math threshold value for each image file. In this example, the MCARI2 value corresponding to the 90th percentile is listed.

[13]:
pd.read_csv(os.path.join(base_dir, 'mask_mcari2_90th', 'mask-stats.csv'))
[13]:
fname plot_id lower-pctl-90
0 F:\\nigo0024\Documents\hs_process_demo\spatial... 1011 0.832222
1 F:\\nigo0024\Documents\hs_process_demo\spatial... 1012 0.811119
2 F:\\nigo0024\Documents\hs_process_demo\spatial... 1013 0.743942
3 F:\\nigo0024\Documents\hs_process_demo\spatial... 1014 0.809496
4 F:\\nigo0024\Documents\hs_process_demo\spatial... 1015 0.813714
5 F:\\nigo0024\Documents\hs_process_demo\spatial... 1016 0.809670
6 F:\\nigo0024\Documents\hs_process_demo\spatial... 1017 0.807791
7 F:\\nigo0024\Documents\hs_process_demo\spatial... 1018 0.777917
8 F:\\nigo0024\Documents\hs_process_demo\spatial... 611 0.852368
9 F:\\nigo0024\Documents\hs_process_demo\spatial... 612 0.839260
10 F:\\nigo0024\Documents\hs_process_demo\spatial... 613 0.813595
11 F:\\nigo0024\Documents\hs_process_demo\spatial... 614 0.824346
12 F:\\nigo0024\Documents\hs_process_demo\spatial... 615 0.856374
13 F:\\nigo0024\Documents\hs_process_demo\spatial... 616 0.849705
14 F:\\nigo0024\Documents\hs_process_demo\spatial... 617 0.847811
15 F:\\nigo0024\Documents\hs_process_demo\spatial... 618 0.744430
16 F:\\nigo0024\Documents\hs_process_demo\spatial... 711 0.855418
17 F:\\nigo0024\Documents\hs_process_demo\spatial... 712 0.810563
18 F:\\nigo0024\Documents\hs_process_demo\spatial... 713 0.827544
19 F:\\nigo0024\Documents\hs_process_demo\spatial... 714 0.840182
20 F:\\nigo0024\Documents\hs_process_demo\spatial... 715 0.849235
21 F:\\nigo0024\Documents\hs_process_demo\spatial... 716 0.850539
22 F:\\nigo0024\Documents\hs_process_demo\spatial... 717 0.839124
23 F:\\nigo0024\Documents\hs_process_demo\spatial... 718 0.839761
24 F:\\nigo0024\Documents\hs_process_demo\spatial... 811 0.828950
25 F:\\nigo0024\Documents\hs_process_demo\spatial... 812 0.832546
26 F:\\nigo0024\Documents\hs_process_demo\spatial... 813 0.826736
27 F:\\nigo0024\Documents\hs_process_demo\spatial... 814 0.800934
28 F:\\nigo0024\Documents\hs_process_demo\spatial... 815 0.792807
29 F:\\nigo0024\Documents\hs_process_demo\spatial... 816 0.792768
30 F:\\nigo0024\Documents\hs_process_demo\spatial... 817 0.837843
31 F:\\nigo0024\Documents\hs_process_demo\spatial... 818 0.755556
32 F:\\nigo0024\Documents\hs_process_demo\spatial... 911 0.826041
33 F:\\nigo0024\Documents\hs_process_demo\spatial... 912 0.803858
34 F:\\nigo0024\Documents\hs_process_demo\spatial... 913 0.715721
35 F:\\nigo0024\Documents\hs_process_demo\spatial... 914 0.835746
36 F:\\nigo0024\Documents\hs_process_demo\spatial... 915 0.816475
37 F:\\nigo0024\Documents\hs_process_demo\spatial... 916 0.818592
38 F:\\nigo0024\Documents\hs_process_demo\spatial... 917 0.830873
39 F:\\nigo0024\Documents\hs_process_demo\spatial... 918 0.826988

Second is a geotiff file for each of the image cubes after the masking procedure. This can be opened in QGIS to visualize in a spatial reference system, or can be opened using any software that supports floating point .tif files. The masked pixels are saved as null values and should render transparently.

segment-create-mask-geotiff

Third is the full hyperspectral datacube, also with the masked pixels saved as null values. Note that the only pixels remaining are the 10% with the highest MCARI2 values.

segment-create-mask-datacube

Fourth is the mean spectra across the unmasked datacube pixels. This is illustrated above by the green line plot (the light green shadow represents the standard deviation for each band).


7.6. batch.spatial_crop

Iterates through a spreadsheet that provides necessary information about how each image should be cropped and how it should be saved. [API]

If gdf is passed (a geopandas.GoeDataFrame polygon file), the cropped images will be shifted to the center of appropriate “plot” polygon.

Tips and Tricks for fname_sheet when gdf is not passed

If gdf is not passed, fname_sheet may have the following required column headings that correspond to the relevant parameters in `spatial_mod.crop_single <tutorial_spatial_mod.html#spatial_mod.crop_single>`__ and `spatial_mod.crop_many_gdf <tutorial_spatial_mod.html#spatial_mod.crop_many_gdf>`__:

  1. “directory”

  2. “name_short”

  3. “name_long”

  4. “ext”

  5. “pix_e_ul”

  6. “pix_n_ul”.

With this minimum input, batch.spatial_crop will read in each image, crop from the upper left pixel (determined as pix_e_ul/pix_n_ul) to the lower right pixel calculated based on crop_e_pix/crop_n_pix (which is the width of the cropped area in units of pixels).

Note: crop_e_pix and crop_n_pix have default values (see `defaults.crop_defaults <api/hs_process.defaults.html#hs_process.defaults>`__), but they can also be passed specifically for each datacube by including appropriate columns in fname_sheet (which takes precedence over defaults.crop_defaults).

fname_sheet may also have the following optional column headings:

  1. “crop_e_pix”

  2. “crop_n_pix”

  3. “crop_e_m”

  4. “crop_n_m”

  5. “buf_e_pix”

  6. “buf_n_pix”

  7. “buf_e_m”

  8. “buf_n_m”

  9. “plot_id”

More fname_sheet Tips and Tricks

  1. These optional inputs passed via fname_sheet allow more control over exactly how the images are to be cropped. For a more detailed explanation of the information that many of these columns are intended to contain, see the documentation for `spatial_mod.crop_single <tutorial_spatial_mod.html#spatial_mod.crop_single>`__ and `spatial_mod.crop_many_gdf <tutorial_spatial_mod.html#spatial_mod.crop_many_gdf>`__. Those parameters not referenced should be apparent in the API examples and tutorials.

  2. If the column names are different in fname_sheet than described here, `defaults.spat_crop_cols <api/hs_process.defaults.html#hs_process.defaults>`__ can be modified to indicate which columns correspond to the relevant information.

  3. Any other columns can be added to fname_sheet, but batch.spatial_crop does not use them in any way.

Note: The following batch example only actually processes a single hyperspectral image. If more datacubes were present in base_dir, however, batch.spatial_crop would process all datacubes that were available.

Note: This example uses spatial_mod.crop_many_gdf to crop many plots from a datacube using a polygon geometry file describing the spatial extent of each plot.

Load and initialize the batch module, checking to be sure the directory exists.

[14]:
import os
import geopandas as gpd
import pandas as pd
from hs_process import batch

base_dir = data_dir
print(os.path.isdir(base_dir))
hsbatch = batch(base_dir, search_ext='.bip', dir_level=0)  # searches for all files in ``base_dir`` with a ".bip" file extension
True

Load the plot geometry as a geopandas.GeoDataFrame

[15]:
fname_gdf = os.path.join(data_dir, 'plot_bounds.geojson')

gdf = gpd.read_file(fname_gdf)

Perform the spatial cropping using the “many_gdf” method. Note that nothing is being bassed to fname_sheet here, so batch.spatial_crop is simply going to attempt to crop all plots contained within gdf that overlap with any datacubes in base_dir. This option does not allow for any flexibility regarding minor adjustments to the cropping procedure (e.g., offset to the plot location in the datacube relative to the location in the gdf), but it is the most straightforward way to run batch.spatial_crop because it does not depend on anything to be passed to fname_sheet. It does, however, allow you to adjust the plot buffer relative to gdf via hsbatch.io.defaults.crop_defaults

[16]:
hsbatch.io.defaults.crop_defaults.buf_e_m = 2
hsbatch.io.defaults.crop_defaults.buf_n_m = 0.5
hsbatch.io.set_io_defaults(force=True)
hsbatch.spatial_crop(base_dir=base_dir, method='many_gdf', gdf=gdf)
Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1018-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_918-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_818-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_718-spatial-crop.bip


C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_618-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1017-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_917-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_817-spatial-crop.bip
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()


Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_717-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_617-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1016-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_916-spatial-crop.bip
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()


Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_816-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_716-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_616-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1015-spatial-crop.bip
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()


Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_915-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_815-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_715-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_615-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1014-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_914-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_814-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_714-spatial-crop.bip
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()


Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_614-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1013-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_913-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_813-spatial-crop.bip
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()


Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_713-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_613-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1012-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_912-spatial-crop.bip
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()


Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_812-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_712-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_612-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1011-spatial-crop.bip
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()


Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_911-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_811-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_711-spatial-crop.bip



Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_611-spatial-crop.bip
C:\Users\nigo0024\AppData\Local\Continuum\anaconda3\envs\spec\lib\site-packages\hs_process\utilities.py:1041: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  ax = plt.subplot()


Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
The size of ``spyfile`` is zero; thus there is nothing to write to file and ``write_cube()`` is being aborted.
Filename: Wells_rep2_20180628_16h56m_pika_gige_7_1010-spatial-crop.bip.hdr

The size of ``spyfile`` is zero; thus there is nothing to write to file and ``write_tif()`` is being aborted.
Filename: Wells_rep2_20180628_16h56m_pika_gige_7_1010-spatial-crop.tif


Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
The size of ``spyfile`` is zero; thus there is nothing to write to file and ``write_cube()`` is being aborted.
Filename: Wells_rep2_20180628_16h56m_pika_gige_7_910-spatial-crop.bip.hdr

The size of ``spyfile`` is zero; thus there is nothing to write to file and ``write_tif()`` is being aborted.
Filename: Wells_rep2_20180628_16h56m_pika_gige_7_910-spatial-crop.tif


Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
The size of ``spyfile`` is zero; thus there is nothing to write to file and ``write_cube()`` is being aborted.
Filename: Wells_rep2_20180628_16h56m_pika_gige_7_810-spatial-crop.bip.hdr

The size of ``spyfile`` is zero; thus there is nothing to write to file and ``write_tif()`` is being aborted.
Filename: Wells_rep2_20180628_16h56m_pika_gige_7_810-spatial-crop.tif


Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
The size of ``spyfile`` is zero; thus there is nothing to write to file and ``write_cube()`` is being aborted.
Filename: Wells_rep2_20180628_16h56m_pika_gige_7_710-spatial-crop.bip.hdr

The size of ``spyfile`` is zero; thus there is nothing to write to file and ``write_tif()`` is being aborted.
Filename: Wells_rep2_20180628_16h56m_pika_gige_7_710-spatial-crop.tif


Spatially cropping: F:\\nigo0024\Documents\hs_process_demo\Wells_rep2_20180628_16h56m_pika_gige_7-Radiance Conversion-Georectify Airborne Datacube-Convert Radiance Cube to Reflectance from Measured Reference Spectrum.bip
The size of ``spyfile`` is zero; thus there is nothing to write to file and ``write_cube()`` is being aborted.
Filename: Wells_rep2_20180628_16h56m_pika_gige_7_610-spatial-crop.bip.hdr

The size of ``spyfile`` is zero; thus there is nothing to write to file and ``write_tif()`` is being aborted.
Filename: Wells_rep2_20180628_16h56m_pika_gige_7_610-spatial-crop.tif

_images/tutorial_batch_33_19.png

A new folder was created in base_dir - F:\\nigo0024\Documents\hs_process_demo\spatial_crop - that contains the cropped datacubes and the cropped geotiff images. The Plot ID from the gdf is used to name each datacube according to its plot ID. The geotiff images can be opened in QGIS to visualize the images after cropping them.

spatial-crop-tifs

The cropped images were brightened in QGIS to emphasize the cropped boundaries. The plot boundaries are overlaid for reference (notice the 2.0 m buffer on the East/West ends and the 0.5 m buffer on the North/South sides).


7.7. batch.spectra_combine

Batch processing tool to gather all pixels from every image in a directory, compute the mean and standard deviation, and save as a single spectra (i.e., a spectra file is equivalent to a single spectral pixel with no spatial information). [API]

Visualize the individual spectra by opening in Spectronon.

spectra-combine-initial

Notice that there is a range in radiance values across the various reference panels (e.g., the radiance in the green region ranges from ~26k to ~28k μW sr-1 cm-2 μm-1).

Note: The following example will load in several small hyperspectral radiance datacubes (not reflectance) that were previously cropped manually (via Spectronon software). These datacubes represent the radiance values of grey reference panels that were placed in the field to provide data necessary for converting radiance imagery to reflectance. These particular datacubes were extracted from several different images captured within ~10 minutes of each other.

Load and initialize the batch module, checking to be sure the directory exists.

[17]:
import os
from hs_process import batch

base_dir = os.path.join(data_dir, 'cube_ref_panels')
print(os.path.isdir(base_dir))
hsbatch = batch(base_dir)
True

Combine all the radiance datacubes in the directory via batch.spectra_combine.

[18]:
hsbatch.spectra_combine(base_dir=base_dir, search_ext='bip', dir_level=0, out_force=True)
Combining datacubes/spectra into a single mean spectra.
Number of input datacubes/spectra: 7
Total number of pixels: 1516
Saving F:\nigo0024\Documents\hs_process_demo\cube_ref_panels\spec_mean_spy.spec

Visualize the combined spectra by opening in Spectronon. The solid line represents the mean radiance spectra across all pixels and images in base_dir, and the lighter, slightly transparent line represents the standard deviation of the radiance across all pixels and images in base_dir.

spectra-combine

Notice the lower signal at the oxygen absorption region (near 770 nm). After converting datacubes to reflectance, it may be desireable to spectrally clip this region (see `spec_mod.spectral_clip <tutorial_spec_mod.html#spec_mod.spectral_clip>`__)


7.8. batch.spectra_to_csv

Reads all the .spec files in a direcory and saves their reflectance information to a .csv. batch.spectra_to_csv is identical to batch.spectra_to_df except a .csv file is saved rather than returning a pandas.DataFrame. [API]

Note: The following example builds on the results of the `batch.segment_band_math tutorial <tutorial_batch.html#batch.segment_band_math>`__ and `batch.segment_create_mask <tutorial_batch.html#batch.segment_create_mask>`__. Please complete each of those tutorial examples to be sure your directory (i.e., F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th) is populated with image files.

Load and initialize the batch module, checking to be sure the directory exists.

[19]:
import os
from hs_process import batch

base_dir = os.path.join(data_dir, 'spatial_mod', 'crop_many_gdf', 'mask_mcari2_90th')
print(os.path.isdir(base_dir))
hsbatch = batch(base_dir)
True

Read all the .spec files in base_dir and save them to a .csv file.

[20]:
hsbatch.spectra_to_csv(base_dir=base_dir, search_ext='spec', dir_level=0)
Writing mean spectra to a .csv file.
Number of input datacubes/spectra: 40
Output file location: F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th\stats-spectra.csv

When stats-spectra.csv is opened, we can see that each row is a .spec file from a different plot, and each column is a particular spectral band/wavelength.

[21]:
import pandas as pd
pd.read_csv(os.path.join(base_dir, 'stats-spectra.csv'))
[21]:
Unnamed: 0 wavelength 394.6 396.6528 398.7056 400.7584 402.8112 404.864 406.9168 408.9696 ... 866.744 868.7968 870.8496 872.9024 874.9552 877.008 879.0608 881.1136 883.1664 885.2192
0 fname plot_id 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000 7.000000 8.000000 ... 231.000000 232.000000 233.000000 234.000000 235.000000 236.000000 237.000000 238.000000 239.000000 240.000000
1 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1011 6.422696 11.165407 5.400625 4.512296 3.475373 2.522064 2.044144 1.697843 ... 45.952736 45.177956 44.178223 45.595730 44.237053 45.192883 44.707069 44.317673 44.977257 44.885410
2 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1012 8.112519 10.618262 5.917343 4.360370 3.632289 3.072112 2.277318 1.906745 ... 44.907276 44.544106 43.384926 44.675610 43.880154 44.394325 43.728794 43.444515 44.277538 44.192337
3 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1013 7.546187 11.487464 6.051892 4.632227 3.686217 2.832436 2.235654 1.991209 ... 40.590130 40.234657 39.194435 40.260246 39.648201 40.096077 39.318855 39.217598 39.904327 39.873375
4 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1014 7.918447 11.799173 6.479166 4.771261 3.451924 2.763257 2.347495 1.948497 ... 46.262978 45.802395 44.400795 45.824875 45.436096 45.664883 44.691391 44.591335 45.321087 45.260036
5 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1015 8.051130 12.631905 6.097687 4.523533 3.659562 3.061043 2.291068 2.011611 ... 46.753952 46.385578 44.936142 46.200020 45.938831 46.119297 45.290573 45.130165 45.812798 45.785793
6 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1016 8.193905 12.427509 6.110229 4.745999 3.591855 2.923646 2.446748 1.976440 ... 45.650295 45.279652 43.989613 45.044235 44.638329 45.159748 44.195812 44.206612 44.825630 44.806541
7 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1017 7.731573 11.072787 6.414916 4.379418 3.568001 3.087936 2.706290 2.253996 ... 45.070175 44.707264 43.649368 44.803082 44.225674 44.722172 43.806782 43.737411 44.391449 44.494034
8 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1018 9.187103 12.664470 7.222271 5.166668 3.755876 3.502435 2.585752 2.439782 ... 43.974651 43.589466 42.655235 43.862473 42.618870 43.594215 42.709656 42.671970 43.441093 43.256435
9 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 611 7.894733 12.925845 6.147056 4.658052 3.637797 2.892701 2.176254 1.929648 ... 48.910378 48.432854 47.286629 48.732929 47.200031 48.484467 47.580902 47.318703 48.056881 47.892609
10 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 612 8.052910 12.121128 6.476834 4.594028 3.963124 3.352512 2.584712 2.176424 ... 49.243702 48.784691 47.616558 48.979633 48.166191 48.791489 47.949718 47.854076 48.677956 48.559052
11 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 613 7.101891 13.869357 6.037887 4.746872 4.050615 3.069094 2.371190 2.110826 ... 46.847263 46.357956 45.119789 46.259048 45.815186 46.091328 45.331429 45.250095 45.902679 45.867226
12 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 614 7.767455 11.517489 6.504547 5.002610 4.108159 3.150337 2.335922 2.077424 ... 48.436760 48.011398 46.613682 48.012177 47.631981 47.782158 46.921013 46.775673 47.526283 47.689594
13 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 615 8.338742 12.195340 6.451599 4.240588 3.776052 3.113763 2.356512 2.021913 ... 50.734745 50.287186 48.781429 50.275272 49.895214 50.099014 49.201550 49.157391 49.928482 49.944981
14 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 616 8.462449 12.228027 6.221152 5.020068 3.859836 2.963626 2.616114 2.148959 ... 50.882053 50.610901 49.143269 50.353683 50.076084 50.424557 49.586929 49.364635 50.327682 50.158352
15 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 617 7.836879 12.302659 6.516508 5.028650 3.786623 3.158106 2.512555 2.211797 ... 50.542599 49.898525 48.739388 50.094898 49.135872 49.818291 49.213223 48.849125 49.606403 49.541588
16 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 618 7.699069 12.479805 7.513241 5.080193 3.766904 4.039999 2.889983 2.481177 ... 43.423470 43.023785 42.083881 43.321228 42.022205 43.036125 42.286880 42.169292 42.878952 42.629581
17 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 711 7.413501 11.979908 6.331764 4.616187 3.741205 2.953020 2.130414 1.865968 ... 48.960533 48.333519 47.319622 48.817574 47.147610 48.457798 47.601730 47.443398 48.177635 48.079128
18 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 712 8.563736 12.756330 6.512790 4.603833 4.078624 3.001086 2.345825 2.182991 ... 45.364338 44.942127 43.734760 44.859043 44.096611 44.891098 43.987461 43.934639 44.584408 44.516068
19 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 713 7.193272 12.432698 6.341044 4.751496 3.884561 3.225402 2.386267 1.978704 ... 47.191071 46.948906 45.465096 46.803604 46.162277 46.604122 45.723297 45.659050 46.285809 46.223267
20 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 714 7.506849 12.163078 6.235592 5.051850 3.565286 3.103295 2.514792 2.101607 ... 50.147270 49.754768 48.239792 49.542763 49.063854 49.437073 48.558815 48.262203 49.123722 49.125538
21 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 715 7.843419 11.334277 6.070998 4.755501 3.612546 2.946136 2.481973 2.127480 ... 50.221123 49.917950 48.327522 49.861164 49.485455 49.758858 48.701935 48.561798 49.448074 49.339077
22 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 716 8.595501 12.686199 6.714646 5.089789 4.046583 3.353686 2.646060 2.288584 ... 51.727932 51.372154 49.958393 51.196743 50.829052 51.205315 50.234829 50.052689 51.005817 51.010590
23 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 717 8.393307 13.584164 7.553740 5.226162 3.891386 3.332365 2.603128 2.308126 ... 49.470417 49.000923 47.869789 49.044590 48.184570 48.950596 47.984806 47.949333 48.544048 48.653152
24 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 718 8.843493 12.679571 7.023562 5.442327 3.547979 3.654238 2.801330 2.408600 ... 49.965923 49.596848 48.566929 49.934406 48.459545 49.734013 48.911800 48.704708 49.373581 49.234245
25 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 811 7.083653 12.006280 6.046984 4.687656 3.714422 3.112501 2.201406 1.955266 ... 45.894547 45.683109 44.512463 45.909119 44.418194 45.559864 44.653900 44.596027 45.253811 45.233994
26 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 812 8.100746 11.882498 6.556836 5.156692 3.808788 3.205003 2.256833 1.985809 ... 47.641499 47.320831 46.146374 47.431927 46.529518 47.210178 46.263016 46.228031 47.041344 46.920643
27 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 813 7.392107 11.692697 6.868009 4.766898 3.300512 3.251760 2.483874 1.982789 ... 48.353649 47.845009 46.524998 47.933548 47.388008 47.743717 46.758194 46.675159 47.434868 47.407082
28 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 814 8.676796 12.797872 6.245512 5.114694 4.033754 3.256408 2.559943 2.309992 ... 47.045605 46.719845 45.381981 46.669727 46.393925 46.522648 45.601192 45.478077 46.220753 46.200783
29 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 815 8.454503 11.652295 6.748854 4.714633 3.751000 3.298980 2.519693 2.213987 ... 44.587364 44.260040 42.810707 44.226532 43.810524 43.945774 43.191242 42.986115 43.673561 43.686180
30 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 816 8.175219 13.649111 7.179554 5.547868 3.977848 3.313987 2.767278 2.332556 ... 45.729687 45.239017 44.123909 45.202801 44.771603 45.066429 44.421761 44.196083 45.021992 45.006042
31 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 817 8.296126 13.092884 7.353922 5.555367 4.299960 3.954008 2.897280 2.612855 ... 50.166386 49.834427 48.704960 49.829338 49.234818 49.822399 48.999508 48.709965 49.634937 49.476097
32 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 818 8.924273 14.522986 8.038774 5.096577 4.669975 4.417596 3.166564 2.866211 ... 42.627266 42.324959 41.408493 42.656376 41.297897 42.299149 41.525536 41.309063 41.896805 41.875996
33 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 911 8.365755 12.340913 6.055570 4.737850 4.451369 3.291192 2.254622 1.987984 ... 45.649204 45.279106 44.228539 45.560150 44.004513 45.451752 44.573612 44.313133 44.938354 44.885864
34 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 912 7.755309 12.361582 5.754279 4.510909 3.683419 2.989809 2.239138 1.859932 ... 42.767139 42.336288 41.331120 42.436756 41.684254 42.417118 41.477863 41.362335 42.096577 41.973705
35 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 913 7.122913 11.877316 6.892590 4.961846 4.327274 3.118866 2.508498 2.138189 ... 38.523857 38.142170 37.192219 38.290588 37.585289 38.046993 37.458794 37.296215 37.876701 37.846321
36 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 914 7.722693 13.433213 6.761981 4.856444 3.743105 2.982534 2.461215 2.062335 ... 48.972168 48.546608 47.056313 48.416878 47.996143 48.298695 47.345364 47.046642 47.961697 47.986835
37 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 915 7.725030 11.052719 6.663088 5.057089 3.447933 3.124759 2.375962 2.051084 ... 46.610313 46.200542 44.802040 46.019176 45.863613 45.803249 44.921337 44.851391 45.774323 45.598038
38 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 916 7.591694 12.025175 6.902575 4.726539 3.803775 3.225370 2.517198 2.167479 ... 47.249176 46.941048 45.536686 46.785034 46.375957 46.834408 45.817791 45.817036 46.511391 46.343300
39 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 917 7.740458 12.813018 6.744251 4.722281 4.015078 3.286421 2.402844 2.121481 ... 47.565178 47.211433 45.898144 47.103230 46.536907 47.184261 46.145023 46.001781 46.891209 46.768360
40 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 918 8.190433 13.093901 7.376089 4.867056 3.657851 3.631400 2.795508 2.494714 ... 48.311169 47.838398 46.746750 48.233326 46.831379 47.917675 47.090836 46.953537 47.744019 47.643070

41 rows × 242 columns


7.9. batch.spectra_to_df

Reads all the .spec files in a direcory and returns their data as a pandas.DataFrame object. batch.spectra_to_df is identical to batch.spectra_to_csv except a pandas.DataFrame is returned rather than saving a .csv file. [API]

Note: The following example builds on the results of the `batch.segment_band_math tutorial <tutorial_batch.html#batch.segment_band_math>`__ and `batch.segment_create_mask <tutorial_batch.html#batch.segment_create_mask>`__. Please complete each of those tutorial examples to be sure your directory (i.e., F:\\nigo0024\Documents\hs_process_demo\spatial_mod\crop_many_gdf\mask_mcari2_90th) is populated with image files.

Load and initialize the batch module, checking to be sure the directory exists.

[22]:
import os
from hs_process import batch

base_dir = os.path.join(data_dir, 'spatial_mod', 'crop_many_gdf', 'mask_mcari2_90th')
print(os.path.isdir(base_dir))
hsbatch = batch(base_dir)
True

Read all the .spec files in base_dir and load them to df_spec, a pandas.DataFrame.

[23]:
df_spec = hsbatch.spectra_to_df(base_dir=base_dir, search_ext='spec', dir_level=0)
df_spec
Writing mean spectra to a ``pandas.DataFrame``.
Number of input datacubes/spectra: 40
[23]:
fname plot_id 1 2 3 4 5 6 7 8 ... 231 232 233 234 235 236 237 238 239 240
0 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1011 0.064227 0.111654 0.054006 0.045123 0.034754 0.025221 0.020441 0.016978 ... 0.459527 0.451780 0.441782 0.455957 0.442371 0.451929 0.447071 0.443177 0.449773 0.448854
1 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1012 0.081125 0.106183 0.059173 0.043604 0.036323 0.030721 0.022773 0.019067 ... 0.449073 0.445441 0.433849 0.446756 0.438802 0.443943 0.437288 0.434445 0.442775 0.441923
2 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1013 0.075462 0.114875 0.060519 0.046322 0.036862 0.028324 0.022357 0.019912 ... 0.405901 0.402347 0.391944 0.402602 0.396482 0.400961 0.393189 0.392176 0.399043 0.398734
3 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1014 0.079184 0.117992 0.064792 0.047713 0.034519 0.027633 0.023475 0.019485 ... 0.462630 0.458024 0.444008 0.458249 0.454361 0.456649 0.446914 0.445913 0.453211 0.452600
4 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1015 0.080511 0.126319 0.060977 0.045235 0.036596 0.030610 0.022911 0.020116 ... 0.467540 0.463856 0.449361 0.462000 0.459388 0.461193 0.452906 0.451302 0.458128 0.457858
5 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1016 0.081939 0.124275 0.061102 0.047460 0.035919 0.029236 0.024467 0.019764 ... 0.456503 0.452797 0.439896 0.450442 0.446383 0.451597 0.441958 0.442066 0.448256 0.448065
6 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1017 0.077316 0.110728 0.064149 0.043794 0.035680 0.030879 0.027063 0.022540 ... 0.450702 0.447073 0.436494 0.448031 0.442257 0.447222 0.438068 0.437374 0.443915 0.444940
7 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1018 0.091871 0.126645 0.072223 0.051667 0.037559 0.035024 0.025858 0.024398 ... 0.439747 0.435895 0.426552 0.438625 0.426189 0.435942 0.427097 0.426720 0.434411 0.432564
8 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 611 0.078947 0.129258 0.061471 0.046581 0.036378 0.028927 0.021763 0.019296 ... 0.489104 0.484329 0.472866 0.487329 0.472000 0.484845 0.475809 0.473187 0.480569 0.478926
9 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 612 0.080529 0.121211 0.064768 0.045940 0.039631 0.033525 0.025847 0.021764 ... 0.492437 0.487847 0.476166 0.489796 0.481662 0.487915 0.479497 0.478541 0.486780 0.485591
10 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 613 0.071019 0.138694 0.060379 0.047469 0.040506 0.030691 0.023712 0.021108 ... 0.468473 0.463580 0.451198 0.462590 0.458152 0.460913 0.453314 0.452501 0.459027 0.458672
11 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 614 0.077675 0.115175 0.065045 0.050026 0.041082 0.031503 0.023359 0.020774 ... 0.484368 0.480114 0.466137 0.480122 0.476320 0.477822 0.469210 0.467757 0.475263 0.476896
12 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 615 0.083387 0.121953 0.064516 0.042406 0.037761 0.031138 0.023565 0.020219 ... 0.507347 0.502872 0.487814 0.502753 0.498952 0.500990 0.492016 0.491574 0.499285 0.499450
13 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 616 0.084624 0.122280 0.062212 0.050201 0.038598 0.029636 0.026161 0.021490 ... 0.508821 0.506109 0.491433 0.503537 0.500761 0.504246 0.495869 0.493646 0.503277 0.501584
14 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 617 0.078369 0.123027 0.065165 0.050287 0.037866 0.031581 0.025126 0.022118 ... 0.505426 0.498985 0.487394 0.500949 0.491359 0.498183 0.492132 0.488491 0.496064 0.495416
15 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 618 0.076991 0.124798 0.075132 0.050802 0.037669 0.040400 0.028900 0.024812 ... 0.434235 0.430238 0.420839 0.433212 0.420222 0.430361 0.422869 0.421693 0.428790 0.426296
16 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 711 0.074135 0.119799 0.063318 0.046162 0.037412 0.029530 0.021304 0.018660 ... 0.489605 0.483335 0.473196 0.488176 0.471476 0.484578 0.476017 0.474434 0.481776 0.480791
17 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 712 0.085637 0.127563 0.065128 0.046038 0.040786 0.030011 0.023458 0.021830 ... 0.453643 0.449421 0.437348 0.448590 0.440966 0.448911 0.439875 0.439346 0.445844 0.445161
18 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 713 0.071933 0.124327 0.063410 0.047515 0.038846 0.032254 0.023863 0.019787 ... 0.471911 0.469489 0.454651 0.468036 0.461623 0.466041 0.457233 0.456591 0.462858 0.462233
19 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 714 0.075068 0.121631 0.062356 0.050519 0.035653 0.031033 0.025148 0.021016 ... 0.501473 0.497548 0.482398 0.495428 0.490639 0.494371 0.485588 0.482622 0.491237 0.491255
20 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 715 0.078434 0.113343 0.060710 0.047555 0.036125 0.029461 0.024820 0.021275 ... 0.502211 0.499180 0.483275 0.498612 0.494855 0.497589 0.487019 0.485618 0.494481 0.493391
21 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 716 0.085955 0.126862 0.067146 0.050898 0.040466 0.033537 0.026461 0.022886 ... 0.517279 0.513722 0.499584 0.511967 0.508291 0.512053 0.502348 0.500527 0.510058 0.510106
22 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 717 0.083933 0.135842 0.075537 0.052262 0.038914 0.033324 0.026031 0.023081 ... 0.494704 0.490009 0.478698 0.490446 0.481846 0.489506 0.479848 0.479493 0.485440 0.486532
23 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 718 0.088435 0.126796 0.070236 0.054423 0.035480 0.036542 0.028013 0.024086 ... 0.499659 0.495968 0.485669 0.499344 0.484595 0.497340 0.489118 0.487047 0.493736 0.492342
24 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 811 0.070837 0.120063 0.060470 0.046877 0.037144 0.031125 0.022014 0.019553 ... 0.458945 0.456831 0.445125 0.459091 0.444182 0.455599 0.446539 0.445960 0.452538 0.452340
25 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 812 0.081007 0.118825 0.065568 0.051567 0.038088 0.032050 0.022568 0.019858 ... 0.476415 0.473208 0.461464 0.474319 0.465295 0.472102 0.462630 0.462280 0.470413 0.469206
26 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 813 0.073921 0.116927 0.068680 0.047669 0.033005 0.032518 0.024839 0.019828 ... 0.483536 0.478450 0.465250 0.479335 0.473880 0.477437 0.467582 0.466752 0.474349 0.474071
27 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 814 0.086768 0.127979 0.062455 0.051147 0.040338 0.032564 0.025599 0.023100 ... 0.470456 0.467198 0.453820 0.466697 0.463939 0.465226 0.456012 0.454781 0.462208 0.462008
28 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 815 0.084545 0.116523 0.067489 0.047146 0.037510 0.032990 0.025197 0.022140 ... 0.445874 0.442600 0.428107 0.442265 0.438105 0.439458 0.431912 0.429861 0.436736 0.436862
29 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 816 0.081752 0.136491 0.071796 0.055479 0.039778 0.033140 0.027673 0.023326 ... 0.457297 0.452390 0.441239 0.452028 0.447716 0.450664 0.444218 0.441961 0.450220 0.450060
30 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 817 0.082961 0.130929 0.073539 0.055554 0.043000 0.039540 0.028973 0.026129 ... 0.501664 0.498344 0.487050 0.498293 0.492348 0.498224 0.489995 0.487100 0.496349 0.494761
31 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 818 0.089243 0.145230 0.080388 0.050966 0.046700 0.044176 0.031666 0.028662 ... 0.426273 0.423250 0.414085 0.426564 0.412979 0.422991 0.415255 0.413091 0.418968 0.418760
32 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 911 0.083658 0.123409 0.060556 0.047379 0.044514 0.032912 0.022546 0.019880 ... 0.456492 0.452791 0.442285 0.455601 0.440045 0.454518 0.445736 0.443131 0.449384 0.448859
33 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 912 0.077553 0.123616 0.057543 0.045109 0.036834 0.029898 0.022391 0.018599 ... 0.427671 0.423363 0.413311 0.424368 0.416843 0.424171 0.414779 0.413623 0.420966 0.419737
34 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 913 0.071229 0.118773 0.068926 0.049618 0.043273 0.031189 0.025085 0.021382 ... 0.385239 0.381422 0.371922 0.382906 0.375853 0.380470 0.374588 0.372962 0.378767 0.378463
35 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 914 0.077227 0.134332 0.067620 0.048564 0.037431 0.029825 0.024612 0.020623 ... 0.489722 0.485466 0.470563 0.484169 0.479961 0.482987 0.473454 0.470466 0.479617 0.479868
36 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 915 0.077250 0.110527 0.066631 0.050571 0.034479 0.031248 0.023760 0.020511 ... 0.466103 0.462005 0.448020 0.460192 0.458636 0.458032 0.449213 0.448514 0.457743 0.455980
37 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 916 0.075917 0.120252 0.069026 0.047265 0.038038 0.032254 0.025172 0.021675 ... 0.472492 0.469410 0.455367 0.467850 0.463760 0.468344 0.458178 0.458170 0.465114 0.463433
38 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 917 0.077405 0.128130 0.067443 0.047223 0.040151 0.032864 0.024028 0.021215 ... 0.475652 0.472114 0.458981 0.471032 0.465369 0.471843 0.461450 0.460018 0.468912 0.467684
39 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 918 0.081904 0.130939 0.073761 0.048671 0.036579 0.036314 0.027955 0.024947 ... 0.483112 0.478384 0.467467 0.482333 0.468314 0.479177 0.470908 0.469535 0.477440 0.476431

40 rows × 242 columns

Each row is a .spec file from a different plot, and each column is a particular spectral band.

It is somewhat confusing to conceptualize spectral data by band number (as opposed to the wavelenth it represents). hs_process.hs_tools.get_band can be used to retrieve spectral data for all plots via indexing by wavelength. Say we need to access reflectance at 710 nm for each plot (in this case, the 710 nm band is band number 155).

[24]:
df_710nm = df_spec[['fname', 'plot_id', hsbatch.io.tools.get_band(710)]]
df_710nm
[24]:
fname plot_id 155
0 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1011 0.057691
1 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1012 0.061125
2 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1013 0.068554
3 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1014 0.065782
4 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1015 0.068864
5 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1016 0.067865
6 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1017 0.078624
7 Wells_rep2_20180628_16h56m_pika_gige_7_plot_10... 1018 0.083274
8 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 611 0.068968
9 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 612 0.069943
10 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 613 0.080705
11 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 614 0.073068
12 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 615 0.069128
13 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 616 0.073243
14 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 617 0.073029
15 Wells_rep2_20180628_16h56m_pika_gige_7_plot_61... 618 0.082816
16 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 711 0.062415
17 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 712 0.071282
18 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 713 0.071761
19 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 714 0.071243
20 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 715 0.070207
21 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 716 0.072630
22 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 717 0.082647
23 Wells_rep2_20180628_16h56m_pika_gige_7_plot_71... 718 0.075310
24 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 811 0.067439
25 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 812 0.065353
26 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 813 0.076600
27 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 814 0.080333
28 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 815 0.082084
29 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 816 0.079716
30 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 817 0.079085
31 Wells_rep2_20180628_16h56m_pika_gige_7_plot_81... 818 0.097097
32 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 911 0.058718
33 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 912 0.065625
34 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 913 0.081310
35 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 914 0.068121
36 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 915 0.073891
37 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 916 0.071346
38 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 917 0.074224
39 Wells_rep2_20180628_16h56m_pika_gige_7_plot_91... 918 0.071906

7.10. batch.spectral_clip

Batch processing tool to spectrally clip multiple datacubes in the same way. [API]

Note: The following example builds on the results of the `batch.spatial_crop tutorial <tutorial_batch.html#batch.spatial_crop>`__. Please complete the batch.spatial_crop tutorial example to be sure your directory (i.e., base_dir) is populated with multiple hyperspectral datacubes. The following example will be using datacubes located in teh following directory: F:\\nigo0024\Documents\hs_process_demo\spatial_crop

Load and initialize the batch module, checking to be sure the directory exists.

[25]:
import os
from hs_process import batch

base_dir = os.path.join(data_dir, 'spatial_crop')
print(os.path.isdir(base_dir))
hsbatch = batch(base_dir, search_ext='.bip')  # searches for all files in ``base_dir`` with a ".bip" file extension
True

Use batch.spectral_clip to clip all spectral bands below 420 nm and above 880 nm, as well as the bands near the oxygen absorption (i.e., 760-776 nm) and water absorption (i.e., 813-827 nm) regions.

[26]:
hsbatch.spectral_clip(base_dir=base_dir, folder_name='spec_clip',
                      wl_bands=[[0, 420], [760, 776], [813, 827], [880, 1000]])
Processing 40 files. If this is not what is expected, please check if files have already undergone processing. If existing files should be overwritten, be sure to set the ``out_force`` parameter.


Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1011-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_1011-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1012-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_1012-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1013-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_1013-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1014-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_1014-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1015-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_1015-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1016-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_1016-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1017-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_1017-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1018-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_1018-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_611-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_611-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_612-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_612-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_613-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_613-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_614-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_614-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_615-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_615-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_616-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_616-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_617-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_617-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_618-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_618-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_711-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_711-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_712-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_712-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_713-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_713-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_714-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_714-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_715-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_715-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_716-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_716-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_717-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_717-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_718-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_718-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_811-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_811-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_812-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_812-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_813-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_813-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_814-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_814-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_815-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_815-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_816-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_816-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_817-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_817-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_818-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_818-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_911-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_911-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_912-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_912-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_913-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_913-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_914-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_914-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_915-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_915-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_916-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_916-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_917-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_917-spec-clip.bip

Spectrally clipping: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_918-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_clip\Wells_rep2_20180628_16h56m_pika_gige_7_918-spec-clip.bip

Use Seaborn to visualize the spectra of a single pixel in one of the processed images.

[27]:
import seaborn as sns

fname = os.path.join(base_dir, 'Wells_rep2_20180628_16h56m_pika_gige_7_1011-spatial-crop.bip')
hsbatch.io.read_cube(fname)
spy_mem = hsbatch.io.spyfile.open_memmap()  # datacube before clipping
meta_bands = list(hsbatch.io.tools.meta_bands.values())
fname = os.path.join(base_dir, 'spec_clip', 'Wells_rep2_20180628_16h56m_pika_gige_7_1011-spec-clip.bip')
hsbatch.io.read_cube(fname)
spy_mem_clip = hsbatch.io.spyfile.open_memmap()  # datacube after clipping
meta_bands_clip = list(hsbatch.io.tools.meta_bands.values())
ax = sns.lineplot(x=meta_bands, y=spy_mem[26][29], label='Before spectral clipping', linewidth=3)
ax = sns.lineplot(x=meta_bands_clip, y=spy_mem_clip[26][29], label='After spectral clipping', ax=ax)
ax.set_xlabel('Wavelength (nm)', weight='bold')
ax.set_ylabel('Reflectance (%)', weight='bold')
ax.set_title(r'API Example: `batch.spectral_clip`', weight='bold')

[27]:
Text(0.5, 1.0, 'API Example: `batch.spectral_clip`')
_images/tutorial_batch_57_1.png

7.11. batch.spectral_smooth

Batch processing tool to spectrally smooth multiple datacubes in the same way. [API]

Note: The following example builds on the results of the batch.spatial_crop tutorial. Please complete the batch.spatial_crop tutorial example to be sure your directory (i.e., base_dir) is populated with multiple hyperspectral datacubes. The following example will be using datacubes located in the following directory: F:\\nigo0024\Documents\hs_process_demo\spatial_crop

Load and initialize the batch module, checking to be sure the directory exists.

[28]:
import os
from hs_process import batch

base_dir = os.path.join(data_dir, 'spatial_crop')
print(os.path.isdir(base_dir))
hsbatch = batch(base_dir, search_ext='.bip')  # searches for all files in ``base_dir`` with a ".bip" file extension
True

Use batch.spectral_smooth to perform a Savitzky-Golay smoothing operation on each image/pixel in base_dir. The window_size and order can be adjusted to achieve desired smoothing results.

[29]:
hsbatch.spectral_smooth(base_dir=base_dir, folder_name='spec_smooth',
                        window_size=11, order=2)
Processing 40 files. If this is not what is expected, please check if files have already undergone processing. If existing files should be overwritten, be sure to set the ``out_force`` parameter.


Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1011-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_1011-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1012-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_1012-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1013-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_1013-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1014-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_1014-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1015-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_1015-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1016-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_1016-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1017-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_1017-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_1018-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_1018-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_611-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_611-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_612-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_612-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_613-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_613-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_614-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_614-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_615-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_615-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_616-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_616-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_617-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_617-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_618-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_618-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_711-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_711-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_712-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_712-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_713-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_713-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_714-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_714-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_715-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_715-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_716-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_716-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_717-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_717-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_718-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_718-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_811-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_811-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_812-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_812-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_813-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_813-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_814-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_814-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_815-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_815-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_816-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_816-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_817-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_817-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_818-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_818-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_911-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_911-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_912-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_912-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_913-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_913-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_914-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_914-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_915-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_915-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_916-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_916-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_917-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_917-spec-smooth.bip

Spectrally smoothing: F:\\nigo0024\Documents\hs_process_demo\spatial_crop\Wells_rep2_20180628_16h56m_pika_gige_7_918-spatial-crop.bip
Saving F:\nigo0024\Documents\hs_process_demo\spatial_crop\spec_smooth\Wells_rep2_20180628_16h56m_pika_gige_7_918-spec-smooth.bip

Use Seaborn to visualize the spectra of a single pixel in one of the processed images.

[30]:
import seaborn as sns

fname = os.path.join(base_dir, 'Wells_rep2_20180628_16h56m_pika_gige_7_1011-spatial-crop.bip')
hsbatch.io.read_cube(fname)
spy_mem = hsbatch.io.spyfile.open_memmap()  # datacube before smoothing
meta_bands = list(hsbatch.io.tools.meta_bands.values())
fname = os.path.join(base_dir, 'spec_smooth', 'Wells_rep2_20180628_16h56m_pika_gige_7_1011-spec-smooth.bip')
hsbatch.io.read_cube(fname)
spy_mem_clip = hsbatch.io.spyfile.open_memmap()  # datacube after smoothing
meta_bands_clip = list(hsbatch.io.tools.meta_bands.values())
ax = sns.lineplot(x=meta_bands, y=spy_mem[26][29], label='Before spectral smoothing', linewidth=3)
ax = sns.lineplot(x=meta_bands_clip, y=spy_mem_clip[26][29], label='After spectral smoothing', ax=ax)
ax.set_xlabel('Wavelength (nm)', weight='bold')
ax.set_ylabel('Reflectance (%)', weight='bold')
ax.set_title(r'API Example: `batch.spectral_smooth`', weight='bold')
[30]:
Text(0.5, 1.0, 'API Example: `batch.spectral_smooth`')
_images/tutorial_batch_63_1.png