isofit.utils.multicomponent_classification

Classes

Component

Worker

Functions

load_surface_mat(surface_files[, wavelength_file, ...])

filter_image(out[, thresh])

Temporary function to clean the image.

multicomponent_classification(rdn_file, obs_file, ...)

Classify a radiance file based on a per-pixel prior selection.

cli(**kwargs)

Module Contents

class Component(model_dict)[source]
model_dict[source]
components[source]
n_comp[source]
wl[source]
n_wl[source]
surface_categories[source]
idx_ref[source]
pickClosest(x, geom)[source]
class Worker(rdn_file: str, obs_file: str, loc_file: str, out_file: str, model_dict: list, wl: numpy.ndarray, fwhm: numpy.ndarray, dayofyear: int, irr_file: str, loglevel: str, logfile: str)[source]

Bases: object

rdn[source]
loc[source]
obs[source]
out_file[source]
out[source]
component[source]
esd[source]
dayofyear[source]
wl[source]
fwhm[source]
solar_irr[source]
solarIrradiance(irr_file)[source]
run_lines(startstop)[source]
load_surface_mat(surface_files, wavelength_file=None, keys_to_combine=['means', 'covs', 'attribute_means', 'attribute_covs', 'surface_categories'])[source]
filter_image(out, thresh=100)[source]

Temporary function to clean the image. Memory intensive.

Could try to make this recursive by nesting the bottom loop into the top loop

multicomponent_classification(rdn_file: str, obs_file: str, loc_file: str, out_file: str, surface_files: str, wavelength_file: std, n_cores: int = -1, dayofyear: int = None, irr_file: str = None, clean: bool = False, thresh: int = 100, ray_address: str = None, ray_redis_password: str = None, ray_temp_dir=None, ray_ip_head=None, loglevel: str = 'INFO', logfile: str = None)[source]

Classify a radiance file based on a per-pixel prior selection. The classification leverages the same methodology ISOFIT uses to select a prior distribution from an input .json or .mat file.

 :param rdn_file: Radiance data cube. Expected to be ENVI format :type rdn_file: str :param obs_file: Location data cube of shape (Lon, Lat, Elevation). Expected to be ENVI format :type obs_file: str :param loc_file:

Observation data cube of shape:

(path length, to-sensor azimuth, to-sensor zenith, to-sun azimuth, to-sun zenith, phase, slope, aspect, cosine i, UTC time)

Expected to be ENVI format

Parameters:
  • out_file (str) – Output path to location where to save output file.

  • surface_files (str or dict) – CLI entry into the classifier uses a .mat or a .json file Apply OE entry into the classifier uses a dict argument.

  • wavelength_file (str) – Standard ISOFIT wavelength file

  • n_cores (int, default=1) – Number of cores to run classifier with.

  • dayofyear (int) – Day of year for earth-sun distance calculation

  • irr_file (str) – Path to irradiance file to use in the classification

  • clean (str) – Experimental method to filter out noisy classification masks. Creates connected binary components and filters out small features.

  • thresh (int) – Threshold size to filter out features smaller than this number of pixels.

  • loglevel (str) – Logging level to use (e.g. DEBUG, INFO, etc.)

  • logfile (str) – Output location for logging file if writing to disk.

cli(**kwargs)[source]