document.add_heading('Normalized Difference Vegetation Index Image (NDVI)',level=2) document.add_paragraph('\nNDVI image provides you a color map of the vegetation of your farming field and nearby areas. The areas shown in red are the regions where the crop growth may not be normal. You should refer to these images when your crop is in the early stage of growth.\n') p = document.add_paragraph('') p.add_run('Scientific Background\n').bold = True document.add_paragraph('NDVI measures status of plant health based on how plants reflect light at certain frequencies. Though we cannot perceive it with our eyes, everything around us (including plants) reflect wavelengths of light in visible and non-visible spectrum. Taking into account how much amount of a certain wavelength is reflected, we can assess the current status of plants. If a plant is healthy, it will have large amount of chlorophyll on its leaves and will absorb good amount of visible light from 0.4 to 0.7 microns and reflect quite less of it and vice-versa. We take into account this basic principle in identifying crop health status of an agricultural land.') #column_img(uid,fieldid,'colormap_farmonaut','colormap2') column_img(uid,fieldid,'_ndvi','_ndvi_cmap2') #column_img(uid,fieldid,(uid+'_collage_ndvi_ndvi_cmap2'),(uid+'_collagecolormap_farmonautcolormap2')) file_name= uid+'_collage_ndvi_ndvi_cmap2.png' document.add_picture(file_name,width=Inches(7)) file_name= 'colormap_collage.png' document.add_picture(file_name,width=Inches(7)) document.add_paragraph('\nPlease check this article to read more about NDVI:\n https://farmonaut.com/blogs/remote-sensing/normalized-difference-vegetation-index-ndvi/\n') document.add_heading('Table of NDVI value change with time',level=1) ndvi_records = ndvi dates = [] ndvi_columns = len(ndvi_records)+1 table = document.add_table(rows=1,cols=ndvi_columns) table.style = 'TableGrid' hdr_cells = table.rows[0].cells i =0 for (key,val) in ndvi_records.items(): dates.append(key) dates.sort() for key in dates: if i==0: hdr_cells[i].text = 'Date' hdr_cells[i].bold = True i = i+1 y = key[0:4] m = key[4:6] d = key[6:] kk = y+'-'+m+'-'+d hdr_cells[i].text = kk hdr_cells[i].bold = True i = i+1 row_cells = table.add_row().cells i = 0 for key in dates: if i==0: row_cells[i].text = 'NDVI Value' i=i+1 val = float(ndvi_records[key])/100 row_cells[i].text = str(val) row_cells[i].bold = True i=i+1 if len(ndvi_records)>1: #document.add_heading('Graph of NDVI vs Time',level=2) create_linegraph(uid,'ndvi',ndvi) column_img(uid,fieldid,'_ndvi_piechart','_ndvi_linegraph') file_name = uid+'_collage_ndvi_piechart_ndvi_linegraph.png' document.add_picture(file_name,width=Inches(7.0)) else: p = document.add_paragraph('') file_name = uid+'_ndvi'+'_piechart.png' document.add_picture(file_name,width=Inches(6))