<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Vero,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
i.sentinel.mask doesn't retrieve the maximum from the xml file but computes the value from the image using r.univar. The error could be due to the computational region..has the region been set correctly?</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Can you send the <span style="color: rgb(50, 49, 48); font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important;">MTD_TL.xml file? I can download the image and make some tests</span><span style="color: rgb(50, 49, 48); font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important;">.</span></div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Roberta</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Da:</b> grass-user <grass-user-bounces@lists.osgeo.org> per conto di Veronica Andreo <veroandreo@gmail.com><br>
<b>Inviato:</b> martedě 28 gennaio 2020 19:57<br>
<b>A:</b> grass-user <grass-user@lists.osgeo.org><br>
<b>Oggetto:</b> [GRASS-user] error in i.sentinel.mask: nan values in xml file</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Hello</div>
<div><br>
</div>
<div>I try to use i.sentinel.mask but I get the following error:</div>
<div><br>
</div>
<div>i.sentinel.mask blue=$blue green=$green red=$red swir11=$swir11 nir=$nir swir12=$swir12 nir8a=$nir8a cloud_mask=cloud shadow_mask=shadow mtd_file=`find $out_dir -name 'MTD_TL.xml'`</div>
<div><br>
ADVERTENCIA: All subsequent operations will be limited to the current<br>
             computational region<br>
ADVERTENCIA: Any rescale factor has been applied<br>
--- Start computing maximum values of bands ---<br>
T21JYM_20200126T134201_B02_10m<br>
T21JYM_20200126T134201_B03_10m<br>
T21JYM_20200126T134201_B04_10m<br>
T21JYM_20200126T134201_B08_10m<br>
T21JYM_20200126T134201_B8A_20m<br>
T21JYM_20200126T134201_B11_20m<br>
T21JYM_20200126T134201_B12_20m<br>
--- Computed maximum value: dict_values([nan, nan, nan, nan, nan, nan,<br>
nan]) ---<br>
--- Statistics have been computed! ---<br>
--- Start clouds detection procedure ---<br>
--- Computing cloud mask... ---<br>
Mapa no válido <nan><br>
Parse error<br>
ERROR: error al parsear<br>
ERROR: An error occurred while running r.mapcalc with expression:<br>
       cloud_def82115 = if((((T21JYM_20200126T134201_B02_10m > (0.08*nan))<br>
       && (T21JYM_20200126T134201_B03_10m > (0.08*nan)) &&<br>
       (T21JYM_20200126T134201_B04_10m > (0.08*nan))) == 1) &&<br>
       (((T21JYM_20200126T134201_B04_10m < ((0.08*nan)*1.5)) &&<br>
       (T21JYM_20200126T134201_B04_10m ><br>
       T21JYM_20200126T134201_B12_20m*1.3)) == 0) &&<br>
       (((T21JYM_20200126T134201_B11_20m < (0.1*nan)) &&<br>
       (T21JYM_20200126T134201_B12_20m < (0.1*nan))) == 0) &&<br>
       ((if(T21JYM_20200126T134201_B8A_20m ==<br>
       max(T21JYM_20200126T134201_B8A_20m, 2 *<br>
       T21JYM_20200126T134201_B02_10m, 2 * T21JYM_20200126T134201_B03_10m,<br>
       2 * T21JYM_20200126T134201_B04_10m))) == 0) &&<br>
       ((T21JYM_20200126T134201_B02_10m > 0.2) == 1), 0, null())<br>
</div>
<div><br>
</div>
<div>I checked the xml file and there are a lot of nan's yes, but there are also real values. Why doesn't the max function in this part:
<a href="https://github.com/OSGeo/grass-addons/blob/master/grass7/imagery/i.sentinel/i.sentinel.mask/i.sentinel.mask.py#L321" target="_blank">
https://github.com/OSGeo/grass-addons/blob/master/grass7/imagery/i.sentinel/i.sentinel.mask/i.sentinel.mask.py#L321</a> recognize them? Isn't there a way to avoid nan while computing max?<br>
</div>
<div><br>
</div>
<div>Thanks much in advance</div>
<div>Vero</div>
<div><br>
</div>
<div>ps: I can provide the xml if needed. <br>
</div>
</div>
</div>
</div>
</body>
</html>