diff --git a/python_app/requirements.txt b/python_app/requirements.txt new file mode 100644 index 0000000..f5db250 --- /dev/null +++ b/python_app/requirements.txt @@ -0,0 +1,28 @@ +aenum==3.1.15 +certifi==2023.7.22 +charset-normalizer==3.3.0 +click==8.1.7 +dataclasses-json==0.6.1 +GDAL==3.7.2 +idna==3.4 +marshmallow==3.20.1 +mypy-extensions==1.0.0 +numpy==1.26.1 +oauthlib==3.2.2 +packaging==23.2 +Pillow==10.1.0 +pyproj==3.6.1 +python-dateutil==2.8.2 +requests==2.31.0 +requests-oauthlib==1.3.1 +sentinelhub==3.9.1 +shapely==2.0.2 +six==1.16.0 +tifffile==2023.9.26 +tomli==2.0.1 +tomli_w==1.0.0 +tqdm==4.66.1 +typing-inspect==0.9.0 +typing_extensions==4.8.0 +urllib3==2.0.6 +utm==0.7.0 diff --git a/r_app/CI_Report_dashboard_planet.html b/r_app/CI_Report_dashboard_planet.html new file mode 100644 index 0000000..3ab3f97 --- /dev/null +++ b/r_app/CI_Report_dashboard_planet.html @@ -0,0 +1,619 @@ + + + + + + + + + + + + + +CI dashboard week 40 - all pivots dashboard using 3x3 meter resolution + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+

stop( here(“myfile.txt”));

+
+
+

title: paste0(“CI report week”, week, ” - all pivots from “, +last_tuesday,” to “, today)

+

output: word_document: reference_docx: +here(“word-styles-reference-03.docx”) # toc: true editor_options: +chunk_output_type: console —

+

This PDF-dashboard shows the status of your fields on a weekly basis. +We will show this in different ways:

+
    +
  1. The first way is with a general overview of field heterogeneity +using ‘variation’ – a higher number indicates more differences between +plants in the same field.
  2. +
  3. The second map shows a normal image of the latest week in colour, of +the demo fields.
  4. +
  5. Then come the maps per field, which show the status for three weeks +ago, two weeks ago, last week, and this week, as well as a percentage +difference map between last week and this week. The percentage +difference maps shows the relative difference in growth over the last +week, with positive numbers showing growth, and negative numbers showing +decline.
  6. +
  7. Below the maps are graphs that show how each pivot quadrant is +doing, measured through the chlorophyll index.
  8. +
+
+
+

+Pivot 1.1 - week 40 - 10 weeks after planting/harvest +

+

+
## Warning: Combining variables of class <numeric> and <character> was deprecated in ggplot2 3.4.0.
+## ℹ Please ensure your variables are compatible before plotting (location: `combine_vars()`)
+## This warning is displayed once every 8 hours.
+## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
+ +

+Pivot 1.10 - week 40 - 45 weeks after planting/harvest +

+ + +

+Pivot 1.11 - week 40 - 42 weeks after planting/harvest +

+ + +

+Pivot 1.12 - week 40 - 10 weeks after planting/harvest +

+ + +

+Pivot 1.13 - week 40 - NA weeks after planting/harvest +

+ + +

+Pivot 1.14 - week 40 - 44 weeks after planting/harvest +

+ + +

+Pivot 1.16 - week 40 - 55 weeks after planting/harvest +

+ + +

+Pivot 1.18 - week 40 - 42 weeks after planting/harvest +

+ + +

+Pivot 1.2 - week 40 - 7 weeks after planting/harvest +

+ + +

+Pivot 1.3 - week 40 - 7 weeks after planting/harvest +

+ + +

+Pivot 1.4 - week 40 - 5 weeks after planting/harvest +

+ + +

+Pivot 1.7 - week 40 - 7 weeks after planting/harvest +

+ + +

+Pivot 1.8 - week 40 - 47 9 weeks after planting/harvest +

+ + +

+Pivot 1.9 - week 40 - 10 weeks after planting/harvest +

+ + +

+Pivot 2.1 - week 40 - 39 weeks after planting/harvest +

+ + +

+Pivot 2.2 - week 40 - 14 weeks after planting/harvest +

+ + +

+Pivot 2.3 - week 40 - 80 58 77 weeks after planting/harvest +

+ + +

+Pivot 2.4 - week 40 - 59 weeks after planting/harvest +

+ + +

+Pivot 2.5 - week 40 - 45 51 weeks after planting/harvest +

+ + +

+Pivot 3.1 - week 40 - 38 44 weeks after planting/harvest +

+ + +

+Pivot 3.2 - week 40 - 35 56 weeks after planting/harvest +

+ + +

+Pivot 3.3 - week 40 - 55 weeks after planting/harvest +

+ + +

+Pivot 4.1 - week 40 - 49 weeks after planting/harvest +

+ + +

+Pivot 4.2 - week 40 - 48 weeks after planting/harvest +

+ + +

+Pivot 4.3 - week 40 - 14 weeks after planting/harvest +

+ + +

+Pivot 4.4 - week 40 - 55 weeks after planting/harvest +

+ + +

+Pivot 4.5 - week 40 - 38 weeks after planting/harvest +

+ + +

+Pivot 4.6 - week 40 - 47 weeks after planting/harvest +

+ + +

+Pivot 5.1 - week 40 - 64 weeks after planting/harvest +

+ + +

+Pivot 5.2 - week 40 - 57 weeks after planting/harvest +

+ + +

+Pivot 5.3 - week 40 - 53 weeks after planting/harvest +

+ + +

+Pivot 5.4 - week 40 - 48 weeks after planting/harvest +

+ + +

+Pivot 6.1 - week 40 - 45 weeks after planting/harvest +

+ + +

+Pivot 6.2 - week 40 - 9 weeks after planting/harvest +

+ + +

+Pivot DL1.1 - week 40 - 65 weeks after planting/harvest +

+ + +

+Pivot DL1.3 - week 40 - NA weeks after planting/harvest +

+

+

+

The below table shows estimates of the biomass if you would harvest +them now.

+

+ + + + +
+ + + + + + + + + + + + + + + diff --git a/r_app/CI_report_dashboard_planet.Rmd b/r_app/CI_report_dashboard_planet.Rmd index 88b489a..b627153 100644 --- a/r_app/CI_report_dashboard_planet.Rmd +++ b/r_app/CI_report_dashboard_planet.Rmd @@ -2,7 +2,7 @@ # title: paste0("CI report week ", week, " - all pivots from ", last_tuesday, " to ", today) output: word_document: - reference_docx: word-styles-reference-03.docx + reference_docx: "/Users/mfolkerts/smartCane/word-styles-reference-03.docx" # toc: true editor_options: chunk_output_type: console @@ -40,13 +40,13 @@ s2_dir <- "C:/Users/timon/Resilience BV/4002 CMD App - General/4002 CMD Team/400 ```{r week, message=FALSE, warning=FALSE, include=FALSE} # week <- 5 -# today = "2023-02-02" -# week <- week(today) -# today = "2022-08-18" -# -today = as.character(Sys.Date()) -week = lubridate::week(Sys.time()) -# week = 26 + today = "2023-10-05" + week <- week(today) + #today = "2022-08-18" + +#today = as.character(Sys.Date()) +#week = lubridate::week(Sys.time()) +## week = 26 title_var <- paste0("CI dashboard week ", week, " - all pivots dashboard using 3x3 meter resolution") ``` diff --git a/smartcane.sh b/smartcane.sh index 0bddccf..52b6a09 100755 --- a/smartcane.sh +++ b/smartcane.sh @@ -2,28 +2,53 @@ # Definieer de directories die aangemaakt moeten worden -#declare -a dirs=( - #"laravel_app/storage/app/extracted_ci/cumulative_vals" - #"laravel_app/storage/app/chemba/merged_tif" - #"laravel_app/storage/app/chemba/merged_virtual" - #"laravel_app/storage/app/chemba/single_images" -#) +declare -a dirs=( + "laravel_app/storage/app/extracted_ci/cumulative_vals" + "laravel_app/storage/app/chemba/merged_tif" + "laravel_app/storage/app/chemba/merged_virtual" + "laravel_app/storage/app/chemba/single_images" +) # ## Loop door de directories en maak ze aan als ze nog niet bestaan, ## of maak ze leeg als ze al bestaan -#for dir in "${dirs[@]}"; do - #if [ ! -d "$dir" ]; then - #mkdir -p "$dir" - #chmod -R 775 "$dir" - #echo "Directory $dir is aangemaakt en bijgewerkt." - #else - ## Verwijder alle inhoud binnen de bestaande directory - #find "$dir" -mindepth 1 -delete - #echo "Inhoud van directory $dir is verwijderd." - #fi -#done -## Runnen van Jupyter Notebook -#jupyter nbconvert --execute --to script --stdout python_app/Chemba_download.ipynb +for dir in "${dirs[@]}"; do + if [ ! -d "$dir" ]; then + mkdir -p "$dir" + chmod -R 775 "$dir" + echo "Directory $dir is aangemaakt en bijgewerkt." + else + # Verwijder alle inhoud binnen de bestaande directory + find "$dir" -mindepth 1 -delete + echo "Inhoud van directory $dir is verwijderd." + fi +done +## Runnen van Jupyter Notebook +# Directory waar de virtuele omgeving zal worden aangemaakt +VENV_DIR="./python_app/myenv" + +# Controleer of de virtuele omgeving al bestaat +if [ ! -d "$VENV_DIR" ]; then + echo "Virtuele omgeving bestaat niet. Aan het aanmaken..." + python3 -m venv "$VENV_DIR" +else + echo "Virtuele omgeving bestaat al." +fi + +# Activeer de virtuele omgeving +source "$VENV_DIR/bin/activate" + +# Installeer of update de benodigde pakketten +if [ -f "requirements.txt" ]; then + echo "Requirements aan het installeren of bijwerken..." + pip install --upgrade -r python_app/requirements.txt +else + echo "Geen requirements.txt bestand gevonden." +fi + +# Hier kan je verdere stappen toevoegen, zoals het uitvoeren van je Python-script of Jupyter Notebook +jupyter nbconvert --execute --to script --stdout python_app/Chemba_download.ipynb +# Deactiveer de virtuele omgeving (optioneel) +deactivate ## Runnen van R scripts # Kopieer de excel file met harvesting data en maak directory aan indien nodig #mkdir -p laravel_app/storage/app/harvesting_data @@ -34,5 +59,5 @@ # ## Runnen van Rmd bestand # -e betekent "evalueren" en -i specificeert de input file -Rscript -e "rmarkdown::render('r_app/CI_Report_dashboard_planet.Rmd', 'all')" +#Rscript -e "rmarkdown::render('r_app/CI_Report_dashboard_planet.Rmd', 'all')"