earthlib.ShadeMask
Functions for shade masking earth engine images.
Landsat457(img, threshold=0.03)
¶
Apply shade masking to a Landsat ⅘/7 image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
img |
Image
|
the ee.Image to shade mask. |
required |
threshold |
float
|
the brightness/reflectance value to exclude. pixels below this value are flagged as shade. |
0.03
|
Returns:
Type | Description |
---|---|
Image
|
the same input image with an updated mask. |
Source code in earthlib/ShadeMask.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
Landsat8(img, threshold=0.03)
¶
Apply shade masking to a Landsat 8 image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
img |
Image
|
the ee.Image to shade mask. |
required |
threshold |
float
|
the brightness/reflectance value to exclude. pixels below this value are flagged as shade. |
0.03
|
Returns:
Type | Description |
---|---|
Image
|
the same input image with an updated mask. |
Source code in earthlib/ShadeMask.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
bySensor(sensor)
¶
Returns the appropriate shade mask function to use by sensor type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sensor |
str
|
string with the sensor name to return (e.g. "Landsat8", "Sentinel2"). |
required |
Returns:
Type | Description |
---|---|
Callable
|
the mask function associated with a sensor to pass to an ee .map() call |
Source code in earthlib/ShadeMask.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
shadeMask(img, threshold)
¶
Use brightness normalization to identify and remove dark pixels.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
img |
Image
|
the ee.Image to shade mask. |
required |
threshold |
float
|
the brightness/reflectance value to exclude. pixels below this value are flagged as shade. |
required |
Returns:
Type | Description |
---|---|
Image
|
a pixel byte map with 0 for shade pixels, 1 for bright pixels. |
Source code in earthlib/ShadeMask.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|