Skip to content

Multicomponent classification

source module isofit.utils.multicomponent_classification

Classes

Functions

  • load_surface_mat

  • filter_image Temporary function to clean the image. Memory intensive.

  • multicomponent_classification 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.

  • cli

source class Component(model_dict)

Methods

source method Component.pickClosest(x, geom)

source class Worker(rdn_file: str, obs_file: str, loc_file: str, out_file: str, model_dict: list, wl: np.ndarray, fwhm: np.ndarray, dayofyear: int, irr_file: str, loglevel: str, logfile: str)

Bases : object

Methods

source method Worker.solarIrradiance(irr_file)

source method Worker.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)

Temporary function to clean the image. Memory intensive.

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

source 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)

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.

 Parameters


rdn_file: str Radiance data cube. Expected to be ENVI format obs_file: str Location data cube of shape (Lon, Lat, Elevation). Expected to be ENVI format loc_file: str 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 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.

Raises

  • ValueError

source cli(**kwargs)