diff --git a/docs/tutorials/custom_raster_dataset.ipynb b/docs/tutorials/custom_raster_dataset.ipynb index 9e8a86ec9cd..19eb8714ddf 100644 --- a/docs/tutorials/custom_raster_dataset.ipynb +++ b/docs/tutorials/custom_raster_dataset.ipynb @@ -3382,7 +3382,7 @@ "\n", " # Reorder and rescale the image\n", " image = sample[\"image\"][rgb_indices].permute(1, 2, 0)\n", - " image = torch.clamp(image / 6000, min=0, max=1).numpy()\n", + " image = torch.clamp(image / 10000, min=0, max=1).numpy()\n", "\n", " # Plot the image\n", " fig, ax = plt.subplots()\n", diff --git a/torchgeo/datasets/sentinel.py b/torchgeo/datasets/sentinel.py index 407a41acc1f..7bbb1a0b590 100644 --- a/torchgeo/datasets/sentinel.py +++ b/torchgeo/datasets/sentinel.py @@ -351,7 +351,9 @@ def plot( raise ValueError("Dataset doesn't contain some of the RGB bands") image = sample["image"][rgb_indices].permute(1, 2, 0) - image = torch.clamp(image / 2000, min=0, max=1) + # DN = 10000 * REFLECTANCE + # https://docs.sentinel-hub.com/api/latest/data/sentinel-2-l2a/ + image = torch.clamp(image / 10000, min=0, max=1) fig, ax = plt.subplots(1, 1, figsize=(4, 4))