earthlib.Unmix
Routines for performing spectral unmixing on earth engine images.
computeModeledSpectra(endmembers, fractions, n_bands)
¶
Constructs a modeled spectrum for each pixel based on endmember fractions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
endmembers |
list
|
a list of ee.List() items, each representing an endmember spectrum. |
required |
fractions |
Image
|
ee.Image output from .unmix() with the same number of bands as items in |
required |
n_bands |
int
|
the number of reflectance bands used to compute the unmixing. |
required |
Returns:
Type | Description |
---|---|
Image
|
an ee.Image with n_bands equal to the number of endmember bands. |
Source code in earthlib/Unmix.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
computeSpectralRMSE(measured, modeled, n_bands)
¶
Computes root mean squared error between measured and modeled spectra.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
measured |
Image
|
an ee.Image of measured reflectance. |
required |
modeled |
Image
|
an ee.Image of modeled reflectance. |
required |
n_bands |
int
|
the number of reflectance bands used to compute the unmixing. |
required |
Returns:
Name | Type | Description |
---|---|---|
rmse |
Image
|
a floating point ee.Image with pixel-wise RMSE values. |
Source code in earthlib/Unmix.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
computeWeight(fractions, rmse_sum)
¶
Computes the relative weight for an image's RMSE based on the sum of the global RMSE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fractions |
Image
|
a multi-band ee.Image object with an 'RMSE' band. |
required |
rmse_sum |
Image
|
a single-band ee.Image object with the global RMSE value. |
required |
Returns:
Type | Description |
---|---|
Image
|
the input |
Source code in earthlib/Unmix.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
fractionalCover(img, endmembers, endmember_names, n_bands=None, shade_normalize=True)
¶
Computes the percent cover of each endmember spectra.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
img |
Image
|
the ee.Image to unmix. |
required |
endmembers |
list
|
lists of ee.List objects, each element corresponding to a subType. |
required |
endmember_names |
list
|
list of names for each endmember. must match the number of lists passed. |
required |
n_bands |
int
|
number of reflectance bands used for unmixing. |
None
|
shade_normalize |
bool
|
flag to apply shade normalization during unmixing. |
True
|
Returns:
Name | Type | Description |
---|---|---|
unmixed |
Image
|
a 3-band image file in order of (soil-veg-impervious). |
Source code in earthlib/Unmix.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
weightedAverage(fractions, weight_sum, band_names)
¶
Computes an RMSE-weighted fractional cover image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fractions |
Image
|
a multi-band ee.Image object with a 'weight' band. |
required |
weight_sum |
Image
|
a single-band ee.Image object with the global weight sum. |
required |
band_names |
list
|
list of band names to apply the weighted average to |
required |
Returns:
Type | Description |
---|---|
Image
|
a scaled fractional cover image. |
Source code in earthlib/Unmix.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
|