Commit 1470dce0 authored by luroth's avatar luroth
Browse files

SE

parent 5d6eb4da
......@@ -154,7 +154,7 @@ def process_plant_count(path_campaign_date_5,
for delta, path_campaign in paths.items():
campaign_date = path_campaign.parts[-1]
campaign_date = path_campaign.parts[-2]
path_GC_AC_folder = path_campaign / 'GC_AC'
......@@ -207,31 +207,27 @@ def process_plant_count(path_campaign_date_5,
idx_w = df_regions.groupby(['plot_label'])['watershed_plant_count_estimation_abs'].transform(np.median) == \
df_regions['watershed_plant_count_estimation_abs']
df_regions_w = df_regions[idx_w]
df_regions_w = df_regions[idx_w].copy()
idx_gc = df_regions.groupby(['plot_label'])['groundcoverage_plant_count_estimation'].transform(np.median) == \
df_regions['groundcoverage_plant_count_estimation']
df_regions_gc = df_regions[idx_gc]
df_regions_gc = df_regions[idx_gc].copy()
# watershed data
df_regions_w['value_json'] = df_regions_w.apply(lambda row: row.loc['area_sizes'].tolist(), axis=1)
df_regions_w['trait'] = "PntDen"
df_regions_w['trait_id'] = 1
df_regions_w['value'] = df_regions_w['plant_count_estimation']
df_regions_w['value'] = df_regions_w['watershed_plant_count_estimation']
df_regions_w['timestamp'] = datetime.strptime(campaign_date, "%Y%m%d")
df_regions_w['timestamp'] = pd.to_datetime(df_regions_w['campaign_date'], format="%Y%m%d")
df_regions_w.to_csv(path_trait_csvs / (design_label + "_watershed_plants.csv"), index=False)
# GC data
df_regions_gc['value_json'] = df_regions_gc.apply(lambda row: row.loc['area_sizes'].tolist(), axis=1)
df_regions_gc['trait'] = "PntDen"
df_regions_gc['trait_id'] = 1
df_regions_gc['value'] = df_regions_gc['plant_count_estimation']
df_regions_gc['value'] = df_regions_gc['groundcoverage_plant_count_estimation']
df_regions_gc['timestamp'] = datetime.strptime(campaign_date, "%Y%m%d")
df_regions_gc['timestamp'] = pd.to_datetime(df_regions_gc['campaign_date'], format="%Y%m%d")
df_regions_gc.to_csv(path_trait_csvs / (design_label + "_gc_plants.csv"), index=False)
......@@ -354,7 +350,7 @@ def process_NadirCC_LCCC_LA_AI(path_campaign, campaign_date, GSD):
y = df_training['delta_to_BBCH']
svm_predictor = svm.SVR(C=2, kernel='rbf', gamma = 0.01, epsilon = 0.1)
svm_predictor = svm.SVR(C=32, kernel='rbf', gamma = 0.015625, epsilon = 0.1)
svm_predictor.fit(X, y)
print("Process campaign ", path_campaign)
......
from GroundAerialCoverage import CanopyAnalysis
from pathlib import Path
path_p = Path("P:/")
#path_p = Path("/home/luroth/public")
if __name__ == "__main__":
base_path_campaign = path_p / 'Evaluation/UAV/_Processed_/ETHZ_eschikon_FPWW022_lot1'
GSD = 0.001
# 2018
plant_count_date_15 = "20180325"
plant_count_date_10 = "20180404"
plant_count_date_5 = "20180411"
# 2019
#plant_count_date_15 = "20190329"
#plant_count_date_10 = "20190402"
#plant_count_date_5 = "20190409"
# Plant count estimate
path_plant_count_campaign_15 = base_path_campaign / plant_count_date_15 / '28m_M600P'
path_plant_count_campaign_10 = base_path_campaign / plant_count_date_10 / '28m_M600P'
path_plant_count_campaign_5 = base_path_campaign / plant_count_date_5 / '28m_M600P'
CanopyAnalysis.process_plant_count(path_plant_count_campaign_5,
path_plant_count_campaign_10,
path_plant_count_campaign_15,
GSD)
from GroundAerialCoverage import CanopyAnalysis
from pathlib import Path
path_p = Path("P:")
#path_p = Path("/home/luroth/public")
if __name__ == "__main__":
base_path_campaign = path_p / 'Evaluation/UAV/_Processed_/DSP_genevey_DSWW001'
GSD = 0.001
# CC, LA
date_folders = base_path_campaign.glob('[0-9]*')
for date_folder in date_folders:
campaign_date = date_folder.name
if int(campaign_date) <= 20190411:
print("Processing", campaign_date)
path_campaign = base_path_campaign / campaign_date / '28m_M600P'
# Clean old files
patterns = ["*_CC_nadir.csv", "*_CC_LC.csv", "*_LA.csv", "*_AI.csv"]
CanopyAnalysis.clean_trait_folder(path_campaign, patterns)
CanopyAnalysis.process_NadirCC_LCCC_LA_AI(path_campaign, campaign_date, GSD)
\ No newline at end of file
from GroundAerialCoverage import CanopyAnalysis
from pathlib import Path
path_p = Path("P:/")
#path_p = Path("/home/luroth/public")
if __name__ == "__main__":
base_path_campaign = path_p / 'Evaluation/UAV/_Processed_/DSP_genevey_DS'
GSD = 0.001
# 2019
plant_count_date_15 = "???"
plant_count_date_10 = "???"
plant_count_date_5 = "???"
# Plant count estimate
path_plant_count_campaign_15 = base_path_campaign / plant_count_date_15 / '28m_M600P'
path_plant_count_campaign_10 = base_path_campaign / plant_count_date_10 / '28m_M600P'
path_plant_count_campaign_5 = base_path_campaign / plant_count_date_5 / '28m_M600P'
CanopyAnalysis.process_plant_count(path_plant_count_campaign_5,
path_plant_count_campaign_10,
path_plant_count_campaign_15,
GSD)
from GroundAerialCoverage import CanopyAnalysis
from pathlib import Path
path_p = Path("P:/")
#path_p = Path("/home/luroth/public")
if __name__ == "__main__":
base_path_campaign = path_p / 'Evaluation/UAV/_Processed_/ETHZ_eschikon_FPWW024_lot4'
GSD = 0.001
# 2018
#plant_count_date_15 = "20180329"
#plant_count_date_10 = "20180404"
#plant_count_date_5 = "20180411"
# 2019
plant_count_date_15 = "20190329"
plant_count_date_10 = "20190402"
plant_count_date_5 = "20190409"
# Plant count estimate
path_plant_count_campaign_15 = base_path_campaign / plant_count_date_15 / '28m_M600P'
path_plant_count_campaign_10 = base_path_campaign / plant_count_date_10 / '28m_M600P'
path_plant_count_campaign_5 = base_path_campaign / plant_count_date_5 / '28m_M600P'
CanopyAnalysis.process_plant_count(path_plant_count_campaign_5,
path_plant_count_campaign_10,
path_plant_count_campaign_15,
GSD)
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