Normalised Difference Nitrogen Index


I’m adding some custom indexes and one which I think would be useful is NDNI, so that I can analyse the nitrogen values in vineyard canopies.

The formula should be:

log (1/1510nm)-log(1/1680nm)

P4DF doesn’t like that and I wonder if it’s something to do with the wavelengths? I’m not 100% sure I understand this, so any help or advice greatly appreciated!

Ahh I think it might be because those wavebands are SWIR, which we don’t have…

But now I have a follow up question @Julius_Petri; what is the recommended index to detect water stress? NDWI?


you could use the Sentinel-2 NDMI = (B08 – B11) / (B08 + B11) as that can be calculated from the satellite data you can download with PIX4Dfields.

The NDMI is a normalized difference moisture index, that uses NIR and SWIR bands to display moisture. The SWIR band reflects changes in both the vegetation water content and the spongy mesophyll structure in vegetation canopies, while the NIR reflectance is affected by leaf internal structure and leaf dry matter content but not by water content. The combination of the NIR with the SWIR removes variations induced by leaf internal structure and leaf dry matter content, improving the accuracy in retrieving the vegetation water content . The amount of water available in the internal leaf structure largely controls the spectral reflectance in the SWIR interval of the electromagnetic spectrum. SWIR reflectance is therefore negatively related to leaf water content. In short, NDMI is used to monitor changes in water content of leaves, and was proposed by Gao.

Source: Measuring moisture: Normalized Difference Moisture Index (NDMI) Sentinel-2 2022 –

Thanks Julius. I just tried entering that formula after downloaded the sat data, am being given a ‘syntax error’ or ‘Variable not allowed’.
I tried the formula just as you posted, and then tried replacing ‘B’ with ‘Blue’ from the custom index builder and neither works. What am I doing wrong please?


that cannot work as the band names in PIX4Dfields are different, you can see the available bands under the calculator:

Thats how the working formula looks like:

1 Like