Question about isnull() in map algebra

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about isnull() in map algebra

margherita
Hi,

I have a doubt. When cloud mask is applied to calculate NDVI
t.rast.mapcalc input=b4,b8,cloud output=ndvi_cloud \
expression="if(isnull(cloud), null(), float(b8 - b4) / ( b8 + b4 ))" \
basename=ndvi_cloud nproc=3
what happens if there is no cloud mask at all for a certain map? In this case NDVI should be taken as is. Instead, to my understanding, what happens:
if(isnull(cloud), null()
If cloud map is not found (meaning there is no cloud detected), isnull(cloud)=True, so the NDVI resulting map is null too. Please correct me if I'm wrong.

Thanks

--
Margherita Di Leo

_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Question about isnull() in map algebra

Markus Metz-3
Hi Madi,

On Thu, Jun 6, 2019 at 4:13 PM Margherita Di Leo <[hidden email]> wrote:

>
> Hi,
>
> reading the training material here: http://training.gismentors.eu/grass-gis-irsae-winter-course-2018/units/23.html
> I have a doubt. When cloud mask is applied to calculate NDVI
>
> t.rast.mapcalc input=b4,b8,cloud output=ndvi_cloud \
> expression="if(isnull(cloud), null(), float(b8 - b4) / ( b8 + b4 ))" \
> basename=ndvi_cloud nproc=3
>
> what happens if there is no cloud mask at all for a certain map? In this case NDVI should be taken as is. Instead, to my understanding, what happens:
>
> if(isnull(cloud), null()
>
> If cloud map is not found (meaning there is no cloud detected), isnull(cloud)=True, so the NDVI resulting map is null too. Please correct me if I'm wrong.

the cloud masks are apparently created with "sentinel-cloud-mask.py" which requires an AOI vector as input, and a cloud mask is always generated: if there are no clouds or no cloud mask, only the AOI is used as mask.

from a quick glance at "sentinel-cloud-mask.py"

Markus M

>> Thanks
>
> --
> Margherita Di Leo
> _______________________________________________
> grass-user mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Question about isnull() in map algebra

margherita


On Thu, Jun 6, 2019 at 6:28 PM Markus Metz <[hidden email]> wrote:
Hi Madi,

On Thu, Jun 6, 2019 at 4:13 PM Margherita Di Leo <[hidden email]> wrote:

>
> Hi,
>
> reading the training material here: http://training.gismentors.eu/grass-gis-irsae-winter-course-2018/units/23.html
> I have a doubt. When cloud mask is applied to calculate NDVI
>
> t.rast.mapcalc input=b4,b8,cloud output=ndvi_cloud \
> expression="if(isnull(cloud), null(), float(b8 - b4) / ( b8 + b4 ))" \
> basename=ndvi_cloud nproc=3
>
> what happens if there is no cloud mask at all for a certain map? In this case NDVI should be taken as is. Instead, to my understanding, what happens:
>
> if(isnull(cloud), null()
>
> If cloud map is not found (meaning there is no cloud detected), isnull(cloud)=True, so the NDVI resulting map is null too. Please correct me if I'm wrong.

the cloud masks are apparently created with "sentinel-cloud-mask.py" which requires an AOI vector as input, and a cloud mask is always generated: if there are no clouds or no cloud mask, only the AOI is used as mask.

from a quick glance at "sentinel-cloud-mask.py"

Markus M

Thank you Markus! 

--
Margherita Di Leo

_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user