From 19b85cc902a857fcd326dd97a0a23d34d7f5e73a Mon Sep 17 00:00:00 2001 From: pahalsrivastava Date: Wed, 7 Jan 2026 11:56:34 +0530 Subject: [PATCH] Updated the CLI commands for PCA of multiband images and updated bcyr and grey reset for Image fusion with PCA results --- .../GRASS_remotesensing.qmd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/content/tutorials/remote_sensing_visualization/GRASS_remotesensing.qmd b/content/tutorials/remote_sensing_visualization/GRASS_remotesensing.qmd index 83a4a50..b4c3ebb 100644 --- a/content/tutorials/remote_sensing_visualization/GRASS_remotesensing.qmd +++ b/content/tutorials/remote_sensing_visualization/GRASS_remotesensing.qmd @@ -435,7 +435,7 @@ Here, we will explore **principal components analysis** (PCA). PCA mathematicall Perform a PCA and output the results to the console/terminal and as PCA component maps. ```{python} -i.pca input=landsat8_2024_B2,landsat8_2024_B3,landsat8_2024_B4, landsat8_2024_B5,landsat8_2024_B6,landsat8_2024_B7 output=Flagstaff_landsat8 +i.pca input=landsat8_2024_B2,landsat8_2024_B3,landsat8_2024_B4,landsat8_2024_B5,landsat8_2024_B6,landsat8_2024_B7 output=Flagstaff_landsat8 ``` #### Python @@ -444,7 +444,7 @@ Perform a PCA and output the results to the console/terminal and as PCA componen ```{python} gs.run_command("i.pca", - input="landsat8_2024_B2,landsat8_2024_B3,landsat8_2024_B4, landsat8_2024_B5,landsat8_2024_B6,landsat8_2024_B7", + input="landsat8_2024_B2,landsat8_2024_B3,landsat8_2024_B4,landsat8_2024_B5,landsat8_2024_B6,landsat8_2024_B7", output=Flagstaff_landsat8) ``` @@ -491,6 +491,14 @@ Here is PCA component 1 colored with a **bcyr** (blue-cyan-yellow-red) color tab Follow the instructions given above for histogram equalization, but pick `bcyr` instead of grey for the color table. +```bash +# Set PCA component 1 to bcyr false color +r.colors -e map=Flagstaff_landsat8.1 color=bcyr + +# Reset histogram to grey for subsequent steps +r.colors -e map=Flagstaff_landsat8.1 color=grey +``` + Note how areas of different vegetation, soil, and water stand out more clearly than with grey-scale. Try other color tables. :::