Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small improvements to some tutorials #77

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions doc/equalize-histogram.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ equalization in :func:`xlandsat.equalize_histogram`.
.. tip::

It can be helpful to do a bit of contrast stretching first, but to a lesser
degree than we did previously.
degree than we did previously. It's also a good idea to use "float32" for
the composite to give it a larger range of color values (but this requires
more RAM).

.. jupyter-execute::

rgb = xls.composite(scene, rescale_to=(0, 0.6))
rgb_eq = xls.equalize_histogram(rgb, clip_limit=0.02, kernel_size=300)
rgb = xls.composite(scene, rescale_to=(0, 0.8), dtype="float32")
rgb_eq = xls.equalize_histogram(rgb, clip_limit=0.04, kernel_size=300)

fig, ax = plt.subplots(1, 1, figsize=(10, 6))
rgb_eq.plot.imshow(ax=ax)
Expand Down
11 changes: 6 additions & 5 deletions doc/missing-values.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _missing-values:

Filling missing values
======================
Fill missing values
===================

Landsat Level 2 data can sometimes contain missing values, particularly around
bright clouds with dark shadows. These pixels will have a value of
Expand All @@ -11,7 +11,8 @@ can use the values of neighboring pixels to interpolate the missing values with

Let's use our sample scene of the December 2015 eruption of `Momotombo volcano
<https://en.wikipedia.org/wiki/Momotombo>`__, Nicaragua, to demonstrate how
it's done.
it's done. The Level 2 version of this scene has several holes because of the
clouds and smoke from the volcano affecting the atmospheric correction method.

First, we'll import the required packages and load the sample scene:

Expand All @@ -32,7 +33,7 @@ the missing values don't simply show up as white:
.. jupyter-execute::

# Make the composite and add it to the scene
rgb = xls.composite(scene, rescale_to=(0.04, 0.17))
rgb = xls.composite(scene, rescale_to=(0, 0.2))

fig, ax = plt.subplots(1, 1, figsize=(10, 6))

Expand All @@ -49,7 +50,7 @@ We can fill these values with reasonable estimates using interpolation:

scene_filled = xls.interpolate_missing(scene)

rgb_filled = xls.composite(scene_filled, rescale_to=(0.04, 0.17))
rgb_filled = xls.composite(scene_filled, rescale_to=(0, 0.2))

fig, ax = plt.subplots(1, 1, figsize=(10, 6))

Expand Down
Loading