<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.5pt;
font-family:Consolas;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:Consolas;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="SV" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText"><span lang="EN-GB">Dear all,<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">I would greatly appreciate advice on how to rank and standardize a raster layer with 6841*15411 pixels.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">If the raster layer was instead a matrix, and I would use R, this is what I would do:<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">Say the raster had 12 pixels<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">rast = matrix(rnorm(12,mean=0.7,sd=0.1),ncol=4,nrow=3)<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">rast<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">> rast<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB"> [,1] [,2] [,3] [,4]<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">[1,] 0.6695254 0.7046706 0.7089812 0.6998835
<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">[2,] 0.6497284 0.6999004 0.6743091 0.8738022
<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">[3,] 0.8441623 0.7493160 0.7420391 0.6824722<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">Next, order<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">> matrix(order(rast),ncol=4,nrow=3)<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB"> [,1] [,2] [,3] [,4]<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">[1,] 2 12 4 6<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">[2,] 1 10 7 3<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">[3,] 8 5 9 11<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">Next standardize in relation to the highest value<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">> matrix(order(rast),ncol=4,nrow=3)/12<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB"> [,1] [,2] [,3] [,4]<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">[1,] 0.16666667 1.0000000 0.3333333 0.5000000
<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">[2,] 0.08333333 0.8333333 0.5833333 0.2500000
<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">[3,] 0.66666667 0.4166667 0.7500000 0.9166667<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">Solutions using R, GRASS or something else will do as fine!<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">Best regards,<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-GB">Tord<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
</div>
</body>
</html>