How to mask the images in GRASS
-
I have MODIS NDVI images, which needs to be masked with VI_Quality. I am using GRASS software and executing GRASS commands using shell scripts. I need to perform raster calculation (multiplication) for NDVI images with the VI_Quality. I want to multiply ith NDVI image with the ith image of VI_Quality. I have used the following codes : for file in $NDVIFILES; do r.mapcalc "$file = $NDVIFILES * $QAFILES; done i=1 for file in $NDVIFILES; do r.mapcalc "file $((i++)) = NDVIFILES $((i++)) * QAFILES $((i++))"; done I am unable to do this raster multiplication in a loop. Please let me know the correct syntax to do this operation. Thanks
-
Answer:
Here's what I suggest: g.mlist --q type=rast pattern-"*NDVI" mapset=shenkottah >> NDVIFILES and a similar expression for the QAFILES This will leave you with two files on your disk, each containing a list of the raster map names. To verify, test with the sed expression: sed -n "4p" NDVIFILES Then you should be able to run a loop to read the raster names and do your mapcalc, something like: for i in `seq 1 22`; do \ NDVI=`sed -n "${i}p" NDVIFILES`; QA=`sed -n "${i}p" QAFILES`; r.mapcalc new_${i} = $NDVI * $QA; done
Karthik K at Geographic Information Systems Visit the source
Related Q & A:
- How To View Private Images On Myspace?Best solution by techcular.com
- How to drag multiple images in Android?Best solution by Stack Overflow
- How to store documents/images/video on a different server in sharepoint 2010?Best solution by SharePoint
- How to store multiple Images in database?Best solution by Stack Overflow
- How do I stop itching from grass?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.