Commit graph

29 commits

Author SHA1 Message Date
Timon 55d67ef503 Merge branch 'code-improvements' into review_perField_code 2026-02-18 15:17:11 +01:00
Timon 1500bbcb1c Refactor KPI calculations and reporting utilities; normalize field details columns, update area change metrics, and enhance .gitignore for PNG exceptions. 2026-02-18 13:26:32 +01:00
Timon f1821dab59 Enhance project configuration and reporting utilities; update .gitignore for PNG exceptions, add CI change thresholds, and improve historical data handling in KPI calculations. 2026-02-18 10:54:42 +01:00
Timon 1f677f2626 Update terminology from DOY to DAH across multiple scripts and reports for consistency in crop age calculations 2026-02-18 09:36:54 +01:00
Timon e4e19df0c7 Update CI report parameters and improve map legend configurations
- Changed report date in CI report for cane supply to "2026-02-04".
- Updated output file naming convention for agronomic support report to reflect new report date.
- Enhanced map creation functions to allow customizable legend positions and improved layout settings.
- Adjusted widths for map arrangements to ensure better visual representation.
- Fixed minor issues in ggplot aesthetics for clearer legend positioning and improved readability.
- Corrected field size unit from hectares to acres in KPI summary generation.
2026-02-17 13:46:43 +01:00
DimitraVeropoulou a9840171cb Enhance logging functionality and update report generation scripts
- Improved safe_log function to include timestamps and conditional logging
- Added diagnostic messages for field visualization processing
- Updated CI map rendering parameters for consistency
- Refined raster mapping functions in report_utils for clarity
- Added .png files to .gitignore
2026-02-16 10:21:55 +01:00
Timon d81f1a4e5a Enhance cum_ci_plot function with dynamic max values for x-axis breaks 2026-02-12 08:47:30 +01:00
Timon 4cd62ab82e Enhance report utility functions and add validation scripts
- Updated `create_CI_map` and `create_CI_diff_map` functions to enforce a 1:1 aspect ratio for consistent map sizing.
- Modified `ci_plot` function to adjust widths of arranged maps for better layout.
- Changed raster merging method in `aggregate_per_field_mosaics_to_farm_level` from `mosaic` to `merge` for improved handling of field data.
- Introduced `test_kpi_validation.R` script to validate the structure of KPI RDS files, ensuring expected KPIs are present.
- Added `test_overview_maps_aggregation.R` script to test the aggregation pipeline for overview maps, including loading field mosaics, creating a farm-level mosaic, and generating visualizations.
2026-02-11 14:32:36 +01:00
Timon b6fa1956c0 Enhance debugging output and improve date handling in TIFF removal script; update report utility functions for better map layout and historical data handling. 2026-02-11 09:48:07 +01:00
Timon 054cc85bdb small issues 2026-02-10 15:38:23 +01:00
Timon 0dc46628fd Address CodeRabbit review feedback - [description of changes] 2026-02-10 12:45:41 +01:00
Timon c313f87959 fixed issue 110 moving stuff to 00 common 2026-02-03 16:14:10 +01:00
Timon 14300f6832 updating inbetween stuff, not finished yet 2026-02-02 12:07:10 +01:00
Timon 458b8247be Cleanup: Fix CI formula, reorganize shell scripts and test files
- Fixed CI calculation: changed from NDVI (NIR-Red)/(NIR+Red) to correct NIR/Green-1 formula in:
  * process_single_tile() function
  * create_ci_band() utility function
  * Updated create_mask_and_crop() documentation

- Renamed numbered shell scripts for clarity (matching R script numbering):
  * 01_run_planet_download -> 10_planet_download.sh
  * 02_run_ci_extraction -> 20_ci_extraction.sh
  * 03_run_growth_model -> 30_growth_model.sh
  * 04_run_mosaic_creation -> 40_mosaic_creation.sh
  * 09_run_calculate_kpis -> 80_calculate_kpis.sh
  * 10_run_kpi_report -> 90_kpi_report.sh

- Archived obsolete shell scripts to old_sh/:
  * build_mosaic.sh, build_report.sh, interpolate_growth_model.sh
  * 05_run_dashboard_report.sh, 06_run_crop_messaging.sh
  * 11_run_yield_prediction.sh/ps1
  * runcane.sh, runpython.sh, smartcane.sh, update_RDS.sh

- Deleted test/debug files and temporary outputs:
  * analyze_*.R, benchmark_gpu_vs_cpu.py, convert_angata_harvest.py
  * debug_mosaic.R, examine_kpi_results.R, generate_sar_report.R
  * inspect_8band_structure.R, inspect_tif_bands.R
  * old_working_utils.R, predict_harvest_operational.R
  * run_kpi_calculation.R, run_report.R, simple_sar_test.R
  * data_validation_tool/, harvest_ci_pattern_analysis.png, kpi_debug.out

- Enhanced harvest prediction: Added threshold tuning (0.40-0.45) and field type handling

- Enhanced mosaic creation: Improved tile detection and routing logic
2026-01-14 16:58:51 +01:00
Timon d22dc2f96e commit all stuff 2026-01-06 14:17:37 +01:00
Timon d5fd4bb463 Add KPI reporting system and deployment documentation
Major Changes:
- NEW: Scripts 09 & 10 for KPI calculation and enhanced reporting
- NEW: Shell script wrappers (01-10) for easier execution
- NEW: R packages flextable and officer for enhanced Word reports
- NEW: DEPLOYMENT_README.md with complete deployment guide
- RENAMED: Numbered R scripts (02, 03, 04) for clarity
- REMOVED: Old package management scripts (using renv only)
- UPDATED: Workflow now uses scripts 09->10 instead of 05

Files Changed: 90+ files
New Packages: flextable, officer
New Scripts: 09_run_calculate_kpis.sh, 10_run_kpi_report.sh
Documentation: DEPLOYMENT_README.md, EMAIL_TO_ADMIN.txt

See DEPLOYMENT_README.md for full deployment instructions.
2025-10-14 11:49:30 +02:00
Martin Folkerts d258a2bf2e cleaned the folders, made some parameters 2025-09-05 15:23:41 +02:00
Martin Folkerts 0e7f5cf11d Merge branch 'code-improvements' 2025-06-25 10:47:11 +02:00
Timon ea6842af48 minor visualistion chagnes 2025-06-25 10:39:26 +02:00
Martin Folkerts cc6b9392d6 Merge branch 'code-improvements' 2025-06-25 09:35:19 +02:00
Timon b2fcd66d2b klaar voor testen, wat plaatjes e.d. aangepast 2025-06-24 21:02:54 +02:00
Martin Folkerts a316b30afc Merge branch 'code-improvements' 2025-06-24 09:58:56 +02:00
Timon 6efcc8cfec Fix CI report pipeline: update tmap v4 syntax, add continuous color scales, fix formatting
- Updated all CI maps to use tm_scale_continuous() for proper tmap v4 compatibility
- Added fixed color scale limits (1-8 for CI, -3 to +3 for differences) for consistent field comparison
- Fixed YAML header formatting issues in CI_report_dashboard_planet.Rmd
- Positioned RGB map before CI overview map as requested
- Removed all obsolete use_breaks parameter references
- Enhanced error handling and logging throughout the pipeline
- Added new experimental analysis scripts and improvements to mosaic creation
2025-06-19 20:37:20 +02:00
Timon 2bed5949fa Refactor CI plotting functions to use proper parameterization
- Refactored ci_plot and cum_ci_plot functions to accept explicit parameters
- Added default values for backward compatibility
- Updated CI_report_dashboard_planet.Rmd to pass explicit parameters
- Added input validation for better error handling
- Added parameter documentation in function headers
- Removed reliance on global variables for better maintainability
2025-04-22 21:41:18 +02:00
Timon 07aee7bed1 –[200~Improve CI report visualization and migrate to terra package
- Replace raster package with terra throughout the codebase
- Update map visualizations with better layout and legends
- Add descriptive headers to report sections
- Improve map legend positioning and sizing
- Enhance error handling for missing data
- Remove redundant legends in field-specific visualizations
- Optimize figure dimensions to prevent page overflow
- Expand documentation of CI index and report components
- Update package dependencies in packages.
2025-04-22 20:55:02 +02:00
Martin Folkerts dd1ee2b1a0 adjusted dates to iso dates 2025-01-07 14:24:38 +01:00
Martin Folkerts 9b29dc4d57 updated signature of cum ci plot 2024-12-03 09:32:04 +01:00
Timon c1a32bf6ad Refactor cum_ci_plot function for enhanced plotting options; added parameters for plot type and season filtering; improved x-axis labeling and updated ggplot aesthetics. Also, continued work on yield prediction in R. 2024-10-31 11:21:39 +01:00
Timon bd9b7d4ab0 adjusted all functions and cleaned scripts incl rmd file 2024-08-29 16:48:24 +02:00