Commit 92065c73 authored by luroth's avatar luroth
Browse files

processing of missing images

parent 98538ddb
......@@ -343,9 +343,11 @@ def zonal_stat(output_path, band_index, raster_path=None, raster_ds=None, shape_
ymax_inc_border = yOrigin - (yoff * -1 * pixelHeight)
# Read raster as arrays
dataraster = raster_band.ReadAsArray(xoff, yoff, xcount, ycount)
if dataraster is None:
pass
dataraster = None
i = 1000
while (dataraster is None) and i>0:
dataraster = raster_band.ReadAsArray(xoff, yoff, xcount, ycount)
i -= 1
# Create mask of plot
# Create coordinate matrix to check if image pixel in plot polygon
......
......@@ -154,14 +154,17 @@ def process_plant_count(path_campaign, delta_to_BBCH30,
for LA_image in LA_images:
parts = LA_image.name.split("_")
if (len(parts) == 3):
if (len(parts) == 2):
design_label = parts[0]
plot_label = parts[1][:-4]
elif (len(parts) == 3):
design_label = parts[0] + "_" + parts[1]
plot_label = parts[2][:-4]
elif (len(parts) == 4):
design_label = parts[0] + "_" + parts[1]
plot_label = parts[2] + "_" + parts[3][:-4]
else:
Exception("Do not know how to parse name " + LA_image.name)
raise Exception("Do not know how to parse name " + LA_image.name + " with n parts: " + str(len(parts)))
print("Process LA image for plot", plot_label)
......
......@@ -6,13 +6,13 @@ path_p = Path("P:/")
if __name__ == "__main__":
base_path_campaign = path_p / 'Evaluation/UAV/_Processed_/DSP_genevey_DS'
base_path_campaign = path_p / 'Evaluation/UAV/_Processed_/DSP_genevey_DSWW001'
GSD = 0.001
# 2019
plant_count_date_15 = "???"
plant_count_date_10 = "???"
plant_count_date_5 = "???"
plant_count_date_15 = "20190319"
plant_count_date_10 = "20190402"
plant_count_date_5 = "20190406"
# Plant count estimate
path_plant_count_campaign_15 = base_path_campaign / plant_count_date_15 / '28m_M600P'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment