isofit.utils.multicomponent_classification ========================================== .. py:module:: isofit.utils.multicomponent_classification Classes ------- .. autoapisummary:: isofit.utils.multicomponent_classification.Component isofit.utils.multicomponent_classification.Worker Functions --------- .. autoapisummary:: isofit.utils.multicomponent_classification.load_surface_mat isofit.utils.multicomponent_classification.filter_image isofit.utils.multicomponent_classification.multicomponent_classification isofit.utils.multicomponent_classification.cli Module Contents --------------- .. py:class:: Component(model_dict) .. py:attribute:: model_dict .. py:attribute:: components .. py:attribute:: n_comp .. py:attribute:: wl .. py:attribute:: n_wl .. py:attribute:: surface_categories .. py:attribute:: idx_ref .. py:method:: pickClosest(x, geom) .. py: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) Bases: :py:obj:`object` .. py:attribute:: rdn .. py:attribute:: loc .. py:attribute:: obs .. py:attribute:: out_file .. py:attribute:: out .. py:attribute:: component .. py:attribute:: esd .. py:attribute:: dayofyear .. py:attribute:: wl .. py:attribute:: fwhm .. py:attribute:: solar_irr .. py:method:: solarIrradiance(irr_file) .. py:method:: run_lines(startstop) .. py:function:: load_surface_mat(surface_files, wavelength_file=None, keys_to_combine=['means', 'covs', 'attribute_means', 'attribute_covs', 'surface_categories']) .. py:function:: 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 .. py:function:: 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.  :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 :type loc_file: str :param out_file: Output path to location where to save output file. :type out_file: str :param surface_files: CLI entry into the classifier uses a .mat or a .json file Apply OE entry into the classifier uses a dict argument. :type surface_files: str or dict :param wavelength_file: Standard ISOFIT wavelength file :type wavelength_file: str :param n_cores: Number of cores to run classifier with. :type n_cores: int, default=1 :param dayofyear: Day of year for earth-sun distance calculation :type dayofyear: int :param irr_file: Path to irradiance file to use in the classification :type irr_file: str :param clean: Experimental method to filter out noisy classification masks. Creates connected binary components and filters out small features. :type clean: str :param thresh: Threshold size to filter out features smaller than this number of pixels. :type thresh: int :param loglevel: Logging level to use (e.g. DEBUG, INFO, etc.) :type loglevel: str :param logfile: Output location for logging file if writing to disk. :type logfile: str .. py:function:: cli(**kwargs)