isofit.core.multistate
Classes
Functions
|
Get the full statevec. I don't love how this is done. |
|
Indexes an image by a provided surface class file. |
|
Indexes an image by a provided surface class file. |
|
This is the primary mechanism by which isofit changes its configuration |
|
A multi-class surface requires some merging across statevectors |
Module Contents
- construct_full_state(full_config)[source]
Get the full statevec. I don’t love how this is done. Should be set up so that it can be pulled right out of the config. This is not currently possible. Have to pull rfl states from initialized surface class. Looks at all the model-states present in the config and collapses them into a single image-universal statevector. Returns both the names and indexes of the image-wide statevector. :param full_config: full Isofit config
- Returns:
list of the combined rfl, surf_non_rfl, RT and instrument state names full_idx_surface: np.array of the combined rfl, surf_non_rfl state indexes full_idx_surf_rfl: np.array of the combined rfl state indexes full_idx_surf_nonrfl: np.array of the combined surf_non_rfl state indexes full_idx_RT: np.array of the combined RT state indexes full_idx_instrument: np.array of the combined instrument state indexes
- Return type:
full_statevec
- index_spectra_by_surface(config, index_pairs, force_full_res=False)[source]
Indexes an image by a provided surface class file. Could extend it to be indexed by an atomspheric classification file as well if you want to vary both surface and atmospheric state. :param surface_config: (Config object) The surface component of the
main config.
- Parameters:
index_pairs
- Returns:
- (dict) where keys are the pixel classification (name)
and values are tuples of rows and columns for each group.
- Return type:
class_groups
- index_spectra_by_surface_view(config, index_pairs, force_full_res=False)[source]
Indexes an image by a provided surface class file. Could extend it to be indexed by an atomspheric classification file as well if you want to vary both surface and atmospheric state. :param surface_config: (Config object) The surface component of the
main config.
- Returns:
- (dict) where keys are the pixel classification (name)
and values are tuples of rows and columns for each group.
- Return type:
class_groups
- update_config_for_surface(config, surface_class_str, clouds=True)[source]
This is the primary mechanism by which isofit changes its configuration across surface classifications. It will leverage the Surfaces dict, and then update the primary config key to reflect that surface. :param config: (Config object) Full isofit config object. :param surface_class_str: (str) string that corresponds to a surface class.
- Returns:
(Config object) Update full isofit config object
- Return type:
config
- match_statevector(state_data: numpy.array, full_statevec: list, fm_statevec: list, null_value=-9999.0)[source]
A multi-class surface requires some merging across statevectors of different length. This function maps the fm-specific state to the io-state that captures all state elements present in the image. The full_state will record a Non :param state_data: (n,) numpy array with the fm-specific state vector :param full_statevec: [m] list of state-names of the image-universal combined statevector :param fm_statevec: [n] list of state-names of the fm-specific state vector :param null_value: (optional) value to fill in the statevector elements that aren’t present at a pixel
- Returns:
(np.array) Populated full state with null_values in missing elements
- Return type:
full_state