From 38f34f30b9e3da05558b52c3c584f70f16bd101c Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Mon, 6 Oct 2025 05:01:53 +0200 Subject: [PATCH 01/69] feat: make all pickerInput in mod_board_simulation module alphabetical and searchable --- R/10_mod_board_simulation_server.R | 60 +++++++++++++++++++----------- R/10_mod_board_simulation_ui.R | 4 +- 2 files changed, 41 insertions(+), 23 deletions(-) diff --git a/R/10_mod_board_simulation_server.R b/R/10_mod_board_simulation_server.R index 01e985b..82710aa 100644 --- a/R/10_mod_board_simulation_server.R +++ b/R/10_mod_board_simulation_server.R @@ -11,9 +11,11 @@ board_simulation_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "json_file_name", - choices = list.files( - path = file.path(session$userData$user_folder, "study_objects"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "study_objects"), + full.names = FALSE + ) ), selected = list.files( path = file.path(session$userData$user_folder, "study_objects"), @@ -23,9 +25,11 @@ board_simulation_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "scenario_name", - choices = list.files( - path = file.path(session$userData$user_folder, "scenarios"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "scenarios"), + full.names = FALSE + ) ), selected = character(0) ) @@ -53,9 +57,11 @@ board_simulation_server <- function( shinyWidgets::updatePickerInput( session, "json_file_name", - choices = list.files( - path = file.path(session$userData$user_folder, "study_objects"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "study_objects"), + full.names = FALSE + ) ), selected = input$json_file_name ) @@ -64,9 +70,11 @@ board_simulation_server <- function( shinyWidgets::updatePickerInput( session, "scenario_name", - choices = list.files( - path = file.path(session$userData$user_folder, "scenarios"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "scenarios"), + full.names = FALSE + ) ), selected = character(0) ) @@ -78,9 +86,11 @@ board_simulation_server <- function( cat(file = stderr(), "10 - Update json_file_name choices\n") shinyWidgets::updatePickerInput( inputId = "json_file_name", - choices = list.files( - path = file.path(session$userData$user_folder, "study_objects"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "study_objects"), + full.names = FALSE + ) ), selected = list.files( path = file.path(session$userData$user_folder, "study_objects"), @@ -237,7 +247,7 @@ board_simulation_server <- function( land_required = land_required, nitrogen_balance = nitrogen_balance ) - + # Add dry matter intake checks ----------------------------------------- # Convert to daily intake dmi_per_day <- energy_required$annual_results$dmi_tot / 365 @@ -329,8 +339,10 @@ board_simulation_server <- function( # update choices for scenario_name and scenario_results_comp input shinyWidgets::updatePickerInput( inputId = "scenario_name", - choices = list.files( - file.path(session$userData$user_folder, "scenarios"), full.names = FALSE + choices = sort( + list.files( + file.path(session$userData$user_folder, "scenarios"), full.names = FALSE + ) ), selected = sub("\\.json$", "", input$json_file_name[1]) ) @@ -441,15 +453,19 @@ board_simulation_server <- function( shinyWidgets::updatePickerInput( session = session, "scenario_name", - choices = list.files( - file.path(session$userData$user_folder, "scenarios"), full.names = FALSE + choices = sort( + list.files( + file.path(session$userData$user_folder, "scenarios"), full.names = FALSE + ) ), selected = character(0) ) shinyWidgets::updatePickerInput( inputId = "scenario_results_comp", - choices = list.files( - file.path(session$userData$user_folder, "scenarios"), full.names = FALSE + choices = sort( + list.files( + file.path(session$userData$user_folder, "scenarios"), full.names = FALSE + ) ), selected = list.files( file.path(session$userData$user_folder, "scenarios"), full.names = FALSE diff --git a/R/10_mod_board_simulation_ui.R b/R/10_mod_board_simulation_ui.R index bcb7d96..1b0c31c 100644 --- a/R/10_mod_board_simulation_ui.R +++ b/R/10_mod_board_simulation_ui.R @@ -41,6 +41,7 @@ board_simulation_ui <- function(id) { choices = NULL, multiple = TRUE, options = list( + `live-search` = TRUE, `selected-text-format` = "count", `count-selected-text` = "{0}/{1} Scenarios" ) @@ -98,7 +99,8 @@ board_simulation_ui <- function(id) { inputId = ns("scenario_name"), label = NULL, choices = NULL, - multiple = FALSE + multiple = FALSE, + options = list(`live-search` = TRUE) ) ) ), From c6e14e75c78ab4e13ea420e43b54371734400e2b Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Mon, 6 Oct 2025 05:02:22 +0200 Subject: [PATCH 02/69] feat: make all pickerInput in mod_board_comparaison module alphabetical and searchable --- R/20_mod_board_comparison_server.R | 62 ++++++++++++++++++------------ R/20_mod_board_comparison_ui.R | 13 +++++-- 2 files changed, 47 insertions(+), 28 deletions(-) diff --git a/R/20_mod_board_comparison_server.R b/R/20_mod_board_comparison_server.R index f66e501..2bf46e2 100644 --- a/R/20_mod_board_comparison_server.R +++ b/R/20_mod_board_comparison_server.R @@ -10,8 +10,10 @@ board_comparison_server <- function( cat(file = stderr(), "20 - Update scenarios lists on new scenario Runs\n") shinyWidgets::updatePickerInput( inputId = "scenario_results_comp", - choices = list.files( - file.path(session$userData$user_folder, "scenarios"), full.names = FALSE + choices = sort( + list.files( + file.path(session$userData$user_folder, "scenarios"), full.names = FALSE + ) ), selected = list.files( file.path(session$userData$user_folder, "scenarios"), full.names = FALSE @@ -26,10 +28,12 @@ board_comparison_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "scenario_results_comp", - choices = list.files( - file.path( - session$userData$user_folder, "scenarios" - ), full.names = FALSE + choices = sort( + list.files( + file.path( + session$userData$user_folder, "scenarios" + ), full.names = FALSE + ) ), selected = head( list.files( @@ -44,10 +48,12 @@ board_comparison_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "comp_name", - choices = list.files( - file.path( - session$userData$user_folder, "comparisons" - ), full.names = FALSE + choices = sort( + list.files( + file.path( + session$userData$user_folder, "comparisons" + ), full.names = FALSE + ) ), selected = character(0) ) @@ -59,9 +65,11 @@ board_comparison_server <- function( shinyWidgets::updatePickerInput( session, "scenario_results_comp", - choices = list.files( - path = file.path(session$userData$user_folder, "scenarios"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "scenarios"), + full.names = FALSE + ) ), selected = input$scenario_results_comp ) @@ -73,9 +81,11 @@ board_comparison_server <- function( shinyWidgets::updatePickerInput( session, "comp_name", - choices = list.files( - path = file.path(session$userData$user_folder, "comparisons"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "comparisons"), + full.names = FALSE + ) ), selected = character(0) ) @@ -181,10 +191,12 @@ board_comparison_server <- function( # update choices for comp_name input shinyWidgets::updatePickerInput( inputId = "comp_name", - choices = list.files( - file.path( - session$userData$user_folder, "comparisons" - ), full.names = FALSE + choices = sort( + list.files( + file.path( + session$userData$user_folder, "comparisons" + ), full.names = FALSE + ) ), selected = paste(input$scenario_results_comp, collapse = " - ") ) @@ -268,16 +280,18 @@ board_comparison_server <- function( source_file_path <- file.path( session$userData$user_folder, "comparisons", input$comp_name ) - + # Delete the selected comparison folder unlink(source_file_path, recursive = TRUE) # Update the selectInput choices after deletion shinyWidgets::updatePickerInput( session, "comp_name", - choices = list.files(file.path( - session$userData$user_folder, "comparisons" - ), full.names = FALSE), + choices = sort( + list.files(file.path( + session$userData$user_folder, "comparisons" + ), full.names = FALSE) + ), selected = character(0) ) showNotification( diff --git a/R/20_mod_board_comparison_ui.R b/R/20_mod_board_comparison_ui.R index 4b1bb1a..b863080 100644 --- a/R/20_mod_board_comparison_ui.R +++ b/R/20_mod_board_comparison_ui.R @@ -43,7 +43,8 @@ board_comparison_ui <- function(id) { label = NULL, choices = NULL, selected = NULL, - multiple = TRUE + multiple = TRUE, + options = list(`live-search` = TRUE) ) ), column( @@ -81,7 +82,8 @@ board_comparison_ui <- function(id) { inputId = ns("comp_name"), label = NULL, choices = NULL, - multiple = FALSE + multiple = FALSE, + options = list(`live-search` = TRUE) ) ) ), @@ -120,9 +122,12 @@ board_comparison_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("comp_category"), label = NULL, - choices = unique(graphs_desc$category)[-1], # remove scenario graphs + choices = sort( + unique(graphs_desc$category)[-1] + ), # remove scenario graphs selected = unique(graphs_desc$category)[1], - multiple = FALSE + multiple = FALSE, + options = list(`live-search` = TRUE) ) ) ) From 7c1f256adb5c24511e57279f5172bf2bfa51a5f8 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Mon, 6 Oct 2025 05:03:12 +0200 Subject: [PATCH 03/69] feat: make all pickerInput in mod_scenario module alphabetical and searchable --- R/30_mod_scenario_server.R | 340 ++++++++++++++++++++++--------------- R/30_mod_scenario_ui.R | 36 ++-- 2 files changed, 231 insertions(+), 145 deletions(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index 756aad3..56dcceb 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -19,9 +19,11 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session, "json_file_name", - choices = list.files( - path = file.path(session$userData$user_folder, "study_objects"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "study_objects"), + full.names = FALSE + ) ), selected = character(0) ) @@ -30,9 +32,11 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "json_shared_folder", - choices = list.files( - path = file.path("data", "shared_folder", "study_objects"), - full.names = FALSE + choices = sort( + list.files( + path = file.path("data", "shared_folder", "study_objects"), + full.names = FALSE + ) ), selected = character(0) ) @@ -41,9 +45,11 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session, "database_code", - choices = list.files( - path = file.path(session$userData$user_folder, "parameters_database"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "parameters_database"), + full.names = FALSE + ) ), selected = character(0) ) @@ -85,7 +91,7 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session, "database_code", - choices = session$userData$databases(), + choices = sort(session$userData$databases()), selected = input$database_code ) }) @@ -117,9 +123,11 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session, "json_file_name", - choices = list.files( - path = file.path(session$userData$user_folder, "study_objects"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "study_objects"), + full.names = FALSE + ) ), selected = input$json_file_name ) @@ -131,9 +139,11 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session, "database_code", - choices = list.files( - path = file.path(session$userData$user_folder, "parameters_database"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "parameters_database"), + full.names = FALSE + ) ), selected = input$database_code ) @@ -206,9 +216,11 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "json_file_name", - choices = list.files( - path = file.path(session$userData$user_folder, "study_objects"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "study_objects"), + full.names = FALSE + ) ) ) @@ -297,7 +309,9 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "json_file_name", - choices = list.files(destination_dir, full.names = FALSE), + choices = sort( + list.files(destination_dir, full.names = FALSE) + ), selected = basename(new_file_path) ) @@ -335,9 +349,11 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "json_file_name", - choices = list.files( - path = file.path(session$userData$user_folder, "study_objects"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "study_objects"), + full.names = FALSE + ) ), selected = paste0(input$json_new_name, ".json") ) @@ -381,7 +397,9 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "json_file_name", - choices = list.files(destination_dir, full.names = FALSE), + choices = sort( + list.files(destination_dir, full.names = FALSE) + ), selected = basename(clone_file_path) ) @@ -469,7 +487,9 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "json_file_name", - choices = list.files(destination_dir, full.names = FALSE), + choices = sort( + list.files(destination_dir, full.names = FALSE) + ), selected = basename(clone_file_path) ) @@ -513,94 +533,96 @@ scenario_server <- function( ) } }) - # Observe Cloning the shared JSON from the pool - observeEvent(input$confirm_clone_shared_pool, { + # Observe Cloning the shared JSON from the pool + observeEvent(input$confirm_clone_shared_pool, { + + # Check if the user confirmed the cloning + if (isTRUE(input$confirm_clone_shared_pool)) { - # Check if the user confirmed the cloning - if (isTRUE(input$confirm_clone_shared_pool)) { - - # Path for the original file in the shared pool - source_file_path <- file.path( - Sys.getenv("DATA_DIR"), "shared_pool", "study_objects", input$pool_file_search + # Path for the original file in the shared pool + source_file_path <- file.path( + Sys.getenv("DATA_DIR"), "shared_pool", "study_objects", input$pool_file_search + ) + + # Set the base name for the cloned JSON file + base_clone_file_name <- tools::file_path_sans_ext(input$pool_file_search) + + # Define the destination directory for the cloned JSON file + destination_dir <- file.path(session$userData$user_folder, "study_objects") + + # Use versioned_copy to create a versioned clone of the JSON file + clone_file_path <- versioned_copy( + source_path = source_file_path, + destination_dir = destination_dir, + base_name = base_clone_file_name, + extension = "json", + versioning = TRUE + ) + + # Read the json file and get the related database's name + json_data <- fromJSON(source_file_path) + db_name <- json_data$database_code + + # If the database is not the default database and is available on + # the shared_pool folder, clone the database as well + if (db_name != "Params DB - Default" && + db_name %in% list.files( + file.path(Sys.getenv("DATA_DIR"), "shared_pool", "parameters_database") + )) { + # Define the source and destination paths for the database directory + db_path <- file.path( + Sys.getenv("DATA_DIR"), "shared_pool", "parameters_database", db_name ) + destination_dir <- file.path(session$userData$user_folder, "parameters_database") - # Set the base name for the cloned JSON file - base_clone_file_name <- tools::file_path_sans_ext(input$pool_file_search) - - # Define the destination directory for the cloned JSON file - destination_dir <- file.path(session$userData$user_folder, "study_objects") - - # Use versioned_copy to create a versioned clone of the JSON file - clone_file_path <- versioned_copy( - source_path = source_file_path, + # Use versioned_copy to clone the database directory with versioning + versioned_copy( + source_path = db_path, destination_dir = destination_dir, - base_name = base_clone_file_name, - extension = "json", + base_name = db_name, versioning = TRUE ) - # Read the json file and get the related database's name - json_data <- fromJSON(source_file_path) - db_name <- json_data$database_code - - # If the database is not the default database and is available on - # the shared_pool folder, clone the database as well - if (db_name != "Params DB - Default" && - db_name %in% list.files( - file.path(Sys.getenv("DATA_DIR"), "shared_pool", "parameters_database") - )) { - # Define the source and destination paths for the database directory - db_path <- file.path( - Sys.getenv("DATA_DIR"), "shared_pool", "parameters_database", db_name - ) - destination_dir <- file.path(session$userData$user_folder, "parameters_database") - - # Use versioned_copy to clone the database directory with versioning - versioned_copy( - source_path = db_path, - destination_dir = destination_dir, - base_name = db_name, - versioning = TRUE - ) - - #Update the database picker input with the cloned database - shinyWidgets::updatePickerInput( - session = session, - inputId = "database_code", - choices = list.files(destination_dir, full.names = FALSE), - selected = db_name - ) - } - - # Reset the Text Input - updateTextInput(session, "pool_file_search", value = "") - - # Update the radio button value to 'user' - updateRadioButtons(session, inputId = "scenario_folder", selected = "user") - - # Update the Json PickerInput to the cloned file + #Update the database picker input with the cloned database shinyWidgets::updatePickerInput( session = session, - inputId = "json_file_name", - choices = list.files( - file.path(session$userData$user_folder, "study_objects"), full.names = FALSE + inputId = "database_code", + choices = sort( + list.files(destination_dir, full.names = FALSE) ), - selected = basename(clone_file_path) - ) - - # Show a success notification - showNotification( - "The JSON and the related Parameters Database have been cloned successfully!", - duration = 3, - type = "message" + selected = db_name ) } - }) + + # Reset the Text Input + updateTextInput(session, "pool_file_search", value = "") + + # Update the radio button value to 'user' + updateRadioButtons(session, inputId = "scenario_folder", selected = "user") + + # Update the Json PickerInput to the cloned file + shinyWidgets::updatePickerInput( + session = session, + inputId = "json_file_name", + choices = list.files( + file.path(session$userData$user_folder, "study_objects"), full.names = FALSE + ), + selected = basename(clone_file_path) + ) + + # Show a success notification + showNotification( + "The JSON and the related Parameters Database have been cloned successfully!", + duration = 3, + type = "message" + ) + } + }) # ----------- Seasons Tab ---------------------------------------------------- # Reactive value to store the seasons data seasons <- reactiveVal(seasons_initialization) - + # Add season button click observeEvent(input$add_season, { req(input$json_file_name) @@ -617,7 +639,7 @@ scenario_server <- function( ) )) }) - + # OK button in modal dialog for adding season observeEvent(input$ok_add_season, { req(input$season_name) @@ -631,7 +653,7 @@ scenario_server <- function( updateTextInput(session, "season_name", value = "") removeModal() }) - + # Render the table output$season_table <- renderDT({ @@ -732,7 +754,8 @@ scenario_server <- function( choices = setNames( lkp_orgfertilizer()$fertilizer_code, lkp_orgfertilizer()$fertilizer_desc - ) + )[sort(lkp_orgfertilizer()$fertilizer_desc)], + options = list(`live-search` = TRUE) ), easyClose = TRUE, footer = tagList( @@ -834,7 +857,7 @@ scenario_server <- function( ) ) }, server = FALSE) - + # Delete fertilizer button click observeEvent(input$delete_fertilizer, { req(nrow(fertilizers()) > 0) # Ensure there are rows to process @@ -921,7 +944,11 @@ scenario_server <- function( shinyWidgets::pickerInput( ns("livestock"), label = NULL, - choices = setNames(lkp_livetype()$livetype_code, lkp_livetype()$livetype_desc) + choices = setNames( + lkp_livetype()$livetype_code, + lkp_livetype()$livetype_desc + )[sort(lkp_livetype()$livetype_desc)], + options = list(`live-search` = TRUE) ), easyClose = TRUE, footer = tagList( @@ -1143,7 +1170,10 @@ scenario_server <- function( shinyWidgets::pickerInput( inputId = ns("manure_management"), label = NULL, - choices = unique(lkp_manureman()$manureman_desc) + choices = sort( + unique(lkp_manureman()$manureman_desc) + ), + options = list(`live-search` = TRUE) ), footer = tagList( actionButton(ns("ok_update_manure_management"), "OK"), @@ -1196,14 +1226,19 @@ scenario_server <- function( shinyWidgets::pickerInput( inputId = ns("feed"), label = NULL, - choices = setNames(lkp_feeditem()$feed_item_code, lkp_feeditem()$feed_item_name) + choices = setNames( + lkp_feeditem()$feed_item_code, + lkp_feeditem()$feed_item_name + )[sort(lkp_feeditem()$feed_item_name)], + options = list(`live-search` = TRUE) ), br(), h2("Selected a Crop", class = "mb-3"), shinyWidgets::pickerInput( inputId = ns("crop"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ), easyClose = TRUE, footer = tagList( @@ -1217,15 +1252,15 @@ scenario_server <- function( observeEvent(input$feed, { feed_type_code <- lkp_feeditem()$feed_type_code[lkp_feeditem()$feed_item_code == input$feed] choices <- setNames( - lkp_feedtype()$feed_type_code[lkp_feedtype()$feed_type_code == feed_type_code], - lkp_feedtype()$feed_type_name[lkp_feedtype()$feed_type_code == feed_type_code] - ) + lkp_feedtype()$feed_type_code[lkp_feedtype()$feed_type_code == feed_type_code], + lkp_feedtype()$feed_type_name[lkp_feedtype()$feed_type_code == feed_type_code] + ) # remove NA values choices <- choices[!is.na(choices)] shinyWidgets::updatePickerInput( session, "crop", - choices = choices + choices = choices[sort(names(choices))] ) }) @@ -1356,7 +1391,7 @@ scenario_server <- function( feedtype_dt$intercrop <- generate_shiny_inputs( FUN = checkboxInput, len = nrow(feedtype_dt), - id = ("intercrop_check"), + id = ("intercrop_check"), value = checked_boxes$intercrop_checked ) @@ -1618,7 +1653,10 @@ scenario_server <- function( shinyWidgets::pickerInput( inputId = ns("source_type"), label = NULL, - choices = c("Main", "Residue", "Purchased") + choices = sort( + c("Main", "Residue", "Purchased") + ), + options = list(`live-search` = TRUE) ), footer = tagList( actionButton(ns("ok_update_source_type"), "OK"), @@ -1637,9 +1675,10 @@ scenario_server <- function( inputId = ns("land_cover"), label = NULL, choices = setNames( - lkp_landcover()$landcover_code, - lkp_landcover()$landcover_desc - ) + lkp_landcover()$landcover_code, + lkp_landcover()$landcover_desc + )[sort(lkp_landcover()$landcover_desc)], + options = list(`live-search` = TRUE) ), footer = tagList( actionButton(ns("ok_update_land_cover"), "OK"), @@ -1657,7 +1696,11 @@ scenario_server <- function( shinyWidgets::pickerInput( inputId = ns("slope_type"), label = NULL, - choices = setNames(lkp_slope()$slope_code, lkp_slope()$slope_desc) + choices = setNames( + lkp_slope()$slope_code, + lkp_slope()$slope_desc + )[sort(lkp_slope()$slope_desc)], + options = list(`live-search` = TRUE) ), footer = tagList( actionButton(ns("ok_update_slope_type"), "OK"), @@ -1677,7 +1720,11 @@ scenario_server <- function( shinyWidgets::pickerInput( inputId = ns("grassland_man"), label = NULL, - choices = setNames(lkp_grasslandman()$management_code, lkp_grasslandman()$management_desc) + choices = setNames( + lkp_grasslandman()$management_code, + lkp_grasslandman()$management_desc + )[sort(lkp_grasslandman()$management_desc)], + options = list(`live-search` = TRUE) ), footer = tagList( actionButton(ns("ok_update_grassland_man"), "OK"), @@ -1699,7 +1746,8 @@ scenario_server <- function( shinyWidgets::pickerInput( inputId = ns("water_regime"), label = NULL, - choices = water_regime_options + choices = sort(water_regime_options), + options = list(`live-search` = TRUE) ), footer = tagList( actionButton(ns("ok_update_water_regime"), "OK"), @@ -1721,7 +1769,8 @@ scenario_server <- function( shinyWidgets::pickerInput( inputId = ns("rice_ecosystem"), label = NULL, - choices = rice_ecosystem_options + choices = sort(rice_ecosystem_options), + options = list(`live-search` = TRUE) ), footer = tagList( actionButton(ns("ok_update_rice_ecosystem"), "OK"), @@ -1743,7 +1792,8 @@ scenario_server <- function( shinyWidgets::pickerInput( inputId = ns("rice_organic_amendment"), label = NULL, - choices = rice_organic_amendment_options + choices = sort(rice_organic_amendment_options), + options = list(`live-search` = TRUE) ), footer = tagList( actionButton(ns("ok_update_rice_organic_amendment"), "OK"), @@ -1763,7 +1813,10 @@ scenario_server <- function( shinyWidgets::pickerInput( inputId = ns("feed_category"), label = NULL, - choices = unique(lkp_feedtype()$category[lkp_feedtype()$category != ""]) + choices = sort( + unique(lkp_feedtype()$category[lkp_feedtype()$category != ""]) + ), + options = list(`live-search` = TRUE) ), footer = tagList( actionButton(ns("ok_update_category"), "OK"), @@ -2288,7 +2341,9 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session, "database_code", - choices = list.files(database_dir, full.names = FALSE), + choices = sort( + list.files(database_dir, full.names = FALSE) + ), selected = selected_database ) @@ -2425,7 +2480,7 @@ scenario_server <- function( basket_data <- list() } }) - + # Update The scenario's select inputs ---------------------------------------- observe({ req(lkp_region()) @@ -2435,58 +2490,77 @@ scenario_server <- function( # Reconstruct the region's input shinyWidgets::updatePickerInput( session, "region", - choices = setNames(lkp_region()$region_code, lkp_region()$region_desc), + choices = setNames( + lkp_region()$region_code, + lkp_region()$region_desc + )[sort(lkp_region()$region_desc)], selected = session$userData$study_object()$region ) #Reconstruct the select inputs shinyWidgets::updatePickerInput( session, "climate_zone", - choices = lkp_climate()$climate_desc, + choices = sort( + lkp_climate()$climate_desc + ), selected = session$userData$study_object()$climate_zone ) shinyWidgets::updatePickerInput( session, "climate_zone_2", - choices = lkp_climate2() %>% - filter(climate_code == "Temperate") %>% - pull(climate2_desc), + choices = sort( + lkp_climate2() %>% + filter(climate_code == "Temperate") %>% + pull(climate2_desc) + ), selected = session$userData$study_object()$climate_zone_2 ) shinyWidgets::updatePickerInput( session, "soil_description", - choices = lkp_soil()$soil_desc, + choices = sort( + lkp_soil()$soil_desc + ), selected = session$userData$study_object()$soil_description ) shinyWidgets::updatePickerInput( session, "cropland_system", - choices = lkp_croplandsystem()$sys_desc, + choices = sort( + lkp_croplandsystem()$sys_desc + ), selected = session$userData$study_object()$cropland_system ) shinyWidgets::updatePickerInput( session, "cropland_tillage", - choices = lkp_tillageregime()$tillage_desc, + choices = sort( + lkp_tillageregime()$tillage_desc + ), selected = session$userData$study_object()$cropland_tillage ) shinyWidgets::updatePickerInput( session, "cropland_orgmatter", - choices = lkp_organicmatter()$orgmatter_desc, + choices = sort( + lkp_organicmatter()$orgmatter_desc + ), selected = session$userData$study_object()$cropland_orgmatter ) shinyWidgets::updatePickerInput( session, "grassland_management", - choices = lkp_grasslandman()$management_desc, + choices = sort( + lkp_grasslandman()$management_desc + ), selected = session$userData$study_object()$grassland_management ) shinyWidgets::updatePickerInput( session, "grassland_implevel", - choices = lkp_grassinputlevel()$grassinputlevel_desc, + choices = sort( + lkp_grassinputlevel()$grassinputlevel_desc + ), selected = session$userData$study_object()$grassland_implevel ) }) diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index 5261b38..a2a3fc5 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -92,7 +92,8 @@ scenario_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("json_file_name"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ) ) ), @@ -158,7 +159,8 @@ scenario_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("json_shared_folder"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ) ) ) @@ -240,7 +242,8 @@ scenario_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("database_code"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ) ) ), @@ -284,7 +287,8 @@ scenario_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("region"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ) ), h2("Climate:", class = "mb-3"), @@ -293,7 +297,8 @@ scenario_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("climate_zone"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ), ), h2("Sub-climate:", class = "mb-3"), @@ -302,7 +307,8 @@ scenario_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("climate_zone_2"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ), ), h2("Farm name:", class = "mb-3"), @@ -604,7 +610,8 @@ scenario_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("soil_description"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ) ), h2("Estimated K Value", class = "mb-3"), @@ -682,7 +689,8 @@ scenario_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("cropland_system"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ) ) ), @@ -710,7 +718,8 @@ scenario_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("cropland_tillage"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ) ) ), @@ -738,7 +747,8 @@ scenario_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("cropland_orgmatter"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ) ) ), @@ -767,7 +777,8 @@ scenario_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("grassland_management"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ) ) ), @@ -795,7 +806,8 @@ scenario_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("grassland_implevel"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ) ) ), From 3c2fabe29dca8b06ce0f83550ff248eb6e806d52 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Mon, 6 Oct 2025 05:03:38 +0200 Subject: [PATCH 04/69] feat: make all pickerInput in mod_params_db module alphabetical and searchable --- R/40_mod_params_db_server.R | 62 ++++++++++++++++++++++++------------- R/40_mod_params_db_ui.R | 6 ++-- 2 files changed, 45 insertions(+), 23 deletions(-) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index d87e12a..96d68cd 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -12,8 +12,10 @@ params_db_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "database_name", - choices = list.files( - file.path(session$userData$user_folder, "parameters_database"), full.names = FALSE + choices = sort( + list.files( + file.path(session$userData$user_folder, "parameters_database"), full.names = FALSE + ) ), selected = character(0) ) @@ -22,9 +24,11 @@ params_db_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "database_shared_folder", - choices = list.files( - # use file.path function better "data" .. - file.path("data", "shared_folder", "parameters_database"), full.names = FALSE + choices = sort( + list.files( + # use file.path function better "data" .. + file.path("data", "shared_folder", "parameters_database"), full.names = FALSE + ) ), selected = character(0) ) @@ -50,9 +54,11 @@ params_db_server <- function( shinyWidgets::updatePickerInput( session, "database_name", - choices = list.files( - path = file.path(session$userData$user_folder, "parameters_database"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "parameters_database"), + full.names = FALSE + ) ), selected = input$database_name ) @@ -152,8 +158,10 @@ params_db_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "database_name", - choices = list.files( - file.path(session$userData$user_folder, "parameters_database"), full.names = FALSE + choices = sort( + list.files( + file.path(session$userData$user_folder, "parameters_database"), full.names = FALSE + ) ) ) @@ -200,8 +208,10 @@ params_db_server <- function( shinyWidgets::updatePickerInput( session = session, inputId = "database_name", - choices = list.files( - file.path(session$userData$user_folder, "parameters_database"), full.names = FALSE + choices = sort( + list.files( + file.path(session$userData$user_folder, "parameters_database"), full.names = FALSE + ) ), selected = basename(clone_file_path) ) @@ -238,9 +248,11 @@ params_db_server <- function( shinyWidgets::updatePickerInput( session, "database_name", - choices = list.files( - path = file.path(session$userData$user_folder, "parameters_database"), - full.names = FALSE + choices = sort( + list.files( + path = file.path(session$userData$user_folder, "parameters_database"), + full.names = FALSE + ) ), selected = input$database_new_name ) @@ -291,7 +303,9 @@ params_db_server <- function( shinyWidgets::updatePickerInput( session, "database_name", - choices = list.files(destination_dir, full.names = FALSE), + choices = sort( + list.files(destination_dir, full.names = FALSE) + ), selected = basename(clone_file_path) ) @@ -395,7 +409,9 @@ params_db_server <- function( shinyWidgets::updatePickerInput( session, "database_name", - choices = list.files(destination_dir, full.names = FALSE), + choices = sort( + list.files(destination_dir, full.names = FALSE) + ), selected = basename(clone_file_path) ) @@ -477,7 +493,9 @@ params_db_server <- function( shinyWidgets::updatePickerInput( session, "database_name", - choices = list.files(destination_dir, full.names = FALSE), + choices = sort( + list.files(destination_dir, full.names = FALSE) + ), selected = basename(clone_file_path) ) @@ -520,9 +538,11 @@ params_db_server <- function( shinyWidgets::updatePickerInput( session, "database_name", - choices = list.files( - file.path(session$userData$user_folder, "parameters_database"), - full.names = FALSE + choices = sort( + list.files( + file.path(session$userData$user_folder, "parameters_database"), + full.names = FALSE + ) ), selected = session$userData$database_code() ) diff --git a/R/40_mod_params_db_ui.R b/R/40_mod_params_db_ui.R index 76dadaf..2429575 100644 --- a/R/40_mod_params_db_ui.R +++ b/R/40_mod_params_db_ui.R @@ -89,7 +89,8 @@ params_db_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("database_name"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ) ) ), @@ -155,7 +156,8 @@ params_db_ui <- function(id) { shinyWidgets::pickerInput( inputId = ns("database_shared_folder"), label = NULL, - choices = NULL + choices = NULL, + options = list(`live-search` = TRUE) ) ) ) From 27b3624cb1e2e416a141e999af79f792ee434306 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 8 Oct 2025 13:58:30 +0200 Subject: [PATCH 05/69] feat: add data validation warnings for livestock time --- R/30_mod_scenario_server.R | 156 ++++++++++++++++++++++++++++++++++--- R/30_mod_scenario_ui.R | 12 +++ 2 files changed, 157 insertions(+), 11 deletions(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index 56dcceb..a8f44da 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1155,6 +1155,140 @@ scenario_server <- function( # Freeze and restore scroll position for livestock table freeze_and_unfreeze_scroll(session, ns("livestock_table")) }) + + # ------ LIVESTOCK TIME VALIDATION ------------------------------------------- + observeEvent(livestock_data(), { + req(livestock_data()) + + livestock_df <- livestock_data() + req(nrow(livestock_df) > 0) + + # ------ Identify relevant columns ----------------------------------------- + time_columns <- c( + "time_in_stable", + "time_in_non_roofed_enclosure", + "time_in_onfarm_grazing", + "time_in_offfarm_grazing" + ) + + valid_time_columns <- time_columns[time_columns %in% names(livestock_df)] + if (length(valid_time_columns) == 0) return() + + time_data <- livestock_df |> + select(all_of(valid_time_columns)) + + # ------ Get display labels ------------------------------------------------ + display_labels <- livestock_table_colnames[ + match(valid_time_columns, names(livestock_data_initialization)) + ] + + # ------ Initialize message containers ------------------------------------- + msg_invalid_value <- data.frame( + livestock = character(), + message = character(), + stringsAsFactors = FALSE + ) + + msg_invalid_sum <- data.frame( + livestock = character(), + message = character(), + stringsAsFactors = FALSE + ) + + # ------ Check for invalid individual values ------------------------------- + for (i in seq_along(valid_time_columns)) { + column_name <- valid_time_columns[i] + column_label <- display_labels[i] + + invalid_indices <- which( + time_data[[column_name]] < 0 | + time_data[[column_name]] > 1 + ) + + if (length(invalid_indices) > 0) { + for (r in invalid_indices) { + livestock_name <- livestock_df$livetype_desc[r] + value <- time_data[[column_name]][r] + + warning_text <- paste0( + " • For ", livestock_name, ", ", + "the value in ", column_label, " is ", + value, ". Please enter a value between 0 and 1." + ) + + msg_invalid_value <- rbind( + msg_invalid_value, + data.frame( + livestock = livestock_name, + message = warning_text, + stringsAsFactors = FALSE + ) + ) + } + } + } + + # ------ Check for invalid totals per livestock ---------------------------- + row_sums <- rowSums(time_data, na.rm = TRUE) + invalid_sum_indices <- which(row_sums != 1) + + if (length(invalid_sum_indices) > 0) { + for (r in invalid_sum_indices) { + livestock_name <- livestock_df$livetype_desc[r] + total_value <- round(row_sums[r], 2) + + warning_text <- paste0( + " • For ", livestock_name, ", ", + "the total of time fraction columns is ", total_value, + ". Please adjust these values so the total equals exactly 1." + ) + + msg_invalid_sum <- rbind( + msg_invalid_sum, + data.frame( + livestock = livestock_name, + message = warning_text, + stringsAsFactors = FALSE + ) + ) + } + } + + # ------ Sort messages alphabetically -------------------------------------- + if (nrow(msg_invalid_value) > 0) { + msg_invalid_value <- msg_invalid_value[ + order(msg_invalid_value$livestock), + ] + } + + if (nrow(msg_invalid_sum) > 0) { + msg_invalid_sum <- msg_invalid_sum[ + order(msg_invalid_sum$livestock), + ] + } + + # ------ Display warnings for invalid values ------------------------------- + if (nrow(msg_invalid_value) > 0) { + shinyjs::html( + id = "alert_message_livestock_inputs_invalid_values", + html = paste(msg_invalid_value$message, collapse = "
") + ) + shinyjs::show(id = "alert_message_livestock_inputs_invalid_values") + } else { + shinyjs::hide(id = "alert_message_livestock_inputs_invalid_values") + } + + # ------ Display warnings for invalid totals ------------------------------- + if (nrow(msg_invalid_sum) > 0) { + shinyjs::html( + id = "alert_message_livestock_inputs_invalid_sum", + html = paste(msg_invalid_sum$message, collapse = "
") + ) + shinyjs::show(id = "alert_message_livestock_inputs_invalid_sum") + } else { + shinyjs::hide(id = "alert_message_livestock_inputs_invalid_sum") + } + }) # Show modal dialog to update manure management observeEvent(input$livestock_table_cell_clicked, { @@ -1252,9 +1386,9 @@ scenario_server <- function( observeEvent(input$feed, { feed_type_code <- lkp_feeditem()$feed_type_code[lkp_feeditem()$feed_item_code == input$feed] choices <- setNames( - lkp_feedtype()$feed_type_code[lkp_feedtype()$feed_type_code == feed_type_code], - lkp_feedtype()$feed_type_name[lkp_feedtype()$feed_type_code == feed_type_code] - ) + lkp_feedtype()$feed_type_code[lkp_feedtype()$feed_type_code == feed_type_code], + lkp_feedtype()$feed_type_name[lkp_feedtype()$feed_type_code == feed_type_code] + ) # remove NA values choices <- choices[!is.na(choices)] shinyWidgets::updatePickerInput( @@ -1675,8 +1809,8 @@ scenario_server <- function( inputId = ns("land_cover"), label = NULL, choices = setNames( - lkp_landcover()$landcover_code, - lkp_landcover()$landcover_desc + lkp_landcover()$landcover_code, + lkp_landcover()$landcover_desc )[sort(lkp_landcover()$landcover_desc)], options = list(`live-search` = TRUE) ), @@ -1697,8 +1831,8 @@ scenario_server <- function( inputId = ns("slope_type"), label = NULL, choices = setNames( - lkp_slope()$slope_code, - lkp_slope()$slope_desc + lkp_slope()$slope_code, + lkp_slope()$slope_desc )[sort(lkp_slope()$slope_desc)], options = list(`live-search` = TRUE) ), @@ -1721,8 +1855,8 @@ scenario_server <- function( inputId = ns("grassland_man"), label = NULL, choices = setNames( - lkp_grasslandman()$management_code, - lkp_grasslandman()$management_desc + lkp_grasslandman()$management_code, + lkp_grasslandman()$management_desc )[sort(lkp_grasslandman()$management_desc)], options = list(`live-search` = TRUE) ), @@ -2491,8 +2625,8 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session, "region", choices = setNames( - lkp_region()$region_code, - lkp_region()$region_desc + lkp_region()$region_code, + lkp_region()$region_desc )[sort(lkp_region()$region_desc)], selected = session$userData$study_object()$region ) diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index a2a3fc5..cdbdf79 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -938,6 +938,18 @@ scenario_ui <- function(id) { ) ) ), + shinyjs::hidden( + div( + id = ns("alert_message_livestock_inputs_invalid_values"), + class = "alert alert-danger", + style = "display:none;" + ), + div( + id = ns("alert_message_livestock_inputs_invalid_sum"), + class = "alert alert-danger", + style = "display:none;" + ) + ), div(DTOutput(ns("livestock_table")), class = "with_checkbox") ) ), From 18d1276a52b2d611c2894c7166024091b0308743 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 8 Oct 2025 22:25:24 +0200 Subject: [PATCH 06/69] feat: Add validation warnings for crop areas and residue management table - Add validation warnings for crop areas and residue management table - Update livestock warnings IDs names for consistency --- R/30_mod_scenario_server.R | 186 ++++++++++++++++++++++++++++++++----- R/30_mod_scenario_ui.R | 18 +++- 2 files changed, 180 insertions(+), 24 deletions(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index a8f44da..f17e6db 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1155,7 +1155,7 @@ scenario_server <- function( # Freeze and restore scroll position for livestock table freeze_and_unfreeze_scroll(session, ns("livestock_table")) }) - + # ------ LIVESTOCK TIME VALIDATION ------------------------------------------- observeEvent(livestock_data(), { req(livestock_data()) @@ -1212,7 +1212,7 @@ scenario_server <- function( warning_text <- paste0( " • For ", livestock_name, ", ", - "the value in ", column_label, " is ", + "the value in '", column_label, "' is ", value, ". Please enter a value between 0 and 1." ) @@ -1270,23 +1270,23 @@ scenario_server <- function( # ------ Display warnings for invalid values ------------------------------- if (nrow(msg_invalid_value) > 0) { shinyjs::html( - id = "alert_message_livestock_inputs_invalid_values", + id = "alert_message_livestock_invalid_values_inputs", html = paste(msg_invalid_value$message, collapse = "
") ) - shinyjs::show(id = "alert_message_livestock_inputs_invalid_values") + shinyjs::show(id = "alert_message_livestock_invalid_values_inputs") } else { - shinyjs::hide(id = "alert_message_livestock_inputs_invalid_values") + shinyjs::hide(id = "alert_message_livestock_invalid_values_inputs") } # ------ Display warnings for invalid totals ------------------------------- if (nrow(msg_invalid_sum) > 0) { shinyjs::html( - id = "alert_message_livestock_inputs_invalid_sum", + id = "alert_message_livestock_invalid_sum_inputs", html = paste(msg_invalid_sum$message, collapse = "
") ) - shinyjs::show(id = "alert_message_livestock_inputs_invalid_sum") + shinyjs::show(id = "alert_message_livestock_invalid_sum_inputs") } else { - shinyjs::hide(id = "alert_message_livestock_inputs_invalid_sum") + shinyjs::hide(id = "alert_message_livestock_invalid_sum_inputs") } }) @@ -1520,7 +1520,6 @@ scenario_server <- function( # Update feedtype with the modified feedtype_dt feedtype(feedtype_dt) - # Checkboxes for enabling/disabling intercrop feedtype_dt$intercrop <- generate_shiny_inputs( FUN = checkboxInput, @@ -1670,21 +1669,164 @@ scenario_server <- function( ) }, server = FALSE) - # Update the crop table data when check box is checked - observeEvent( - input$checkbox_info, { - info <- input$checkbox_info - checked_boxes$intercrop_checked[info$row] <- info$value - feedtype_dt <- feedtype() - feedtype_dt$intercrop <- as.numeric(checked_boxes$intercrop_checked) # we need integer for json - # Reset the disabled cell to the value 0 - feedtype_dt$intercrop_fraction[feedtype_dt$intercrop == 0] <- 0 - feedtype(feedtype_dt) + # ------ CROP INTERCROPPING FRACTION AUTO-UPDATE ----------------------------- + observeEvent(input$checkbox_info, { + info <- input$checkbox_info + req(length(info) > 0) + # Update stored checkbox states + checked_boxes$intercrop_checked[info$row] <- info$value + # Retrieve the current crop table data + feedtype_dt <- feedtype() + # Ensure required columns exist + required_columns <- c("intercrop", "intercrop_fraction") + if (!all(required_columns %in% names(feedtype_dt))) return() + # Update intercropping flag (numeric for JSON export) + feedtype_dt$intercrop <- as.numeric(checked_boxes$intercrop_checked) + # Apply logic for automatic fraction updates when checked + if (isTRUE(info$value)) { + if (is.na(feedtype_dt$intercrop_fraction[info$row]) || + feedtype_dt$intercrop_fraction[info$row] == 0) { + feedtype_dt$intercrop_fraction[info$row] <- 0.01 + } + } else { + feedtype_dt$intercrop_fraction[info$row] <- 0 + } + # Push updated table back into reactive + feedtype(feedtype_dt) + # Keep scroll position stable after re-render + freeze_and_unfreeze_scroll(session, ns("crop_table")) + }) + + # ------ INTERCROPPING & RESIDUE FRACTIONS VALIDATION ------------------------ + observeEvent(feedtype(), { + req(feedtype()) + feedtype_dt <- feedtype() + req(nrow(feedtype_dt) > 0) + + # ---- Validate Intercropping (yes/no) ------------------------------------- + required_cols_intercrop <- c("feed_item_name", "intercrop", "intercrop_fraction") + if (all(required_cols_intercrop %in% names(feedtype_dt))) { - # Freeze and restore scroll position for crop table - freeze_and_unfreeze_scroll(session, ns("crop_table")) + msg_invalid_intercrop <- data.frame( + feed = character(), + message = character(), + stringsAsFactors = FALSE + ) + for (i in seq_len(nrow(feedtype_dt))) { + if (!is.na(feedtype_dt$intercrop[i]) && feedtype_dt$intercrop[i] == 1) { + value <- feedtype_dt$intercrop_fraction[i] + # Auto-assign 0.01 when checked and NA + if (is.na(value)) { + feedtype_dt$intercrop_fraction[i] <- 0.01 + value <- 0.01 + } + # Check invalid range (>0 and <1 required) + if (value <= 0 || value >= 1) { + feed_name <- feedtype_dt$feed_item_name[i] + msg_text <- paste0( + " For ", feed_name, ", ", + "'IF intercropping, fraction of field occupied by this crop' ", + "column value should be > 0 and < 1!" + ) + msg_invalid_intercrop <- rbind( + msg_invalid_intercrop, + data.frame(feed = feed_name, message = msg_text, stringsAsFactors = FALSE) + ) + } + } else { + # If unchecked, force fraction = 0 + feedtype_dt$intercrop_fraction[i] <- 0 + } + } + # Sort alphabetically + if (nrow(msg_invalid_intercrop) > 0) { + msg_invalid_intercrop <- msg_invalid_intercrop[order(msg_invalid_intercrop$feed), ] + } + # Show or hide alert + if (nrow(msg_invalid_intercrop) > 0) { + shinyjs::html( + id = "alert_message_Intercropping_fraction_inputs", + html = paste(msg_invalid_intercrop$message, collapse = "
") + ) + shinyjs::show(id = "alert_message_Intercropping_fraction_inputs") + } else { + shinyjs::hide(id = "alert_message_Intercropping_fraction_inputs") + } } - ) + + # ---- Validate Residue Fraction Columns ---------------------------------- + residue_cols <- c( + "cut_carry_fraction", + "main_product_removal", + "residue_removal", + "residue_burnt" + ) + residue_cols <- residue_cols[residue_cols %in% names(feedtype_dt)] + if (length(residue_cols) > 0) { + # Dynamically match displayed label from feedtype_colnames + col_labels <- vapply( + residue_cols, + function(col) { + match_idx <- which(names(feedtype_initialization) == col) + if (length(match_idx) == 1) { + label_idx <- match_idx - 1 # Adjust for the first blank column + if (label_idx <= length(feedtype_colnames)) { + feedtype_colnames[label_idx] + } else { + col + } + } else { + col + } + }, + character(1) + ) + + msg_invalid_residue <- data.frame( + feed = character(), + message = character(), + stringsAsFactors = FALSE + ) + # Validate each residue column + for (j in seq_along(residue_cols)) { + col <- residue_cols[j] + col_label <- col_labels[j] + + invalid_rows <- which( + !is.na(feedtype_dt[[col]]) & + (feedtype_dt[[col]] < 0 | feedtype_dt[[col]] > 1) + ) + + for (i in invalid_rows) { + feed_name <- feedtype_dt$feed_item_name[i] + msg_text <- paste0( + " For ", feed_name, ", ", + "'", col_label, "' column value should be ≥ 0 and ≤ 1!" + ) + msg_invalid_residue <- rbind( + msg_invalid_residue, + data.frame(feed = feed_name, message = msg_text, stringsAsFactors = FALSE) + ) + } + } + # Sort alphabetically + if (nrow(msg_invalid_residue) > 0) { + msg_invalid_residue <- msg_invalid_residue[order(msg_invalid_residue$feed), ] + } + # Display or hide alert + if (nrow(msg_invalid_residue) > 0) { + shinyjs::html( + id = "alert_message_residue_fractions_inputs", + html = paste(msg_invalid_residue$message, collapse = "
") + ) + shinyjs::show(id = "alert_message_residue_fractions_inputs") + } else { + shinyjs::hide(id = "alert_message_residue_fractions_inputs") + } + } + # Update feedtype data + feedtype(feedtype_dt) + }) # Render the crop inputs table output$crop_inputs_table <- renderDT({ diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index cdbdf79..03c06b4 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -940,12 +940,12 @@ scenario_ui <- function(id) { ), shinyjs::hidden( div( - id = ns("alert_message_livestock_inputs_invalid_values"), + id = ns("alert_message_livestock_invalid_values_inputs"), class = "alert alert-danger", style = "display:none;" ), div( - id = ns("alert_message_livestock_inputs_invalid_sum"), + id = ns("alert_message_livestock_invalid_sum_inputs"), class = "alert alert-danger", style = "display:none;" ) @@ -1047,6 +1047,20 @@ scenario_ui <- function(id) { ) ), h2("Crop areas and residue management", class = "mb-3"), + shinyjs::hidden( + div( + id = ns("alert_message_Intercropping_fraction_inputs"), + class = "alert alert-danger", + style = "display:none;" + ) + ), + shinyjs::hidden( + div( + id = ns("alert_message_residue_fractions_inputs"), + class = "alert alert-danger", + style = "display:none;" + ) + ), div(DTOutput(ns("crop_table")), class = "with_checkbox"), h2("Crop inputs", class = "mb-3 mt-5"), shinyjs::hidden( From 3a4c049a5fd683ce9b7bff60812d2bae1045ee0e Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Thu, 9 Oct 2025 22:22:44 +0200 Subject: [PATCH 07/69] feat: Add clone feature --- R/40_mod_params_db_server.R | 60 ++++++++++++++++++++++++++++++++++--- R/40_mod_params_db_ui.R | 24 ++++++++++++--- 2 files changed, 76 insertions(+), 8 deletions(-) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index 96d68cd..fab45ac 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -593,6 +593,8 @@ params_db_server <- function( # reset the buttons shinyjs::enable(id = paste0("add_rows_", name)) shinyjs::enable(id = paste0("delete_rows_", name)) + shinyjs::enable(id = paste0("clone_rows_", name)) + # Check if the database is the default one if (input$database_name == "Params DB - Default") { editablity <- FALSE @@ -605,16 +607,16 @@ params_db_server <- function( ) ) - # Disable add and delete rows buttons + # Disable all modification buttons shinyjs::disable(id = paste0("add_rows_", name)) shinyjs::disable(id = paste0("delete_rows_", name)) - } else ( + shinyjs::disable(id = paste0("clone_rows_", name)) + } else { editablity <- list( target = "cell", - # Prevent editing of the first column (check boxes for delete rows) disable = list(columns = 0) ) - ) + } datatable( data = data_table, @@ -709,4 +711,54 @@ params_db_server <- function( }) }) + # ------ * Observe Clone Row button ------------------------------------------ + lapply(parameters_db_names, function(name) { + observeEvent(input[[paste0("clone_rows_", name)]], { + req(input$database_name) + + df <- session$userData$parameters_db[[name]] + n <- nrow(df) + # Identify selected row + selected_rows <- which( + sapply(seq_len(n), function(i) + isTRUE(input[[paste0("selected_row_", name, "_", i)]]) + ) + ) + # Duplicate the selected row + req(length(selected_rows) == 1) + row_index <- selected_rows + cloned_row <- df[row_index, , drop = FALSE] + # Add "_clone" suffix to ID column + id_col <- names(df)[1] + if (!is.na(cloned_row[[id_col]]) && cloned_row[[id_col]] != "") { + cloned_row[[id_col]] <- paste0(cloned_row[[id_col]], "_clone") + } else { + cloned_row[[id_col]] <- "new_clone" + } + # Insert cloned row immediately after the original + if (row_index < n) { + df <- rbind( + df[1:row_index, ], + cloned_row, + df[(row_index + 1):n, ] + ) + } else { + df <- rbind(df, cloned_row) + } + # Save updated data + session$userData$parameters_db[[name]] <- df + data.table::fwrite( + df, + file.path( + session$userData$user_folder, + "parameters_database", + input$database_name, + paste0(name, ".csv") + ) + ) + # Freeze and restore scroll position after adding rows + freeze_and_unfreeze_scroll(session, ns(paste0("table_", name))) + }) + }) + })} diff --git a/R/40_mod_params_db_ui.R b/R/40_mod_params_db_ui.R index 2429575..2e9669e 100644 --- a/R/40_mod_params_db_ui.R +++ b/R/40_mod_params_db_ui.R @@ -275,6 +275,19 @@ params_db_ui <- function(id) { icon = icon("plus") ) ), + column( + width = 3, + div( + br(), + class = "d-flex align-items-center px-1", + actionButton( + inputId = ns(paste0("clone_rows_", tab_name)), + label = "Clone Row", + class = "btn btn-primary filters-btn", + icon = icon("copy") + ) + ) + ), column( width = 3, div( @@ -289,14 +302,17 @@ params_db_ui <- function(id) { ) ) ), - div(DTOutput(ns(paste0("table_", tab_name))), class = "with_checkbox"), + div( + DTOutput(ns(paste0("table_", tab_name))), + class = "with_checkbox" + ), tags$div( "The data is immediately saved to the corresponding CSV - file, no confirmation is required!", + file, no confirmation is required!", class = "mb-5 mt-5 text-center", style = "font-size: 20px; line-height: 20px; - font-weight: 500; text-align: left; color: #005275; - font-family: 'serif , Merriweather';" + font-weight: 500; text-align: left; color: #005275; + font-family: 'serif , Merriweather';" ) ) ) From b5eb015d9d219bbf890129ce047999bb72a3ab85 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Fri, 10 Oct 2025 15:31:39 +0200 Subject: [PATCH 08/69] feat: Improve parameter database tables usability --- R/40_mod_params_db_server.R | 233 ++++++++++++++++++++++++++---------- R/40_mod_params_db_ui.R | 32 ++++- 2 files changed, 196 insertions(+), 69 deletions(-) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index fab45ac..4f62524 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -5,6 +5,13 @@ params_db_server <- function( ns <- session$ns jns <- function(x) paste0("#", ns(x)) + # ------ Pagination setup per table ------------------------------------------- + rv <- reactiveValues() + rows_per_page <- 10 + for (nm in parameters_db_names) { + rv[[paste0(nm, "_page")]] <- 1 + } + # ------ * Initialize the parameters database inputs ------------------------- observe({ cat(file = stderr(), "40 - Initializing the parameters database inputs...\n") @@ -618,8 +625,15 @@ params_db_server <- function( ) } + page_var <- paste0(name, "_page") + current_page <- rv[[page_var]] + + start_row <- (current_page - 1) * rows_per_page + 1 + end_row <- min(start_row + rows_per_page - 1, nrow(data_table)) + paged_data <- data_table[start_row:end_row, , drop = FALSE] + datatable( - data = data_table, + data = paged_data, editable = editablity, rownames = FALSE, escape = FALSE, @@ -632,6 +646,7 @@ params_db_server <- function( processing = FALSE, paging = FALSE, searching = FALSE, + info = FALSE, columnDefs = column_defs, drawCallback = JS(checkbox_link_multi(id = "selected_row", ns = ns, table_name = name)), fixedColumns = list(leftColumns = 1) @@ -640,6 +655,34 @@ params_db_server <- function( }, server = FALSE) }) + + # ------ Pagination observers per table --------------------------------------- + lapply(parameters_db_names, function(name) { + + observeEvent(input[[paste0("next_page_", name)]], { + total_rows <- nrow(session$userData$parameters_db[[name]]) + total_pages <- ceiling(total_rows / rows_per_page) + if (rv[[paste0(name, "_page")]] < total_pages) { + rv[[paste0(name, "_page")]] <- rv[[paste0(name, "_page")]] + 1 + } + }) + + observeEvent(input[[paste0("prev_page_", name)]], { + if (rv[[paste0(name, "_page")]] > 1) { + rv[[paste0(name, "_page")]] <- rv[[paste0(name, "_page")]] - 1 + } + }) + + output[[paste0("entries_info_", name)]] <- renderText({ + total_rows <- nrow(session$userData$parameters_db[[name]]) + if (total_rows == 0) return("No entries") + start_row <- (rv[[paste0(name, "_page")]] - 1) * rows_per_page + 1 + end_row <- min(start_row + rows_per_page - 1, total_rows) + paste0("Showing ", start_row, " - ", end_row, " of ", total_rows, " total entries") + }) + + }) + # ------ * Observe edits on rendered DT ------------------------------------- lapply(parameters_db_names, function(name) { observeEvent(input[[paste0("table_", name, "_cell_edit")]], { @@ -666,48 +709,93 @@ params_db_server <- function( }) }) - # ------ * Observe delete and add empty rows buttons ------------------------ lapply(parameters_db_names, function(name) { observeEvent(input[[paste0("delete_rows_", name)]], { req(input$database_name) - rows_to_delete <- which( - sapply( - seq_len(nrow(session$userData$parameters_db[[name]])), - function(i) input[[paste0("selected_row_", name, "_", i)]] - ) - ) - # Proceed only if there are rows selected to delete - if (length(rows_to_delete) > 0) { - session$userData$parameters_db[[name]] <- session$userData$parameters_db[[name]][-rows_to_delete] - # Write updated table back to CSV - fwrite( - session$userData$parameters_db[[name]], - file.path(session$userData$user_folder, "parameters_database", - input$database_name, paste0(name, ".csv")) - ) - } - # Freeze and restore scroll position after deletion - freeze_and_unfreeze_scroll(session, ns(paste0("table_", name))) + isolate({ + df <- session$userData$parameters_db[[name]] + n <- nrow(df) + if (n == 0) return(NULL) + + # ---- Determine current page ------------------------------------- + current_page <- rv[[paste0(name, "_page")]] + start_row <- (current_page - 1) * rows_per_page + 1 + end_row <- min(start_row + rows_per_page - 1, n) + + # ---- Identify selected checkboxes on visible page --------------- + visible_selected <- which( + vapply( + seq_len(end_row - start_row + 1), + function(i) { + val <- input[[paste0("selected_row_", name, "_", i)]] + if (is.null(val)) FALSE else isTRUE(val) + }, + logical(1) + ) + ) + + # ---- Map to global row indices ---------------------------------- + rows_to_delete <- start_row + visible_selected - 1 + + # ---- Delete selected rows -------------------------------------- + if (length(rows_to_delete) > 0) { + df <- df[-rows_to_delete, , drop = FALSE] + session$userData$parameters_db[[name]] <- df + + # ---- Adjust current page if now too high ---------------------- + total_pages <- max(1, ceiling(nrow(df) / rows_per_page)) + if (rv[[paste0(name, "_page")]] > total_pages) { + rv[[paste0(name, "_page")]] <- total_pages + } + + # ---- Save updated table -------------------------------------- + data.table::fwrite( + df, + file.path( + session$userData$user_folder, + "parameters_database", + input$database_name, + paste0(name, ".csv") + ) + ) + + # ---- Keep scroll position ------------------------------------- + freeze_and_unfreeze_scroll(session, ns(paste0("table_", name))) + } + }) }) }) + lapply(parameters_db_names, function(name) { observeEvent(input[[paste0("add_rows_", name)]], { req(input$database_name) + + # ---- Add a new empty row --------------------------------------- session$userData$parameters_db[[name]] <- rbind( session$userData$parameters_db[[name]], as.list(rep(NA, ncol(session$userData$parameters_db[[name]]))) ) + + # ---- Save updated table ---------------------------------------- fwrite( session$userData$parameters_db[[name]], - file.path(session$userData$user_folder, "parameters_database", - input$database_name, paste0(name, ".csv")) + file.path( + session$userData$user_folder, + "parameters_database", + input$database_name, + paste0(name, ".csv") + ) ) - # Freeze and restore scroll position after adding rows - freeze_and_unfreeze_scroll(session, ns(paste0("table_", name))) + # ---- Jump to last page ----------------------------------------- + total_rows <- nrow(session$userData$parameters_db[[name]]) + total_pages <- ceiling(total_rows / rows_per_page) + rv[[paste0(name, "_page")]] <- total_pages + # ---- Keep scroll position (refresh DT) ------------------------- + freeze_and_unfreeze_scroll(session, ns(paste0("table_", name))) }) }) @@ -716,48 +804,65 @@ params_db_server <- function( observeEvent(input[[paste0("clone_rows_", name)]], { req(input$database_name) - df <- session$userData$parameters_db[[name]] - n <- nrow(df) - # Identify selected row - selected_rows <- which( - sapply(seq_len(n), function(i) - isTRUE(input[[paste0("selected_row_", name, "_", i)]]) - ) - ) - # Duplicate the selected row - req(length(selected_rows) == 1) - row_index <- selected_rows - cloned_row <- df[row_index, , drop = FALSE] - # Add "_clone" suffix to ID column - id_col <- names(df)[1] - if (!is.na(cloned_row[[id_col]]) && cloned_row[[id_col]] != "") { - cloned_row[[id_col]] <- paste0(cloned_row[[id_col]], "_clone") - } else { - cloned_row[[id_col]] <- "new_clone" - } - # Insert cloned row immediately after the original - if (row_index < n) { - df <- rbind( - df[1:row_index, ], - cloned_row, - df[(row_index + 1):n, ] + isolate({ + # ---- 1. Retrieve data and setup ---------------------------------- + df <- session$userData$parameters_db[[name]] + n <- nrow(df) + if (n == 0) return(NULL) + + # ---- Determine current page ------------------------------------- + current_page <- rv[[paste0(name, "_page")]] + start_row <- (current_page - 1) * rows_per_page + 1 + end_row <- min(start_row + rows_per_page - 1, n) + + # ---- Identify selected checkbox on visible page ----------------- + visible_selected <- which( + vapply( + seq_len(end_row - start_row + 1), + function(i) isTRUE(input[[paste0("selected_row_", name, "_", i)]]), + logical(1) + ) ) - } else { - df <- rbind(df, cloned_row) - } - # Save updated data - session$userData$parameters_db[[name]] <- df - data.table::fwrite( - df, - file.path( - session$userData$user_folder, - "parameters_database", - input$database_name, - paste0(name, ".csv") + req(length(visible_selected) == 1) + row_index <- start_row + visible_selected - 1 # global index + + # ---- 2. Clone the selected row ----------------------------------- + cloned_row <- df[row_index, , drop = FALSE] + + # Update ID column + id_col <- names(df)[1] + if (!is.na(cloned_row[[id_col]]) && cloned_row[[id_col]] != "") { + cloned_row[[id_col]] <- paste0(cloned_row[[id_col]], "_clone") + } else { + cloned_row[[id_col]] <- "new_clone" + } + + # Insert cloned row right after original + if (row_index < n) { + df <- rbind( + df[1:row_index, ], + cloned_row, + df[(row_index + 1):n, ] + ) + } else { + df <- rbind(df, cloned_row) + } + + # ---- 3. Update memory + disk ------------------------------------- + session$userData$parameters_db[[name]] <- df + data.table::fwrite( + df, + file.path( + session$userData$user_folder, + "parameters_database", + input$database_name, + paste0(name, ".csv") + ) ) - ) - # Freeze and restore scroll position after adding rows - freeze_and_unfreeze_scroll(session, ns(paste0("table_", name))) + + # ---- 5. Maintain scroll continuity ------------------------------- + freeze_and_unfreeze_scroll(session, ns(paste0("table_", name))) + }) }) }) diff --git a/R/40_mod_params_db_ui.R b/R/40_mod_params_db_ui.R index 2e9669e..8914585 100644 --- a/R/40_mod_params_db_ui.R +++ b/R/40_mod_params_db_ui.R @@ -302,17 +302,39 @@ params_db_ui <- function(id) { ) ) ), + div(DTOutput(ns(paste0("table_", tab_name))), class = "with_checkbox"), + # --- Unified table footer (entries info + pagination) ------------------------ div( - DTOutput(ns(paste0("table_", tab_name))), - class = "with_checkbox" + class = "table-footer d-flex justify-content-between align-items-center mt-2 px-3 py-2", + # Left: "Showing 1 to 10 of 10 entries" + span( + textOutput(ns(paste0("entries_info_", tab_name))), + class = "text-muted small" + ), + + # Right: pagination buttons + page info + div( + class = "d-flex align-items-center", + actionButton( + inputId = ns(paste0("prev_page_", tab_name)), + label = "◀ Previous", + class = "btn btn-outline-primary btn-sm me-2" + ), + actionButton( + inputId = ns(paste0("next_page_", tab_name)), + label = "Next ▶", + class = "btn btn-outline-primary btn-sm" + ) + ) ), + # --- Pagination controls (below table, right-aligned) --- tags$div( "The data is immediately saved to the corresponding CSV - file, no confirmation is required!", + file, no confirmation is required!", class = "mb-5 mt-5 text-center", style = "font-size: 20px; line-height: 20px; - font-weight: 500; text-align: left; color: #005275; - font-family: 'serif , Merriweather';" + font-weight: 500; text-align: left; color: #005275; + font-family: 'serif , Merriweather';" ) ) ) From 907cf074540e3fa28042bb6e460510268189dcbd Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Fri, 10 Oct 2025 17:10:15 +0200 Subject: [PATCH 09/69] feat: improve table navigation flow and overall user experience --- R/40_mod_params_db_server.R | 355 +++++++++++++++++++++++------------- R/40_mod_params_db_ui.R | 24 +-- www/sass/app.scss | 66 +++++++ 3 files changed, 303 insertions(+), 142 deletions(-) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index 4f62524..c0794ab 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -627,11 +627,12 @@ params_db_server <- function( page_var <- paste0(name, "_page") current_page <- rv[[page_var]] - + # Determine visible rows based on current page start_row <- (current_page - 1) * rows_per_page + 1 end_row <- min(start_row + rows_per_page - 1, nrow(data_table)) paged_data <- data_table[start_row:end_row, , drop = FALSE] + # Render paged datatable datatable( data = paged_data, editable = editablity, @@ -639,8 +640,7 @@ params_db_server <- function( escape = FALSE, extensions = "FixedColumns", selection = "none", - # Set the first column (selected) name to an empty string - colnames = c("", colnames(data_table)[-1]), + colnames = c("", colnames(data_table)[-1]), # Hide first column name options = list( scrollX = TRUE, processing = FALSE, @@ -648,17 +648,23 @@ params_db_server <- function( searching = FALSE, info = FALSE, columnDefs = column_defs, - drawCallback = JS(checkbox_link_multi(id = "selected_row", ns = ns, table_name = name)), + drawCallback = JS( + checkbox_link_multi( + id = "selected_row", + ns = ns, + table_name = name + ) + ), fixedColumns = list(leftColumns = 1) ) ) + }, server = FALSE) }) - - # ------ Pagination observers per table --------------------------------------- + # ------ PAGINATION OBSERVERS PER TABLE -------------------------------------- lapply(parameters_db_names, function(name) { - + # Go to next page if available observeEvent(input[[paste0("next_page_", name)]], { total_rows <- nrow(session$userData$parameters_db[[name]]) total_pages <- ceiling(total_rows / rows_per_page) @@ -667,20 +673,123 @@ params_db_server <- function( } }) + # Go to previous page if not on first observeEvent(input[[paste0("prev_page_", name)]], { if (rv[[paste0(name, "_page")]] > 1) { rv[[paste0(name, "_page")]] <- rv[[paste0(name, "_page")]] - 1 } }) + # Display current entries range info output[[paste0("entries_info_", name)]] <- renderText({ total_rows <- nrow(session$userData$parameters_db[[name]]) if (total_rows == 0) return("No entries") + start_row <- (rv[[paste0(name, "_page")]] - 1) * rows_per_page + 1 end_row <- min(start_row + rows_per_page - 1, total_rows) - paste0("Showing ", start_row, " - ", end_row, " of ", total_rows, " total entries") + + paste0( + "Showing ", start_row, " - ", end_row, + " of ", total_rows, " total entries" + ) + }) + }) + + + # ------ Compact pagination UI with ellipsis and error guard ----------------- + lapply(parameters_db_names, function(name) { + + output[[paste0("page_buttons_", name)]] <- renderUI({ + # Skip rendering if table not yet initialized + if (is.null(session$userData$parameters_db[[name]])) return(NULL) + + total_rows <- nrow(session$userData$parameters_db[[name]]) + if (is.na(total_rows) || total_rows == 0) return(NULL) + + total_pages <- ceiling(total_rows / rows_per_page) + current_page <- rv[[paste0(name, "_page")]] + if (total_pages <= 1) return(NULL) + + # Determine visible pages (first 2, last 2, ±2 around current) + visible_pages <- unique(sort(c( + 1, 2, + seq(current_page - 2, current_page + 2), + total_pages - 1, total_pages + ))) + visible_pages <- visible_pages[ + visible_pages >= 1 & visible_pages <= total_pages + ] + + # Insert ellipsis for skipped page ranges + page_labels <- c() + for (i in seq_along(visible_pages)) { + page_labels <- c(page_labels, as.character(visible_pages[i])) + if (i < length(visible_pages) && + (visible_pages[i + 1] - visible_pages[i]) > 1) { + page_labels <- c(page_labels, "…") + } + } + + # Build pagination buttons + tagList( + actionButton( + inputId = ns(paste0("prev_page_", name)), + label = "◀ ", + class = "btn btn-outline-primary btn-sm me-1" + ), + lapply(page_labels, function(label) { + if (label == "…") { + span("...", class = "mx-1 text-muted") + } else { + p <- as.numeric(label) + style_class <- if (p == current_page) + "btn btn-primary btn-sm fw-bold" + else + "btn btn-outline-primary btn-sm" + + actionButton( + inputId = ns(paste0("go_page_", name, "_", p)), + label = label, + class = style_class, + style = "min-width: 35px;" + ) + } + }), + actionButton( + inputId = ns(paste0("next_page_", name)), + label = " ▶", + class = "btn btn-outline-primary btn-sm ms-1" + ) + ) }) + # --- Observe dynamic go-to-page buttons safely ---------------------------- + observe({ + # Defensive checks for uninitialized tables + if (is.null(session$userData$parameters_db[[name]])) return() + + total_rows <- nrow(session$userData$parameters_db[[name]]) + if (is.na(total_rows) || total_rows <= 0) return() + + total_pages <- max(1, ceiling(total_rows / rows_per_page)) + if (!is.finite(total_pages) || total_pages < 1) { + total_pages <- 1 + } + + lapply( + seq_len(total_pages), + function(p) { + input_id <- paste0("go_page_", name, "_", p) + observeEvent( + input[[input_id]], + { + rv[[paste0(name, "_page")]] <- p + }, + ignoreInit = TRUE + ) + } + ) + }) }) # ------ * Observe edits on rendered DT ------------------------------------- @@ -709,76 +818,74 @@ params_db_server <- function( }) }) + # ------ DELETE ROW BUTTON --------------------------------------------------- lapply(parameters_db_names, function(name) { observeEvent(input[[paste0("delete_rows_", name)]], { req(input$database_name) - isolate({ - df <- session$userData$parameters_db[[name]] - n <- nrow(df) - if (n == 0) return(NULL) - - # ---- Determine current page ------------------------------------- - current_page <- rv[[paste0(name, "_page")]] - start_row <- (current_page - 1) * rows_per_page + 1 - end_row <- min(start_row + rows_per_page - 1, n) - - # ---- Identify selected checkboxes on visible page --------------- - visible_selected <- which( - vapply( - seq_len(end_row - start_row + 1), - function(i) { - val <- input[[paste0("selected_row_", name, "_", i)]] - if (is.null(val)) FALSE else isTRUE(val) - }, - logical(1) - ) + df <- session$userData$parameters_db[[name]] + n <- nrow(df) + if (n == 0) return(NULL) + # Determine current page + current_page <- rv[[paste0(name, "_page")]] + start_row <- (current_page - 1) * rows_per_page + 1 + end_row <- min(start_row + rows_per_page - 1, n) + # Identify selected checkboxes on visible page + visible_selected <- which( + vapply( + seq_len(end_row - start_row + 1), + function(i) { + val <- input[[paste0("selected_row_", name, "_", i)]] + if (is.null(val)) FALSE else isTRUE(val) + }, + logical(1) ) - - # ---- Map to global row indices ---------------------------------- - rows_to_delete <- start_row + visible_selected - 1 - - # ---- Delete selected rows -------------------------------------- - if (length(rows_to_delete) > 0) { - df <- df[-rows_to_delete, , drop = FALSE] - session$userData$parameters_db[[name]] <- df - - # ---- Adjust current page if now too high ---------------------- - total_pages <- max(1, ceiling(nrow(df) / rows_per_page)) - if (rv[[paste0(name, "_page")]] > total_pages) { - rv[[paste0(name, "_page")]] <- total_pages - } - - # ---- Save updated table -------------------------------------- - data.table::fwrite( - df, - file.path( - session$userData$user_folder, - "parameters_database", - input$database_name, - paste0(name, ".csv") - ) - ) - - # ---- Keep scroll position ------------------------------------- - freeze_and_unfreeze_scroll(session, ns(paste0("table_", name))) + ) + # Map to global row indices + rows_to_delete <- start_row + visible_selected - 1 + # Delete selected rows + if (length(rows_to_delete) > 0) { + df <- df[-rows_to_delete, , drop = FALSE] + session$userData$parameters_db[[name]] <- df + # Adjust current page if now too high + total_pages <- max(1, ceiling(nrow(df) / rows_per_page)) + if (rv[[paste0(name, "_page")]] > total_pages) { + rv[[paste0(name, "_page")]] <- total_pages } - }) + # Save updated table + data.table::fwrite( + df, + file.path( + session$userData$user_folder, + "parameters_database", + input$database_name, + paste0(name, ".csv") + ) + ) + # Keep scroll position + freeze_and_unfreeze_scroll( + session, + ns(paste0("table_", name)) + ) + } }) }) - + # ------ ADD ROW BUTTON ------------------------------------------------------ lapply(parameters_db_names, function(name) { observeEvent(input[[paste0("add_rows_", name)]], { req(input$database_name) - - # ---- Add a new empty row --------------------------------------- + # Add a new empty row session$userData$parameters_db[[name]] <- rbind( session$userData$parameters_db[[name]], - as.list(rep(NA, ncol(session$userData$parameters_db[[name]]))) + as.list( + rep( + NA, + ncol(session$userData$parameters_db[[name]]) + ) + ) ) - - # ---- Save updated table ---------------------------------------- + # Save updated table fwrite( session$userData$parameters_db[[name]], file.path( @@ -788,81 +895,79 @@ params_db_server <- function( paste0(name, ".csv") ) ) - - # ---- Jump to last page ----------------------------------------- + # Jump to last page total_rows <- nrow(session$userData$parameters_db[[name]]) total_pages <- ceiling(total_rows / rows_per_page) rv[[paste0(name, "_page")]] <- total_pages - # ---- Keep scroll position (refresh DT) ------------------------- - freeze_and_unfreeze_scroll(session, ns(paste0("table_", name))) + freeze_and_unfreeze_scroll( + session, + ns(paste0("table_", name)) + ) }) }) - # ------ * Observe Clone Row button ------------------------------------------ + # ------ CLONE ROW BUTTON ---------------------------------------------------- lapply(parameters_db_names, function(name) { observeEvent(input[[paste0("clone_rows_", name)]], { req(input$database_name) - isolate({ - # ---- 1. Retrieve data and setup ---------------------------------- - df <- session$userData$parameters_db[[name]] - n <- nrow(df) - if (n == 0) return(NULL) - - # ---- Determine current page ------------------------------------- - current_page <- rv[[paste0(name, "_page")]] - start_row <- (current_page - 1) * rows_per_page + 1 - end_row <- min(start_row + rows_per_page - 1, n) - - # ---- Identify selected checkbox on visible page ----------------- - visible_selected <- which( - vapply( - seq_len(end_row - start_row + 1), - function(i) isTRUE(input[[paste0("selected_row_", name, "_", i)]]), - logical(1) - ) + # Retrieve data and setup + df <- session$userData$parameters_db[[name]] + n <- nrow(df) + # Determine current page + current_page <- rv[[paste0(name, "_page")]] + start_row <- (current_page - 1) * rows_per_page + 1 + end_row <- min(start_row + rows_per_page - 1, n) + # Identify selected checkbox on visible page + visible_selected <- which( + vapply( + seq_len(end_row - start_row + 1), + function(i) { + isTRUE( + input[[paste0("selected_row_", name, "_", i)]] + ) + }, + logical(1) ) - req(length(visible_selected) == 1) - row_index <- start_row + visible_selected - 1 # global index - - # ---- 2. Clone the selected row ----------------------------------- - cloned_row <- df[row_index, , drop = FALSE] - - # Update ID column - id_col <- names(df)[1] - if (!is.na(cloned_row[[id_col]]) && cloned_row[[id_col]] != "") { - cloned_row[[id_col]] <- paste0(cloned_row[[id_col]], "_clone") - } else { - cloned_row[[id_col]] <- "new_clone" - } - - # Insert cloned row right after original - if (row_index < n) { - df <- rbind( - df[1:row_index, ], - cloned_row, - df[(row_index + 1):n, ] - ) - } else { - df <- rbind(df, cloned_row) - } - - # ---- 3. Update memory + disk ------------------------------------- - session$userData$parameters_db[[name]] <- df - data.table::fwrite( - df, - file.path( - session$userData$user_folder, - "parameters_database", - input$database_name, - paste0(name, ".csv") - ) + ) + req(length(visible_selected) == 1) + row_index <- start_row + visible_selected - 1 # global index + # Clone the selected row + cloned_row <- df[row_index, , drop = FALSE] + # Update ID column + id_col <- names(df)[1] + if (!is.na(cloned_row[[id_col]]) && cloned_row[[id_col]] != "") { + cloned_row[[id_col]] <- paste0(cloned_row[[id_col]], "_clone") + } else { + cloned_row[[id_col]] <- "new_clone" + } + # Insert cloned row right after original + if (row_index < n) { + df <- rbind( + df[1:row_index, ], + cloned_row, + df[(row_index + 1):n, ] ) - - # ---- 5. Maintain scroll continuity ------------------------------- - freeze_and_unfreeze_scroll(session, ns(paste0("table_", name))) - }) + } else { + df <- rbind(df, cloned_row) + } + # Update memory + disk + session$userData$parameters_db[[name]] <- df + data.table::fwrite( + df, + file.path( + session$userData$user_folder, + "parameters_database", + input$database_name, + paste0(name, ".csv") + ) + ) + + freeze_and_unfreeze_scroll( + session, + ns(paste0("table_", name)) + ) }) }) diff --git a/R/40_mod_params_db_ui.R b/R/40_mod_params_db_ui.R index 8914585..66f5964 100644 --- a/R/40_mod_params_db_ui.R +++ b/R/40_mod_params_db_ui.R @@ -303,28 +303,16 @@ params_db_ui <- function(id) { ) ), div(DTOutput(ns(paste0("table_", tab_name))), class = "with_checkbox"), - # --- Unified table footer (entries info + pagination) ------------------------ + # Unified table footer (entries info + pagination) div( - class = "table-footer d-flex justify-content-between align-items-center mt-2 px-3 py-2", - # Left: "Showing 1 to 10 of 10 entries" + class = "table-footer d-flex justify-content-between align-items-center mt-2 px-3 py-1", span( textOutput(ns(paste0("entries_info_", tab_name))), class = "text-muted small" ), - - # Right: pagination buttons + page info div( - class = "d-flex align-items-center", - actionButton( - inputId = ns(paste0("prev_page_", tab_name)), - label = "◀ Previous", - class = "btn btn-outline-primary btn-sm me-2" - ), - actionButton( - inputId = ns(paste0("next_page_", tab_name)), - label = "Next ▶", - class = "btn btn-outline-primary btn-sm" - ) + class = "pagination-bar-container ms-auto", + uiOutput(ns(paste0("page_buttons_", tab_name))) ) ), # --- Pagination controls (below table, right-aligned) --- @@ -336,8 +324,10 @@ params_db_ui <- function(id) { font-weight: 500; text-align: left; color: #005275; font-family: 'serif , Merriweather';" ) + ) ) + } ) ) @@ -346,4 +336,4 @@ params_db_ui <- function(id) { ) ) ) -} +} \ No newline at end of file diff --git a/www/sass/app.scss b/www/sass/app.scss index e9a7496..69c1705 100644 --- a/www/sass/app.scss +++ b/www/sass/app.scss @@ -1369,3 +1369,69 @@ table.dataTable tbody tr>.dtfc-fixed-left{ } } } + + +// ------ Compact Pagination Bar (centered + scaled) -------------------------- + +.pagination-bar-container { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 6px; // spacing between buttons + padding-right: 4px; + + // Base button style + .btn { + font-size: 13px !important; + width: 34px; + height: 32px; + padding: 0 !important; + line-height: 32px; + border-radius: 6px; + border: 1px solid #005275 !important; + color: #005275 !important; + background-color: transparent !important; + text-align: center; + vertical-align: middle; + display: inline-flex; + align-items: center; + justify-content: center; + transition: all 0.15s ease-in-out; + + // Arrow icons + i, + svg { + font-size: 15px !important; + line-height: 1; + vertical-align: middle; + } + + // Hover state for unselected buttons + &:hover { + background-color: #005275 !important; + color: #fff !important; + } + + // Active (selected) page + &.btn-primary, + &.fw-bold { + background-color: #e5e9ea !important; + color: #005275 !important; + border-color: #00527533 !important; + box-shadow: inset 0 0 0 1px #0052751a; + + &:hover { + background-color: #e5e9ea !important; + } + } + } + + // Ellipsis + .text-muted { + font-size: 13px; + opacity: 0.7; + margin: 0 4px; + line-height: 32px; + } +} + From 49ba364c2138b6cbd6396996aba873b6d74c1891 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Fri, 10 Oct 2025 22:00:13 +0200 Subject: [PATCH 10/69] chore: clean and document new features --- R/30_mod_scenario_server.R | 118 ++++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 53 deletions(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index f17e6db..baebbb6 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1156,14 +1156,13 @@ scenario_server <- function( freeze_and_unfreeze_scroll(session, ns("livestock_table")) }) - # ------ LIVESTOCK TIME VALIDATION ------------------------------------------- + # ------ LIVESTOCK TIME VALIDATION -------------------------------------------- observeEvent(livestock_data(), { req(livestock_data()) livestock_df <- livestock_data() req(nrow(livestock_df) > 0) - - # ------ Identify relevant columns ----------------------------------------- + # Identify relevant time columns time_columns <- c( "time_in_stable", "time_in_non_roofed_enclosure", @@ -1171,18 +1170,18 @@ scenario_server <- function( "time_in_offfarm_grazing" ) - valid_time_columns <- time_columns[time_columns %in% names(livestock_df)] + valid_time_columns <- time_columns[ + time_columns %in% names(livestock_df) + ] if (length(valid_time_columns) == 0) return() time_data <- livestock_df |> select(all_of(valid_time_columns)) - - # ------ Get display labels ------------------------------------------------ + # Get display labels for the valid columns display_labels <- livestock_table_colnames[ match(valid_time_columns, names(livestock_data_initialization)) ] - - # ------ Initialize message containers ------------------------------------- + # Initialize message containers msg_invalid_value <- data.frame( livestock = character(), message = character(), @@ -1194,8 +1193,7 @@ scenario_server <- function( message = character(), stringsAsFactors = FALSE ) - - # ------ Check for invalid individual values ------------------------------- + # Check for invalid individual values (<0 or >1) for (i in seq_along(valid_time_columns)) { column_name <- valid_time_columns[i] column_label <- display_labels[i] @@ -1211,9 +1209,9 @@ scenario_server <- function( value <- time_data[[column_name]][r] warning_text <- paste0( - " • For ", livestock_name, ", ", - "the value in '", column_label, "' is ", - value, ". Please enter a value between 0 and 1." + " For '", livestock_name, "', the value in", + "'", column_label, "' column is ", + value, ". value should be ≥ 0 and ≤ 1!" ) msg_invalid_value <- rbind( @@ -1227,8 +1225,7 @@ scenario_server <- function( } } } - - # ------ Check for invalid totals per livestock ---------------------------- + # Check for invalid totals (sum ≠ 1) row_sums <- rowSums(time_data, na.rm = TRUE) invalid_sum_indices <- which(row_sums != 1) @@ -1238,9 +1235,9 @@ scenario_server <- function( total_value <- round(row_sums[r], 2) warning_text <- paste0( - " • For ", livestock_name, ", ", - "the total of time fraction columns is ", total_value, - ". Please adjust these values so the total equals exactly 1." + "For '", livestock_name, "', ", + "the sum of values across the four time-fraction columns is ", + total_value, ". Please adjust these values so the total equals exactly 1." ) msg_invalid_sum <- rbind( @@ -1253,8 +1250,7 @@ scenario_server <- function( ) } } - - # ------ Sort messages alphabetically -------------------------------------- + # Sort messages alphabetically if (nrow(msg_invalid_value) > 0) { msg_invalid_value <- msg_invalid_value[ order(msg_invalid_value$livestock), @@ -1266,8 +1262,7 @@ scenario_server <- function( order(msg_invalid_sum$livestock), ] } - - # ------ Display warnings for invalid values ------------------------------- + # Display warnings for invalid values if (nrow(msg_invalid_value) > 0) { shinyjs::html( id = "alert_message_livestock_invalid_values_inputs", @@ -1277,8 +1272,7 @@ scenario_server <- function( } else { shinyjs::hide(id = "alert_message_livestock_invalid_values_inputs") } - - # ------ Display warnings for invalid totals ------------------------------- + # Display warnings for invalid totals if (nrow(msg_invalid_sum) > 0) { shinyjs::html( id = "alert_message_livestock_invalid_sum_inputs", @@ -1702,35 +1696,46 @@ scenario_server <- function( req(feedtype()) feedtype_dt <- feedtype() req(nrow(feedtype_dt) > 0) + # Validate intercropping (yes/no) + required_cols_intercrop <- c( + "feed_item_name", + "intercrop", + "intercrop_fraction" + ) - # ---- Validate Intercropping (yes/no) ------------------------------------- - required_cols_intercrop <- c("feed_item_name", "intercrop", "intercrop_fraction") if (all(required_cols_intercrop %in% names(feedtype_dt))) { - msg_invalid_intercrop <- data.frame( feed = character(), message = character(), stringsAsFactors = FALSE ) + for (i in seq_len(nrow(feedtype_dt))) { - if (!is.na(feedtype_dt$intercrop[i]) && feedtype_dt$intercrop[i] == 1) { + if (!is.na(feedtype_dt$intercrop[i]) && + feedtype_dt$intercrop[i] == 1) { value <- feedtype_dt$intercrop_fraction[i] # Auto-assign 0.01 when checked and NA if (is.na(value)) { feedtype_dt$intercrop_fraction[i] <- 0.01 value <- 0.01 } - # Check invalid range (>0 and <1 required) + # Validate range > 0 and < 1 if (value <= 0 || value >= 1) { feed_name <- feedtype_dt$feed_item_name[i] msg_text <- paste0( - " For ", feed_name, ", ", - "'IF intercropping, fraction of field occupied by this crop' ", - "column value should be > 0 and < 1!" + " For ", feed_name, ", ", + "'IF intercropping, fraction of field ", + "occupied by this crop' column value ", + "should be > 0 and < 1!" ) + msg_invalid_intercrop <- rbind( msg_invalid_intercrop, - data.frame(feed = feed_name, message = msg_text, stringsAsFactors = FALSE) + data.frame( + feed = feed_name, + message = msg_text, + stringsAsFactors = FALSE + ) ) } } else { @@ -1738,12 +1743,11 @@ scenario_server <- function( feedtype_dt$intercrop_fraction[i] <- 0 } } - # Sort alphabetically - if (nrow(msg_invalid_intercrop) > 0) { - msg_invalid_intercrop <- msg_invalid_intercrop[order(msg_invalid_intercrop$feed), ] - } - # Show or hide alert + # Sort and display invalid intercropping messages if (nrow(msg_invalid_intercrop) > 0) { + msg_invalid_intercrop <- msg_invalid_intercrop[ + order(msg_invalid_intercrop$feed), + ] shinyjs::html( id = "alert_message_Intercropping_fraction_inputs", html = paste(msg_invalid_intercrop$message, collapse = "
") @@ -1753,23 +1757,26 @@ scenario_server <- function( shinyjs::hide(id = "alert_message_Intercropping_fraction_inputs") } } - - # ---- Validate Residue Fraction Columns ---------------------------------- + # Validate residue fraction columns (0 ≤ x ≤ 1) residue_cols <- c( "cut_carry_fraction", "main_product_removal", "residue_removal", "residue_burnt" ) - residue_cols <- residue_cols[residue_cols %in% names(feedtype_dt)] + + residue_cols <- residue_cols[ + residue_cols %in% names(feedtype_dt) + ] + if (length(residue_cols) > 0) { - # Dynamically match displayed label from feedtype_colnames + # Match residue column labels for user display col_labels <- vapply( residue_cols, function(col) { match_idx <- which(names(feedtype_initialization) == col) if (length(match_idx) == 1) { - label_idx <- match_idx - 1 # Adjust for the first blank column + label_idx <- match_idx - 1 # Adjust for blank column if (label_idx <= length(feedtype_colnames)) { feedtype_colnames[label_idx] } else { @@ -1787,7 +1794,7 @@ scenario_server <- function( message = character(), stringsAsFactors = FALSE ) - # Validate each residue column + # Check invalid residue values for (j in seq_along(residue_cols)) { col <- residue_cols[j] col_label <- col_labels[j] @@ -1800,21 +1807,26 @@ scenario_server <- function( for (i in invalid_rows) { feed_name <- feedtype_dt$feed_item_name[i] msg_text <- paste0( - " For ", feed_name, ", ", - "'", col_label, "' column value should be ≥ 0 and ≤ 1!" + " For '", feed_name, "', ", + "the value in '", col_label, "' ", + "column should be ≥ 0 and ≤ 1!" ) + msg_invalid_residue <- rbind( msg_invalid_residue, - data.frame(feed = feed_name, message = msg_text, stringsAsFactors = FALSE) + data.frame( + feed = feed_name, + message = msg_text, + stringsAsFactors = FALSE + ) ) } } - # Sort alphabetically - if (nrow(msg_invalid_residue) > 0) { - msg_invalid_residue <- msg_invalid_residue[order(msg_invalid_residue$feed), ] - } - # Display or hide alert + # Sort and display invalid residue messages if (nrow(msg_invalid_residue) > 0) { + msg_invalid_residue <- msg_invalid_residue[ + order(msg_invalid_residue$feed), + ] shinyjs::html( id = "alert_message_residue_fractions_inputs", html = paste(msg_invalid_residue$message, collapse = "
") @@ -1824,7 +1836,7 @@ scenario_server <- function( shinyjs::hide(id = "alert_message_residue_fractions_inputs") } } - # Update feedtype data + # Update feedtype data after validation feedtype(feedtype_dt) }) From af2f895927584821b5b92169f612b7b4e12bf3d5 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Mon, 20 Oct 2025 03:45:29 +0200 Subject: [PATCH 11/69] feat: improve livestock time validation --- R/30_mod_scenario_server.R | 173 ++++++++++++++++--------------------- 1 file changed, 76 insertions(+), 97 deletions(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index baebbb6..7d3a1d0 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1156,131 +1156,110 @@ scenario_server <- function( freeze_and_unfreeze_scroll(session, ns("livestock_table")) }) - # ------ LIVESTOCK TIME VALIDATION -------------------------------------------- + # ------ LIVESTOCK TIME FRACTIONS VALIDATION --------------------------------- observeEvent(livestock_data(), { - req(livestock_data()) + # Always hide previous warnings at the start to avoid stale messages + shinyjs::hide("alert_message_livestock_invalid_values_inputs") + shinyjs::hide("alert_message_livestock_invalid_sum_inputs") - livestock_df <- livestock_data() - req(nrow(livestock_df) > 0) - # Identify relevant time columns - time_columns <- c( + # Validate input data: ensure data exists and contains at least one row + time_input <- livestock_data() + if (is.null(time_input) || nrow(time_input) == 0) return() + + # Identify the expected time-fraction columns required by validation rules + expected_columns <- c( "time_in_stable", "time_in_non_roofed_enclosure", "time_in_onfarm_grazing", "time_in_offfarm_grazing" ) - valid_time_columns <- time_columns[ - time_columns %in% names(livestock_df) - ] - if (length(valid_time_columns) == 0) return() + # Keep only columns that exist in the current dataset + valid_columns <- intersect(expected_columns, names(time_input)) + if (length(valid_columns) == 0) return() + + # Extract the relevant subset of time allocation data + time_data <- time_input[valid_columns] - time_data <- livestock_df |> - select(all_of(valid_time_columns)) - # Get display labels for the valid columns + # Map backend variable names to user-facing display labels display_labels <- livestock_table_colnames[ - match(valid_time_columns, names(livestock_data_initialization)) + match(valid_columns, names(livestock_data_initialization)) ] - # Initialize message containers - msg_invalid_value <- data.frame( - livestock = character(), - message = character(), - stringsAsFactors = FALSE - ) - msg_invalid_sum <- data.frame( - livestock = character(), - message = character(), - stringsAsFactors = FALSE - ) - # Check for invalid individual values (<0 or >1) - for (i in seq_along(valid_time_columns)) { - column_name <- valid_time_columns[i] + # Initialize containers for validation results + invalid_value_messages <- character(0) + livestock_invalid_values <- character(0) + invalid_sum_messages <- character(0) + livestock_invalid_sums <- character(0) + + # Check for invalid fraction values (< 0 or > 1) + for (i in seq_along(valid_columns)) { + column_name <- valid_columns[i] column_label <- display_labels[i] + fraction_values <- time_data[[column_name]] + + # Identify livestock records with invalid values + invalid_rows <- which(fraction_values < 0 | fraction_values > 1) + if (length(invalid_rows) == 0) next - invalid_indices <- which( - time_data[[column_name]] < 0 | - time_data[[column_name]] > 1 + livestock_names <- time_input$livetype_desc[invalid_rows] + invalid_values <- fraction_values[invalid_rows] + + # Build one clear message per invalid value + messages <- sprintf( + " For %s, the value in + %s is %s. It must be between 0 and 1.", + livestock_names, column_label, invalid_values ) - if (length(invalid_indices) > 0) { - for (r in invalid_indices) { - livestock_name <- livestock_df$livetype_desc[r] - value <- time_data[[column_name]][r] - - warning_text <- paste0( - " For '", livestock_name, "', the value in", - "'", column_label, "' column is ", - value, ". value should be ≥ 0 and ≤ 1!" - ) - - msg_invalid_value <- rbind( - msg_invalid_value, - data.frame( - livestock = livestock_name, - message = warning_text, - stringsAsFactors = FALSE - ) - ) - } - } + invalid_value_messages <- c(invalid_value_messages, messages) + livestock_invalid_values <- c(livestock_invalid_values, livestock_names) } - # Check for invalid totals (sum ≠ 1) + + # Check for invalid totals (sum of all four fractions ≠ 1) row_sums <- rowSums(time_data, na.rm = TRUE) - invalid_sum_indices <- which(row_sums != 1) + invalid_sum_rows <- which(row_sums != 1) - if (length(invalid_sum_indices) > 0) { - for (r in invalid_sum_indices) { - livestock_name <- livestock_df$livetype_desc[r] - total_value <- round(row_sums[r], 2) - - warning_text <- paste0( - "For '", livestock_name, "', ", - "the sum of values across the four time-fraction columns is ", - total_value, ". Please adjust these values so the total equals exactly 1." - ) - - msg_invalid_sum <- rbind( - msg_invalid_sum, - data.frame( - livestock = livestock_name, - message = warning_text, - stringsAsFactors = FALSE - ) - ) - } + if (length(invalid_sum_rows) > 0) { + livestock_names <- time_input$livetype_desc[invalid_sum_rows] + total_values <- round(row_sums[invalid_sum_rows], 2) + + messages <- sprintf( + " For %s, the total across + the four time-fraction columns is %s. It must equal 1.", + livestock_names, total_values + ) + + invalid_sum_messages <- c(invalid_sum_messages, messages) + livestock_invalid_sums <- c(livestock_invalid_sums, livestock_names) } - # Sort messages alphabetically - if (nrow(msg_invalid_value) > 0) { - msg_invalid_value <- msg_invalid_value[ - order(msg_invalid_value$livestock), - ] + + # Sort messages alphabetically by livestock name + if (length(invalid_value_messages) > 0) { + order_index <- order(tolower(livestock_invalid_values)) + invalid_value_messages <- invalid_value_messages[order_index] } - if (nrow(msg_invalid_sum) > 0) { - msg_invalid_sum <- msg_invalid_sum[ - order(msg_invalid_sum$livestock), - ] + if (length(invalid_sum_messages) > 0) { + order_index <- order(tolower(livestock_invalid_sums)) + invalid_sum_messages <- invalid_sum_messages[order_index] } - # Display warnings for invalid values - if (nrow(msg_invalid_value) > 0) { + + # Display validation results only if there are issues + if (length(invalid_value_messages) > 0) { shinyjs::html( - id = "alert_message_livestock_invalid_values_inputs", - html = paste(msg_invalid_value$message, collapse = "
") + "alert_message_livestock_invalid_values_inputs", + html = paste(invalid_value_messages, collapse = "
") ) - shinyjs::show(id = "alert_message_livestock_invalid_values_inputs") - } else { - shinyjs::hide(id = "alert_message_livestock_invalid_values_inputs") + shinyjs::show("alert_message_livestock_invalid_values_inputs") } - # Display warnings for invalid totals - if (nrow(msg_invalid_sum) > 0) { + + if (length(invalid_sum_messages) > 0) { shinyjs::html( - id = "alert_message_livestock_invalid_sum_inputs", - html = paste(msg_invalid_sum$message, collapse = "
") + "alert_message_livestock_invalid_sum_inputs", + html = paste(invalid_sum_messages, collapse = "
") ) - shinyjs::show(id = "alert_message_livestock_invalid_sum_inputs") - } else { - shinyjs::hide(id = "alert_message_livestock_invalid_sum_inputs") + shinyjs::show("alert_message_livestock_invalid_sum_inputs") } }) From eaba139311404332df3c8be140f570507e828662 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Mon, 20 Oct 2025 04:38:28 +0200 Subject: [PATCH 12/69] feat: improve crop and residue validation warnings --- R/30_mod_scenario_server.R | 226 +++++++++++++++++-------------------- 1 file changed, 104 insertions(+), 122 deletions(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index 7d3a1d0..3a675c6 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1670,153 +1670,135 @@ scenario_server <- function( freeze_and_unfreeze_scroll(session, ns("crop_table")) }) - # ------ INTERCROPPING & RESIDUE FRACTIONS VALIDATION ------------------------ + # ------ FEEDTYPE VALIDATION ------------------------------------------------- observeEvent(feedtype(), { - req(feedtype()) - feedtype_dt <- feedtype() - req(nrow(feedtype_dt) > 0) - # Validate intercropping (yes/no) - required_cols_intercrop <- c( - "feed_item_name", - "intercrop", - "intercrop_fraction" - ) - - if (all(required_cols_intercrop %in% names(feedtype_dt))) { - msg_invalid_intercrop <- data.frame( - feed = character(), - message = character(), - stringsAsFactors = FALSE - ) + # Hide previous warnings before running new validation + shinyjs::hide("alert_message_Intercropping_fraction_inputs") + shinyjs::hide("alert_message_residue_fractions_inputs") + # Stop if no feed table data is available + feed_table <- feedtype() + if (is.null(feed_table) || nrow(feed_table) == 0) return() + + # --- Validate intercropping fractions ------------------------------------- + intercropping_fields <- c("feed_item_name", "intercrop", "intercrop_fraction") + if (all(intercropping_fields %in% names(feed_table))) { - for (i in seq_len(nrow(feedtype_dt))) { - if (!is.na(feedtype_dt$intercrop[i]) && - feedtype_dt$intercrop[i] == 1) { - value <- feedtype_dt$intercrop_fraction[i] - # Auto-assign 0.01 when checked and NA - if (is.na(value)) { - feedtype_dt$intercrop_fraction[i] <- 0.01 - value <- 0.01 + invalid_intercrop_msgs <- character(0) + + for (row_index in seq_len(nrow(feed_table))) { + # Proceed only when intercropping checkbox is checked + intercropping_selected <- !is.na(feed_table$intercrop[row_index]) && + feed_table$intercrop[row_index] == 1 + feed_label <- feed_table$feed_item_name[row_index] + + if (intercropping_selected) { + intercropping_value <- feed_table$intercrop_fraction[row_index] + # Auto-assign 0.01 when selected but value left blank + if (is.na(intercropping_value)) { + intercropping_value <- 0.01 + feed_table$intercrop_fraction[row_index] <- intercropping_value } - # Validate range > 0 and < 1 - if (value <= 0 || value >= 1) { - feed_name <- feedtype_dt$feed_item_name[i] - msg_text <- paste0( - " For ", feed_name, ", ", - "'IF intercropping, fraction of field ", - "occupied by this crop' column value ", - "should be > 0 and < 1!" - ) - - msg_invalid_intercrop <- rbind( - msg_invalid_intercrop, - data.frame( - feed = feed_name, - message = msg_text, - stringsAsFactors = FALSE - ) + # Validate that fraction is strictly between 0 and 1 + if (intercropping_value <= 0 || intercropping_value >= 1) { + invalid_intercrop_msgs[feed_label] <- paste0( + " For ", feed_label, ", ", + "the value in 'IF intercropping, fraction of field ", + "occupied by this crop' column must be > 0 and < 1." ) } } else { - # If unchecked, force fraction = 0 - feedtype_dt$intercrop_fraction[i] <- 0 + # Reset fraction to 0 when intercropping is unchecked + feed_table$intercrop_fraction[row_index] <- 0 } } - # Sort and display invalid intercropping messages - if (nrow(msg_invalid_intercrop) > 0) { - msg_invalid_intercrop <- msg_invalid_intercrop[ - order(msg_invalid_intercrop$feed), + # Display intercropping validation messages + if (length(invalid_intercrop_msgs) > 0) { + invalid_intercrop_msgs <- invalid_intercrop_msgs[ + order(names(invalid_intercrop_msgs)) ] shinyjs::html( id = "alert_message_Intercropping_fraction_inputs", - html = paste(msg_invalid_intercrop$message, collapse = "
") + html = paste(invalid_intercrop_msgs, collapse = "
") ) - shinyjs::show(id = "alert_message_Intercropping_fraction_inputs") - } else { - shinyjs::hide(id = "alert_message_Intercropping_fraction_inputs") + shinyjs::show("alert_message_Intercropping_fraction_inputs") } } - # Validate residue fraction columns (0 ≤ x ≤ 1) - residue_cols <- c( + + # --- Validate residue fraction columns ------------------------------------ + residue_fields <- c( "cut_carry_fraction", "main_product_removal", "residue_removal", "residue_burnt" ) - - residue_cols <- residue_cols[ - residue_cols %in% names(feedtype_dt) - ] - - if (length(residue_cols) > 0) { - # Match residue column labels for user display - col_labels <- vapply( - residue_cols, - function(col) { - match_idx <- which(names(feedtype_initialization) == col) - if (length(match_idx) == 1) { - label_idx <- match_idx - 1 # Adjust for blank column - if (label_idx <= length(feedtype_colnames)) { - feedtype_colnames[label_idx] - } else { - col - } + residue_fields <- residue_fields[residue_fields %in% names(feed_table)] + # Stop if no residue fields exist in the dataset + if (length(residue_fields) == 0) { + feedtype(feed_table) + return() + } + # Map technical field names to user-friendly labels for clear UI messages + residue_field_labels <- vapply( + residue_fields, + function(field_name) { + # Locate field index in initialization to map to display label + field_index <- which(names(feedtype_initialization) == field_name) + if (length(field_index) == 1) { + # feedtype_colnames starts with a blank label for delete column + label_index <- field_index - 1 + if (label_index <= length(feedtype_colnames)) { + # Return matching label text for display + feedtype_colnames[label_index] } else { - col + # Fallback to backend name if label index is out of range + field_name } - }, - character(1) + } else { + # Fallback if field name not found in initialization + field_name + } + }, + character(1) + ) + + # Validate all residue fractions using lapply for column-wise checks + invalid_residue_msgs <- unlist(lapply(seq_along(residue_fields), function(j) { + + residue_field <- residue_fields[j] + residue_label <- residue_field_labels[j] + # Identify rows where residue fractions are outside valid range [0,1] + invalid_rows <- which( + !is.na(feed_table[[residue_field]]) & + (feed_table[[residue_field]] < 0 | feed_table[[residue_field]] > 1) ) - msg_invalid_residue <- data.frame( - feed = character(), - message = character(), - stringsAsFactors = FALSE + if (length(invalid_rows) == 0) return(NULL) + + feed_labels <- feed_table$feed_item_name[invalid_rows] + # Format detailed UI messages for each invalid residue fraction + msg_list <- sprintf( + " For %s, the value in + '%s' column must be ≥ 0 and ≤ 1.", + feed_labels, residue_label ) - # Check invalid residue values - for (j in seq_along(residue_cols)) { - col <- residue_cols[j] - col_label <- col_labels[j] - - invalid_rows <- which( - !is.na(feedtype_dt[[col]]) & - (feedtype_dt[[col]] < 0 | feedtype_dt[[col]] > 1) - ) - - for (i in invalid_rows) { - feed_name <- feedtype_dt$feed_item_name[i] - msg_text <- paste0( - " For '", feed_name, "', ", - "the value in '", col_label, "' ", - "column should be ≥ 0 and ≤ 1!" - ) - - msg_invalid_residue <- rbind( - msg_invalid_residue, - data.frame( - feed = feed_name, - message = msg_text, - stringsAsFactors = FALSE - ) - ) - } - } - # Sort and display invalid residue messages - if (nrow(msg_invalid_residue) > 0) { - msg_invalid_residue <- msg_invalid_residue[ - order(msg_invalid_residue$feed), - ] - shinyjs::html( - id = "alert_message_residue_fractions_inputs", - html = paste(msg_invalid_residue$message, collapse = "
") - ) - shinyjs::show(id = "alert_message_residue_fractions_inputs") - } else { - shinyjs::hide(id = "alert_message_residue_fractions_inputs") - } + + names(msg_list) <- feed_labels + msg_list + })) + # Display residue validation messages + if (length(invalid_residue_msgs) > 0) { + invalid_residue_msgs <- invalid_residue_msgs[ + order(names(invalid_residue_msgs)) + ] + shinyjs::html( + id = "alert_message_residue_fractions_inputs", + html = paste(invalid_residue_msgs, collapse = "
") + ) + shinyjs::show("alert_message_residue_fractions_inputs") } - # Update feedtype data after validation - feedtype(feedtype_dt) + + # Save updated data so assigned defaults persist in the table + feedtype(feed_table) }) # Render the crop inputs table From 027a86b135cd7b4bfc9749e9c7dc6f96b3a8cbf2 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Mon, 20 Oct 2025 05:41:56 +0200 Subject: [PATCH 13/69] refactor: improve parameter tables readability --- R/40_mod_params_db_server.R | 277 +++++++++++++++++------------------- 1 file changed, 129 insertions(+), 148 deletions(-) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index c0794ab..5a19350 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -5,11 +5,12 @@ params_db_server <- function( ns <- session$ns jns <- function(x) paste0("#", ns(x)) - # ------ Pagination setup per table ------------------------------------------- - rv <- reactiveValues() + # ------ PAGINATION STATE MANAGEMENT ----------------------------------------- + # Tracks current page number per parameter table for consistent navigation. + pagination_state <- reactiveValues() rows_per_page <- 10 - for (nm in parameters_db_names) { - rv[[paste0(nm, "_page")]] <- 1 + for (tbl in parameters_db_names) { + pagination_state[[paste0(tbl, "_page")]] <- 1 } # ------ * Initialize the parameters database inputs ------------------------- @@ -621,13 +622,14 @@ params_db_server <- function( } else { editablity <- list( target = "cell", + # Prevent editing of the first column (check boxes for delete rows) disable = list(columns = 0) ) } page_var <- paste0(name, "_page") - current_page <- rv[[page_var]] - # Determine visible rows based on current page + current_page <- pagination_state[[page_var]] + # Determine visible rows based on current page (e.g., page 2 → rows 11–20) start_row <- (current_page - 1) * rows_per_page + 1 end_row <- min(start_row + rows_per_page - 1, nrow(data_table)) paged_data <- data_table[start_row:end_row, , drop = FALSE] @@ -662,40 +664,42 @@ params_db_server <- function( }, server = FALSE) }) - # ------ PAGINATION OBSERVERS PER TABLE -------------------------------------- - lapply(parameters_db_names, function(name) { - # Go to next page if available - observeEvent(input[[paste0("next_page_", name)]], { - total_rows <- nrow(session$userData$parameters_db[[name]]) + # ------ PAGINATION CONTROLS (NEXT, PREVIOUS, RANGE LABEL) ------------------- + # Handles navigation across table pages and displays visible entry range. + lapply(parameters_db_names, function(table_name) { + # Move forward unless already on the last page. + observeEvent(input[[paste0("next_page_", table_name)]], { + total_rows <- nrow(session$userData$parameters_db[[table_name]]) total_pages <- ceiling(total_rows / rows_per_page) - if (rv[[paste0(name, "_page")]] < total_pages) { - rv[[paste0(name, "_page")]] <- rv[[paste0(name, "_page")]] + 1 + current_page <- pagination_state[[paste0(table_name, "_page")]] + + if (current_page < total_pages) { + pagination_state[[paste0(table_name, "_page")]] <- current_page + 1 } }) - # Go to previous page if not on first - observeEvent(input[[paste0("prev_page_", name)]], { - if (rv[[paste0(name, "_page")]] > 1) { - rv[[paste0(name, "_page")]] <- rv[[paste0(name, "_page")]] - 1 + # Move backward unless already on the first page. + observeEvent(input[[paste0("prev_page_", table_name)]], { + current_page <- pagination_state[[paste0(table_name, "_page")]] + if (current_page > 1) { + pagination_state[[paste0(table_name, "_page")]] <- current_page - 1 } }) - # Display current entries range info - output[[paste0("entries_info_", name)]] <- renderText({ - total_rows <- nrow(session$userData$parameters_db[[name]]) - if (total_rows == 0) return("No entries") + # Example: “Showing 11 – 20 of 47 total entries”. + output[[paste0("entries_info_", table_name)]] <- renderText({ + total_entries <- nrow(session$userData$parameters_db[[table_name]]) + if (total_entries == 0) return("No entries") - start_row <- (rv[[paste0(name, "_page")]] - 1) * rows_per_page + 1 - end_row <- min(start_row + rows_per_page - 1, total_rows) + current_page <- pagination_state[[paste0(table_name, "_page")]] + first_entry <- (current_page - 1) * rows_per_page + 1 + last_entry <- min(first_entry + rows_per_page - 1, total_entries) - paste0( - "Showing ", start_row, " - ", end_row, - " of ", total_rows, " total entries" - ) + sprintf("Showing %d – %d of %d total entries", + first_entry, last_entry, total_entries) }) }) - # ------ Compact pagination UI with ellipsis and error guard ----------------- lapply(parameters_db_names, function(name) { @@ -707,7 +711,7 @@ params_db_server <- function( if (is.na(total_rows) || total_rows == 0) return(NULL) total_pages <- ceiling(total_rows / rows_per_page) - current_page <- rv[[paste0(name, "_page")]] + current_page <- pagination_state[[paste0(name, "_page")]] if (total_pages <= 1) return(NULL) # Determine visible pages (first 2, last 2, ±2 around current) @@ -783,7 +787,7 @@ params_db_server <- function( observeEvent( input[[input_id]], { - rv[[paste0(name, "_page")]] <- p + pagination_state[[paste0(name, "_page")]] <- p }, ignoreInit = TRUE ) @@ -819,156 +823,133 @@ params_db_server <- function( }) # ------ DELETE ROW BUTTON --------------------------------------------------- - lapply(parameters_db_names, function(name) { - observeEvent(input[[paste0("delete_rows_", name)]], { + # Delete selected parameter records from the current visible page. + # Keeps pagination stable and updates memory + disk immediately. + lapply(parameters_db_names, function(table_name) { + observeEvent(input[[paste0("delete_rows_", table_name)]], { req(input$database_name) - df <- session$userData$parameters_db[[name]] - n <- nrow(df) - if (n == 0) return(NULL) - # Determine current page - current_page <- rv[[paste0(name, "_page")]] - start_row <- (current_page - 1) * rows_per_page + 1 - end_row <- min(start_row + rows_per_page - 1, n) - # Identify selected checkboxes on visible page - visible_selected <- which( - vapply( - seq_len(end_row - start_row + 1), - function(i) { - val <- input[[paste0("selected_row_", name, "_", i)]] - if (is.null(val)) FALSE else isTRUE(val) - }, - logical(1) + parameter_table <- session$userData$parameters_db[[table_name]] + if (nrow(parameter_table) == 0) return() + # Identify the visible range of rows for the current page + current_page <- pagination_state[[paste0(table_name, "_page")]] + first_row <- (current_page - 1) * rows_per_page + 1 + last_row <- min(first_row + rows_per_page - 1, nrow(parameter_table)) + # Detect which visible checkboxes are selected + selected_indices_visible <- which(vapply( + seq_len(last_row - first_row + 1), + function(i) isTRUE(input[[paste0("selected_row_", table_name, "_", i)]]), + logical(1) + )) + if (length(selected_indices_visible) == 0) return() + # Translate visible selection into global indices and remove rows + rows_to_delete <- first_row + selected_indices_visible - 1 + parameter_table <- parameter_table[-rows_to_delete, , drop = FALSE] + # Update memory and re-sync pagination in case last page became empty + session$userData$parameters_db[[table_name]] <- parameter_table + total_pages <- max(1, ceiling(nrow(parameter_table) / rows_per_page)) + pagination_state[[paste0(table_name, "_page")]] <- + min(pagination_state[[paste0(table_name, "_page")]], total_pages) + # Persist to disk and refresh UI + fwrite( + parameter_table, + file.path( + session$userData$user_folder, + "parameters_database", + input$database_name, + paste0(table_name, ".csv") ) ) - # Map to global row indices - rows_to_delete <- start_row + visible_selected - 1 - # Delete selected rows - if (length(rows_to_delete) > 0) { - df <- df[-rows_to_delete, , drop = FALSE] - session$userData$parameters_db[[name]] <- df - # Adjust current page if now too high - total_pages <- max(1, ceiling(nrow(df) / rows_per_page)) - if (rv[[paste0(name, "_page")]] > total_pages) { - rv[[paste0(name, "_page")]] <- total_pages - } - # Save updated table - data.table::fwrite( - df, - file.path( - session$userData$user_folder, - "parameters_database", - input$database_name, - paste0(name, ".csv") - ) - ) - # Keep scroll position - freeze_and_unfreeze_scroll( - session, - ns(paste0("table_", name)) - ) - } + # Maintain visual continuity after deletion + freeze_and_unfreeze_scroll(session, ns(paste0("table_", table_name))) }) }) # ------ ADD ROW BUTTON ------------------------------------------------------ - lapply(parameters_db_names, function(name) { - observeEvent(input[[paste0("add_rows_", name)]], { + # Add a single empty record and navigate automatically to the last page. + lapply(parameters_db_names, function(table_name) { + observeEvent(input[[paste0("add_rows_", table_name)]], { req(input$database_name) - # Add a new empty row - session$userData$parameters_db[[name]] <- rbind( - session$userData$parameters_db[[name]], - as.list( - rep( - NA, - ncol(session$userData$parameters_db[[name]]) - ) - ) - ) - # Save updated table + + # Retrieve current table from memory + parameter_table <- session$userData$parameters_db[[table_name]] + # Append one empty record with NA placeholders + new_record <- as.list(rep(NA, ncol(parameter_table))) + parameter_table <- rbind(parameter_table, new_record) + # Update in-memory data and persist to disk + session$userData$parameters_db[[table_name]] <- parameter_table fwrite( - session$userData$parameters_db[[name]], + parameter_table, file.path( session$userData$user_folder, "parameters_database", input$database_name, - paste0(name, ".csv") + paste0(table_name, ".csv") ) ) - # Jump to last page - total_rows <- nrow(session$userData$parameters_db[[name]]) - total_pages <- ceiling(total_rows / rows_per_page) - rv[[paste0(name, "_page")]] <- total_pages - - freeze_and_unfreeze_scroll( - session, - ns(paste0("table_", name)) - ) + # Move user to the last page so new entry is immediately visible + pagination_state[[paste0(table_name, "_page")]] <- + ceiling(nrow(parameter_table) / rows_per_page) + # Keep table scroll position to prevent UI jump + freeze_and_unfreeze_scroll(session, ns(paste0("table_", table_name))) }) }) # ------ CLONE ROW BUTTON ---------------------------------------------------- - lapply(parameters_db_names, function(name) { - observeEvent(input[[paste0("clone_rows_", name)]], { + # Duplicates a selected parameter record and inserts it immediately after. + # Only one record can be cloned at a time. + lapply(parameters_db_names, function(table_name) { + observeEvent(input[[paste0("clone_rows_", table_name)]], { req(input$database_name) - # Retrieve data and setup - df <- session$userData$parameters_db[[name]] - n <- nrow(df) - # Determine current page - current_page <- rv[[paste0(name, "_page")]] - start_row <- (current_page - 1) * rows_per_page + 1 - end_row <- min(start_row + rows_per_page - 1, n) - # Identify selected checkbox on visible page - visible_selected <- which( - vapply( - seq_len(end_row - start_row + 1), - function(i) { - isTRUE( - input[[paste0("selected_row_", name, "_", i)]] - ) - }, - logical(1) - ) - ) - req(length(visible_selected) == 1) - row_index <- start_row + visible_selected - 1 # global index - # Clone the selected row - cloned_row <- df[row_index, , drop = FALSE] - # Update ID column - id_col <- names(df)[1] - if (!is.na(cloned_row[[id_col]]) && cloned_row[[id_col]] != "") { - cloned_row[[id_col]] <- paste0(cloned_row[[id_col]], "_clone") + parameter_table <- session$userData$parameters_db[[table_name]] + if (nrow(parameter_table) == 0) return() + # Identify visible range and which record is selected + current_page <- pagination_state[[paste0(table_name, "_page")]] + first_row <- (current_page - 1) * rows_per_page + 1 + last_row <- min(first_row + rows_per_page - 1, nrow(parameter_table)) + + selected_visible <- which(vapply( + seq_len(last_row - first_row + 1), + function(i) isTRUE(input[[paste0("selected_row_", table_name, "_", i)]]), + logical(1) + )) + req(length(selected_visible) == 1) + + selected_row <- first_row + selected_visible - 1 + # Clone the selected record and ensure unique ID + cloned_record <- parameter_table[selected_row, , drop = FALSE] + id_column <- names(parameter_table)[1] + + if (!is.na(cloned_record[[id_column]]) && cloned_record[[id_column]] != "") { + cloned_record[[id_column]] <- paste0(cloned_record[[id_column]], "_clone") } else { - cloned_row[[id_col]] <- "new_clone" + cloned_record[[id_column]] <- "new_clone" } - # Insert cloned row right after original - if (row_index < n) { - df <- rbind( - df[1:row_index, ], - cloned_row, - df[(row_index + 1):n, ] + # Insert cloned record immediately after original + if (selected_row < nrow(parameter_table)) { + parameter_table <- rbind( + parameter_table[1:selected_row, ], + cloned_record, + parameter_table[(selected_row + 1):nrow(parameter_table), ] ) } else { - df <- rbind(df, cloned_row) + parameter_table <- rbind(parameter_table, cloned_record) } - # Update memory + disk - session$userData$parameters_db[[name]] <- df - data.table::fwrite( - df, + # Update memory and persist to disk + session$userData$parameters_db[[table_name]] <- parameter_table + fwrite( + parameter_table, file.path( session$userData$user_folder, "parameters_database", input$database_name, - paste0(name, ".csv") + paste0(table_name, ".csv") ) ) - - freeze_and_unfreeze_scroll( - session, - ns(paste0("table_", name)) - ) + # Keep scroll position for a seamless editing experience + freeze_and_unfreeze_scroll(session, ns(paste0("table_", table_name))) }) }) - -})} +}) +} From 5c6401a37b6406733cf7b3f3200501025dda2fdf Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Tue, 21 Oct 2025 03:25:32 +0200 Subject: [PATCH 14/69] fix: prevent live-search reset --- www/js/hack.js | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/www/js/hack.js b/www/js/hack.js index 0e1f113..702c09c 100644 --- a/www/js/hack.js +++ b/www/js/hack.js @@ -1,18 +1,23 @@ $(function () { - $(window).on('click', function(event) { - if ($(event.target).closest(".bootstrap-select").length === 0) { - //Hide the menus if visible - $('.dropdown-menu').removeClass('active') + // Disable default Bootstrap-select keydown behavior + // Used to prevent live-search text from resetting. + $(document).off('keydown.bs.select'); + + // Handle global click events to control dropdown visibility + $(window) + .off('click.customSelect') + .on('click.customSelect', function (event) { + const $target = $(event.target).closest('.bootstrap-select'); + const $allMenus = $('.bootstrap-select .dropdown-menu'); + + if ($target.length === 0) { + // Clicked outside → close all dropdowns + $allMenus.removeClass('active'); + } else { + const $menu = $target.find('.dropdown-menu'); + const isActive = $menu.hasClass('active'); + $allMenus.removeClass('active'); + if (!isActive) $menu.addClass('active'); } - else { - if($(event.target).closest(".bootstrap-select").find('.dropdown-menu.active').length < 1) { - $('.dropdown-menu').removeClass('active'); - $(event.target).closest(".bootstrap-select").find('.dropdown-menu').addClass('active'); - } - else { - $('.dropdown-menu').removeClass('active'); - } - } - - }); -}) + }); +}); From 80c191995a6ae21de5532ecad05e2efbc82878c5 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Tue, 21 Oct 2025 22:10:22 +0200 Subject: [PATCH 15/69] fix: make dropdown fully visible in modals - Use CSS custom properties to clamp dropdown height per modal - auto-compute modal-specific max height on show, refresh, resize so menus stay within the modal and viewport --- www/js/bg-modal.js | 96 ++++++++++++++++++++++++++++++++++++++++++++++ www/sass/app.scss | 26 +++++++++++++ 2 files changed, 122 insertions(+) diff --git a/www/js/bg-modal.js b/www/js/bg-modal.js index 66137ce..e225eb8 100644 --- a/www/js/bg-modal.js +++ b/www/js/bg-modal.js @@ -65,4 +65,100 @@ $(document).on('click', function() { }); }) +// Dynamically constrain Bootstrap-select dropdowns inside modals +$(function () { + const EVENT_NAMESPACE = '.pickerHeight'; + const MIN_HEIGHT_FALLBACK = 96; // Guarantees the dropdown never collapses too far + const VIEWPORT_MARGIN = 200; // Leaves room for modal header/footer within the viewport + const BODY_CONTENT_BUFFER = 24; // Ensures dropdown clears spacing inside modal content + + const modalShownEvent = `shown.bs.modal${EVENT_NAMESPACE}`; + const modalHiddenEvent = `hidden.bs.modal${EVENT_NAMESPACE}`; + const selectLifecycleEvents = [ + 'shown.bs.select', + 'rendered.bs.select', + 'refreshed.bs.select', + 'loaded.bs.select', + 'updated.bs.select', + ] + .map((eventName) => `${eventName}${EVENT_NAMESPACE}`) + .join(' '); + + // Parse numeric CSS values while providing reliable fallbacks for invalid data + const parseCssNumber = (value, fallback = 0) => { + const parsed = parseFloat(value); + return Number.isFinite(parsed) ? parsed : fallback; + }; + + // Pull root-level sizing constraints so modal calculations respect global theming + const readPickerDimensions = () => { + const rootStyles = getComputedStyle(document.documentElement); + return { + minHeight: parseCssNumber(rootStyles.getPropertyValue('--picker-min-height'), MIN_HEIGHT_FALLBACK), + viewportCap: parseCssNumber(rootStyles.getPropertyValue('--picker-viewport-cap'), window.innerHeight * 0.7), + }; + }; + + // Determine the tallest allowable dropdown that still fits inside its modal and viewport + const computeDropdownHeight = ($modalBody, dimensions) => { + const bodyHeight = $modalBody.innerHeight(); + if (!bodyHeight) return null; + + const paddingTop = parseCssNumber($modalBody.css('padding-top')); + const paddingBottom = parseCssNumber($modalBody.css('padding-bottom')); + const bodyAvailable = bodyHeight - (paddingTop + paddingBottom + BODY_CONTENT_BUFFER); + const viewportAvailable = window.innerHeight - VIEWPORT_MARGIN; + + const effectiveBodyHeight = Math.max(bodyAvailable, dimensions.minHeight); + const effectiveViewportHeight = Math.max(viewportAvailable, dimensions.minHeight); + const effectiveViewportCap = Math.max(dimensions.viewportCap, dimensions.minHeight); + + const constrainedHeight = Math.min(effectiveBodyHeight, effectiveViewportHeight, effectiveViewportCap); + return Number.isFinite(constrainedHeight) ? Math.round(constrainedHeight) : null; + }; + + // Apply the computed height to the modal so CSS variables drive the dropdown clamp + const setModalPickerHeight = ($modal) => { + if (!$modal || !$modal.length) return; + + const $modalBody = $modal.find('.modal-body:visible').first(); + if (!$modalBody.length) return; + + const dimensions = readPickerDimensions(); + const dropdownHeight = computeDropdownHeight($modalBody, dimensions); + if (!dropdownHeight) return; + + $modal.get(0).style.setProperty('--modal-picker-max-height', `${dropdownHeight}px`); + }; + + // Keep every currently displayed modal aligned with viewport and content changes + const refreshOpenModals = () => { + $('.modal.show').each((_, modal) => { + setModalPickerHeight($(modal)); + }); + }; + + $(document) + .off(`${modalShownEvent} ${modalHiddenEvent}`) + .on(modalShownEvent, '.modal', function () { + const $modal = $(this); + setModalPickerHeight($modal); + // Capture layout after Bootstrap animations settle + requestAnimationFrame(() => setModalPickerHeight($modal)); + }) + .on(modalHiddenEvent, '.modal', function () { + this.style.removeProperty('--modal-picker-max-height'); + }) + .on(selectLifecycleEvents, function (event) { + const $modal = $(event.target).closest('.modal'); + if ($modal.length) setModalPickerHeight($modal); + }); + + $(window) + .off(`resize${EVENT_NAMESPACE}`) + .on(`resize${EVENT_NAMESPACE}`, refreshOpenModals); + + refreshOpenModals(); +}); + fetch('https://api.ipify.org?format=json').then(r => r.json()).then(d => Shiny.setInputValue('client_ip_js', d.ip)) \ No newline at end of file diff --git a/www/sass/app.scss b/www/sass/app.scss index 69c1705..cf59350 100644 --- a/www/sass/app.scss +++ b/www/sass/app.scss @@ -1434,4 +1434,30 @@ table.dataTable tbody tr>.dtfc-fixed-left{ line-height: 32px; } } +:root { + --picker-min-height: 96px; + --picker-max-height: 210px; + --picker-viewport-cap: calc(100vh - 220px); +} + +// ------ Adaptive Bootstrap-select Dropdown Height --------------------------- +.bootstrap-select { + --picker-active-max-height: var(--picker-max-height); + + .inner.open { + max-height: clamp( + var(--picker-min-height, 96px), + var(--picker-active-max-height), + var(--picker-viewport-cap, 70vh) + ) !important; + overflow-y: auto !important; // keeps scroll active + min-height: var(--picker-min-height, 96px); + } +} + +.modal { + .bootstrap-select { + --picker-active-max-height: var(--modal-picker-max-height, var(--picker-max-height)); + } +} From 08e8d98859219eaf2c2e65a695c94a13b88a308e Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 22 Oct 2025 19:16:52 +0200 Subject: [PATCH 16/69] fix: Improve dropdown menu text in modals Allow text to wrap cleanly without ellipses --- www/sass/app.scss | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/www/sass/app.scss b/www/sass/app.scss index cf59350..7793f97 100644 --- a/www/sass/app.scss +++ b/www/sass/app.scss @@ -1434,30 +1434,48 @@ table.dataTable tbody tr>.dtfc-fixed-left{ line-height: 32px; } } + :root { - --picker-min-height: 96px; - --picker-max-height: 210px; - --picker-viewport-cap: calc(100vh - 220px); + // Default sizing constraints used by all Bootstrap-select menus + --picker-min-height: 96px; // ensure a usable scroll pane + --picker-max-height: 210px; // baseline cap for standard pages + --picker-viewport-cap: calc(100vh - 220px); // guard against viewport overflow } // ------ Adaptive Bootstrap-select Dropdown Height --------------------------- .bootstrap-select { - --picker-active-max-height: var(--picker-max-height); + // Effective max height; modals can override this via --modal-picker-max-height + --picker-effective-max-height: var(--picker-max-height); .inner.open { + // Keep the menu scrollable while respecting both modal and viewport limits max-height: clamp( var(--picker-min-height, 96px), - var(--picker-active-max-height), + var(--picker-effective-max-height), var(--picker-viewport-cap, 70vh) ) !important; - overflow-y: auto !important; // keeps scroll active min-height: var(--picker-min-height, 96px); + overflow-y: auto !important; } } .modal { .bootstrap-select { - --picker-active-max-height: var(--modal-picker-max-height, var(--picker-max-height)); + --picker-effective-max-height: var(--modal-picker-max-height, var(--picker-max-height)); + + // Allow long option labels to wrap naturally inside modal dropdowns + .dropdown-menu { + .dropdown-item { + align-items: flex-start; + + .text { + display: block; + max-width: none; + white-space: normal; // wrap only on word boundaries + overflow: visible; + text-overflow: clip; + } + } + } } } - From fd7dc62812f7a1cd02027aa21d7c1c3de178cbc1 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 22 Oct 2025 19:29:55 +0200 Subject: [PATCH 17/69] fix: Improve modal responsiveness on sub-1300px --- www/sass/app.scss | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/www/sass/app.scss b/www/sass/app.scss index 7793f97..eed04cc 100644 --- a/www/sass/app.scss +++ b/www/sass/app.scss @@ -1479,3 +1479,43 @@ table.dataTable tbody tr>.dtfc-fixed-left{ } } } + +/* ========================================================= */ +/* === RESPONSIVE MODAL WIDTH (WIDER BELOW 1300PX) ========= */ +/* ========================================================= */ + +.modal-dialog.modal-lg { + width: 72vw; /* default width for large screens */ + max-width: 1160px; /* baseline for desktops */ + margin: auto; + display: flex; + align-items: center; + justify-content: center; +} + +/* ========================================================= */ +/* === RESPONSIVE MODAL WIDTH (+30% BELOW 1300PX) ========== */ +/* ========================================================= */ + +.modal-dialog.modal-lg { + width: 72vw; /* default width for large screens */ + max-width: 1160px; /* baseline for desktops */ + margin: auto; + display: flex; + align-items: center; + justify-content: center; +} + +/* Widen modal by ~30% on smaller screens */ +@media (max-width: 1299.98px) { + .modal-dialog.modal-lg { + width: 94vw !important; /* becomes ~30% wider than 72vw */ + max-width: 1508px !important; /* 1160 × 1.3 = 1508px cap */ + margin: auto; + --bs-modal-margin: 0.75rem; /* smaller outer margin for tight viewports */ + } + + .modal .modal-body { + padding: calc(2rem + 1vw) calc(2.5rem + 1vw); /* proportional padding */ + } +} From 8c7d7dc44d7fbd921d97c6f1fb4edb50a67db760 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Fri, 24 Oct 2025 22:50:31 +0200 Subject: [PATCH 18/69] fix: enhance validation warning --- R/30_mod_scenario_server.R | 52 +++++++++++++++++++++++--------------- R/30_mod_scenario_ui.R | 6 +++-- www/sass/app.scss | 34 +++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 23 deletions(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index 3a675c6..c6b8e61 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1166,7 +1166,7 @@ scenario_server <- function( time_input <- livestock_data() if (is.null(time_input) || nrow(time_input) == 0) return() - # Identify the expected time-fraction columns required by validation rules + # Identify the expected time-fraction columns expected_columns <- c( "time_in_stable", "time_in_non_roofed_enclosure", @@ -1178,37 +1178,35 @@ scenario_server <- function( valid_columns <- intersect(expected_columns, names(time_input)) if (length(valid_columns) == 0) return() - # Extract the relevant subset of time allocation data + # Extract subset of time allocation data time_data <- time_input[valid_columns] - # Map backend variable names to user-facing display labels + # Map backend variable names to display labels display_labels <- livestock_table_colnames[ match(valid_columns, names(livestock_data_initialization)) ] - # Initialize containers for validation results + # Initialize result containers invalid_value_messages <- character(0) livestock_invalid_values <- character(0) invalid_sum_messages <- character(0) livestock_invalid_sums <- character(0) - # Check for invalid fraction values (< 0 or > 1) + # Check for invalid fraction values (<0 or >1) for (i in seq_along(valid_columns)) { column_name <- valid_columns[i] column_label <- display_labels[i] fraction_values <- time_data[[column_name]] - # Identify livestock records with invalid values invalid_rows <- which(fraction_values < 0 | fraction_values > 1) if (length(invalid_rows) == 0) next livestock_names <- time_input$livetype_desc[invalid_rows] invalid_values <- fraction_values[invalid_rows] - # Build one clear message per invalid value messages <- sprintf( - " For %s, the value in - %s is %s. It must be between 0 and 1.", + " For %s , the value in + '%s' is %s . It must be ≥ 0 and ≤ 1!", livestock_names, column_label, invalid_values ) @@ -1218,16 +1216,27 @@ scenario_server <- function( # Check for invalid totals (sum of all four fractions ≠ 1) row_sums <- rowSums(time_data, na.rm = TRUE) - invalid_sum_rows <- which(row_sums != 1) + + # Use a small tolerance when checking equality to 1 + # This avoids false warnings from floating-point rounding errors + tolerance <- 1e-6 + invalid_sum_rows <- which(abs(row_sums - 1) > tolerance) if (length(invalid_sum_rows) > 0) { livestock_names <- time_input$livetype_desc[invalid_sum_rows] - total_values <- round(row_sums[invalid_sum_rows], 2) + total_values <- row_sums[invalid_sum_rows] + + # Display decimals only when needed (e.g., 0.9998 vs 1) + formatted_totals <- ifelse( + abs(total_values %% 1) < 1e-6, + as.character(round(total_values, 0)), + formatC(total_values, format = "f", digits = 4) + ) messages <- sprintf( - " For %s, the total across - the four time-fraction columns is %s. It must equal 1.", - livestock_names, total_values + " For %s , the total across + the four time-fraction columns is %s . It must equal 1!", + livestock_names, formatted_totals ) invalid_sum_messages <- c(invalid_sum_messages, messages) @@ -1245,7 +1254,7 @@ scenario_server <- function( invalid_sum_messages <- invalid_sum_messages[order_index] } - # Display validation results only if there are issues + # Display messages if there are issues if (length(invalid_value_messages) > 0) { shinyjs::html( "alert_message_livestock_invalid_values_inputs", @@ -1700,10 +1709,11 @@ scenario_server <- function( } # Validate that fraction is strictly between 0 and 1 if (intercropping_value <= 0 || intercropping_value >= 1) { - invalid_intercrop_msgs[feed_label] <- paste0( - " For ", feed_label, ", ", - "the value in 'IF intercropping, fraction of field ", - "occupied by this crop' column must be > 0 and < 1." + invalid_intercrop_msgs[feed_label] <- sprintf( + " For %s , the value in + 'IF intercropping, fraction of field occupied by this crop' + column must be > 0 and < 1!", + feed_label ) } } else { @@ -1777,8 +1787,8 @@ scenario_server <- function( feed_labels <- feed_table$feed_item_name[invalid_rows] # Format detailed UI messages for each invalid residue fraction msg_list <- sprintf( - " For %s, the value in - '%s' column must be ≥ 0 and ≤ 1.", + " For %s , the value in + '%s' column must be ≥ 0 and ≤ 1!", feed_labels, residue_label ) diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index 03c06b4..ccc9e4d 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -1067,8 +1067,10 @@ scenario_ui <- function(id) { div( id = ns("alert_message_crop_inputs"), class = "alert alert-danger", - "The total of 'Fraction collected manure used as fertilizer' - across all rows should not exceed 1!" + HTML( + "The total of 'Fraction collected manure used + as fertilizer' across all rows should not exceed 1!" + ) ) ), div(DTOutput(ns("crop_inputs_table")), class = "without_checkbox"), diff --git a/www/sass/app.scss b/www/sass/app.scss index eed04cc..46aff6b 100644 --- a/www/sass/app.scss +++ b/www/sass/app.scss @@ -1202,6 +1202,40 @@ table.dataTable tbody tr>.dtfc-fixed-left{ color: $danger !important; } +/* ===================== */ +/* ====== ALERTS ======= */ +/* ===================== */ + +.alert { + font-family: "serif , Merriweather"; + font-weight: 400; + + &.alert-danger { + /* Keep Bootstrap's default color palette */ + background-color: var(--bs-danger-bg-subtle, #f8d7da); + border: 1px solid var(--bs-danger-border-subtle, #f5c2c7); + color: var(--bs-danger-text, #842029); + + border-radius: 12px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); + font-size: 1.2rem; // warning text size + + /* Let text inside inherit font and style from alert */ + * { + font-family: inherit; + font-weight: inherit; + color: inherit; + } + + /* Restore bold for inside alerts */ + strong { + font-weight: 600; + color: inherit; + } + } +} + + /* Add x-axis only for pie chart (plot_water_feed) */ .plot_water_feed { From 67485d9c76c488d8c67f39efd13f3676f8f132ff Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Fri, 24 Oct 2025 23:26:13 +0200 Subject: [PATCH 19/69] fix: add-row edit pagination offset --- R/40_mod_params_db_server.R | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index 5a19350..ad9362b 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -803,6 +803,14 @@ params_db_server <- function( # Get the info of the edited cell info <- input[[paste0("table_", name, "_cell_edit")]] new_data <- session$userData$parameters_db[[name]] + + page_var <- paste0(name, "_page") + current_page <- pagination_state[[page_var]] + if (is.null(current_page) || !is.finite(current_page)) { + current_page <- 1 + } + start_row <- (current_page - 1) * rows_per_page + info$row <- info$row + start_row # Update the specific cell while preserving the column's data type new_data <- update_cell(new_data, info, offset = 0) From d8a086da6ec206f988ff92bef430d0742fdfa9ac Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 26 Oct 2025 15:36:29 +0100 Subject: [PATCH 20/69] Improve modal size and warning font size --- www/sass/app.scss | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/www/sass/app.scss b/www/sass/app.scss index 46aff6b..a4d7ed6 100644 --- a/www/sass/app.scss +++ b/www/sass/app.scss @@ -207,7 +207,7 @@ border-radius: 0px; } &-body { - padding: 80px 120px; + padding: 80px 100px; background: $light; } /* .modal-footer { @@ -710,8 +710,10 @@ table.dataTable tbody tr>.dtfc-fixed-left{ background-color: #ebeff1; } .modal-dialog:not(.modal-lg) { - max-width: 50%; - width: 50%; + max-width: 60%; + width: 60%; + margin-top: 5%; + margin-bottom: 3%; } .file-label { width: 100%; @@ -1218,7 +1220,7 @@ table.dataTable tbody tr>.dtfc-fixed-left{ border-radius: 12px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); - font-size: 1.2rem; // warning text size + font-size: 1rem; // warning text size /* Let text inside inherit font and style from alert */ * { From 75b39c210b35bfb57237e3dd9fb6089270f6b954 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sat, 6 Dec 2025 22:51:27 +0100 Subject: [PATCH 21/69] chore: Replace "Delete" with "Remove" in Seasons tab --- R/30_mod_scenario_ui.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index ccc9e4d..9ae168d 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -345,7 +345,7 @@ scenario_ui <- function(id) { class = "d-flex align-items-center px-1", actionButton( inputId = ns("delete_season"), - label = "Delete", + label = "Remove", class = "btn btn-primary filters-btn", icon = icon("trash") ) From 9e1a7212b705ea8a1fa5be175eab17d5dfd326d0 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 10 Dec 2025 14:07:54 +0100 Subject: [PATCH 22/69] Implement data checks for Area tab inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add validation module ensuring all Area tab fields (Soil N, Soil C, Soil clay, Bulk density, Soil depth, ET₀, and land conversions) are non-negative (≥ 0) with real-time error messaging. - Correct ET₀ label formatting from ETO to proper subscript. --- R/30_mod_scenario_server.R | 3 + R/30_mod_scenario_ui.R | 8 +- R/30_mod_scenario_validation.R | 232 +++++++++++++++++++++++++++++++++ 3 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 R/30_mod_scenario_validation.R diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index c6b8e61..aaa9615 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -69,6 +69,9 @@ scenario_server <- function( shinyjs::html(id = "last_update_date", html = last_modification_date) }) + # ----- Validation Module ---------------------------------------------------- + validation_server("validation", input = input, parent_session = session) + # ----- * Show Scenario Editor Section after selection ---------------------- observeEvent(input$json_file_name, { shinyjs::show(id = "scenario_editor_section") diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index 9ae168d..aca94ed 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -586,6 +586,12 @@ scenario_ui <- function(id) { class = "carousel-item", div(class = "p-5 bg-light", h2("Area", class = "tabsH2"), + shinyjs::hidden( + div( + id = ns("alert_message_area_inputs"), + class = "alert alert-danger" + ) + ), h2("Annual precipitation (mm/yr)", class = "mb-3"), tags$div( class = "mb-4", @@ -670,7 +676,7 @@ scenario_ui <- function(id) { value = 0 ) ), - h2("ETO (mm/year)", class = "mb-3"), + h2("ET₀ (mm/year)", class = "mb-3"), tags$div( class = "mb-5", numericInput( diff --git a/R/30_mod_scenario_validation.R b/R/30_mod_scenario_validation.R new file mode 100644 index 0000000..fa38790 --- /dev/null +++ b/R/30_mod_scenario_validation.R @@ -0,0 +1,232 @@ +# ------ VALIDATION MODULE ----------------------------------------------------- +#' +#' Real-time validation for scenario input fields. Validates user inputs against +#' predefined rules and displays formatted error messages. +#' +#' Usage: Call \code{validation_server()} in the main server function. + +# ------ VALIDATION RULES & ERROR MESSAGES ----------------------------------------------------- + +# Lookup table for validation rule functions +# Each function takes a numeric value and returns TRUE if valid, FALSE otherwise +validation_conditions <- list( + # Validates value is zero or greater + non_negative = function(x) x >= 0, + # Validates value is strictly greater than zero + positive = function(x) x > 0, + # Validates value is a proportion (0-1 inclusive) + between_0_1 = function(x) x >= 0 && x <= 1 +) + +# Error message templates corresponding to each validation rule +# These are displayed to users when validation fails +error_message_templates <- list( + non_negative = "It must be ≥ 0!", + positive = "It must be > 0!", + between_0_1 = "It must be ≥ 0 and ≤ 1!" +) + +# Configuration for area input fields +# Each field specifies its input ID, display label, and validation rule +area_fields_config <- list( + list( + id = "soil_n", + label = "Soil N (g/kg)", + validator = "non_negative" + ), + list( + id = "soil_c", + label = "Soil C (g/kg)", + validator = "non_negative" + ), + list( + id = "soil_clay", + label = "Soil clay (%)", + validator = "non_negative" + ), + list( + id = "soil_bulk", + label = "Bulk density (g/cm³)", + validator = "non_negative" + ), + list( + id = "soil_depth", + label = "Soil depth (m)", + validator = "non_negative" + ), + list( + id = "et", + label = "ET₀ (mm/year)", + validator = "non_negative" + ), + list( + id = "grassland_toarable", + label = "Conversion Grassland to arable land (ha)", + validator = "non_negative" + ), + list( + id = "arable_tograssland", + label = "Conversion Arable land to grassland (ha)", + validator = "non_negative" + ) +) + +# ------ VALIDATION REGISTRY ----------------------------------------------------- + +# Central registry organizing validation configurations by input group +# Each entry contains field configurations and the associated alert element ID +validation_registry <- list( + area_inputs = list( + fields = area_fields_config, + alert_id = "alert_message_area_inputs" + ) +) + +# ------ CORE VALIDATION LOGIC ----------------------------------------------------- + +#' Execute validation logic and synchronize UI state +#' +#' Validates all provided fields against their validation rules and displays +#' error messages in the UI alert element when validation fails. +#' +#' @param fields List of field objects, each containing: +#' - id: Input field identifier +#' - label: Human-readable field name +#' - value: Current field value +#' - validate_fn: Validation function +#' - error_msg: Error message template +#' @param alert_id Character string specifying the UI element ID for displaying +#' validation messages +#' +#' @return Invisible logical: TRUE if validation errors found, FALSE otherwise +#' +#' @details +#' The function performs the following steps: +#' 1. Hides the alert element initially +#' 2. Validates each field with a non-null, non-NA value +#' 3. Collects error messages for invalid fields +#' 4. Displays combined error messages in the alert element if any errors found +#' 5. Returns TRUE if errors found, FALSE if all fields valid +execute_validation <- function(fields, alert_id) { + # Initially hide the alert message element + shinyjs::hide(id = alert_id, asis = TRUE) + + # Initialize empty vector to collect validation error messages + validation_error_messages <- character(0) + + # Iterate through each field configuration + for (field in fields) { + # Only validate fields with non-null and non-NA values + # Empty or NA values are considered acceptable and skip validation + if (!is.null(field$value) && !is.na(field$value)) { + # Apply the validation function to the field's current value + is_valid <- field$validate_fn(field$value) + + # If validation fails, construct and collect error message + if (!is_valid) { + formatted_error_message <- sprintf( + " The value in '%s' is %s. %s", + field$label, + field$value, + field$error_msg + ) + validation_error_messages <- c(validation_error_messages, formatted_error_message) + } + } + } + + # If any validation errors were found, display them + if (length(validation_error_messages) > 0) { + # Combine all error messages with line breaks for display + combined_error_html <- paste(validation_error_messages, collapse = "
") + + # Update the alert element with the combined error messages + shinyjs::html(id = alert_id, html = combined_error_html, asis = TRUE) + + # Make the alert element visible + shinyjs::show(id = alert_id, asis = TRUE) + + return(invisible(TRUE)) + } + + # No validation errors found + return(invisible(FALSE)) +} + +# ------ SERVER MODULE ----------------------------------------------------- + +#' Validation Server Module +#' +#' Shiny server module that provides reactive validation for input fields. +#' Automatically validates inputs when they change and displays error messages. +#' +#' @param id Character string specifying the module namespace ID +#' @param input Shiny input object from the parent scope +#' @param parent_session Shiny session object from the parent scope, used for +#' proper namespacing of alert elements +#' +#' @return A Shiny module server function +#' +#' @details +#' This module monitors specified input fields and triggers validation +#' whenever any field value changes. It uses the validation registry to +#' determine which fields to monitor and which rules to apply. +#' +#' @examples +#' # In server.R: +#' validation_server("validation", input, session) +validation_server <- function(id, input, parent_session) { + moduleServer(id, function(input_module, output, session) { + #' Prepare field configurations with current input values + #' + #' Enriches field configuration with current input values and resolves + #' validator function references to actual functions. + #' + #' @param field_config_list List of field configuration objects + #' + #' @return List of enriched field objects ready for validation + prepare_fields <- function(field_config_list) { + lapply(field_config_list, function(field_config) { + # Create a copy of the field configuration + enriched_field <- field_config + + # Add the current value from the input object + enriched_field$value <- input[[field_config$id]] + + # Resolve validator name to actual validation function and error message + if (!is.null(field_config$validator)) { + enriched_field$validate_fn <- validation_conditions[[field_config$validator]] + enriched_field$error_msg <- error_message_templates[[field_config$validator]] + } + + return(enriched_field) + }) + } + + # Retrieve validation configuration for area inputs + area_validation_config <- validation_registry$area_inputs + + # Create a reactive trigger that fires when any area input field changes + # This reactive returns a list of all field values, causing it to + # re-execute whenever any field in the list changes + area_inputs_trigger <- reactive({ + lapply(area_validation_config$fields, function(field_config) { + input[[field_config$id]] + }) + }) + + # Observe the reactive trigger and execute validation when it fires + observeEvent(area_inputs_trigger(), { + # Prepare fields with current values and validation functions + prepared_fields <- prepare_fields( + area_validation_config$fields + ) + + # Execute validation and update UI + execute_validation( + fields = prepared_fields, + alert_id = parent_session$ns(area_validation_config$alert_id) + ) + }) + }) +} From 9a5672ffdc0e8ab7bc914e14ee1080bda6591579 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 10 Dec 2025 14:29:14 +0100 Subject: [PATCH 23/69] Implement data checks for waste tab Validates Waste input fields (milk and meat waste percentages along production, distribution, processing, and consumption) are between 0-100 with real-time error messaging. Extends validation module with percentage validator and adds `waste_inputs` configuration to validation registry. --- R/30_mod_scenario_ui.R | 6 +++ R/30_mod_scenario_validation.R | 78 ++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index aca94ed..297a088 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -438,6 +438,12 @@ scenario_ui <- function(id) { class = "carousel-item", div(class = "p-5 bg-light", h2("Waste of milk and meat", class = "tabsH2"), + shinyjs::hidden( + div( + id = ns("alert_message_waste_inputs"), + class = "alert alert-danger" + ) + ), fluidRow( column( width = 6, diff --git a/R/30_mod_scenario_validation.R b/R/30_mod_scenario_validation.R index fa38790..0fe92a7 100644 --- a/R/30_mod_scenario_validation.R +++ b/R/30_mod_scenario_validation.R @@ -14,6 +14,8 @@ validation_conditions <- list( non_negative = function(x) x >= 0, # Validates value is strictly greater than zero positive = function(x) x > 0, + # Validates value is a percentage (0-100 inclusive) + percentage = function(x) x >= 0 && x <= 100, # Validates value is a proportion (0-1 inclusive) between_0_1 = function(x) x >= 0 && x <= 1 ) @@ -23,6 +25,7 @@ validation_conditions <- list( error_message_templates <- list( non_negative = "It must be ≥ 0!", positive = "It must be > 0!", + percentage = "It must be ≥ 0 and ≤ 100!", between_0_1 = "It must be ≥ 0 and ≤ 1!" ) @@ -71,6 +74,51 @@ area_fields_config <- list( ) ) +# Configuration for waste input fields (percentages) +# Each field specifies its input ID, display label, and validation rule +waste_fields_config <- list( + list( + id = "waste_production_milk", + label = "Production (milk)", + validator = "percentage" + ), + list( + id = "waste_distribution_milk", + label = "Distribution (milk)", + validator = "percentage" + ), + list( + id = "waste_processing_milk", + label = "Processing (milk)", + validator = "percentage" + ), + list( + id = "waste_consume_milk", + label = "Consumption (milk)", + validator = "percentage" + ), + list( + id = "waste_production_meat", + label = "Production (meat)", + validator = "percentage" + ), + list( + id = "waste_distribution_meat", + label = "Distribution (meat)", + validator = "percentage" + ), + list( + id = "waste_processing_meat", + label = "Processing (meat)", + validator = "percentage" + ), + list( + id = "waste_consume_meat", + label = "Consumption (meat)", + validator = "percentage" + ) +) + # ------ VALIDATION REGISTRY ----------------------------------------------------- # Central registry organizing validation configurations by input group @@ -79,6 +127,10 @@ validation_registry <- list( area_inputs = list( fields = area_fields_config, alert_id = "alert_message_area_inputs" + ), + waste_inputs = list( + fields = waste_fields_config, + alert_id = "alert_message_waste_inputs" ) ) @@ -228,5 +280,31 @@ validation_server <- function(id, input, parent_session) { alert_id = parent_session$ns(area_validation_config$alert_id) ) }) + + # Retrieve validation configuration for waste inputs + waste_validation_config <- validation_registry$waste_inputs + + # Create a reactive trigger that fires when any waste input field changes + # This reactive returns a list of all field values, causing it to + # re-execute whenever any field in the list changes + waste_inputs_trigger <- reactive({ + lapply(waste_validation_config$fields, function(field_config) { + input[[field_config$id]] + }) + }) + + # Observe the reactive trigger and execute validation when it fires + observeEvent(waste_inputs_trigger(), { + # Prepare fields with current values and validation functions + prepared_fields <- prepare_fields( + waste_validation_config$fields + ) + + # Execute validation and update UI + execute_validation( + fields = prepared_fields, + alert_id = parent_session$ns(waste_validation_config$alert_id) + ) + }) }) } From 147f536b5efbc29180ddc298f91c43e864d50f8b Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 10 Dec 2025 14:40:44 +0100 Subject: [PATCH 24/69] Sort validation errors by field order Displays validation errors in config order instead of random order for better readability and predictable error presentation. --- R/30_mod_scenario_validation.R | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/R/30_mod_scenario_validation.R b/R/30_mod_scenario_validation.R index 0fe92a7..bfd4c5d 100644 --- a/R/30_mod_scenario_validation.R +++ b/R/30_mod_scenario_validation.R @@ -163,18 +163,20 @@ execute_validation <- function(fields, alert_id) { # Initially hide the alert message element shinyjs::hide(id = alert_id, asis = TRUE) - # Initialize empty vector to collect validation error messages - validation_error_messages <- character(0) + # Initialize empty list to collect validation errors with field information + validation_errors <- list() + + # Iterate through each field configuration with index + for (i in seq_along(fields)) { + field <- fields[[i]] - # Iterate through each field configuration - for (field in fields) { # Only validate fields with non-null and non-NA values # Empty or NA values are considered acceptable and skip validation if (!is.null(field$value) && !is.na(field$value)) { # Apply the validation function to the field's current value is_valid <- field$validate_fn(field$value) - # If validation fails, construct and collect error message + # If validation fails, construct and collect error with field index if (!is_valid) { formatted_error_message <- sprintf( " The value in '%s' is %s. %s", @@ -182,13 +184,24 @@ execute_validation <- function(fields, alert_id) { field$value, field$error_msg ) - validation_error_messages <- c(validation_error_messages, formatted_error_message) + + # Store error with field index for sorting + validation_errors[[length(validation_errors) + 1]] <- list( + index = i, + message = formatted_error_message + ) } } } - # If any validation errors were found, display them - if (length(validation_error_messages) > 0) { + # If any validation errors were found, sort and display them + if (length(validation_errors) > 0) { + # Sort errors by field index to maintain config order + sorted_errors <- validation_errors[order(sapply(validation_errors, function(e) e$index))] + + # Extract just the messages + validation_error_messages <- sapply(sorted_errors, function(e) e$message) + # Combine all error messages with line breaks for display combined_error_html <- paste(validation_error_messages, collapse = "
") From b919d89e3b2844a4d84b29c92e8b82377c228776 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 10 Dec 2025 14:55:52 +0100 Subject: [PATCH 25/69] Implement data checks for Manure/Fertilizer tab inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Validates that all 4 manure/fertilizer purchase fields are non-negative (≥ 0) with real-time error messaging. --- R/30_mod_scenario_ui.R | 6 ++++ R/30_mod_scenario_validation.R | 55 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index 297a088..03b32ae 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -368,6 +368,12 @@ scenario_ui <- function(id) { div(class = "p-5 bg-light", h2("Manure/Fertilizer bought", class = "tabsH2"), h2("Manure", class = "mb-4"), + shinyjs::hidden( + div( + id = ns("alert_message_manure_inputs"), + class = "alert alert-danger" + ) + ), h2("Annual purchase of manure (kg N):", class = "mb-3"), tags$div( class = "mb-4", diff --git a/R/30_mod_scenario_validation.R b/R/30_mod_scenario_validation.R index bfd4c5d..e365bc6 100644 --- a/R/30_mod_scenario_validation.R +++ b/R/30_mod_scenario_validation.R @@ -119,6 +119,31 @@ waste_fields_config <- list( ) ) +# Configuration for manure/fertilizer input fields +# Each field specifies its input ID, display label, and validation rule +manure_fields_config <- list( + list( + id = "purchased_manure", + label = "Annual purchase of manure (kg N)", + validator = "non_negative" + ), + list( + id = "purchased_compost", + label = "Annual purchase of compost (kg N)", + validator = "non_negative" + ), + list( + id = "purchased_organic_n", + label = "Annual purchase of other organic N additions (kg N)", + validator = "non_negative" + ), + list( + id = "purchased_bedding", + label = "Annual purchase of bedding materials (kg N)", + validator = "non_negative" + ) +) + # ------ VALIDATION REGISTRY ----------------------------------------------------- # Central registry organizing validation configurations by input group @@ -131,6 +156,10 @@ validation_registry <- list( waste_inputs = list( fields = waste_fields_config, alert_id = "alert_message_waste_inputs" + ), + manure_inputs = list( + fields = manure_fields_config, + alert_id = "alert_message_manure_inputs" ) ) @@ -319,5 +348,31 @@ validation_server <- function(id, input, parent_session) { alert_id = parent_session$ns(waste_validation_config$alert_id) ) }) + + # Retrieve validation configuration for manure inputs + manure_validation_config <- validation_registry$manure_inputs + + # Create a reactive trigger that fires when any manure input field changes + # This reactive returns a list of all field values, causing it to + # re-execute whenever any field in the list changes + manure_inputs_trigger <- reactive({ + lapply(manure_validation_config$fields, function(field_config) { + input[[field_config$id]] + }) + }) + + # Observe the reactive trigger and execute validation when it fires + observeEvent(manure_inputs_trigger(), { + # Prepare fields with current values and validation functions + prepared_fields <- prepare_fields( + manure_validation_config$fields + ) + + # Execute validation and update UI + execute_validation( + fields = prepared_fields, + alert_id = parent_session$ns(manure_validation_config$alert_id) + ) + }) }) } From 7be55fadf1045432cf967e7efe03f442c048e49f Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 10 Dec 2025 15:07:17 +0100 Subject: [PATCH 26/69] Fix input type for Manure/Fertilizer fields Changes `textInput` to `numericInput` for proper numeric validation of manure/fertilizer purchase inputs. --- R/30_mod_scenario_ui.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index 03b32ae..b267202 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -377,7 +377,7 @@ scenario_ui <- function(id) { h2("Annual purchase of manure (kg N):", class = "mb-3"), tags$div( class = "mb-4", - textInput( + numericInput( inputId = ns("purchased_manure"), label = NULL, value = 0 @@ -386,7 +386,7 @@ scenario_ui <- function(id) { h2("Annual purchase of compost (kg N):", class = "mb-3"), tags$div( class = "mb-4", - textInput( + numericInput( inputId = ns("purchased_compost"), label = NULL, value = 0 @@ -395,7 +395,7 @@ scenario_ui <- function(id) { h2("Annual purchase of other organic N additions (kg N):", class = "mb-3"), tags$div( class = "mb-4", - textInput( + numericInput( inputId = ns("purchased_organic_n"), label = NULL, value = 0 @@ -404,7 +404,7 @@ scenario_ui <- function(id) { h2("Annual purchase of bedding materials (kg N):", class = "mb-3"), tags$div( class = "mb-5", - textInput( + numericInput( inputId = ns("purchased_bedding"), label = NULL, value = 0 From f9cc79609f728b0dca56ae93a0dfd5b7398f41c8 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Thu, 11 Dec 2025 01:40:32 +0100 Subject: [PATCH 27/69] Restructure validation module documentation Enhanced module header, renamed validation_server() to farm_validation_server() and organized validation systems by target tab scalability purpse. --- R/30_mod_scenario_server.R | 2 +- R/30_mod_scenario_validation.R | 60 +++++++++++++++------------------- 2 files changed, 28 insertions(+), 34 deletions(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index aaa9615..e8b5c3c 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -70,7 +70,7 @@ scenario_server <- function( }) # ----- Validation Module ---------------------------------------------------- - validation_server("validation", input = input, parent_session = session) + farm_validation_server("validation", input = input, parent_session = session) # ----- * Show Scenario Editor Section after selection ---------------------- observeEvent(input$json_file_name, { diff --git a/R/30_mod_scenario_validation.R b/R/30_mod_scenario_validation.R index e365bc6..37dfe5f 100644 --- a/R/30_mod_scenario_validation.R +++ b/R/30_mod_scenario_validation.R @@ -1,11 +1,19 @@ -# ------ VALIDATION MODULE ----------------------------------------------------- +# ------ VALIDATION MODULE --------------------------------------------------- #' -#' Real-time validation for scenario input fields. Validates user inputs against -#' predefined rules and displays formatted error messages. +#' Real-time data validation engine providing immediate feedback on user inputs +#' across multiple application tabs. Implements rule-based validation logic with +#' dynamic error messaging to ensure data integrity and guide users toward +#' correct input values. #' -#' Usage: Call \code{validation_server()} in the main server function. +#' VALIDATION SYSTEMS: +#' +#' 1. FARM TAB: farm_validation_server() +#' Field-level validation for Area, Waste, and Manure inputs +#' Rules: non-negative, positive, percentage, between 0-1 + +# ------ SECTION 1: FARM TAB VALIDATION -------------------------------------- -# ------ VALIDATION RULES & ERROR MESSAGES ----------------------------------------------------- +# VALIDATION RULES & ERROR MESSAGES ------------------------------------------ # Lookup table for validation rule functions # Each function takes a numeric value and returns TRUE if valid, FALSE otherwise @@ -144,7 +152,7 @@ manure_fields_config <- list( ) ) -# ------ VALIDATION REGISTRY ----------------------------------------------------- +# ------ VALIDATION REGISTRY ------------------------------------------------- # Central registry organizing validation configurations by input group # Each entry contains field configurations and the associated alert element ID @@ -163,7 +171,7 @@ validation_registry <- list( ) ) -# ------ CORE VALIDATION LOGIC ----------------------------------------------------- +# ------ CORE VALIDATION LOGIC ----------------------------------------------- #' Execute validation logic and synchronize UI state #' @@ -180,14 +188,7 @@ validation_registry <- list( #' validation messages #' #' @return Invisible logical: TRUE if validation errors found, FALSE otherwise -#' -#' @details -#' The function performs the following steps: -#' 1. Hides the alert element initially -#' 2. Validates each field with a non-null, non-NA value -#' 3. Collects error messages for invalid fields -#' 4. Displays combined error messages in the alert element if any errors found -#' 5. Returns TRUE if errors found, FALSE if all fields valid + execute_validation <- function(fields, alert_id) { # Initially hide the alert message element shinyjs::hide(id = alert_id, asis = TRUE) @@ -247,29 +248,22 @@ execute_validation <- function(fields, alert_id) { return(invisible(FALSE)) } -# ------ SERVER MODULE ----------------------------------------------------- +# ------ FARM TAB VALIDATION SERVER MODULE ----------------------------------- -#' Validation Server Module -#' -#' Shiny server module that provides reactive validation for input fields. -#' Automatically validates inputs when they change and displays error messages. +#' Farm Tab Validation Server Module #' -#' @param id Character string specifying the module namespace ID -#' @param input Shiny input object from the parent scope -#' @param parent_session Shiny session object from the parent scope, used for -#' proper namespacing of alert elements +#' TARGET TAB: Farm #' -#' @return A Shiny module server function +#' Validates Area, Waste, and Manure input fields. Displays errors in +#' tab-specific alert elements. #' -#' @details -#' This module monitors specified input fields and triggers validation -#' whenever any field value changes. It uses the validation registry to -#' determine which fields to monitor and which rules to apply. +#' @param id Module namespace ID +#' @param input Shiny input object from parent scope +#' @param parent_session Shiny session object from parent scope #' -#' @examples -#' # In server.R: -#' validation_server("validation", input, session) -validation_server <- function(id, input, parent_session) { +#' @return Shiny module server function + +farm_validation_server <- function(id, input, parent_session) { moduleServer(id, function(input_module, output, session) { #' Prepare field configurations with current input values #' From ec3b7ad8bf44027447a00091552dbfeade5f50af Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Thu, 11 Dec 2025 01:53:37 +0100 Subject: [PATCH 28/69] Add live validation for Livestock Feeding tab Added `livestock_feeding_validation_server()` to validate allocation tables in real-time. Ensures each livestock column sums to exactly 100% per season. --- R/30_mod_scenario_server.R | 8 ++ R/30_mod_scenario_ui.R | 13 ++- R/30_mod_scenario_validation.R | 162 +++++++++++++++++++++++++++++++++ 3 files changed, 180 insertions(+), 3 deletions(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index e8b5c3c..8859789 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -2285,6 +2285,14 @@ scenario_server <- function( # Reactive value to store the data frames for each season basket_data <- reactiveValues() + # Initialize livestock feeding validation + livestock_feeding_validation_server( + id = "validation", + basket_data = basket_data, + seasons = seasons, + parent_session = session + ) + # UI output for the Season/Feed Allocation tab output$livestock_feeding_ui <- renderUI({ tags$div( diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index b267202..8a6524d 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -1098,9 +1098,16 @@ scenario_ui <- function(id) { tabPanel( "Livestock Feeding", div(class = "p-5 bg-light", - uiOutput(ns("livestock_feeding_ui")), - h2("Allocation in percentage of a feed to livestock by season", class = "mb-5"), - uiOutput(ns("livestock_feeding_table")) + uiOutput(ns("livestock_feeding_ui")), + h2("Allocation in percentage of a feed to livestock by season", class = "mb-5"), + shinyjs::hidden( + div( + id = ns("alert_livestock_feeding_global"), + class = "alert alert-danger", + style = "margin-bottom: 20px;" + ) + ), + uiOutput(ns("livestock_feeding_table")) ) ) ) diff --git a/R/30_mod_scenario_validation.R b/R/30_mod_scenario_validation.R index 37dfe5f..a27d65f 100644 --- a/R/30_mod_scenario_validation.R +++ b/R/30_mod_scenario_validation.R @@ -10,6 +10,10 @@ #' 1. FARM TAB: farm_validation_server() #' Field-level validation for Area, Waste, and Manure inputs #' Rules: non-negative, positive, percentage, between 0-1 +#' +#' 2. LIVESTOCK FEEDING TAB: livestock_feeding_validation_server() +#' Table-level validation for allocation percentages +#' Rule: Each livestock column must sum to exactly 100% per season # ------ SECTION 1: FARM TAB VALIDATION -------------------------------------- @@ -370,3 +374,161 @@ farm_validation_server <- function(id, input, parent_session) { }) }) } + +# ------ SECTION 2: LIVESTOCK FEEDING TAB VALIDATION ------------------------- + +# ------ LIVESTOCK FEEDING TABLE VALIDATION ---------------------------------- + +#' Validate Livestock Feeding Allocation Percentages +#' +#' Validates that allocation percentages for each livestock type sum to 100% +#' per season. This is a table-based validation where each column (livestock) +#' must sum to exactly 100 across all feed rows. +#' +#' @param season_data Data frame containing allocation percentages for one season +#' Rows represent feeds, columns represent livestock types +#' @param season_name Character string specifying the season name for error messages +#' +#' @return List containing: +#' - has_errors: Logical, TRUE if any column sum is not 100 +#' - error_messages: Character vector of formatted error messages + +validate_season_allocations <- function(season_data, season_name) { + # Initialize result structure + validation_result <- list( + has_errors = FALSE, + error_messages = character(0) + ) + + # Return early if data is NULL or empty + if (is.null(season_data) || nrow(season_data) == 0 || ncol(season_data) == 0) { + return(validation_result) + } + + # Exclude the "Total" row from validation (it's auto-calculated) + # We only validate the actual allocation rows + data_without_total <- season_data[rownames(season_data) != "Total", , drop = FALSE] + + # Return early if no data rows to validate + if (nrow(data_without_total) == 0) { + return(validation_result) + } + + # Calculate column sums for each livestock type + column_sums <- colSums(data_without_total, na.rm = TRUE) + + # Identify columns where sum is not 100 (with small tolerance for floating point) + # Using tolerance of 0.01 to handle floating point arithmetic issues + tolerance <- 0.01 + invalid_columns <- which(abs(column_sums - 100) > tolerance) + + # If any invalid columns found, generate error messages + if (length(invalid_columns) > 0) { + validation_result$has_errors <- TRUE + + # Generate formatted error message for each invalid column + validation_result$error_messages <- sapply(invalid_columns, function(col_index) { + livestock_name <- names(column_sums)[col_index] + actual_sum <- round(column_sums[col_index], 2) + + sprintf( + paste0( + " For season '%s', ", + "the total of feed allocations in '%s' ", + "is %s%%. It must equal 100%%." + ), + season_name, + livestock_name, + actual_sum + ) + }) + } + + return(validation_result) +} + +#' Livestock Feeding Tab Validation Server Module +#' +#' TARGET TAB: Livestock Feeding +#' +#' Validates allocation tables: each livestock column must sum to 100% per season. +#' Uses single observer pattern to prevent observer accumulation. +#' +#' @param id Module namespace ID +#' @param basket_data ReactiveValues containing allocation data per season +#' @param seasons Reactive data frame with season information +#' @param parent_session Shiny session object from parent scope +#' +#' @return Shiny module server function + + +livestock_feeding_validation_server <- function( + id, + basket_data, + seasons, + parent_session +) { + moduleServer(id, function(input, output, session) { + # Reactive values to track validation errors for each season + # Using reactiveValues() allows direct assignment + season_errors <- reactiveValues() + + # Single observer that validates all seasons when any data changes + observeEvent(c(seasons(), reactiveValuesToList(basket_data)), { + # Get current seasons + current_seasons <- if (!is.null(seasons()) && nrow(seasons()) > 0) { + seasons()$Season + } else { + character(0) + } + + # Clean up errors for deleted seasons + all_error_keys <- names(reactiveValuesToList(season_errors)) + deleted_keys <- setdiff(all_error_keys, current_seasons) + for (key in deleted_keys) { + season_errors[[key]] <- NULL + } + + # Validate each existing season + for (season in current_seasons) { + season_data <- basket_data[[season]] + + # Skip if no valid data + if (is.null(season_data) || !is.data.frame(season_data) || nrow(season_data) == 0) { + next + } + + # Validate and store errors + validation_result <- validate_season_allocations( + season_data = season_data, + season_name = season + ) + season_errors[[season]] <- if (validation_result$has_errors) { + validation_result$error_messages + } else { + NULL + } + } + }, ignoreNULL = FALSE, ignoreInit = FALSE) + + # Observer to update the global alert based on all validation errors + observe({ + global_alert_id <- parent_session$ns("alert_livestock_feeding_global") + + # Get all error messages + all_errors <- reactiveValuesToList(season_errors) + non_null_errors <- all_errors[!sapply(all_errors, is.null)] + messages <- unlist(non_null_errors) + + if (length(messages) > 0) { + # Show alert with combined errors + combined_html <- paste(messages, collapse = "
") + shinyjs::html(id = global_alert_id, html = combined_html, asis = TRUE) + shinyjs::show(id = global_alert_id, asis = TRUE) + } else { + # Hide alert when no errors + shinyjs::hide(id = global_alert_id, asis = TRUE) + } + }) + }) +} From 945951ce2393976063100e0462a512b7d18fbbca Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 21 Dec 2025 19:12:00 +0100 Subject: [PATCH 29/69] Restrict unselected fertilizers in crop inputs Prevent users from editing fertilizer columns in the Crop Inputs table that were not enabled in the Farm tab. Implement a whitelist approach to dynamically block inactive columns using specific column indices. --- R/30_mod_scenario_init.R | 14 ++++++++++++++ R/30_mod_scenario_server.R | 30 ++++++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/R/30_mod_scenario_init.R b/R/30_mod_scenario_init.R index 9e3e60b..01ca787 100644 --- a/R/30_mod_scenario_init.R +++ b/R/30_mod_scenario_init.R @@ -302,6 +302,20 @@ fertilizer_percentages <- c( "Ammonia" = 82 ) +# Fertilizer name to column mapping -------------------------------------------- +# Maps fertilizer names from the 'Farm > Fertilizer' tab to their corresponding +# column names in the 'Crop Inputs' dataframe. Used to dynamically identify +# and control column editability. +fertilizer_column_mapping <- c( + "Urea" = "urea", + "NPK" = "npk", + "DAP" = "dap", + "Ammonium nitrate" = "ammonium_nitrate", + "Ammonium sulfate" = "ammonium_sulfate", + "N solutions" = "n_solutions", + "Ammonia" = "ammonia" +) + # Water regime SelectInput options --------------------------------------------- water_regime_options <- c( "Non-flooded pre-season <180 days( often in double cropping of rice)", diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index c6b8e61..e9fbc9f 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1813,13 +1813,28 @@ scenario_server <- function( # Render the crop inputs table output$crop_inputs_table <- renderDT({ + req(fertilizers()) + + # Identifies all available fertilizer columns based on the mapping + all_fertilizer_cols <- unname(fertilizer_column_mapping) + all_col_names <- colnames(crop_inputs_data()) + fertilizer_col_indices <- which(all_col_names %in% all_fertilizer_cols) + + # Identifies currently active fertilizer columns based on user selection + active_col_names <- fertilizer_column_mapping[fertilizers()$fertilizer_desc] + active_col_indices <- which(all_col_names %in% active_col_names) + + # Calculates indices of inactive fertilizer columns to disable + blocked_col_indices <- setdiff(fertilizer_col_indices, active_col_indices) + + # Adjusts indices to 0-based for DataTables (JavaScript) compatibility + blocked_js_indices <- blocked_col_indices - 1 + datatable( crop_inputs_data(), colnames = crop_inputs_table_colnames, editable = list( - target = "cell", - # Prevent editing of the first column (check boxes for delete rows) - disable = list(columns = 0) + target = "cell" ), selection = "none", rownames = FALSE, @@ -1831,14 +1846,21 @@ scenario_server <- function( paging = FALSE, fixedColumns = list(leftColumns = 1), columnDefs = list( + # Visually block Feed (0) and Crop (1) columns from double-click interaction list( targets = get_column_indices(crop_inputs_data(), c("Feed", "Crop")) - 1, createdCell = JS(disable_all_rows_edit_js()), searchable = FALSE + ), + # Applies visual 'not-allowed' cursor to inactive fertilizer columns + list( + targets = blocked_js_indices, + createdCell = JS(disable_and_add_cursor_js()), + searchable = FALSE ) ) ) - ) %>% + ) %>% formatStyle( columns = 3:ncol(crop_inputs_data()), backgroundColor = "#a9d18e" From 58d5fbfc8b77b52cfa05583a2120a393c2b74668 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 21 Dec 2025 19:16:15 +0100 Subject: [PATCH 30/69] Add warning on missing fertilizers in Crop Inputs Display a warning alert above the Crop Inputs table when no fertilizers have been selected in the Farm tab. --- R/30_mod_scenario_server.R | 7 +++++++ R/30_mod_scenario_ui.R | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index e9fbc9f..ea8865c 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1815,6 +1815,13 @@ scenario_server <- function( output$crop_inputs_table <- renderDT({ req(fertilizers()) + # Observe fertilizers to show/hide the warning message + if (nrow(fertilizers()) == 0) { + shinyjs::show("alert_no_fertilizers") + } else { + shinyjs::hide("alert_no_fertilizers") + } + # Identifies all available fertilizer columns based on the mapping all_fertilizer_cols <- unname(fertilizer_column_mapping) all_col_names <- colnames(crop_inputs_data()) diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index ccc9e4d..39d97f0 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -1073,6 +1073,18 @@ scenario_ui <- function(id) { ) ) ), + # Displays a warning if no fertilizers are selected + # controlled via shinyjs in the server + shinyjs::hidden( + div( + id = ns("alert_no_fertilizers"), + class = "alert alert-danger", + HTML( + "No fertilizers have been selected in the 'Farm > Fertilizer' tab. + Please add at least one fertilizer to enable editing." + ) + ) + ), div(DTOutput(ns("crop_inputs_table")), class = "without_checkbox"), br() ) From 957baff8b1719bfeeba6c9739bd394b529558b85 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 21 Dec 2025 23:09:44 +0100 Subject: [PATCH 31/69] Remove custom pagination logic - Remove all pagination control observers - Update renderDT to display full table without paging - Adapt row operations (edit/delete/add/clone) for full table display --- R/40_mod_params_db_server.R | 214 +++++------------------------------- R/40_mod_params_db_ui.R | 14 +-- 2 files changed, 28 insertions(+), 200 deletions(-) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index ad9362b..b124ba8 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -5,14 +5,6 @@ params_db_server <- function( ns <- session$ns jns <- function(x) paste0("#", ns(x)) - # ------ PAGINATION STATE MANAGEMENT ----------------------------------------- - # Tracks current page number per parameter table for consistent navigation. - pagination_state <- reactiveValues() - rows_per_page <- 10 - for (tbl in parameters_db_names) { - pagination_state[[paste0(tbl, "_page")]] <- 1 - } - # ------ * Initialize the parameters database inputs ------------------------- observe({ cat(file = stderr(), "40 - Initializing the parameters database inputs...\n") @@ -627,16 +619,9 @@ params_db_server <- function( ) } - page_var <- paste0(name, "_page") - current_page <- pagination_state[[page_var]] - # Determine visible rows based on current page (e.g., page 2 → rows 11–20) - start_row <- (current_page - 1) * rows_per_page + 1 - end_row <- min(start_row + rows_per_page - 1, nrow(data_table)) - paged_data <- data_table[start_row:end_row, , drop = FALSE] - - # Render paged datatable + # Render datatable with all rows datatable( - data = paged_data, + data = data_table, editable = editablity, rownames = FALSE, escape = FALSE, @@ -664,138 +649,6 @@ params_db_server <- function( }, server = FALSE) }) - # ------ PAGINATION CONTROLS (NEXT, PREVIOUS, RANGE LABEL) ------------------- - # Handles navigation across table pages and displays visible entry range. - lapply(parameters_db_names, function(table_name) { - # Move forward unless already on the last page. - observeEvent(input[[paste0("next_page_", table_name)]], { - total_rows <- nrow(session$userData$parameters_db[[table_name]]) - total_pages <- ceiling(total_rows / rows_per_page) - current_page <- pagination_state[[paste0(table_name, "_page")]] - - if (current_page < total_pages) { - pagination_state[[paste0(table_name, "_page")]] <- current_page + 1 - } - }) - - # Move backward unless already on the first page. - observeEvent(input[[paste0("prev_page_", table_name)]], { - current_page <- pagination_state[[paste0(table_name, "_page")]] - if (current_page > 1) { - pagination_state[[paste0(table_name, "_page")]] <- current_page - 1 - } - }) - - # Example: “Showing 11 – 20 of 47 total entries”. - output[[paste0("entries_info_", table_name)]] <- renderText({ - total_entries <- nrow(session$userData$parameters_db[[table_name]]) - if (total_entries == 0) return("No entries") - - current_page <- pagination_state[[paste0(table_name, "_page")]] - first_entry <- (current_page - 1) * rows_per_page + 1 - last_entry <- min(first_entry + rows_per_page - 1, total_entries) - - sprintf("Showing %d – %d of %d total entries", - first_entry, last_entry, total_entries) - }) - }) - - # ------ Compact pagination UI with ellipsis and error guard ----------------- - lapply(parameters_db_names, function(name) { - - output[[paste0("page_buttons_", name)]] <- renderUI({ - # Skip rendering if table not yet initialized - if (is.null(session$userData$parameters_db[[name]])) return(NULL) - - total_rows <- nrow(session$userData$parameters_db[[name]]) - if (is.na(total_rows) || total_rows == 0) return(NULL) - - total_pages <- ceiling(total_rows / rows_per_page) - current_page <- pagination_state[[paste0(name, "_page")]] - if (total_pages <= 1) return(NULL) - - # Determine visible pages (first 2, last 2, ±2 around current) - visible_pages <- unique(sort(c( - 1, 2, - seq(current_page - 2, current_page + 2), - total_pages - 1, total_pages - ))) - visible_pages <- visible_pages[ - visible_pages >= 1 & visible_pages <= total_pages - ] - - # Insert ellipsis for skipped page ranges - page_labels <- c() - for (i in seq_along(visible_pages)) { - page_labels <- c(page_labels, as.character(visible_pages[i])) - if (i < length(visible_pages) && - (visible_pages[i + 1] - visible_pages[i]) > 1) { - page_labels <- c(page_labels, "…") - } - } - - # Build pagination buttons - tagList( - actionButton( - inputId = ns(paste0("prev_page_", name)), - label = "◀ ", - class = "btn btn-outline-primary btn-sm me-1" - ), - lapply(page_labels, function(label) { - if (label == "…") { - span("...", class = "mx-1 text-muted") - } else { - p <- as.numeric(label) - style_class <- if (p == current_page) - "btn btn-primary btn-sm fw-bold" - else - "btn btn-outline-primary btn-sm" - - actionButton( - inputId = ns(paste0("go_page_", name, "_", p)), - label = label, - class = style_class, - style = "min-width: 35px;" - ) - } - }), - actionButton( - inputId = ns(paste0("next_page_", name)), - label = " ▶", - class = "btn btn-outline-primary btn-sm ms-1" - ) - ) - }) - - # --- Observe dynamic go-to-page buttons safely ---------------------------- - observe({ - # Defensive checks for uninitialized tables - if (is.null(session$userData$parameters_db[[name]])) return() - - total_rows <- nrow(session$userData$parameters_db[[name]]) - if (is.na(total_rows) || total_rows <= 0) return() - - total_pages <- max(1, ceiling(total_rows / rows_per_page)) - if (!is.finite(total_pages) || total_pages < 1) { - total_pages <- 1 - } - - lapply( - seq_len(total_pages), - function(p) { - input_id <- paste0("go_page_", name, "_", p) - observeEvent( - input[[input_id]], - { - pagination_state[[paste0(name, "_page")]] <- p - }, - ignoreInit = TRUE - ) - } - ) - }) - }) - # ------ * Observe edits on rendered DT ------------------------------------- lapply(parameters_db_names, function(name) { observeEvent(input[[paste0("table_", name, "_cell_edit")]], { @@ -803,14 +656,6 @@ params_db_server <- function( # Get the info of the edited cell info <- input[[paste0("table_", name, "_cell_edit")]] new_data <- session$userData$parameters_db[[name]] - - page_var <- paste0(name, "_page") - current_page <- pagination_state[[page_var]] - if (is.null(current_page) || !is.finite(current_page)) { - current_page <- 1 - } - start_row <- (current_page - 1) * rows_per_page - info$row <- info$row + start_row # Update the specific cell while preserving the column's data type new_data <- update_cell(new_data, info, offset = 0) @@ -831,34 +676,29 @@ params_db_server <- function( }) # ------ DELETE ROW BUTTON --------------------------------------------------- - # Delete selected parameter records from the current visible page. - # Keeps pagination stable and updates memory + disk immediately. + # Delete selected parameter records and update memory + disk immediately. lapply(parameters_db_names, function(table_name) { observeEvent(input[[paste0("delete_rows_", table_name)]], { req(input$database_name) parameter_table <- session$userData$parameters_db[[table_name]] if (nrow(parameter_table) == 0) return() - # Identify the visible range of rows for the current page - current_page <- pagination_state[[paste0(table_name, "_page")]] - first_row <- (current_page - 1) * rows_per_page + 1 - last_row <- min(first_row + rows_per_page - 1, nrow(parameter_table)) - # Detect which visible checkboxes are selected - selected_indices_visible <- which(vapply( - seq_len(last_row - first_row + 1), + + # Detect which checkboxes are selected + selected_indices <- which(vapply( + seq_len(nrow(parameter_table)), function(i) isTRUE(input[[paste0("selected_row_", table_name, "_", i)]]), logical(1) )) - if (length(selected_indices_visible) == 0) return() - # Translate visible selection into global indices and remove rows - rows_to_delete <- first_row + selected_indices_visible - 1 - parameter_table <- parameter_table[-rows_to_delete, , drop = FALSE] - # Update memory and re-sync pagination in case last page became empty + if (length(selected_indices) == 0) return() + + # Remove selected rows + parameter_table <- parameter_table[-selected_indices, , drop = FALSE] + + # Update memory session$userData$parameters_db[[table_name]] <- parameter_table - total_pages <- max(1, ceiling(nrow(parameter_table) / rows_per_page)) - pagination_state[[paste0(table_name, "_page")]] <- - min(pagination_state[[paste0(table_name, "_page")]], total_pages) - # Persist to disk and refresh UI + + # Persist to disk fwrite( parameter_table, file.path( @@ -868,22 +708,25 @@ params_db_server <- function( paste0(table_name, ".csv") ) ) + # Maintain visual continuity after deletion freeze_and_unfreeze_scroll(session, ns(paste0("table_", table_name))) }) }) # ------ ADD ROW BUTTON ------------------------------------------------------ - # Add a single empty record and navigate automatically to the last page. + # Add a single empty record to the table. lapply(parameters_db_names, function(table_name) { observeEvent(input[[paste0("add_rows_", table_name)]], { req(input$database_name) # Retrieve current table from memory parameter_table <- session$userData$parameters_db[[table_name]] + # Append one empty record with NA placeholders new_record <- as.list(rep(NA, ncol(parameter_table))) parameter_table <- rbind(parameter_table, new_record) + # Update in-memory data and persist to disk session$userData$parameters_db[[table_name]] <- parameter_table fwrite( @@ -895,9 +738,7 @@ params_db_server <- function( paste0(table_name, ".csv") ) ) - # Move user to the last page so new entry is immediately visible - pagination_state[[paste0(table_name, "_page")]] <- - ceiling(nrow(parameter_table) / rows_per_page) + # Keep table scroll position to prevent UI jump freeze_and_unfreeze_scroll(session, ns(paste0("table_", table_name))) }) @@ -912,19 +753,15 @@ params_db_server <- function( parameter_table <- session$userData$parameters_db[[table_name]] if (nrow(parameter_table) == 0) return() - # Identify visible range and which record is selected - current_page <- pagination_state[[paste0(table_name, "_page")]] - first_row <- (current_page - 1) * rows_per_page + 1 - last_row <- min(first_row + rows_per_page - 1, nrow(parameter_table)) - selected_visible <- which(vapply( - seq_len(last_row - first_row + 1), + # Find which record is selected + selected_row <- which(vapply( + seq_len(nrow(parameter_table)), function(i) isTRUE(input[[paste0("selected_row_", table_name, "_", i)]]), logical(1) )) - req(length(selected_visible) == 1) + req(length(selected_row) == 1) - selected_row <- first_row + selected_visible - 1 # Clone the selected record and ensure unique ID cloned_record <- parameter_table[selected_row, , drop = FALSE] id_column <- names(parameter_table)[1] @@ -934,6 +771,7 @@ params_db_server <- function( } else { cloned_record[[id_column]] <- "new_clone" } + # Insert cloned record immediately after original if (selected_row < nrow(parameter_table)) { parameter_table <- rbind( @@ -944,6 +782,7 @@ params_db_server <- function( } else { parameter_table <- rbind(parameter_table, cloned_record) } + # Update memory and persist to disk session$userData$parameters_db[[table_name]] <- parameter_table fwrite( @@ -955,6 +794,7 @@ params_db_server <- function( paste0(table_name, ".csv") ) ) + # Keep scroll position for a seamless editing experience freeze_and_unfreeze_scroll(session, ns(paste0("table_", table_name))) }) diff --git a/R/40_mod_params_db_ui.R b/R/40_mod_params_db_ui.R index 66f5964..33f4dbe 100644 --- a/R/40_mod_params_db_ui.R +++ b/R/40_mod_params_db_ui.R @@ -303,19 +303,7 @@ params_db_ui <- function(id) { ) ), div(DTOutput(ns(paste0("table_", tab_name))), class = "with_checkbox"), - # Unified table footer (entries info + pagination) - div( - class = "table-footer d-flex justify-content-between align-items-center mt-2 px-3 py-1", - span( - textOutput(ns(paste0("entries_info_", tab_name))), - class = "text-muted small" - ), - div( - class = "pagination-bar-container ms-auto", - uiOutput(ns(paste0("page_buttons_", tab_name))) - ) - ), - # --- Pagination controls (below table, right-aligned) --- + # Informational message: edits are auto-saved to CSV tags$div( "The data is immediately saved to the corresponding CSV file, no confirmation is required!", From 53b6855cff99d7585f9d35ac68ec6dbfb757fcce Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 21 Dec 2025 23:21:40 +0100 Subject: [PATCH 32/69] Add header freeze in parameter tables - Add `FixedHeader` extension for frozen column names - Configure scrollY (500px) with scrollCollapse - Hide `dtfc-right-top-blocker` to prevent header overlap --- R/40_mod_params_db_server.R | 9 ++++++--- www/sass/hack.scss | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index b124ba8..ca9f0ed 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -619,17 +619,19 @@ params_db_server <- function( ) } - # Render datatable with all rows + # Render datatable with all rows and frozen headers datatable( data = data_table, editable = editablity, rownames = FALSE, escape = FALSE, - extensions = "FixedColumns", + extensions = c("FixedColumns", "FixedHeader"), selection = "none", colnames = c("", colnames(data_table)[-1]), # Hide first column name options = list( scrollX = TRUE, + scrollY = "500px", + scrollCollapse = TRUE, processing = FALSE, paging = FALSE, searching = FALSE, @@ -642,7 +644,8 @@ params_db_server <- function( table_name = name ) ), - fixedColumns = list(leftColumns = 1) + fixedColumns = list(leftColumns = 1), + fixedHeader = TRUE ) ) diff --git a/www/sass/hack.scss b/www/sass/hack.scss index a23a1e7..5d9b64e 100644 --- a/www/sass/hack.scss +++ b/www/sass/hack.scss @@ -28,3 +28,8 @@ display: block !important; } } + +// Hide the FixedColumns scrollbar blocker that overlaps with header +.dtfc-right-top-blocker { + display: none !important; +} From ddc53057d1de1908b1167ef6119c3faf2777a441 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Tue, 23 Dec 2025 13:31:13 +0100 Subject: [PATCH 33/69] Add column search feature to parameter DB tables - Add search input for each column in parameter tables - Enable per-column filtering for improved navigation - Style search inputs with brand colors and focus states - Maintain compatibility with FixedHeader and FixedColumns --- R/40_mod_params_db_fct.R | 59 +++++++++++++++++++++++++++++++++++++ R/40_mod_params_db_server.R | 13 ++++---- www/sass/app.scss | 39 ++++++++++++++++++++++++ www/sass/hack.scss | 5 ---- 4 files changed, 103 insertions(+), 13 deletions(-) diff --git a/R/40_mod_params_db_fct.R b/R/40_mod_params_db_fct.R index 37664f5..9287ae4 100644 --- a/R/40_mod_params_db_fct.R +++ b/R/40_mod_params_db_fct.R @@ -36,3 +36,62 @@ add_cursor_to_disabled_column_js <- function() { $(td).css("cursor", "not-allowed"); }' } + +# Initialize column search inputs for DataTables +init_column_search_js <- function() { + 'function(settings, json) { + var api = this.api(); + + // Prevent duplicate search rows on table redraws + // Use a flag in settings to track if we already initialized the search row + if (settings.oInit.searchRowInitialized) { + return; + } + settings.oInit.searchRowInitialized = true; + + // Create the search row element that will hold all search inputs + var searchRow = $(""); + + // Loop through each column to create search inputs + api.columns().every(function(index) { + var column = this; + var th = $(""); + + // First column is the checkbox column - leave it empty + if (index === 0) { + th.appendTo(searchRow); + } else { + // Create a text input for filtering this column + var input = $(\'\') + .on("keyup change clear", function() { + // Only trigger search if the value actually changed + if (column.search() !== this.value) { + column.search(this.value).draw(); + } + }) + .on("click", function(e) { + // Prevent clicks from bubbling up (e.g., to column sorting) + e.stopPropagation(); + }); + + th.append(input); + th.appendTo(searchRow); + } + }); + + // Add the completed search row to the table header + $(api.table().header()).append(searchRow); + + // Update FixedHeader and FixedColumns to include the new search row in their clones + setTimeout(function() { + if (api.fixedHeader) { + api.fixedHeader.adjust(); + } + if (api.fixedColumns) { + api.fixedColumns().update(); + } + // Recalculate column widths and redraw to ensure proper alignment + api.columns.adjust().draw(false); + }, 30); + }' +} diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index ca9f0ed..e8cbdc4 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -584,8 +584,7 @@ params_db_server <- function( "livetype_desc", "ipcc_meth_ef_t1", "ipcc_meth_ef_t2", "ipcc_meth_man", "ipcc_meth_exc") ) - 1, - createdCell = JS(disable_and_add_cursor_js()), - searchable = FALSE + createdCell = JS(disable_and_add_cursor_js()) ) )) } @@ -602,8 +601,7 @@ params_db_server <- function( column_defs <- list( list( targets = "_all", # Apply to all cells - createdCell = JS(add_cursor_to_disabled_column_js()), - searchable = FALSE + createdCell = JS(add_cursor_to_disabled_column_js()) ) ) @@ -630,11 +628,9 @@ params_db_server <- function( colnames = c("", colnames(data_table)[-1]), # Hide first column name options = list( scrollX = TRUE, - scrollY = "500px", - scrollCollapse = TRUE, processing = FALSE, paging = FALSE, - searching = FALSE, + searching = TRUE, info = FALSE, columnDefs = column_defs, drawCallback = JS( @@ -645,7 +641,8 @@ params_db_server <- function( ) ), fixedColumns = list(leftColumns = 1), - fixedHeader = TRUE + fixedHeader = TRUE, + initComplete = JS(init_column_search_js()) ) ) diff --git a/www/sass/app.scss b/www/sass/app.scss index a4d7ed6..075a62a 100644 --- a/www/sass/app.scss +++ b/www/sass/app.scss @@ -636,6 +636,7 @@ caption { table.dataTable thead th, table.dataTable thead td, table.dataTable tfoot th, table.dataTable tfoot td { color: #005275; font-family: 'Merriweather'; + background-color: #f5f5f5; } table.dataTable th.dt-right, table.dataTable td.dt-right{ text-align: left; @@ -1555,3 +1556,41 @@ table.dataTable tbody tr>.dtfc-fixed-left{ padding: calc(2rem + 1vw) calc(2.5rem + 1vw); /* proportional padding */ } } + +/* ======================================== */ +/* ======= DATATABLE COLUMN SEARCH ======= */ +/* ======================================== */ + +/* Styles for the second header row containing column search inputs */ +table.dataTable thead tr:nth-child(2) th { + vertical-align: bottom !important; + padding: 2px !important; + line-height: 1 !important; + box-sizing: border-box !important; + + /* Search input field styling */ + input[type="text"] { + width: 100% !important; + padding: 4px 8px !important; + margin: 0 !important; + border: 1px solid #005275 !important; + border-radius: 4px !important; + font-size: 12px !important; + line-height: 1.4 !important; + box-sizing: border-box !important; + color: #005275 !important; + + /* Focus state styling */ + &:focus { + border: 2px solid #005275 !important; + outline: none !important; + padding: 3px 7px !important; + } + } +} + +/* Hide the global DataTables search filter */ +.dataTables_filter { + display: none !important; +} + diff --git a/www/sass/hack.scss b/www/sass/hack.scss index 5d9b64e..a23a1e7 100644 --- a/www/sass/hack.scss +++ b/www/sass/hack.scss @@ -28,8 +28,3 @@ display: block !important; } } - -// Hide the FixedColumns scrollbar blocker that overlaps with header -.dtfc-right-top-blocker { - display: none !important; -} From 5735bb94340174c735b5ee51be91a1183a9d1940 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Tue, 23 Dec 2025 15:08:59 +0100 Subject: [PATCH 34/69] Rename `Feedtype` to `Crops` across codebase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change table title "Feedtype" → "Crops" - Rename `feed_type_code` → `crop_code` - Rename `feed_type_name` → crop_name`` --- R/30_mod_scenario_init.R | 4 +- R/30_mod_scenario_server.R | 80 +++++++++---------- R/40_mod_params_db_ui.R | 8 +- .../Params DB - Default/lkp_feedtype.csv | 2 +- data/primary_database/lkp_feedtype.csv | 2 +- .../Params_1/lkp_feedtype.csv | 2 +- .../Params_2/lkp_feedtype.csv | 2 +- data/shared_folder/study_objects/Study_1.json | 58 +++++++------- data/shared_folder/study_objects/Study_2.json | 26 +++--- 9 files changed, 95 insertions(+), 89 deletions(-) diff --git a/R/30_mod_scenario_init.R b/R/30_mod_scenario_init.R index 01ca787..57c9005 100644 --- a/R/30_mod_scenario_init.R +++ b/R/30_mod_scenario_init.R @@ -192,10 +192,10 @@ livestock_data_initialization <- data.frame( ) feedtype_initialization <- data.frame( - feed_type_code = numeric(), + crop_code = numeric(), feed_item_code = numeric(), feed_item_name = character(), - feed_type_name = character(), + crop_name = character(), source_type = character(), intercrop = numeric(), intercrop_fraction = numeric(), diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index ea8865c..4850322 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1366,10 +1366,10 @@ scenario_server <- function( # Update second select input "crop" depending on the first input "feed" observeEvent(input$feed, { - feed_type_code <- lkp_feeditem()$feed_type_code[lkp_feeditem()$feed_item_code == input$feed] + crop_code <- lkp_feeditem()$crop_code[lkp_feeditem()$feed_item_code == input$feed] choices <- setNames( - lkp_feedtype()$feed_type_code[lkp_feedtype()$feed_type_code == feed_type_code], - lkp_feedtype()$feed_type_name[lkp_feedtype()$feed_type_code == feed_type_code] + lkp_feedtype()$crop_code[lkp_feedtype()$crop_code == crop_code], + lkp_feedtype()$crop_name[lkp_feedtype()$crop_code == crop_code] ) # remove NA values choices <- choices[!is.na(choices)] @@ -1383,12 +1383,12 @@ scenario_server <- function( # Add new crop row from modal observeEvent(input$ok_add_crop, { req(input$crop, input$feed) - if (!((input$crop %in% feedtype()[, "feed_type_code"]) && (input$feed %in% feedtype()[, "feed_item_code"]))) { + if (!((input$crop %in% feedtype()[, "crop_code"]) && (input$feed %in% feedtype()[, "feed_item_code"]))) { new_row <- data.frame( - feed_type_code = input$crop, + crop_code = input$crop, feed_item_code = input$feed, feed_item_name = lkp_feeditem()$feed_item_name[lkp_feeditem()$feed_item_code == input$feed], - feed_type_name = lkp_feedtype()$feed_type_name[lkp_feedtype()$feed_type_code == input$crop], + crop_name = lkp_feedtype()$crop_name[lkp_feedtype()$crop_code == input$crop], source_type = "Main", # Only column that is hard coded like the qt app intercrop = 0, intercrop_fraction = 0, @@ -1410,33 +1410,33 @@ scenario_server <- function( grassman_change_factor = lkp_grasslandman()$change_factor[1], landcover_c_factor = lkp_landcover()$c_factor[1], slope_p_factor = lkp_slope()$p_factor[1], - dry_yield = lkp_feedtype()$dry_yield[lkp_feedtype()$feed_type_code == input$crop], - residue_dry_yield = lkp_feedtype()$residue_dry_yield[lkp_feedtype()$feed_type_code == input$crop], + dry_yield = lkp_feedtype()$dry_yield[lkp_feedtype()$crop_code == input$crop], + residue_dry_yield = lkp_feedtype()$residue_dry_yield[lkp_feedtype()$crop_code == input$crop], n_content = 0, - residue_n = lkp_feedtype()$residue_n[lkp_feedtype()$feed_type_code == input$crop], - kc_initial = lkp_feedtype()$kc_initial[lkp_feedtype()$feed_type_code == input$crop], - kc_midseason = lkp_feedtype()$kc_midseason[lkp_feedtype()$feed_type_code == input$crop], - kc_late = lkp_feedtype()$kc_late[lkp_feedtype()$feed_type_code == input$crop], - category = lkp_feedtype()$category[lkp_feedtype()$feed_type_code == input$crop], - trees_ha = lkp_feedtype()$trees_ha[lkp_feedtype()$feed_type_code == input$crop], - trees_dhb = lkp_feedtype()$trees_dhb[lkp_feedtype()$feed_type_code == input$crop], - trees_growth = lkp_feedtype()$trees_growth[lkp_feedtype()$feed_type_code == input$crop], - trees_removal = lkp_feedtype()$trees_removal[lkp_feedtype()$feed_type_code == input$crop], - trees_ha_dbh25 = lkp_feedtype()$trees_ha_dbh25[lkp_feedtype()$feed_type_code == input$crop], - average_dbh25 = lkp_feedtype()$average_dbh25[lkp_feedtype()$feed_type_code == input$crop], - increase_dbh25 = lkp_feedtype()$increase_dbh25[lkp_feedtype()$feed_type_code == input$crop], - trees_ha_dbh2550 = lkp_feedtype()$trees_ha_dbh2550[lkp_feedtype()$feed_type_code == input$crop], - average_dbh2550 = lkp_feedtype()$average_dbh2550[lkp_feedtype()$feed_type_code == input$crop], - increase_dbh2550 = lkp_feedtype()$increase_dbh2550[lkp_feedtype()$feed_type_code == input$crop], - trees_ha_dbh50 = lkp_feedtype()$trees_ha_dbh50[lkp_feedtype()$feed_type_code == input$crop], - average_dbh50 = lkp_feedtype()$average_dbh50[lkp_feedtype()$feed_type_code == input$crop], - increase_dbh50 = lkp_feedtype()$increase_dbh50[lkp_feedtype()$feed_type_code == input$crop], - time_horizon = lkp_feedtype()$time_horizon[lkp_feedtype()$feed_type_code == input$crop], - diameter_breast = lkp_feedtype()$diameter_breast[lkp_feedtype()$feed_type_code == input$crop], + residue_n = lkp_feedtype()$residue_n[lkp_feedtype()$crop_code == input$crop], + kc_initial = lkp_feedtype()$kc_initial[lkp_feedtype()$crop_code == input$crop], + kc_midseason = lkp_feedtype()$kc_midseason[lkp_feedtype()$crop_code == input$crop], + kc_late = lkp_feedtype()$kc_late[lkp_feedtype()$crop_code == input$crop], + category = lkp_feedtype()$category[lkp_feedtype()$crop_code == input$crop], + trees_ha = lkp_feedtype()$trees_ha[lkp_feedtype()$crop_code == input$crop], + trees_dhb = lkp_feedtype()$trees_dhb[lkp_feedtype()$crop_code == input$crop], + trees_growth = lkp_feedtype()$trees_growth[lkp_feedtype()$crop_code == input$crop], + trees_removal = lkp_feedtype()$trees_removal[lkp_feedtype()$crop_code == input$crop], + trees_ha_dbh25 = lkp_feedtype()$trees_ha_dbh25[lkp_feedtype()$crop_code == input$crop], + average_dbh25 = lkp_feedtype()$average_dbh25[lkp_feedtype()$crop_code == input$crop], + increase_dbh25 = lkp_feedtype()$increase_dbh25[lkp_feedtype()$crop_code == input$crop], + trees_ha_dbh2550 = lkp_feedtype()$trees_ha_dbh2550[lkp_feedtype()$crop_code == input$crop], + average_dbh2550 = lkp_feedtype()$average_dbh2550[lkp_feedtype()$crop_code == input$crop], + increase_dbh2550 = lkp_feedtype()$increase_dbh2550[lkp_feedtype()$crop_code == input$crop], + trees_ha_dbh50 = lkp_feedtype()$trees_ha_dbh50[lkp_feedtype()$crop_code == input$crop], + average_dbh50 = lkp_feedtype()$average_dbh50[lkp_feedtype()$crop_code == input$crop], + increase_dbh50 = lkp_feedtype()$increase_dbh50[lkp_feedtype()$crop_code == input$crop], + time_horizon = lkp_feedtype()$time_horizon[lkp_feedtype()$crop_code == input$crop], + diameter_breast = lkp_feedtype()$diameter_breast[lkp_feedtype()$crop_code == input$crop], # These ones are available in the json but not in the DT fraction_as_manure = "NULL", # We should get null in the json n_fertilizer = "NULL", # We should get null in the json - main_n = lkp_feedtype()$main_n[lkp_feedtype()$feed_type_code == input$crop], + main_n = lkp_feedtype()$main_n[lkp_feedtype()$crop_code == input$crop], land_cover = lkp_landcover()$landcover_code[1], slope = lkp_slope()$slope_code[1], grassman = lkp_grasslandman()$management_code[1], @@ -1445,7 +1445,7 @@ scenario_server <- function( new_input_row <- data.frame( Feed = lkp_feeditem()$feed_item_name[lkp_feeditem()$feed_item_code == input$feed], - Crop = lkp_feedtype()$feed_type_name[lkp_feedtype()$feed_type_code == input$crop], + Crop = lkp_feedtype()$crop_name[lkp_feedtype()$crop_code == input$crop], fraction_as_fertilizer = 0, urea = 0, npk = 0, @@ -1484,7 +1484,7 @@ scenario_server <- function( rows_not_contains_grass <- which(feedtype_dt$category != "grass") - 1 # index for js # Identify indices of non-rice crops - rows_not_contains_rice <- which(feedtype_dt$feed_type_name != "Rice") - 1 # index for js + rows_not_contains_rice <- which(feedtype_dt$crop_name != "Rice") - 1 # index for js # Identify indices of rows to disable depending on the source type rows_not_residue <- which(feedtype_dt$source_type != "Residue") - 1 # index for js @@ -1538,7 +1538,7 @@ scenario_server <- function( feedtype_dt <- feedtype_dt %>% select( - -feed_type_code, -feed_item_code, -fraction_as_manure, -n_fertilizer, + -crop_code, -feed_item_code, -fraction_as_manure, -n_fertilizer, -main_n, -slope, -grassman, -land_cover ) @@ -1597,7 +1597,7 @@ scenario_server <- function( targets = get_column_indices( feedtype_dt, c("feed_item_name", - "feed_type_name", + "crop_name", "source_type", "intercrop", "land_cover_desc", @@ -2025,7 +2025,7 @@ scenario_server <- function( } else if ((info$col + 2) == which(names(feedtype()) == "water_regime")) { - if (feedtype()[info$row, "feed_type_name"] == "Rice") { + if (feedtype()[info$row, "crop_name"] == "Rice") { if (modal_open()) return() modal_open(TRUE) @@ -2048,7 +2048,7 @@ scenario_server <- function( } else if ((info$col + 2) == which(names(feedtype()) == "ecosystem_type")) { - if (feedtype()[info$row, "feed_type_name"] == "Rice") { + if (feedtype()[info$row, "crop_name"] == "Rice") { if (modal_open()) return() modal_open(TRUE) @@ -2071,7 +2071,7 @@ scenario_server <- function( } else if ((info$col + 2) == which(names(feedtype()) == "organic_amendment")) { - if (feedtype()[info$row, "feed_type_name"] == "Rice") { + if (feedtype()[info$row, "crop_name"] == "Rice") { if (modal_open()) return() modal_open(TRUE) @@ -2344,7 +2344,7 @@ scenario_server <- function( # Generate and Render Dynamic Feed Allocation Table for Each Season lapply(seasons()$Season, function(season) { - ft <- paste(feedtype()$feed_item_name, "of", feedtype()$feed_type_name) + ft <- paste(feedtype()$feed_item_name, "of", feedtype()$crop_name) lt <- livestock_data()$livetype_desc df <- as.data.frame(matrix(0, nrow = length(ft), ncol = length(lt))) colnames(df) <- lt @@ -2538,7 +2538,7 @@ scenario_server <- function( feeds = lapply(seq_len(nrow(feedtype())), function(j) { list( feed_item_code = feedtype()$feed_item_code[j], - feed_type_code = feedtype()$feed_type_code[j], + crop_code = feedtype()$crop_code[j], livestock = lapply(seq_len(nrow(livestock_data())), function(k) { list( livetype_code = livestock_data()$livetype_code[ @@ -2679,7 +2679,7 @@ scenario_server <- function( # Separate crop_inputs_data and add 'Feed' and 'Crop' columns crop_df <- item[, crop_columns, drop = FALSE] crop_df$Feed <- item$feed_item_name - crop_df$Crop <- item$feed_type_name + crop_df$Crop <- item$crop_name # Reorder columns to make 'Feed' the first and 'Crop' the second column crop_df <- crop_df[, c("Feed", "Crop", setdiff(names(crop_df), c("Feed", "Crop")))] @@ -2757,7 +2757,7 @@ scenario_server <- function( # Rename the rownames & colnames rownames(season_df) <- paste( study_object$feed_items$feed_item_name, - "of", study_object$feed_items$feed_type_name + "of", study_object$feed_items$crop_name ) colnames(season_df) <- study_object$livestock$livetype_desc diff --git a/R/40_mod_params_db_ui.R b/R/40_mod_params_db_ui.R index 33f4dbe..8afdf22 100644 --- a/R/40_mod_params_db_ui.R +++ b/R/40_mod_params_db_ui.R @@ -260,8 +260,14 @@ params_db_ui <- function(id) { lapply( c("lkp_feeditem", "lkp_feedtype", "lkp_livetype"), function(tab_name) { + # Custom tab titles mapping + tab_titles <- c( + "lkp_feeditem" = "Feeditem", + "lkp_feedtype" = "Crops", + "lkp_livetype" = "Livetype" + ) tabPanel( - str_to_title(sub("^lkp_", "", tab_name)), + tab_titles[tab_name], div( class = "p-5 bg-light", fluidRow( diff --git a/data/default_data/parameters_database/Params DB - Default/lkp_feedtype.csv b/data/default_data/parameters_database/Params DB - Default/lkp_feedtype.csv index 99e98b8..7727a03 100644 --- a/data/default_data/parameters_database/Params DB - Default/lkp_feedtype.csv +++ b/data/default_data/parameters_database/Params DB - Default/lkp_feedtype.csv @@ -1,4 +1,4 @@ -feed_type_code,feed_type_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,n_fixation,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,n_fixation,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast 1,Andropogon gayanus,8.882191781,0,0.0104,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 2,Avena sativa,0.352,2.64,0.0176,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 3,Avena sativa-forage,9.1,0,0.016,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/lkp_feedtype.csv b/data/primary_database/lkp_feedtype.csv index 99e98b8..7727a03 100644 --- a/data/primary_database/lkp_feedtype.csv +++ b/data/primary_database/lkp_feedtype.csv @@ -1,4 +1,4 @@ -feed_type_code,feed_type_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,n_fixation,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,n_fixation,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast 1,Andropogon gayanus,8.882191781,0,0.0104,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 2,Avena sativa,0.352,2.64,0.0176,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 3,Avena sativa-forage,9.1,0,0.016,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/shared_folder/parameters_database/Params_1/lkp_feedtype.csv b/data/shared_folder/parameters_database/Params_1/lkp_feedtype.csv index 99e98b8..7727a03 100644 --- a/data/shared_folder/parameters_database/Params_1/lkp_feedtype.csv +++ b/data/shared_folder/parameters_database/Params_1/lkp_feedtype.csv @@ -1,4 +1,4 @@ -feed_type_code,feed_type_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,n_fixation,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,n_fixation,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast 1,Andropogon gayanus,8.882191781,0,0.0104,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 2,Avena sativa,0.352,2.64,0.0176,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 3,Avena sativa-forage,9.1,0,0.016,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/shared_folder/parameters_database/Params_2/lkp_feedtype.csv b/data/shared_folder/parameters_database/Params_2/lkp_feedtype.csv index 99e98b8..7727a03 100644 --- a/data/shared_folder/parameters_database/Params_2/lkp_feedtype.csv +++ b/data/shared_folder/parameters_database/Params_2/lkp_feedtype.csv @@ -1,4 +1,4 @@ -feed_type_code,feed_type_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,n_fixation,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,n_fixation,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast 1,Andropogon gayanus,8.882191781,0,0.0104,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 2,Avena sativa,0.352,2.64,0.0176,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 3,Avena sativa-forage,9.1,0,0.016,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/shared_folder/study_objects/Study_1.json b/data/shared_folder/study_objects/Study_1.json index bc8990c..c9ca49b 100644 --- a/data/shared_folder/study_objects/Study_1.json +++ b/data/shared_folder/study_objects/Study_1.json @@ -1,4 +1,4 @@ -{ +{ "seasons": [ { "season_name": "wet", @@ -160,9 +160,9 @@ ], "feed_items": [ { - "feed_type_code": "43", + "crop_code": "43", "feed_item_code": "17", - "feed_type_name": "Purchased", + "crop_name": "Purchased", "feed_item_name": "Concentrate (commercial)", "source_type": "Main", "intercrop": 0, @@ -224,9 +224,9 @@ "ammonia": 0 }, { - "feed_type_code": "36", + "crop_code": "36", "feed_item_code": "64", - "feed_type_name": "Natural pasture", + "crop_name": "Natural pasture", "feed_item_name": "Naturally occuring pasture - green fodder", "source_type": "Main", "intercrop": 0, @@ -288,9 +288,9 @@ "ammonia": 0 }, { - "feed_type_code": "40", + "crop_code": "40", "feed_item_code": "82", - "feed_type_name": "Pennisetum purpureum", + "crop_name": "Pennisetum purpureum", "feed_item_name": "Pennisetum purpureum - forage", "source_type": "Main", "intercrop": 0, @@ -352,9 +352,9 @@ "ammonia": 0 }, { - "feed_type_code": "17", + "crop_code": "17", "feed_item_code": "29", - "feed_type_name": "Groundnut", + "crop_name": "Groundnut", "feed_item_name": "Groundnut (Arachis hypogaea) - crop residue", "source_type": "Residue", "intercrop": 0, @@ -416,9 +416,9 @@ "ammonia": 0 }, { - "feed_type_code": "6", + "crop_code": "6", "feed_item_code": "12", - "feed_type_name": "Brachiaria hybrid", + "crop_name": "Brachiaria hybrid", "feed_item_name": "Brachiaria hybrid (forage)", "source_type": "Main", "intercrop": 0, @@ -480,9 +480,9 @@ "ammonia": 0 }, { - "feed_type_code": "34", + "crop_code": "34", "feed_item_code": "3", - "feed_type_name": "Musa spp.", + "crop_name": "Musa spp.", "feed_item_name": "Banana leaves", "source_type": "Residue", "intercrop": 0, @@ -544,9 +544,9 @@ "ammonia": 0 }, { - "feed_type_code": "26", + "crop_code": "26", "feed_item_code": "38", - "feed_type_name": "Lablab", + "crop_name": "Lablab", "feed_item_name": "Lablab (Lablab purpureus) - forage", "source_type": "Main", "intercrop": 0, @@ -621,7 +621,7 @@ "feeds": [ { "feed_item_code": "17", - "feed_type_code": "43", + "crop_code": "43", "livestock": [ { "livetype_code": "2", @@ -635,7 +635,7 @@ }, { "feed_item_code": "64", - "feed_type_code": "36", + "crop_code": "36", "livestock": [ { "livetype_code": "2", @@ -649,7 +649,7 @@ }, { "feed_item_code": "82", - "feed_type_code": "40", + "crop_code": "40", "livestock": [ { "livetype_code": "2", @@ -663,7 +663,7 @@ }, { "feed_item_code": "29", - "feed_type_code": "17", + "crop_code": "17", "livestock": [ { "livetype_code": "2", @@ -677,7 +677,7 @@ }, { "feed_item_code": "12", - "feed_type_code": "6", + "crop_code": "6", "livestock": [ { "livetype_code": "2", @@ -691,7 +691,7 @@ }, { "feed_item_code": "3", - "feed_type_code": "34", + "crop_code": "34", "livestock": [ { "livetype_code": "2", @@ -705,7 +705,7 @@ }, { "feed_item_code": "38", - "feed_type_code": "26", + "crop_code": "26", "livestock": [ { "livetype_code": "2", @@ -724,7 +724,7 @@ "feeds": [ { "feed_item_code": "17", - "feed_type_code": "43", + "crop_code": "43", "livestock": [ { "livetype_code": "2", @@ -738,7 +738,7 @@ }, { "feed_item_code": "64", - "feed_type_code": "36", + "crop_code": "36", "livestock": [ { "livetype_code": "2", @@ -752,7 +752,7 @@ }, { "feed_item_code": "82", - "feed_type_code": "40", + "crop_code": "40", "livestock": [ { "livetype_code": "2", @@ -766,7 +766,7 @@ }, { "feed_item_code": "29", - "feed_type_code": "17", + "crop_code": "17", "livestock": [ { "livetype_code": "2", @@ -780,7 +780,7 @@ }, { "feed_item_code": "12", - "feed_type_code": "6", + "crop_code": "6", "livestock": [ { "livetype_code": "2", @@ -794,7 +794,7 @@ }, { "feed_item_code": "3", - "feed_type_code": "34", + "crop_code": "34", "livestock": [ { "livetype_code": "2", @@ -808,7 +808,7 @@ }, { "feed_item_code": "38", - "feed_type_code": "26", + "crop_code": "26", "livestock": [ { "livetype_code": "2", diff --git a/data/shared_folder/study_objects/Study_2.json b/data/shared_folder/study_objects/Study_2.json index 84c40c1..a2fe564 100644 --- a/data/shared_folder/study_objects/Study_2.json +++ b/data/shared_folder/study_objects/Study_2.json @@ -1,4 +1,4 @@ -{ +{ "seasons": [ { "season_name": "wet", @@ -160,9 +160,9 @@ ], "feed_items": [ { - "feed_type_code": "22", + "crop_code": "22", "feed_item_code": "7", - "feed_type_name": "Hordeum vulgare (grain)", + "crop_name": "Hordeum vulgare (grain)", "feed_item_name": "Barley (straw)", "source_type": "Residue", "intercrop": 0, @@ -224,9 +224,9 @@ "ammonia": 0 }, { - "feed_type_code": "6", + "crop_code": "6", "feed_item_code": "12", - "feed_type_name": "Brachiaria hybrid", + "crop_name": "Brachiaria hybrid", "feed_item_name": "Brachiaria hybrid (forage)", "source_type": "Main", "intercrop": 1, @@ -288,9 +288,9 @@ "ammonia": 0 }, { - "feed_type_code": "45", + "crop_code": "45", "feed_item_code": "99", - "feed_type_name": "Rice", + "crop_name": "Rice", "feed_item_name": "Rice (Oryza sativa) - straw", "source_type": "Residue", "intercrop": 0, @@ -365,7 +365,7 @@ "feeds": [ { "feed_item_code": "7", - "feed_type_code": "22", + "crop_code": "22", "livestock": [ { "livetype_code": "2", @@ -379,7 +379,7 @@ }, { "feed_item_code": "12", - "feed_type_code": "6", + "crop_code": "6", "livestock": [ { "livetype_code": "2", @@ -393,7 +393,7 @@ }, { "feed_item_code": "99", - "feed_type_code": "45", + "crop_code": "45", "livestock": [ { "livetype_code": "2", @@ -412,7 +412,7 @@ "feeds": [ { "feed_item_code": "7", - "feed_type_code": "22", + "crop_code": "22", "livestock": [ { "livetype_code": "2", @@ -426,7 +426,7 @@ }, { "feed_item_code": "12", - "feed_type_code": "6", + "crop_code": "6", "livestock": [ { "livetype_code": "2", @@ -440,7 +440,7 @@ }, { "feed_item_code": "99", - "feed_type_code": "45", + "crop_code": "45", "livestock": [ { "livetype_code": "2", From 4bbe03b3ea77d97c0643fe801fe28419ace360a1 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Tue, 23 Dec 2025 15:18:35 +0100 Subject: [PATCH 35/69] Remove `n_fixation` column from `lkp_feedtype` --- .../Params DB - Default/lkp_feedtype.csv | 152 +++++++++--------- data/primary_database/lkp_feedtype.csv | 152 +++++++++--------- .../Params_1/lkp_feedtype.csv | 152 +++++++++--------- .../Params_2/lkp_feedtype.csv | 152 +++++++++--------- 4 files changed, 304 insertions(+), 304 deletions(-) diff --git a/data/default_data/parameters_database/Params DB - Default/lkp_feedtype.csv b/data/default_data/parameters_database/Params DB - Default/lkp_feedtype.csv index 7727a03..9c00cb2 100644 --- a/data/default_data/parameters_database/Params DB - Default/lkp_feedtype.csv +++ b/data/default_data/parameters_database/Params DB - Default/lkp_feedtype.csv @@ -1,76 +1,76 @@ -crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,n_fixation,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast -1,Andropogon gayanus,8.882191781,0,0.0104,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -2,Avena sativa,0.352,2.64,0.0176,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -3,Avena sativa-forage,9.1,0,0.016,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -4,Beta vulgaris,10.45,2.75,0.0125,0,0,0.72,1.04,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -5,Brachiaria brizantha,15.64657534,0,0.0176,0,0,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -6,Brachiaria hybrid,13.76438356,0,0.0224,0,0,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -7,Canavalia brasiliensis,4,0,0.0352,0,0,0.15,1.1,0.25,70.4,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -8,Cassava,5.04,5.04,0.004,0,0.05,0,0,0,0,tree shrub,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -9,Cowpea,0.85405,2.967413131,0.038,0,0.117,0.15,1.05,0.6,50.35220101,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -10,Cratylia,12,0,0.0384,0,0,1.05,1.1,1.1,230.4,tree legume,400,18,2,0,0,0,0,0,0,0,0,0,0,0,0 -11,Cynodon nlemfuensis,10,0,0.02,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -12,Dichanthium aristatum,10,0,0.0128,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -13,Fodder maize,1.064,1.344259298,0.017,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -14,Fustuca arundinacea,12.6,0,0.014,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -15,Gliricidia,5,0,0.0356,0,0,1.05,1.1,1.1,89,tree legume,3000,18,2,0,0,0,0,0,0,0,0,0,0,0,0 -16,Glycine max,3.1045,0,0.064,0,0,0.15,1.15,0.6,99.344,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -17,Groundnut,1.159,2.792748276,0.037,0,0.117,0.15,1.15,0.6,38.19798966,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -18,Guava,0,0,0.002,0,0.146,1.05,1.1,1.1,0,tree crop,25,20,0,0,0,0,0,0,0,0,0,0,0,0,0 -19,Guazuma ulmifolia,17,0,0.024,0,0,1.05,1.1,1.1,204,tree legume,10000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -20,Hedysarum coronarium,5,0,0.032,0,0,0.15,1.1,0.25,80,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -21,Hordeum vulgare (forage),6.8,0,0.0072,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -22,Hordeum vulgare (grain),0.609,1.584,0.01888,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -23,Hordeum vulgare (IP),4.35,1.584,0.01888,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -24,Hyparrhenia rufa,10.1369863,0,0.01,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -25,Ischaemum ciliare,8,0,0.01,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -26,Lablab,1.62184,1.6478263,0.004,0,0,0.15,1.1,0.25,36.200206,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -27,Leucaena,14,0,0.034,0,0,1.05,1.1,1.1,238,tree legume,400,18,3,0,0,0,0,0,0,0,0,0,0,0,0 -28,Lolium multiflorum,11.4,0,0.012,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -29,Maize,8.6,3,0.017,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -30,Maize IP,8.6,3,0.017,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -31,Maize-silage,18,0,0.007,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -32,Medicago sativa,12,0,0.032,0,0,0.15,1.1,0.25,192,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -33,Moringa oleifera,20,0,0.038,0,0,1.05,1.1,1.1,380,tree legume,80000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -34,Musa spp.,5,1.6,0.008,0,0,0.15,1.2,0.7,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -35,N/A,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -36,Natural pasture,10,0,0.01,0,0.027,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -37,Natural trees,0,0,0.005,0,0.73,1.05,1.1,1.1,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -38,Panicum maximum,17.01917808,0,0.0192,0,0,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -39,Paspalum notatum,6.882191781,0,0.016,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -40,Pennisetum purpureum,6,0,0.023,0,0.027,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -41,Pennisetum purpureum-silage,6,0,0.01,0,0,1,1,1,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -42,Pigeon pea,0.85785,2.417508846,0.035,0,0.116,0,0,0,36.76995462,tree legume,5000,10,25,0,0,0,0,0,0,0,0,0,0,0,0 -43,Purchased,0,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -44,Red pepper,0.624,0.067513333,0.009,0,0.1,0,0,0,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -45,Rice,1.6,2.405895238,0.009,0,0,1.05,1.2,0.75,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -46,Sorghum bicolor (grain),3.999,8.7892,0.02,0,0.05,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -47,Sorghum bicolor (forage/silage),13.5,0,0.006,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -48,Sugarcane,11,1.384336134,0.001,0,0.171,0.15,1.2,0.7,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -49,Swazi,15,0,0.016,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -50,Trifolium alexandrinum,4.95,0,0.0416,0,0,0.15,1.1,0.25,102.96,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -51,Triticum,1.566,2.002,0.0202,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -52,Triticum OF,1.566,0.1584,0.0202,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -53,Triticum IP,4.35,5.377777778,0.0202,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -54,Vicia faba (grain),1.74,1.8,0.046,0,0,0.15,1.1,0.25,50.82,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -55,Tripsacum andersonii ,0.22,0.72,0.014,0,0,0.7,1.1,0.85,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -56,Desmodium intoturm,0.852,0.383,0.02,0,0,0.6,1.1,0.85,90,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -57,Lupinus angustifolius,0.2,0.25,0.0235,0,0,0.5,1.1,1.05,255,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -58,Mucuna pruriens,0.902,0.625,0.016,0,0,0.5,1.1,0.8,252,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -59,Morus alba,0.502,0.5,0.03,0,0,0.4,0.8,0.5,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -60,Dactylis glomerata,0,0,0,0,0,0.5,1.2,0.9,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -61,Bauhinia variegata,0,0,0,0,0,0.5,0.8,0.8,0,tree legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -62,Pennisetum glaucum,6,1.89,0.02,0,0,0.4,1.2,0.8,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -63,Pennisetum glaucum forage,6,1.89,0.02,0,0,0.4,1.2,0.8,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -64,Ananas comosus,60,0,0.0145,0,0,0.5,1.2,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -65,Solanum tuberosum,20,0.2,0.015,0,0,0.5,1.2,0.7,0,Tuber,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -66,Cucurbita maxima,0,0,0,0,0,0.6,1,0.8,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -67,Trifolium pratense,2.3,0.3,0.02,0,0,0.5,1.1,0.7,60,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -68,Chloris gayana,5,5,0.02,0,0,0.4,1.1,0.8,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -69,Sesbania sesban,6,0.3,0.03,0,0,0.6,1.2,0.8,83,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -70,Bromus inermis,20.6,0,0.0145,0,0,0.4,1,0.7,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -71,Stipa,0,0,0,0,0,0.5,1,0.7,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -72,Stylosanthes guianensis,20,0.3,0.0056,0,0,0.5,1.1,0.7,,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -73,Ipomoea batatas,25,0.3,0.0032,0,0,0.6,1.1,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -74,Lycopersicon esculentum,0,0,0.0145,0,0,0.6,1.1,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -75,Melilotus alba,2.5,0.5,0.016,0,0,0.5,1,0.8,12.58,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Andropogon gayanus,8.882191781,0,0.0104,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Avena sativa,0.352,2.64,0.0176,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Avena sativa-forage,9.1,0,0.016,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Beta vulgaris,10.45,2.75,0.0125,0,0,0.72,1.04,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Brachiaria brizantha,15.64657534,0,0.0176,0,0,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Brachiaria hybrid,13.76438356,0,0.0224,0,0,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Canavalia brasiliensis,4,0,0.0352,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Cassava,5.04,5.04,0.004,0,0.05,0,0,0,tree shrub,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Cowpea,0.85405,2.967413131,0.038,0,0.117,0.15,1.05,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Cratylia,12,0,0.0384,0,0,1.05,1.1,1.1,tree legume,400,18,2,0,0,0,0,0,0,0,0,0,0,0,0 +11,Cynodon nlemfuensis,10,0,0.02,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Dichanthium aristatum,10,0,0.0128,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Fodder maize,1.064,1.344259298,0.017,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Fustuca arundinacea,12.6,0,0.014,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Gliricidia,5,0,0.0356,0,0,1.05,1.1,1.1,tree legume,3000,18,2,0,0,0,0,0,0,0,0,0,0,0,0 +16,Glycine max,3.1045,0,0.064,0,0,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Groundnut,1.159,2.792748276,0.037,0,0.117,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +18,Guava,0,0,0.002,0,0.146,1.05,1.1,1.1,tree crop,25,20,0,0,0,0,0,0,0,0,0,0,0,0,0 +19,Guazuma ulmifolia,17,0,0.024,0,0,1.05,1.1,1.1,tree legume,10000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +20,Hedysarum coronarium,5,0,0.032,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +21,Hordeum vulgare (forage),6.8,0,0.0072,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +22,Hordeum vulgare (grain),0.609,1.584,0.01888,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +23,Hordeum vulgare (IP),4.35,1.584,0.01888,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +24,Hyparrhenia rufa,10.1369863,0,0.01,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +25,Ischaemum ciliare,8,0,0.01,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +26,Lablab,1.62184,1.6478263,0.004,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +27,Leucaena,14,0,0.034,0,0,1.05,1.1,1.1,tree legume,400,18,3,0,0,0,0,0,0,0,0,0,0,0,0 +28,Lolium multiflorum,11.4,0,0.012,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +29,Maize,8.6,3,0.017,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +30,Maize IP,8.6,3,0.017,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +31,Maize-silage,18,0,0.007,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +32,Medicago sativa,12,0,0.032,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +33,Moringa oleifera,20,0,0.038,0,0,1.05,1.1,1.1,tree legume,80000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +34,Musa spp.,5,1.6,0.008,0,0,0.15,1.2,0.7,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +35,N/A,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +36,Natural pasture,10,0,0.01,0,0.027,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +37,Natural trees,0,0,0.005,0,0.73,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +38,Panicum maximum,17.01917808,0,0.0192,0,0,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +39,Paspalum notatum,6.882191781,0,0.016,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +40,Pennisetum purpureum,6,0,0.023,0,0.027,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +41,Pennisetum purpureum-silage,6,0,0.01,0,0,1,1,1,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +42,Pigeon pea,0.85785,2.417508846,0.035,0,0.116,0,0,0,tree legume,5000,10,25,0,0,0,0,0,0,0,0,0,0,0,0 +43,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +44,Red pepper,0.624,0.067513333,0.009,0,0.1,0,0,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +45,Rice,1.6,2.405895238,0.009,0,0,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +46,Sorghum bicolor (grain),3.999,8.7892,0.02,0,0.05,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +47,Sorghum bicolor (forage/silage),13.5,0,0.006,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +48,Sugarcane,11,1.384336134,0.001,0,0.171,0.15,1.2,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +49,Swazi,15,0,0.016,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +50,Trifolium alexandrinum,4.95,0,0.0416,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +51,Triticum,1.566,2.002,0.0202,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +52,Triticum OF,1.566,0.1584,0.0202,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +53,Triticum IP,4.35,5.377777778,0.0202,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +54,Vicia faba (grain),1.74,1.8,0.046,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +55,Tripsacum andersonii ,0.22,0.72,0.014,0,0,0.7,1.1,0.85,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +56,Desmodium intoturm,0.852,0.383,0.02,0,0,0.6,1.1,0.85,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +57,Lupinus angustifolius,0.2,0.25,0.0235,0,0,0.5,1.1,1.05,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +58,Mucuna pruriens,0.902,0.625,0.016,0,0,0.5,1.1,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +59,Morus alba,0.502,0.5,0.03,0,0,0.4,0.8,0.5,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +60,Dactylis glomerata,0,0,0,0,0,0.5,1.2,0.9,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +61,Bauhinia variegata,0,0,0,0,0,0.5,0.8,0.8,tree legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +62,Pennisetum glaucum,6,1.89,0.02,0,0,0.4,1.2,0.8,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +63,Pennisetum glaucum forage,6,1.89,0.02,0,0,0.4,1.2,0.8,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +64,Ananas comosus,60,0,0.0145,0,0,0.5,1.2,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +65,Solanum tuberosum,20,0.2,0.015,0,0,0.5,1.2,0.7,Tuber,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +66,Cucurbita maxima,0,0,0,0,0,0.6,1,0.8,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +67,Trifolium pratense,2.3,0.3,0.02,0,0,0.5,1.1,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +68,Chloris gayana,5,5,0.02,0,0,0.4,1.1,0.8,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +69,Sesbania sesban,6,0.3,0.03,0,0,0.6,1.2,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +70,Bromus inermis,20.6,0,0.0145,0,0,0.4,1,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +71,Stipa,0,0,0,0,0,0.5,1,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +72,Stylosanthes guianensis,20,0.3,0.0056,0,0,0.5,1.1,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +73,Ipomoea batatas,25,0.3,0.0032,0,0,0.6,1.1,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +74,Lycopersicon esculentum,0,0,0.0145,0,0,0.6,1.1,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +75,Melilotus alba,2.5,0.5,0.016,0,0,0.5,1,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/lkp_feedtype.csv b/data/primary_database/lkp_feedtype.csv index 7727a03..9c00cb2 100644 --- a/data/primary_database/lkp_feedtype.csv +++ b/data/primary_database/lkp_feedtype.csv @@ -1,76 +1,76 @@ -crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,n_fixation,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast -1,Andropogon gayanus,8.882191781,0,0.0104,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -2,Avena sativa,0.352,2.64,0.0176,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -3,Avena sativa-forage,9.1,0,0.016,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -4,Beta vulgaris,10.45,2.75,0.0125,0,0,0.72,1.04,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -5,Brachiaria brizantha,15.64657534,0,0.0176,0,0,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -6,Brachiaria hybrid,13.76438356,0,0.0224,0,0,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -7,Canavalia brasiliensis,4,0,0.0352,0,0,0.15,1.1,0.25,70.4,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -8,Cassava,5.04,5.04,0.004,0,0.05,0,0,0,0,tree shrub,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -9,Cowpea,0.85405,2.967413131,0.038,0,0.117,0.15,1.05,0.6,50.35220101,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -10,Cratylia,12,0,0.0384,0,0,1.05,1.1,1.1,230.4,tree legume,400,18,2,0,0,0,0,0,0,0,0,0,0,0,0 -11,Cynodon nlemfuensis,10,0,0.02,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -12,Dichanthium aristatum,10,0,0.0128,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -13,Fodder maize,1.064,1.344259298,0.017,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -14,Fustuca arundinacea,12.6,0,0.014,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -15,Gliricidia,5,0,0.0356,0,0,1.05,1.1,1.1,89,tree legume,3000,18,2,0,0,0,0,0,0,0,0,0,0,0,0 -16,Glycine max,3.1045,0,0.064,0,0,0.15,1.15,0.6,99.344,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -17,Groundnut,1.159,2.792748276,0.037,0,0.117,0.15,1.15,0.6,38.19798966,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -18,Guava,0,0,0.002,0,0.146,1.05,1.1,1.1,0,tree crop,25,20,0,0,0,0,0,0,0,0,0,0,0,0,0 -19,Guazuma ulmifolia,17,0,0.024,0,0,1.05,1.1,1.1,204,tree legume,10000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -20,Hedysarum coronarium,5,0,0.032,0,0,0.15,1.1,0.25,80,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -21,Hordeum vulgare (forage),6.8,0,0.0072,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -22,Hordeum vulgare (grain),0.609,1.584,0.01888,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -23,Hordeum vulgare (IP),4.35,1.584,0.01888,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -24,Hyparrhenia rufa,10.1369863,0,0.01,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -25,Ischaemum ciliare,8,0,0.01,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -26,Lablab,1.62184,1.6478263,0.004,0,0,0.15,1.1,0.25,36.200206,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -27,Leucaena,14,0,0.034,0,0,1.05,1.1,1.1,238,tree legume,400,18,3,0,0,0,0,0,0,0,0,0,0,0,0 -28,Lolium multiflorum,11.4,0,0.012,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -29,Maize,8.6,3,0.017,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -30,Maize IP,8.6,3,0.017,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -31,Maize-silage,18,0,0.007,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -32,Medicago sativa,12,0,0.032,0,0,0.15,1.1,0.25,192,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -33,Moringa oleifera,20,0,0.038,0,0,1.05,1.1,1.1,380,tree legume,80000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -34,Musa spp.,5,1.6,0.008,0,0,0.15,1.2,0.7,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -35,N/A,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -36,Natural pasture,10,0,0.01,0,0.027,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -37,Natural trees,0,0,0.005,0,0.73,1.05,1.1,1.1,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -38,Panicum maximum,17.01917808,0,0.0192,0,0,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -39,Paspalum notatum,6.882191781,0,0.016,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -40,Pennisetum purpureum,6,0,0.023,0,0.027,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -41,Pennisetum purpureum-silage,6,0,0.01,0,0,1,1,1,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -42,Pigeon pea,0.85785,2.417508846,0.035,0,0.116,0,0,0,36.76995462,tree legume,5000,10,25,0,0,0,0,0,0,0,0,0,0,0,0 -43,Purchased,0,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -44,Red pepper,0.624,0.067513333,0.009,0,0.1,0,0,0,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -45,Rice,1.6,2.405895238,0.009,0,0,1.05,1.2,0.75,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -46,Sorghum bicolor (grain),3.999,8.7892,0.02,0,0.05,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -47,Sorghum bicolor (forage/silage),13.5,0,0.006,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -48,Sugarcane,11,1.384336134,0.001,0,0.171,0.15,1.2,0.7,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -49,Swazi,15,0,0.016,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -50,Trifolium alexandrinum,4.95,0,0.0416,0,0,0.15,1.1,0.25,102.96,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -51,Triticum,1.566,2.002,0.0202,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -52,Triticum OF,1.566,0.1584,0.0202,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -53,Triticum IP,4.35,5.377777778,0.0202,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -54,Vicia faba (grain),1.74,1.8,0.046,0,0,0.15,1.1,0.25,50.82,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -55,Tripsacum andersonii ,0.22,0.72,0.014,0,0,0.7,1.1,0.85,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -56,Desmodium intoturm,0.852,0.383,0.02,0,0,0.6,1.1,0.85,90,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -57,Lupinus angustifolius,0.2,0.25,0.0235,0,0,0.5,1.1,1.05,255,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -58,Mucuna pruriens,0.902,0.625,0.016,0,0,0.5,1.1,0.8,252,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -59,Morus alba,0.502,0.5,0.03,0,0,0.4,0.8,0.5,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -60,Dactylis glomerata,0,0,0,0,0,0.5,1.2,0.9,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -61,Bauhinia variegata,0,0,0,0,0,0.5,0.8,0.8,0,tree legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -62,Pennisetum glaucum,6,1.89,0.02,0,0,0.4,1.2,0.8,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -63,Pennisetum glaucum forage,6,1.89,0.02,0,0,0.4,1.2,0.8,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -64,Ananas comosus,60,0,0.0145,0,0,0.5,1.2,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -65,Solanum tuberosum,20,0.2,0.015,0,0,0.5,1.2,0.7,0,Tuber,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -66,Cucurbita maxima,0,0,0,0,0,0.6,1,0.8,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -67,Trifolium pratense,2.3,0.3,0.02,0,0,0.5,1.1,0.7,60,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -68,Chloris gayana,5,5,0.02,0,0,0.4,1.1,0.8,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -69,Sesbania sesban,6,0.3,0.03,0,0,0.6,1.2,0.8,83,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -70,Bromus inermis,20.6,0,0.0145,0,0,0.4,1,0.7,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -71,Stipa,0,0,0,0,0,0.5,1,0.7,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -72,Stylosanthes guianensis,20,0.3,0.0056,0,0,0.5,1.1,0.7,,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -73,Ipomoea batatas,25,0.3,0.0032,0,0,0.6,1.1,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -74,Lycopersicon esculentum,0,0,0.0145,0,0,0.6,1.1,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -75,Melilotus alba,2.5,0.5,0.016,0,0,0.5,1,0.8,12.58,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Andropogon gayanus,8.882191781,0,0.0104,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Avena sativa,0.352,2.64,0.0176,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Avena sativa-forage,9.1,0,0.016,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Beta vulgaris,10.45,2.75,0.0125,0,0,0.72,1.04,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Brachiaria brizantha,15.64657534,0,0.0176,0,0,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Brachiaria hybrid,13.76438356,0,0.0224,0,0,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Canavalia brasiliensis,4,0,0.0352,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Cassava,5.04,5.04,0.004,0,0.05,0,0,0,tree shrub,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Cowpea,0.85405,2.967413131,0.038,0,0.117,0.15,1.05,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Cratylia,12,0,0.0384,0,0,1.05,1.1,1.1,tree legume,400,18,2,0,0,0,0,0,0,0,0,0,0,0,0 +11,Cynodon nlemfuensis,10,0,0.02,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Dichanthium aristatum,10,0,0.0128,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Fodder maize,1.064,1.344259298,0.017,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Fustuca arundinacea,12.6,0,0.014,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Gliricidia,5,0,0.0356,0,0,1.05,1.1,1.1,tree legume,3000,18,2,0,0,0,0,0,0,0,0,0,0,0,0 +16,Glycine max,3.1045,0,0.064,0,0,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Groundnut,1.159,2.792748276,0.037,0,0.117,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +18,Guava,0,0,0.002,0,0.146,1.05,1.1,1.1,tree crop,25,20,0,0,0,0,0,0,0,0,0,0,0,0,0 +19,Guazuma ulmifolia,17,0,0.024,0,0,1.05,1.1,1.1,tree legume,10000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +20,Hedysarum coronarium,5,0,0.032,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +21,Hordeum vulgare (forage),6.8,0,0.0072,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +22,Hordeum vulgare (grain),0.609,1.584,0.01888,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +23,Hordeum vulgare (IP),4.35,1.584,0.01888,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +24,Hyparrhenia rufa,10.1369863,0,0.01,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +25,Ischaemum ciliare,8,0,0.01,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +26,Lablab,1.62184,1.6478263,0.004,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +27,Leucaena,14,0,0.034,0,0,1.05,1.1,1.1,tree legume,400,18,3,0,0,0,0,0,0,0,0,0,0,0,0 +28,Lolium multiflorum,11.4,0,0.012,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +29,Maize,8.6,3,0.017,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +30,Maize IP,8.6,3,0.017,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +31,Maize-silage,18,0,0.007,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +32,Medicago sativa,12,0,0.032,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +33,Moringa oleifera,20,0,0.038,0,0,1.05,1.1,1.1,tree legume,80000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +34,Musa spp.,5,1.6,0.008,0,0,0.15,1.2,0.7,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +35,N/A,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +36,Natural pasture,10,0,0.01,0,0.027,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +37,Natural trees,0,0,0.005,0,0.73,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +38,Panicum maximum,17.01917808,0,0.0192,0,0,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +39,Paspalum notatum,6.882191781,0,0.016,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +40,Pennisetum purpureum,6,0,0.023,0,0.027,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +41,Pennisetum purpureum-silage,6,0,0.01,0,0,1,1,1,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +42,Pigeon pea,0.85785,2.417508846,0.035,0,0.116,0,0,0,tree legume,5000,10,25,0,0,0,0,0,0,0,0,0,0,0,0 +43,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +44,Red pepper,0.624,0.067513333,0.009,0,0.1,0,0,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +45,Rice,1.6,2.405895238,0.009,0,0,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +46,Sorghum bicolor (grain),3.999,8.7892,0.02,0,0.05,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +47,Sorghum bicolor (forage/silage),13.5,0,0.006,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +48,Sugarcane,11,1.384336134,0.001,0,0.171,0.15,1.2,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +49,Swazi,15,0,0.016,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +50,Trifolium alexandrinum,4.95,0,0.0416,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +51,Triticum,1.566,2.002,0.0202,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +52,Triticum OF,1.566,0.1584,0.0202,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +53,Triticum IP,4.35,5.377777778,0.0202,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +54,Vicia faba (grain),1.74,1.8,0.046,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +55,Tripsacum andersonii ,0.22,0.72,0.014,0,0,0.7,1.1,0.85,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +56,Desmodium intoturm,0.852,0.383,0.02,0,0,0.6,1.1,0.85,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +57,Lupinus angustifolius,0.2,0.25,0.0235,0,0,0.5,1.1,1.05,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +58,Mucuna pruriens,0.902,0.625,0.016,0,0,0.5,1.1,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +59,Morus alba,0.502,0.5,0.03,0,0,0.4,0.8,0.5,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +60,Dactylis glomerata,0,0,0,0,0,0.5,1.2,0.9,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +61,Bauhinia variegata,0,0,0,0,0,0.5,0.8,0.8,tree legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +62,Pennisetum glaucum,6,1.89,0.02,0,0,0.4,1.2,0.8,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +63,Pennisetum glaucum forage,6,1.89,0.02,0,0,0.4,1.2,0.8,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +64,Ananas comosus,60,0,0.0145,0,0,0.5,1.2,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +65,Solanum tuberosum,20,0.2,0.015,0,0,0.5,1.2,0.7,Tuber,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +66,Cucurbita maxima,0,0,0,0,0,0.6,1,0.8,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +67,Trifolium pratense,2.3,0.3,0.02,0,0,0.5,1.1,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +68,Chloris gayana,5,5,0.02,0,0,0.4,1.1,0.8,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +69,Sesbania sesban,6,0.3,0.03,0,0,0.6,1.2,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +70,Bromus inermis,20.6,0,0.0145,0,0,0.4,1,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +71,Stipa,0,0,0,0,0,0.5,1,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +72,Stylosanthes guianensis,20,0.3,0.0056,0,0,0.5,1.1,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +73,Ipomoea batatas,25,0.3,0.0032,0,0,0.6,1.1,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +74,Lycopersicon esculentum,0,0,0.0145,0,0,0.6,1.1,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +75,Melilotus alba,2.5,0.5,0.016,0,0,0.5,1,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/shared_folder/parameters_database/Params_1/lkp_feedtype.csv b/data/shared_folder/parameters_database/Params_1/lkp_feedtype.csv index 7727a03..9c00cb2 100644 --- a/data/shared_folder/parameters_database/Params_1/lkp_feedtype.csv +++ b/data/shared_folder/parameters_database/Params_1/lkp_feedtype.csv @@ -1,76 +1,76 @@ -crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,n_fixation,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast -1,Andropogon gayanus,8.882191781,0,0.0104,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -2,Avena sativa,0.352,2.64,0.0176,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -3,Avena sativa-forage,9.1,0,0.016,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -4,Beta vulgaris,10.45,2.75,0.0125,0,0,0.72,1.04,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -5,Brachiaria brizantha,15.64657534,0,0.0176,0,0,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -6,Brachiaria hybrid,13.76438356,0,0.0224,0,0,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -7,Canavalia brasiliensis,4,0,0.0352,0,0,0.15,1.1,0.25,70.4,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -8,Cassava,5.04,5.04,0.004,0,0.05,0,0,0,0,tree shrub,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -9,Cowpea,0.85405,2.967413131,0.038,0,0.117,0.15,1.05,0.6,50.35220101,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -10,Cratylia,12,0,0.0384,0,0,1.05,1.1,1.1,230.4,tree legume,400,18,2,0,0,0,0,0,0,0,0,0,0,0,0 -11,Cynodon nlemfuensis,10,0,0.02,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -12,Dichanthium aristatum,10,0,0.0128,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -13,Fodder maize,1.064,1.344259298,0.017,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -14,Fustuca arundinacea,12.6,0,0.014,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -15,Gliricidia,5,0,0.0356,0,0,1.05,1.1,1.1,89,tree legume,3000,18,2,0,0,0,0,0,0,0,0,0,0,0,0 -16,Glycine max,3.1045,0,0.064,0,0,0.15,1.15,0.6,99.344,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -17,Groundnut,1.159,2.792748276,0.037,0,0.117,0.15,1.15,0.6,38.19798966,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -18,Guava,0,0,0.002,0,0.146,1.05,1.1,1.1,0,tree crop,25,20,0,0,0,0,0,0,0,0,0,0,0,0,0 -19,Guazuma ulmifolia,17,0,0.024,0,0,1.05,1.1,1.1,204,tree legume,10000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -20,Hedysarum coronarium,5,0,0.032,0,0,0.15,1.1,0.25,80,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -21,Hordeum vulgare (forage),6.8,0,0.0072,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -22,Hordeum vulgare (grain),0.609,1.584,0.01888,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -23,Hordeum vulgare (IP),4.35,1.584,0.01888,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -24,Hyparrhenia rufa,10.1369863,0,0.01,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -25,Ischaemum ciliare,8,0,0.01,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -26,Lablab,1.62184,1.6478263,0.004,0,0,0.15,1.1,0.25,36.200206,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -27,Leucaena,14,0,0.034,0,0,1.05,1.1,1.1,238,tree legume,400,18,3,0,0,0,0,0,0,0,0,0,0,0,0 -28,Lolium multiflorum,11.4,0,0.012,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -29,Maize,8.6,3,0.017,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -30,Maize IP,8.6,3,0.017,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -31,Maize-silage,18,0,0.007,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -32,Medicago sativa,12,0,0.032,0,0,0.15,1.1,0.25,192,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -33,Moringa oleifera,20,0,0.038,0,0,1.05,1.1,1.1,380,tree legume,80000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -34,Musa spp.,5,1.6,0.008,0,0,0.15,1.2,0.7,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -35,N/A,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -36,Natural pasture,10,0,0.01,0,0.027,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -37,Natural trees,0,0,0.005,0,0.73,1.05,1.1,1.1,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -38,Panicum maximum,17.01917808,0,0.0192,0,0,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -39,Paspalum notatum,6.882191781,0,0.016,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -40,Pennisetum purpureum,6,0,0.023,0,0.027,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -41,Pennisetum purpureum-silage,6,0,0.01,0,0,1,1,1,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -42,Pigeon pea,0.85785,2.417508846,0.035,0,0.116,0,0,0,36.76995462,tree legume,5000,10,25,0,0,0,0,0,0,0,0,0,0,0,0 -43,Purchased,0,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -44,Red pepper,0.624,0.067513333,0.009,0,0.1,0,0,0,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -45,Rice,1.6,2.405895238,0.009,0,0,1.05,1.2,0.75,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -46,Sorghum bicolor (grain),3.999,8.7892,0.02,0,0.05,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -47,Sorghum bicolor (forage/silage),13.5,0,0.006,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -48,Sugarcane,11,1.384336134,0.001,0,0.171,0.15,1.2,0.7,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -49,Swazi,15,0,0.016,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -50,Trifolium alexandrinum,4.95,0,0.0416,0,0,0.15,1.1,0.25,102.96,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -51,Triticum,1.566,2.002,0.0202,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -52,Triticum OF,1.566,0.1584,0.0202,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -53,Triticum IP,4.35,5.377777778,0.0202,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -54,Vicia faba (grain),1.74,1.8,0.046,0,0,0.15,1.1,0.25,50.82,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -55,Tripsacum andersonii ,0.22,0.72,0.014,0,0,0.7,1.1,0.85,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -56,Desmodium intoturm,0.852,0.383,0.02,0,0,0.6,1.1,0.85,90,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -57,Lupinus angustifolius,0.2,0.25,0.0235,0,0,0.5,1.1,1.05,255,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -58,Mucuna pruriens,0.902,0.625,0.016,0,0,0.5,1.1,0.8,252,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -59,Morus alba,0.502,0.5,0.03,0,0,0.4,0.8,0.5,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -60,Dactylis glomerata,0,0,0,0,0,0.5,1.2,0.9,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -61,Bauhinia variegata,0,0,0,0,0,0.5,0.8,0.8,0,tree legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -62,Pennisetum glaucum,6,1.89,0.02,0,0,0.4,1.2,0.8,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -63,Pennisetum glaucum forage,6,1.89,0.02,0,0,0.4,1.2,0.8,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -64,Ananas comosus,60,0,0.0145,0,0,0.5,1.2,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -65,Solanum tuberosum,20,0.2,0.015,0,0,0.5,1.2,0.7,0,Tuber,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -66,Cucurbita maxima,0,0,0,0,0,0.6,1,0.8,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -67,Trifolium pratense,2.3,0.3,0.02,0,0,0.5,1.1,0.7,60,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -68,Chloris gayana,5,5,0.02,0,0,0.4,1.1,0.8,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -69,Sesbania sesban,6,0.3,0.03,0,0,0.6,1.2,0.8,83,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -70,Bromus inermis,20.6,0,0.0145,0,0,0.4,1,0.7,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -71,Stipa,0,0,0,0,0,0.5,1,0.7,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -72,Stylosanthes guianensis,20,0.3,0.0056,0,0,0.5,1.1,0.7,,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -73,Ipomoea batatas,25,0.3,0.0032,0,0,0.6,1.1,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -74,Lycopersicon esculentum,0,0,0.0145,0,0,0.6,1.1,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -75,Melilotus alba,2.5,0.5,0.016,0,0,0.5,1,0.8,12.58,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Andropogon gayanus,8.882191781,0,0.0104,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Avena sativa,0.352,2.64,0.0176,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Avena sativa-forage,9.1,0,0.016,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Beta vulgaris,10.45,2.75,0.0125,0,0,0.72,1.04,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Brachiaria brizantha,15.64657534,0,0.0176,0,0,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Brachiaria hybrid,13.76438356,0,0.0224,0,0,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Canavalia brasiliensis,4,0,0.0352,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Cassava,5.04,5.04,0.004,0,0.05,0,0,0,tree shrub,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Cowpea,0.85405,2.967413131,0.038,0,0.117,0.15,1.05,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Cratylia,12,0,0.0384,0,0,1.05,1.1,1.1,tree legume,400,18,2,0,0,0,0,0,0,0,0,0,0,0,0 +11,Cynodon nlemfuensis,10,0,0.02,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Dichanthium aristatum,10,0,0.0128,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Fodder maize,1.064,1.344259298,0.017,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Fustuca arundinacea,12.6,0,0.014,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Gliricidia,5,0,0.0356,0,0,1.05,1.1,1.1,tree legume,3000,18,2,0,0,0,0,0,0,0,0,0,0,0,0 +16,Glycine max,3.1045,0,0.064,0,0,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Groundnut,1.159,2.792748276,0.037,0,0.117,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +18,Guava,0,0,0.002,0,0.146,1.05,1.1,1.1,tree crop,25,20,0,0,0,0,0,0,0,0,0,0,0,0,0 +19,Guazuma ulmifolia,17,0,0.024,0,0,1.05,1.1,1.1,tree legume,10000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +20,Hedysarum coronarium,5,0,0.032,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +21,Hordeum vulgare (forage),6.8,0,0.0072,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +22,Hordeum vulgare (grain),0.609,1.584,0.01888,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +23,Hordeum vulgare (IP),4.35,1.584,0.01888,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +24,Hyparrhenia rufa,10.1369863,0,0.01,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +25,Ischaemum ciliare,8,0,0.01,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +26,Lablab,1.62184,1.6478263,0.004,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +27,Leucaena,14,0,0.034,0,0,1.05,1.1,1.1,tree legume,400,18,3,0,0,0,0,0,0,0,0,0,0,0,0 +28,Lolium multiflorum,11.4,0,0.012,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +29,Maize,8.6,3,0.017,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +30,Maize IP,8.6,3,0.017,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +31,Maize-silage,18,0,0.007,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +32,Medicago sativa,12,0,0.032,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +33,Moringa oleifera,20,0,0.038,0,0,1.05,1.1,1.1,tree legume,80000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +34,Musa spp.,5,1.6,0.008,0,0,0.15,1.2,0.7,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +35,N/A,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +36,Natural pasture,10,0,0.01,0,0.027,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +37,Natural trees,0,0,0.005,0,0.73,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +38,Panicum maximum,17.01917808,0,0.0192,0,0,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +39,Paspalum notatum,6.882191781,0,0.016,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +40,Pennisetum purpureum,6,0,0.023,0,0.027,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +41,Pennisetum purpureum-silage,6,0,0.01,0,0,1,1,1,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +42,Pigeon pea,0.85785,2.417508846,0.035,0,0.116,0,0,0,tree legume,5000,10,25,0,0,0,0,0,0,0,0,0,0,0,0 +43,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +44,Red pepper,0.624,0.067513333,0.009,0,0.1,0,0,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +45,Rice,1.6,2.405895238,0.009,0,0,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +46,Sorghum bicolor (grain),3.999,8.7892,0.02,0,0.05,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +47,Sorghum bicolor (forage/silage),13.5,0,0.006,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +48,Sugarcane,11,1.384336134,0.001,0,0.171,0.15,1.2,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +49,Swazi,15,0,0.016,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +50,Trifolium alexandrinum,4.95,0,0.0416,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +51,Triticum,1.566,2.002,0.0202,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +52,Triticum OF,1.566,0.1584,0.0202,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +53,Triticum IP,4.35,5.377777778,0.0202,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +54,Vicia faba (grain),1.74,1.8,0.046,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +55,Tripsacum andersonii ,0.22,0.72,0.014,0,0,0.7,1.1,0.85,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +56,Desmodium intoturm,0.852,0.383,0.02,0,0,0.6,1.1,0.85,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +57,Lupinus angustifolius,0.2,0.25,0.0235,0,0,0.5,1.1,1.05,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +58,Mucuna pruriens,0.902,0.625,0.016,0,0,0.5,1.1,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +59,Morus alba,0.502,0.5,0.03,0,0,0.4,0.8,0.5,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +60,Dactylis glomerata,0,0,0,0,0,0.5,1.2,0.9,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +61,Bauhinia variegata,0,0,0,0,0,0.5,0.8,0.8,tree legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +62,Pennisetum glaucum,6,1.89,0.02,0,0,0.4,1.2,0.8,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +63,Pennisetum glaucum forage,6,1.89,0.02,0,0,0.4,1.2,0.8,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +64,Ananas comosus,60,0,0.0145,0,0,0.5,1.2,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +65,Solanum tuberosum,20,0.2,0.015,0,0,0.5,1.2,0.7,Tuber,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +66,Cucurbita maxima,0,0,0,0,0,0.6,1,0.8,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +67,Trifolium pratense,2.3,0.3,0.02,0,0,0.5,1.1,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +68,Chloris gayana,5,5,0.02,0,0,0.4,1.1,0.8,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +69,Sesbania sesban,6,0.3,0.03,0,0,0.6,1.2,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +70,Bromus inermis,20.6,0,0.0145,0,0,0.4,1,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +71,Stipa,0,0,0,0,0,0.5,1,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +72,Stylosanthes guianensis,20,0.3,0.0056,0,0,0.5,1.1,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +73,Ipomoea batatas,25,0.3,0.0032,0,0,0.6,1.1,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +74,Lycopersicon esculentum,0,0,0.0145,0,0,0.6,1.1,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +75,Melilotus alba,2.5,0.5,0.016,0,0,0.5,1,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/shared_folder/parameters_database/Params_2/lkp_feedtype.csv b/data/shared_folder/parameters_database/Params_2/lkp_feedtype.csv index 7727a03..9c00cb2 100644 --- a/data/shared_folder/parameters_database/Params_2/lkp_feedtype.csv +++ b/data/shared_folder/parameters_database/Params_2/lkp_feedtype.csv @@ -1,76 +1,76 @@ -crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,n_fixation,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast -1,Andropogon gayanus,8.882191781,0,0.0104,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -2,Avena sativa,0.352,2.64,0.0176,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -3,Avena sativa-forage,9.1,0,0.016,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -4,Beta vulgaris,10.45,2.75,0.0125,0,0,0.72,1.04,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -5,Brachiaria brizantha,15.64657534,0,0.0176,0,0,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -6,Brachiaria hybrid,13.76438356,0,0.0224,0,0,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -7,Canavalia brasiliensis,4,0,0.0352,0,0,0.15,1.1,0.25,70.4,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -8,Cassava,5.04,5.04,0.004,0,0.05,0,0,0,0,tree shrub,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -9,Cowpea,0.85405,2.967413131,0.038,0,0.117,0.15,1.05,0.6,50.35220101,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -10,Cratylia,12,0,0.0384,0,0,1.05,1.1,1.1,230.4,tree legume,400,18,2,0,0,0,0,0,0,0,0,0,0,0,0 -11,Cynodon nlemfuensis,10,0,0.02,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -12,Dichanthium aristatum,10,0,0.0128,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -13,Fodder maize,1.064,1.344259298,0.017,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -14,Fustuca arundinacea,12.6,0,0.014,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -15,Gliricidia,5,0,0.0356,0,0,1.05,1.1,1.1,89,tree legume,3000,18,2,0,0,0,0,0,0,0,0,0,0,0,0 -16,Glycine max,3.1045,0,0.064,0,0,0.15,1.15,0.6,99.344,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -17,Groundnut,1.159,2.792748276,0.037,0,0.117,0.15,1.15,0.6,38.19798966,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -18,Guava,0,0,0.002,0,0.146,1.05,1.1,1.1,0,tree crop,25,20,0,0,0,0,0,0,0,0,0,0,0,0,0 -19,Guazuma ulmifolia,17,0,0.024,0,0,1.05,1.1,1.1,204,tree legume,10000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -20,Hedysarum coronarium,5,0,0.032,0,0,0.15,1.1,0.25,80,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -21,Hordeum vulgare (forage),6.8,0,0.0072,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -22,Hordeum vulgare (grain),0.609,1.584,0.01888,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -23,Hordeum vulgare (IP),4.35,1.584,0.01888,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -24,Hyparrhenia rufa,10.1369863,0,0.01,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -25,Ischaemum ciliare,8,0,0.01,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -26,Lablab,1.62184,1.6478263,0.004,0,0,0.15,1.1,0.25,36.200206,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -27,Leucaena,14,0,0.034,0,0,1.05,1.1,1.1,238,tree legume,400,18,3,0,0,0,0,0,0,0,0,0,0,0,0 -28,Lolium multiflorum,11.4,0,0.012,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -29,Maize,8.6,3,0.017,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -30,Maize IP,8.6,3,0.017,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -31,Maize-silage,18,0,0.007,0,0.05,0.15,1.15,0.3,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -32,Medicago sativa,12,0,0.032,0,0,0.15,1.1,0.25,192,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -33,Moringa oleifera,20,0,0.038,0,0,1.05,1.1,1.1,380,tree legume,80000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -34,Musa spp.,5,1.6,0.008,0,0,0.15,1.2,0.7,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -35,N/A,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -36,Natural pasture,10,0,0.01,0,0.027,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -37,Natural trees,0,0,0.005,0,0.73,1.05,1.1,1.1,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -38,Panicum maximum,17.01917808,0,0.0192,0,0,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -39,Paspalum notatum,6.882191781,0,0.016,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -40,Pennisetum purpureum,6,0,0.023,0,0.027,0.6,1.1,1.05,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -41,Pennisetum purpureum-silage,6,0,0.01,0,0,1,1,1,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -42,Pigeon pea,0.85785,2.417508846,0.035,0,0.116,0,0,0,36.76995462,tree legume,5000,10,25,0,0,0,0,0,0,0,0,0,0,0,0 -43,Purchased,0,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -44,Red pepper,0.624,0.067513333,0.009,0,0.1,0,0,0,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -45,Rice,1.6,2.405895238,0.009,0,0,1.05,1.2,0.75,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -46,Sorghum bicolor (grain),3.999,8.7892,0.02,0,0.05,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -47,Sorghum bicolor (forage/silage),13.5,0,0.006,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -48,Sugarcane,11,1.384336134,0.001,0,0.171,0.15,1.2,0.7,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -49,Swazi,15,0,0.016,0,0,0.3,0.75,0.75,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -50,Trifolium alexandrinum,4.95,0,0.0416,0,0,0.15,1.1,0.25,102.96,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -51,Triticum,1.566,2.002,0.0202,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -52,Triticum OF,1.566,0.1584,0.0202,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -53,Triticum IP,4.35,5.377777778,0.0202,0,0,0.1,1.1,0.55,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -54,Vicia faba (grain),1.74,1.8,0.046,0,0,0.15,1.1,0.25,50.82,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -55,Tripsacum andersonii ,0.22,0.72,0.014,0,0,0.7,1.1,0.85,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -56,Desmodium intoturm,0.852,0.383,0.02,0,0,0.6,1.1,0.85,90,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -57,Lupinus angustifolius,0.2,0.25,0.0235,0,0,0.5,1.1,1.05,255,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -58,Mucuna pruriens,0.902,0.625,0.016,0,0,0.5,1.1,0.8,252,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -59,Morus alba,0.502,0.5,0.03,0,0,0.4,0.8,0.5,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -60,Dactylis glomerata,0,0,0,0,0,0.5,1.2,0.9,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -61,Bauhinia variegata,0,0,0,0,0,0.5,0.8,0.8,0,tree legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -62,Pennisetum glaucum,6,1.89,0.02,0,0,0.4,1.2,0.8,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -63,Pennisetum glaucum forage,6,1.89,0.02,0,0,0.4,1.2,0.8,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -64,Ananas comosus,60,0,0.0145,0,0,0.5,1.2,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -65,Solanum tuberosum,20,0.2,0.015,0,0,0.5,1.2,0.7,0,Tuber,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -66,Cucurbita maxima,0,0,0,0,0,0.6,1,0.8,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -67,Trifolium pratense,2.3,0.3,0.02,0,0,0.5,1.1,0.7,60,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -68,Chloris gayana,5,5,0.02,0,0,0.4,1.1,0.8,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -69,Sesbania sesban,6,0.3,0.03,0,0,0.6,1.2,0.8,83,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -70,Bromus inermis,20.6,0,0.0145,0,0,0.4,1,0.7,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -71,Stipa,0,0,0,0,0,0.5,1,0.7,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -72,Stylosanthes guianensis,20,0.3,0.0056,0,0,0.5,1.1,0.7,,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -73,Ipomoea batatas,25,0.3,0.0032,0,0,0.6,1.1,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -74,Lycopersicon esculentum,0,0,0.0145,0,0,0.6,1.1,0.7,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -75,Melilotus alba,2.5,0.5,0.016,0,0,0.5,1,0.8,12.58,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Andropogon gayanus,8.882191781,0,0.0104,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Avena sativa,0.352,2.64,0.0176,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Avena sativa-forage,9.1,0,0.016,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Beta vulgaris,10.45,2.75,0.0125,0,0,0.72,1.04,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Brachiaria brizantha,15.64657534,0,0.0176,0,0,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Brachiaria hybrid,13.76438356,0,0.0224,0,0,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Canavalia brasiliensis,4,0,0.0352,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Cassava,5.04,5.04,0.004,0,0.05,0,0,0,tree shrub,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Cowpea,0.85405,2.967413131,0.038,0,0.117,0.15,1.05,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Cratylia,12,0,0.0384,0,0,1.05,1.1,1.1,tree legume,400,18,2,0,0,0,0,0,0,0,0,0,0,0,0 +11,Cynodon nlemfuensis,10,0,0.02,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Dichanthium aristatum,10,0,0.0128,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Fodder maize,1.064,1.344259298,0.017,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Fustuca arundinacea,12.6,0,0.014,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Gliricidia,5,0,0.0356,0,0,1.05,1.1,1.1,tree legume,3000,18,2,0,0,0,0,0,0,0,0,0,0,0,0 +16,Glycine max,3.1045,0,0.064,0,0,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Groundnut,1.159,2.792748276,0.037,0,0.117,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +18,Guava,0,0,0.002,0,0.146,1.05,1.1,1.1,tree crop,25,20,0,0,0,0,0,0,0,0,0,0,0,0,0 +19,Guazuma ulmifolia,17,0,0.024,0,0,1.05,1.1,1.1,tree legume,10000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +20,Hedysarum coronarium,5,0,0.032,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +21,Hordeum vulgare (forage),6.8,0,0.0072,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +22,Hordeum vulgare (grain),0.609,1.584,0.01888,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +23,Hordeum vulgare (IP),4.35,1.584,0.01888,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +24,Hyparrhenia rufa,10.1369863,0,0.01,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +25,Ischaemum ciliare,8,0,0.01,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +26,Lablab,1.62184,1.6478263,0.004,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +27,Leucaena,14,0,0.034,0,0,1.05,1.1,1.1,tree legume,400,18,3,0,0,0,0,0,0,0,0,0,0,0,0 +28,Lolium multiflorum,11.4,0,0.012,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +29,Maize,8.6,3,0.017,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +30,Maize IP,8.6,3,0.017,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +31,Maize-silage,18,0,0.007,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +32,Medicago sativa,12,0,0.032,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +33,Moringa oleifera,20,0,0.038,0,0,1.05,1.1,1.1,tree legume,80000,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +34,Musa spp.,5,1.6,0.008,0,0,0.15,1.2,0.7,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +35,N/A,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +36,Natural pasture,10,0,0.01,0,0.027,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +37,Natural trees,0,0,0.005,0,0.73,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +38,Panicum maximum,17.01917808,0,0.0192,0,0,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +39,Paspalum notatum,6.882191781,0,0.016,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +40,Pennisetum purpureum,6,0,0.023,0,0.027,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +41,Pennisetum purpureum-silage,6,0,0.01,0,0,1,1,1,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +42,Pigeon pea,0.85785,2.417508846,0.035,0,0.116,0,0,0,tree legume,5000,10,25,0,0,0,0,0,0,0,0,0,0,0,0 +43,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +44,Red pepper,0.624,0.067513333,0.009,0,0.1,0,0,0,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +45,Rice,1.6,2.405895238,0.009,0,0,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +46,Sorghum bicolor (grain),3.999,8.7892,0.02,0,0.05,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +47,Sorghum bicolor (forage/silage),13.5,0,0.006,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +48,Sugarcane,11,1.384336134,0.001,0,0.171,0.15,1.2,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +49,Swazi,15,0,0.016,0,0,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +50,Trifolium alexandrinum,4.95,0,0.0416,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +51,Triticum,1.566,2.002,0.0202,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +52,Triticum OF,1.566,0.1584,0.0202,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +53,Triticum IP,4.35,5.377777778,0.0202,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +54,Vicia faba (grain),1.74,1.8,0.046,0,0,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +55,Tripsacum andersonii ,0.22,0.72,0.014,0,0,0.7,1.1,0.85,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +56,Desmodium intoturm,0.852,0.383,0.02,0,0,0.6,1.1,0.85,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +57,Lupinus angustifolius,0.2,0.25,0.0235,0,0,0.5,1.1,1.05,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +58,Mucuna pruriens,0.902,0.625,0.016,0,0,0.5,1.1,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +59,Morus alba,0.502,0.5,0.03,0,0,0.4,0.8,0.5,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +60,Dactylis glomerata,0,0,0,0,0,0.5,1.2,0.9,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +61,Bauhinia variegata,0,0,0,0,0,0.5,0.8,0.8,tree legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +62,Pennisetum glaucum,6,1.89,0.02,0,0,0.4,1.2,0.8,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +63,Pennisetum glaucum forage,6,1.89,0.02,0,0,0.4,1.2,0.8,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +64,Ananas comosus,60,0,0.0145,0,0,0.5,1.2,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +65,Solanum tuberosum,20,0.2,0.015,0,0,0.5,1.2,0.7,Tuber,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +66,Cucurbita maxima,0,0,0,0,0,0.6,1,0.8,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +67,Trifolium pratense,2.3,0.3,0.02,0,0,0.5,1.1,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +68,Chloris gayana,5,5,0.02,0,0,0.4,1.1,0.8,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +69,Sesbania sesban,6,0.3,0.03,0,0,0.6,1.2,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +70,Bromus inermis,20.6,0,0.0145,0,0,0.4,1,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +71,Stipa,0,0,0,0,0,0.5,1,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +72,Stylosanthes guianensis,20,0.3,0.0056,0,0,0.5,1.1,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +73,Ipomoea batatas,25,0.3,0.0032,0,0,0.6,1.1,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +74,Lycopersicon esculentum,0,0,0.0145,0,0,0.6,1.1,0.7,herbaceous plant,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +75,Melilotus alba,2.5,0.5,0.016,0,0,0.5,1,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 From 3cfb3c863c41f8d4c13bd4a8174d19b599cc227c Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Tue, 23 Dec 2025 16:11:35 +0100 Subject: [PATCH 36/69] Auto-generate unique codes for add row feature --- R/40_mod_params_db_fct.R | 16 ++++++++++++++++ R/40_mod_params_db_server.R | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/R/40_mod_params_db_fct.R b/R/40_mod_params_db_fct.R index 9287ae4..71bb716 100644 --- a/R/40_mod_params_db_fct.R +++ b/R/40_mod_params_db_fct.R @@ -95,3 +95,19 @@ init_column_search_js <- function() { }, 30); }' } + +# Generate next unique numeric code for parameters database tables +# Used when adding new rows to auto-assign sequential unique codes +generate_next_code <- function(parameter_table, code_column) { + # Extract existing codes and convert to numeric + existing_codes <- parameter_table[[code_column]] + numeric_codes <- as.numeric(existing_codes[!is.na(existing_codes)]) + + # Handle empty table case + if (length(numeric_codes) == 0) { + return(1) + } + + # Return next available code + return(max(numeric_codes, na.rm = TRUE) + 1) +} \ No newline at end of file diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index e8cbdc4..c49930a 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -725,6 +725,13 @@ params_db_server <- function( # Append one empty record with NA placeholders new_record <- as.list(rep(NA, ncol(parameter_table))) + names(new_record) <- names(parameter_table) + + # Auto-generate unique code for first column + code_column <- names(parameter_table)[1] + new_record[[code_column]] <- generate_next_code(parameter_table, code_column) + + # Append to table parameter_table <- rbind(parameter_table, new_record) # Update in-memory data and persist to disk From 701208180abef56a54fce8980ae5733fa107a8d9 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Fri, 26 Dec 2025 18:08:48 +0100 Subject: [PATCH 37/69] Disable buttons and code editing in Livetype table --- R/40_mod_params_db_server.R | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index ad9362b..e81bf70 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -589,8 +589,8 @@ params_db_server <- function( list( targets = which( names(data_table) %in% c( - "livetype_desc", "ipcc_meth_ef_t1", "ipcc_meth_ef_t2", - "ipcc_meth_man", "ipcc_meth_exc") + "livetype_code", "livetype_desc", "ipcc_meth_ef_t1", + "ipcc_meth_ef_t2", "ipcc_meth_man", "ipcc_meth_exc") ) - 1, createdCell = JS(disable_and_add_cursor_js()), searchable = FALSE @@ -603,6 +603,13 @@ params_db_server <- function( shinyjs::enable(id = paste0("delete_rows_", name)) shinyjs::enable(id = paste0("clone_rows_", name)) + # Disable buttons specifically for lkp_livetype + if (name == "lkp_livetype") { + shinyjs::disable(id = paste0("add_rows_", name)) + shinyjs::disable(id = paste0("delete_rows_", name)) + shinyjs::disable(id = paste0("clone_rows_", name)) + } + # Check if the database is the default one if (input$database_name == "Params DB - Default") { editablity <- FALSE From 8df12fa38ec32954386f998f677b42b91fb76fb9 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 24 Dec 2025 19:16:49 +0100 Subject: [PATCH 38/69] Reposition 'Edit Parameters' button --- R/30_mod_scenario_ui.R | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index ccc9e4d..6bea915 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -17,8 +17,19 @@ scenario_ui <- function(id) { span(strong(id = ns("last_update_date"))) ), ), + div( + class = "container mt-2 mb-2", + style = "text-align: right", + a( + class = "editInformationBtn", + icon("edit"), + "Edit Parameters", + icon("chevron-right", class = "editInfoIcon"), + onclick = go_to(target = "params_db") + ) + ), fixedPage( - class = "bg-light px-4 pt-5 pb-5 mt-5 mb-5", + class = "bg-light px-4 pt-5 pb-5 mt-4 mb-5", style = "margin-top: 20px;", h2("Choose a file option:", class = "mb-3"), fluidRow( @@ -247,17 +258,6 @@ scenario_ui <- function(id) { ) ) ), - div( - class = "container mt-2 mb-2", - style = "text-align: right", - a( - class = "editInformationBtn", - icon("edit"), - "Edit Parameters", - icon("chevron-right", class = "editInfoIcon"), - onclick = go_to(target = "params_db") - ) - ), shinyjs::hidden( div( id = ns("scenario_editor_section"), From 0fdfeadc9fede8fa1feee77285f75da72a442672 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 24 Dec 2025 19:40:34 +0100 Subject: [PATCH 39/69] Update the form link --- www/html/helper.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/html/helper.html b/www/html/helper.html index 322d0d6..be080e3 100644 --- a/www/html/helper.html +++ b/www/html/helper.html @@ -14,7 +14,7 @@
- + From 9cc7242551d8c0a965151fcf15bfb9a1da98f2c2 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Tue, 23 Dec 2025 20:23:32 +0100 Subject: [PATCH 40/69] Fix clone/delete targeting after sorting --- R/40_mod_params_db_fct.R | 84 ++++++++++++++++++++++++++-------------- 1 file changed, 55 insertions(+), 29 deletions(-) diff --git a/R/40_mod_params_db_fct.R b/R/40_mod_params_db_fct.R index 71bb716..70e72f5 100644 --- a/R/40_mod_params_db_fct.R +++ b/R/40_mod_params_db_fct.R @@ -5,24 +5,37 @@ checkbox_link_multi <- function(id, ns, table_name) { 'function(settings) { console.log("Checkbox link function called for table: ', table_name, '"); - // Select all checkbox inputs within the current DataTable - var checkboxes = $(settings.nTable).find("input[type=checkbox]"); - console.log("Checkboxes found in table ', table_name, ':", checkboxes.length); - - // Iterate over each checkbox element - checkboxes.each(function(i) { - - var checkboxId = "', ns(paste0(id, "_", table_name)), '_" + (i + 1); - console.log("Assigning checkbox ID for table ', table_name, ':", checkboxId); - - // Send the initial state of the checkbox to Shiny - Shiny.setInputValue(checkboxId, this.checked, {priority: "event"}); - - // Add an event listener to update the state on change - $(this).on("change", function() { - // Update Shiny input with the new state of the checkbox - Shiny.setInputValue(checkboxId, this.checked, {priority: "event"}); - }); + // Create DataTables API instance to access row-level methods + var api = new $.fn.dataTable.Api(settings); + + // Iterate through all rows using DataTables API + // This ensures we get the correct data row index regardless of sorting/filtering + api.rows().every(function(displayIdx) { + var row = this; + var node = row.node(); + + // Find the checkbox input in this row + var checkbox = $(node).find("input[type=checkbox]").first(); + + if (checkbox.length > 0) { + // Get the ORIGINAL data row index (0-based) + // This index is CONSTANT - it does not change when user sorts/filters the table + var dataIdx = row.index(); + + // Create checkbox ID based on DATA index (convert to 1-based for R) + // This ensures the checkbox ID always matches the same data row + var checkboxId = "', ns(paste0(id, "_", table_name)), '_" + (dataIdx + 1); + console.log("Display row:", displayIdx, "-> Data row:", dataIdx, "-> Checkbox ID:", checkboxId); + + // Initialize checkbox state in Shiny + Shiny.setInputValue(checkboxId, checkbox.prop("checked"), {priority: "event"}); + + // Listen for checkbox changes and update Shiny + // Remove any existing listeners first to avoid duplicates + checkbox.off("change").on("change", function() { + Shiny.setInputValue(checkboxId, this.checked, {priority: "event"}); + }); + } }); }' ) @@ -96,18 +109,31 @@ init_column_search_js <- function() { }' } -# Generate next unique numeric code for parameters database tables -# Used when adding new rows to auto-assign sequential unique codes -generate_next_code <- function(parameter_table, code_column) { - # Extract existing codes and convert to numeric - existing_codes <- parameter_table[[code_column]] - numeric_codes <- as.numeric(existing_codes[!is.na(existing_codes)]) +#' Generate Next Unique Code +#' +#' Calculates the next sequential code for a new row by finding the maximum +#' existing numeric code in the specified column and adding 1. +#' +#' @param data A data frame containing the parameter table +#' @param code_column Character string, name of the code column +#' +#' @return Integer, the next unique code (max + 1, or 1 if table is empty) +#' +#' @examples +#' generate_next_code(crops_data, "crop_code") +generate_next_code <- function(data, code_column) { + if (nrow(data) == 0 || all(is.na(data[[code_column]]))) { + return(1) + } - # Handle empty table case - if (length(numeric_codes) == 0) { + # Extract numeric codes, ignoring non-numeric values + existing_codes <- suppressWarnings(as.numeric(data[[code_column]])) + existing_codes <- existing_codes[!is.na(existing_codes)] + + if (length(existing_codes) == 0) { return(1) } - # Return next available code - return(max(numeric_codes, na.rm = TRUE) + 1) -} \ No newline at end of file + next_code <- max(existing_codes) + 1 + return(next_code) +} From 55ae3924c8d8973fd8772cad84a580ddc3a85d4e Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Tue, 23 Dec 2025 22:28:17 +0100 Subject: [PATCH 41/69] Rename 'lkp_feedtype' to 'lkp_crops' - Renamed 'lkp_feedtype' to 'lkp_crops' in parameter database references - Updated all 'lkp_feedtype()' calls to 'lkp_crops()' in server modules - Renamed CSV files from 'lkp_feedtype.csv' to 'lkp_crops.csv' - Changed 'feed_type_code' column to 'crop_code' in lkp_feeditem.csv files - Updated UI tab labels and mappings in params_db module --- R/30_mod_scenario_server.R | 58 +++++++++---------- R/40_mod_params_db_ui.R | 4 +- .../{lkp_feedtype.csv => lkp_crops.csv} | 0 .../Params DB - Default/lkp_feeditem.csv | 2 +- .../{lkp_feedtype.csv => lkp_crops.csv} | 0 data/primary_database/lkp_feeditem.csv | 2 +- .../{lkp_feedtype.csv => lkp_crops.csv} | 0 .../Params_1/lkp_feeditem.csv | 2 +- .../{lkp_feedtype.csv => lkp_crops.csv} | 0 .../Params_2/lkp_feeditem.csv | 2 +- global.R | 2 +- 11 files changed, 36 insertions(+), 36 deletions(-) rename data/default_data/parameters_database/Params DB - Default/{lkp_feedtype.csv => lkp_crops.csv} (100%) rename data/primary_database/{lkp_feedtype.csv => lkp_crops.csv} (100%) rename data/shared_folder/parameters_database/Params_1/{lkp_feedtype.csv => lkp_crops.csv} (100%) rename data/shared_folder/parameters_database/Params_2/{lkp_feedtype.csv => lkp_crops.csv} (100%) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index 4850322..8c64de7 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1368,8 +1368,8 @@ scenario_server <- function( observeEvent(input$feed, { crop_code <- lkp_feeditem()$crop_code[lkp_feeditem()$feed_item_code == input$feed] choices <- setNames( - lkp_feedtype()$crop_code[lkp_feedtype()$crop_code == crop_code], - lkp_feedtype()$crop_name[lkp_feedtype()$crop_code == crop_code] + lkp_crops()$crop_code[lkp_crops()$crop_code == crop_code], + lkp_crops()$crop_name[lkp_crops()$crop_code == crop_code] ) # remove NA values choices <- choices[!is.na(choices)] @@ -1388,7 +1388,7 @@ scenario_server <- function( crop_code = input$crop, feed_item_code = input$feed, feed_item_name = lkp_feeditem()$feed_item_name[lkp_feeditem()$feed_item_code == input$feed], - crop_name = lkp_feedtype()$crop_name[lkp_feedtype()$crop_code == input$crop], + crop_name = lkp_crops()$crop_name[lkp_crops()$crop_code == input$crop], source_type = "Main", # Only column that is hard coded like the qt app intercrop = 0, intercrop_fraction = 0, @@ -1410,33 +1410,33 @@ scenario_server <- function( grassman_change_factor = lkp_grasslandman()$change_factor[1], landcover_c_factor = lkp_landcover()$c_factor[1], slope_p_factor = lkp_slope()$p_factor[1], - dry_yield = lkp_feedtype()$dry_yield[lkp_feedtype()$crop_code == input$crop], - residue_dry_yield = lkp_feedtype()$residue_dry_yield[lkp_feedtype()$crop_code == input$crop], + dry_yield = lkp_crops()$dry_yield[lkp_crops()$crop_code == input$crop], + residue_dry_yield = lkp_crops()$residue_dry_yield[lkp_crops()$crop_code == input$crop], n_content = 0, - residue_n = lkp_feedtype()$residue_n[lkp_feedtype()$crop_code == input$crop], - kc_initial = lkp_feedtype()$kc_initial[lkp_feedtype()$crop_code == input$crop], - kc_midseason = lkp_feedtype()$kc_midseason[lkp_feedtype()$crop_code == input$crop], - kc_late = lkp_feedtype()$kc_late[lkp_feedtype()$crop_code == input$crop], - category = lkp_feedtype()$category[lkp_feedtype()$crop_code == input$crop], - trees_ha = lkp_feedtype()$trees_ha[lkp_feedtype()$crop_code == input$crop], - trees_dhb = lkp_feedtype()$trees_dhb[lkp_feedtype()$crop_code == input$crop], - trees_growth = lkp_feedtype()$trees_growth[lkp_feedtype()$crop_code == input$crop], - trees_removal = lkp_feedtype()$trees_removal[lkp_feedtype()$crop_code == input$crop], - trees_ha_dbh25 = lkp_feedtype()$trees_ha_dbh25[lkp_feedtype()$crop_code == input$crop], - average_dbh25 = lkp_feedtype()$average_dbh25[lkp_feedtype()$crop_code == input$crop], - increase_dbh25 = lkp_feedtype()$increase_dbh25[lkp_feedtype()$crop_code == input$crop], - trees_ha_dbh2550 = lkp_feedtype()$trees_ha_dbh2550[lkp_feedtype()$crop_code == input$crop], - average_dbh2550 = lkp_feedtype()$average_dbh2550[lkp_feedtype()$crop_code == input$crop], - increase_dbh2550 = lkp_feedtype()$increase_dbh2550[lkp_feedtype()$crop_code == input$crop], - trees_ha_dbh50 = lkp_feedtype()$trees_ha_dbh50[lkp_feedtype()$crop_code == input$crop], - average_dbh50 = lkp_feedtype()$average_dbh50[lkp_feedtype()$crop_code == input$crop], - increase_dbh50 = lkp_feedtype()$increase_dbh50[lkp_feedtype()$crop_code == input$crop], - time_horizon = lkp_feedtype()$time_horizon[lkp_feedtype()$crop_code == input$crop], - diameter_breast = lkp_feedtype()$diameter_breast[lkp_feedtype()$crop_code == input$crop], + residue_n = lkp_crops()$residue_n[lkp_crops()$crop_code == input$crop], + kc_initial = lkp_crops()$kc_initial[lkp_crops()$crop_code == input$crop], + kc_midseason = lkp_crops()$kc_midseason[lkp_crops()$crop_code == input$crop], + kc_late = lkp_crops()$kc_late[lkp_crops()$crop_code == input$crop], + category = lkp_crops()$category[lkp_crops()$crop_code == input$crop], + trees_ha = lkp_crops()$trees_ha[lkp_crops()$crop_code == input$crop], + trees_dhb = lkp_crops()$trees_dhb[lkp_crops()$crop_code == input$crop], + trees_growth = lkp_crops()$trees_growth[lkp_crops()$crop_code == input$crop], + trees_removal = lkp_crops()$trees_removal[lkp_crops()$crop_code == input$crop], + trees_ha_dbh25 = lkp_crops()$trees_ha_dbh25[lkp_crops()$crop_code == input$crop], + average_dbh25 = lkp_crops()$average_dbh25[lkp_crops()$crop_code == input$crop], + increase_dbh25 = lkp_crops()$increase_dbh25[lkp_crops()$crop_code == input$crop], + trees_ha_dbh2550 = lkp_crops()$trees_ha_dbh2550[lkp_crops()$crop_code == input$crop], + average_dbh2550 = lkp_crops()$average_dbh2550[lkp_crops()$crop_code == input$crop], + increase_dbh2550 = lkp_crops()$increase_dbh2550[lkp_crops()$crop_code == input$crop], + trees_ha_dbh50 = lkp_crops()$trees_ha_dbh50[lkp_crops()$crop_code == input$crop], + average_dbh50 = lkp_crops()$average_dbh50[lkp_crops()$crop_code == input$crop], + increase_dbh50 = lkp_crops()$increase_dbh50[lkp_crops()$crop_code == input$crop], + time_horizon = lkp_crops()$time_horizon[lkp_crops()$crop_code == input$crop], + diameter_breast = lkp_crops()$diameter_breast[lkp_crops()$crop_code == input$crop], # These ones are available in the json but not in the DT fraction_as_manure = "NULL", # We should get null in the json n_fertilizer = "NULL", # We should get null in the json - main_n = lkp_feedtype()$main_n[lkp_feedtype()$crop_code == input$crop], + main_n = lkp_crops()$main_n[lkp_crops()$crop_code == input$crop], land_cover = lkp_landcover()$landcover_code[1], slope = lkp_slope()$slope_code[1], grassman = lkp_grasslandman()$management_code[1], @@ -1445,7 +1445,7 @@ scenario_server <- function( new_input_row <- data.frame( Feed = lkp_feeditem()$feed_item_name[lkp_feeditem()$feed_item_code == input$feed], - Crop = lkp_feedtype()$crop_name[lkp_feedtype()$crop_code == input$crop], + Crop = lkp_crops()$crop_name[lkp_crops()$crop_code == input$crop], fraction_as_fertilizer = 0, urea = 0, npk = 0, @@ -2102,7 +2102,7 @@ scenario_server <- function( inputId = ns("feed_category"), label = NULL, choices = sort( - unique(lkp_feedtype()$category[lkp_feedtype()$category != ""]) + unique(lkp_crops()$category[lkp_crops()$category != ""]) ), options = list(`live-search` = TRUE) ), @@ -2289,7 +2289,7 @@ scenario_server <- function( shinyWidgets::updatePickerInput( session, "feed_category", - selected = lkp_feedtype()$category[1] + selected = lkp_crops()$category[1] ) removeModal() diff --git a/R/40_mod_params_db_ui.R b/R/40_mod_params_db_ui.R index 8afdf22..9da81ef 100644 --- a/R/40_mod_params_db_ui.R +++ b/R/40_mod_params_db_ui.R @@ -258,12 +258,12 @@ params_db_ui <- function(id) { c( id = "tabs", lapply( - c("lkp_feeditem", "lkp_feedtype", "lkp_livetype"), + c("lkp_feeditem", "lkp_crops", "lkp_livetype"), function(tab_name) { # Custom tab titles mapping tab_titles <- c( "lkp_feeditem" = "Feeditem", - "lkp_feedtype" = "Crops", + "lkp_crops" = "Crops", "lkp_livetype" = "Livetype" ) tabPanel( diff --git a/data/default_data/parameters_database/Params DB - Default/lkp_feedtype.csv b/data/default_data/parameters_database/Params DB - Default/lkp_crops.csv similarity index 100% rename from data/default_data/parameters_database/Params DB - Default/lkp_feedtype.csv rename to data/default_data/parameters_database/Params DB - Default/lkp_crops.csv diff --git a/data/default_data/parameters_database/Params DB - Default/lkp_feeditem.csv b/data/default_data/parameters_database/Params DB - Default/lkp_feeditem.csv index 34cef0c..dd871bb 100644 --- a/data/default_data/parameters_database/Params DB - Default/lkp_feeditem.csv +++ b/data/default_data/parameters_database/Params DB - Default/lkp_feeditem.csv @@ -1,4 +1,4 @@ -feed_type_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content,de,, +crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content,de,, 1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521,0.4686,, 34,2,Banana (fruit),22,12.3,5.2,0.8118,, 34,3,Banana leaves,16,10,9.5,0.66,, diff --git a/data/primary_database/lkp_feedtype.csv b/data/primary_database/lkp_crops.csv similarity index 100% rename from data/primary_database/lkp_feedtype.csv rename to data/primary_database/lkp_crops.csv diff --git a/data/primary_database/lkp_feeditem.csv b/data/primary_database/lkp_feeditem.csv index 34cef0c..dd871bb 100644 --- a/data/primary_database/lkp_feeditem.csv +++ b/data/primary_database/lkp_feeditem.csv @@ -1,4 +1,4 @@ -feed_type_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content,de,, +crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content,de,, 1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521,0.4686,, 34,2,Banana (fruit),22,12.3,5.2,0.8118,, 34,3,Banana leaves,16,10,9.5,0.66,, diff --git a/data/shared_folder/parameters_database/Params_1/lkp_feedtype.csv b/data/shared_folder/parameters_database/Params_1/lkp_crops.csv similarity index 100% rename from data/shared_folder/parameters_database/Params_1/lkp_feedtype.csv rename to data/shared_folder/parameters_database/Params_1/lkp_crops.csv diff --git a/data/shared_folder/parameters_database/Params_1/lkp_feeditem.csv b/data/shared_folder/parameters_database/Params_1/lkp_feeditem.csv index 34cef0c..dd871bb 100644 --- a/data/shared_folder/parameters_database/Params_1/lkp_feeditem.csv +++ b/data/shared_folder/parameters_database/Params_1/lkp_feeditem.csv @@ -1,4 +1,4 @@ -feed_type_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content,de,, +crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content,de,, 1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521,0.4686,, 34,2,Banana (fruit),22,12.3,5.2,0.8118,, 34,3,Banana leaves,16,10,9.5,0.66,, diff --git a/data/shared_folder/parameters_database/Params_2/lkp_feedtype.csv b/data/shared_folder/parameters_database/Params_2/lkp_crops.csv similarity index 100% rename from data/shared_folder/parameters_database/Params_2/lkp_feedtype.csv rename to data/shared_folder/parameters_database/Params_2/lkp_crops.csv diff --git a/data/shared_folder/parameters_database/Params_2/lkp_feeditem.csv b/data/shared_folder/parameters_database/Params_2/lkp_feeditem.csv index 34cef0c..dd871bb 100644 --- a/data/shared_folder/parameters_database/Params_2/lkp_feeditem.csv +++ b/data/shared_folder/parameters_database/Params_2/lkp_feeditem.csv @@ -1,4 +1,4 @@ -feed_type_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content,de,, +crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content,de,, 1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521,0.4686,, 34,2,Banana (fruit),22,12.3,5.2,0.8118,, 34,3,Banana leaves,16,10,9.5,0.66,, diff --git a/global.R b/global.R index 57efe34..a821ddf 100644 --- a/global.R +++ b/global.R @@ -42,7 +42,7 @@ Sys.setlocale("LC_TIME", "C") # Set to C locale for English # List of all parameter tables parameters_db_names <- c( "lkp_climate", "lkp_climate2", "lkp_croplandsystem", "lkp_feeditem", - "lkp_feedtype", "lkp_grassinputlevel", "lkp_grasslandman", "lkp_landcover", + "lkp_crops", "lkp_grassinputlevel", "lkp_grasslandman", "lkp_landcover", "lkp_livetype", "lkp_manureman", "lkp_organicmatter", "lkp_orgfertilizer", "lkp_region", "lkp_slope", "lkp_soil", "lkp_tillageregime" ) From 5343afa8a5f2b8edca513566b18bf10da073370a Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 24 Dec 2025 18:53:15 +0100 Subject: [PATCH 42/69] Add duplicate code validation to params tables --- R/40_mod_params_db_server.R | 71 +++++++++++++++++++++++++++++++++++++ R/40_mod_params_db_ui.R | 8 +++++ 2 files changed, 79 insertions(+) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index c49930a..3911e08 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -649,6 +649,77 @@ params_db_server <- function( }, server = FALSE) }) + # ------ Check for duplicates on table load ---------------------------------- + # Detect and display alert message list of duplicate codes in parameter + # database tables + lapply(parameters_db_names, function(name) { + observe({ + # Ensure database is selected and data table is available + req(input$database_name) + req(session$userData$parameters_db[[name]]) + + # Extract table and identify the code column (always first column) + data_table <- session$userData$parameters_db[[name]] + code_column <- names(data_table)[1] + # Count occurrences of each code to find duplicates + code_counts <- table(data_table[[code_column]]) + duplicate_codes <- names(code_counts[code_counts > 1]) + + # Handle duplicate codes if any exist + if (length(duplicate_codes) > 0) { + + # Sort duplicate codes intelligently: + # - Numeric codes: sort numerically (e.g., 2, 10, 100) + # - Text codes: sort alphabetically (e.g., A, B, C) + numeric_codes <- suppressWarnings(as.numeric(duplicate_codes)) + if (all(!is.na(numeric_codes))) { + duplicate_codes <- as.character(sort(numeric_codes)) + } else { + duplicate_codes <- sort(duplicate_codes) + } + + # Format each duplicate code with bold HTML tags for emphasis + bold_codes <- sapply( + duplicate_codes, + function(code) sprintf(" %s ", code) + ) + + # Build grammatically correct list of codes + if (length(bold_codes) == 1) { + codes_text <- bold_codes[1] + } else if (length(bold_codes) == 2) { + codes_text <- paste(bold_codes, collapse = " and ") + } else { + codes_text <- paste( + paste(bold_codes[-length(bold_codes)], collapse = ", "), + "and", + bold_codes[length(bold_codes)] + ) + } + + # Construct error message with column name and duplicate codes + error_message <- sprintf( + paste0( + "In '%s' column, the following codes are duplicated : %s. ", + "Please fix these duplications to have a unique code for each row." + ), + code_column, + codes_text + ) + + # Display the alert message to the user + shinyjs::html( + id = paste0("alert_duplicate_code_", name), + html = error_message + ) + shinyjs::show(id = paste0("alert_duplicate_code_", name)) + + } else { + # No duplicates found - hide the alert message + shinyjs::hide(id = paste0("alert_duplicate_code_", name)) + } + }) + }) # ------ * Observe edits on rendered DT ------------------------------------- lapply(parameters_db_names, function(name) { observeEvent(input[[paste0("table_", name, "_cell_edit")]], { diff --git a/R/40_mod_params_db_ui.R b/R/40_mod_params_db_ui.R index 9da81ef..f3afb3b 100644 --- a/R/40_mod_params_db_ui.R +++ b/R/40_mod_params_db_ui.R @@ -308,6 +308,14 @@ params_db_ui <- function(id) { ) ) ), + # Alert for duplicate code warnings + shinyjs::hidden( + div( + id = ns(paste0("alert_duplicate_code_", tab_name)), + class = "alert alert-danger", + style = "display:none;" + ) + ), div(DTOutput(ns(paste0("table_", tab_name))), class = "with_checkbox"), # Informational message: edits are auto-saved to CSV tags$div( From a82dec7f0690cff4e84fef5c3510a49720841d5a Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 24 Dec 2025 19:27:02 +0100 Subject: [PATCH 43/69] Clean feeditem tables: remove V8/V9 & 'de' --- .../Params DB - Default/lkp_feeditem.csv | 284 +++++++++--------- data/primary_database/lkp_feeditem.csv | 284 +++++++++--------- .../Params_1/lkp_feeditem.csv | 284 +++++++++--------- .../Params_2/lkp_feeditem.csv | 284 +++++++++--------- 4 files changed, 568 insertions(+), 568 deletions(-) diff --git a/data/default_data/parameters_database/Params DB - Default/lkp_feeditem.csv b/data/default_data/parameters_database/Params DB - Default/lkp_feeditem.csv index dd871bb..dd90ee5 100644 --- a/data/default_data/parameters_database/Params DB - Default/lkp_feeditem.csv +++ b/data/default_data/parameters_database/Params DB - Default/lkp_feeditem.csv @@ -1,142 +1,142 @@ -crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content,de,, -1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521,0.4686,, -34,2,Banana (fruit),22,12.3,5.2,0.8118,, -34,3,Banana leaves,16,10,9.5,0.66,, -21,4,Barley (forage),34,8.69,4.5,0.57354,, -23,5,Barley (grains) IP,87.1,12.4,11.8,0.8184,, -22,6,Barley (grains) OFC,87.1,12.4,11.8,0.8184,, -22,7,Barley (straw),87,5.88,0.3,0.38808,, -11,8,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6,0.638319528,, -11,9,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6,0.489101976,, -50,10,Berseem clover,11,12.39,26,0.81774,, -5,11,Brachiaria brizantha (forage),26,7.254794521,7.254794521,0.478816438,, -6,12,Brachiaria hybrid (forage),26,7.254794521,8.254794521,0.478816438,, -7,13,Canavalia brasiliensis (forage),30,12.1,22,0.7986,, -8,14,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94,0.660425832,, -8,15,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45,0.2846184,, -8,16,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81,0.71016,, -43,17,Concentrate (commercial),90,12.1,16,0.7986,, -9,18,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4,0.652135968,, -9,19,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56,0.6897,, -9,20,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88,0.87186,, -9,21,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53,0.924,, -10,22,Cratylia argentea (forage),30,9.4,24,0.6204,, -11,23,Cynodon nlemfuensis (forage),30.3,9.671508,12.6,0.638319528,, -12,24,Dichanthium aristatum (forage),33,7.25,8,0.4785,, -49,25,Digitaria swazilandensis (forage),24,9.7,9.9,0.6402,, -54,26,Fava bean (grain),86.6,13.3,29,0.8778,, -54,27,Fava bean (straw),89.7,6.4,7.4,0.4224,, -15,28,Gliricidia sepium (forage),30,11.5,22.3,0.759,, -17,29,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52,0.52734,, -17,30,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2,1.3982232,, -17,31,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29,0.43296,, -19,32,Guazuma ulmifolia (forage),30,11,15,0.726,, -24,33,Hyparrhenia rufa (forage),26,6.129315068,6,0.404534795,, -25,34,Ischaemum ciliare (forage),24,6.003835616,6,0.396253151,, -28,35,Italian ryegrass (forage),19,8.7,7,0.5742,, -28,36,Italian ryegrass (hay),85,8.36,6.01,0.55176,, -28,37,Italian ryegrass (silage),33.5,9.07,5.3,0.59862,, -26,38,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94,0.75438,, -26,39,Lablab (Lablab purpureus) - hay,90,9.29,16.6,0.61314,, -26,40,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51,0.49104,, -27,41,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93,0.627,, -32,42,Lucerne (Medicago sativa) - forage,21,10.08,19.7,0.66528,, -32,43,Lucerne (Medicago sativa) - hay,85,8.36,12.5,0.55176,, -32,44,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5,0.630029664,, -57,45,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44,0.36762,, -57,46,Lupins (Lupinus angustifolius) - grain,90,19,30,1.254,, -57,47,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54,0.48576,, -43,48,Maize (Zea mays) - bought stover,87,9.127224,5.9,0.602396784,, -29,49,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8,0.500155128,, -30,50,Maize (Zea mays) - cracked grains IP,89,13.020948,10,0.859382568,, -29,51,Maize (Zea mays) - forage,82,10.215792,8.9,0.674242272,, -31,52,Maize (Zea mays) - silage,30,10.79,4.4,0.71214,, -29,53,Maize (Zea mays) - stover,87,9.127224,5.9,0.602396784,, -29,54,Maize (Zea mays) - whole grain,90,15,9,0.99,, -33,55,Moringa oleifera (forage),26.2,10.6,24.3,0.6996,, -58,56,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77,0.7128,, -58,57,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77,0.7128,, -58,58,Mucuna (Mucuna pruriens) - hay,90.6,10.89,14.8,0.71874,, -58,59,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3,0.936738,, -59,60,Mulberry (Morus alba),28.4,10,19.4,0.66,, -35,61,N/A,0,0,0,0,, -36,62,Naturally occuring pasture - grazing,60,5,6,0.33,, -36,63,Naturally occuring pasture - grazing OFR,60,5,6,0.33,, -36,64,Naturally occuring pasture - green fodder,60,5,6,0.33,, -2,65,Oats (Avena sativa) - grain IP,89,12.267324,13.6,0.809643384,, -3,66,Oats (Avena sativa) - green fodder,31,8.36,4,0.55176,, -3,67,Oats (Avena sativa) - hay,85,7.48,3.5,0.49368,, -3,68,Oats (Avena sativa) - hay OFR,85,7.48,3.5,0.49368,, -2,69,Oats (Avena sativa) - hulls,92.4,5.317236,4.1,0.350937576,, -43,70,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2,1.00860012,, -3,71,Oats (Avena sativa) - silage,36.4,8.917884,12.7,0.588580344,, -2,72,Oats (Avena sativa) - straw,88,6.47,0,0.42702,, -60,73,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1,0.569237328,, -60,74,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4,0.53884116,, -61,75,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15,0.49462842,, -38,76,Panicum maximum (forage),26,7.543013699,9.882191781,0.497838904,, -38,77,Panicum maximum (green fodder),26,7.58,10,0.50028,, -39,78,Paspalum notatum (forage),28,7.543013699,8.254794521,0.497838904,, -62,79,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4,0.624503088,, -62,80,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88,0.82038,, -63,81,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81,0.5643,, -40,82,Pennisetum purpureum - forage,15,9.880848,11,0.652135968,, -41,83,Pennisetum purpureum - silage,19.5,7.5,6.5,0.495,, -42,84,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3,0.527788008,, -42,85,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39,0.73128,, -42,86,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6,0.759,, -64,87,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1,0.7599042,, -64,88,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94,0.54252,, -65,89,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96,0.6765,, -65,90,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13,0.85734,, -43,91,Poultry litter,78.7,8.16426,17.78,0.53884116,, -66,92,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44,0.65406,, -67,93,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8,0.688058712,, -67,94,Red clover (Trifolium pratense) - hay,88.4,8.331732,15,0.549894312,, -68,95,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1,0.49764,, -68,96,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7,0.6006,, -43,97,Rice (Oryza sativa) - bran (with germs),91,10.425132,14,0.688058712,, -45,98,Rice (Oryza sativa) - hulls,92,1.423512,3.1,0.093951792,, -45,99,Rice (Oryza sativa) - straw,91.88,5.64,3.85,0.37224,, -69,100,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3,0.56364,, -70,101,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3,0.740561184,, -70,102,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6,0.530551296,, -46,103,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9,0.464232384,, -47,104,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7,0.56562,, -46,105,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6,0.817933248,, -47,106,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7,0.56562,, -16,107,Soybean (Glycine max) - crop residue,88,6.322068,5.2,0.417256488,, -16,108,Soybean (Glycine max) - meal,89,13.18842,49.6,0.87043572,, -16,109,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2,0.823459824,, -16,110,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3,0.93951792,, -71,111,Stipa (grazing) OF,72,5.6,5,0.3696,, -72,112,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69,0.630029664,, -4,113,Sugar beet (pulp) OFR,89,11.4,8.9,0.7524,, -43,114,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9,0.4554,, -48,115,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69,0.49104,, -48,116,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3,0.594,, -43,117,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8,0.71845488,, -48,118,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9,0.4554,, -48,119,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5,0.462,, -20,120,Sulla,12.3,9.7,20.2,0.6402,, -43,121,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9,0.602396784,, -73,122,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4,0.66066,, -73,123,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1,0.89628,, -73,124,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6,0.7491,, -73,125,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4,0.66066,, -14,126,Tall fescue,21,9.11,8.9,0.60126,, -74,127,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21,0.49038,, -53,128,Wheat (bran) IP,87,11,17.3,0.726,, -52,129,Wheat (bran) OFC,87,11,17.3,0.726,, -51,130,Wheat (straw),88,5.63,4.2,0.37158,, -51,131,Wheat (straw) OFR,88,5.63,4.2,0.37158,, -75,132,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5,0.6006,, -36,142,Natural hay,60,5,6,0.33,, -40,133,Pennisetum purpureum- hay,86,9.88,11,0.6521,, -55,134,Guatemala grass forage,20,10,19,0.66,, -3,135,Oats(Avena sativa)- bran,26,7.48,3.5,0.4936,, -16,136,Soybean(Glycine max) straw,86,7,5.9,0.462,, -38,137,Panicum maximum (hay),,7.54,9.88,0.4976,, -51,138,Wheat (bran),87,11,17.3,0.726,, -5,139,Brachiaria hay,86,7.25,8.25,0.4785,, -56,140,Greenleaf desmodium(Desmodium intoturm),25,8,15,0.528,, +crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content +1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521 +34,2,Banana (fruit),22,12.3,5.2 +34,3,Banana leaves,16,10,9.5 +21,4,Barley (forage),34,8.69,4.5 +23,5,Barley (grains) IP,87.1,12.4,11.8 +22,6,Barley (grains) OFC,87.1,12.4,11.8 +22,7,Barley (straw),87,5.88,0.3 +11,8,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6 +11,9,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6 +50,10,Berseem clover,11,12.39,26 +5,11,Brachiaria brizantha (forage),26,7.254794521,7.254794521 +6,12,Brachiaria hybrid (forage),26,7.254794521,8.254794521 +7,13,Canavalia brasiliensis (forage),30,12.1,22 +8,14,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94 +8,15,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45 +8,16,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81 +43,17,Concentrate (commercial),90,12.1,16 +9,18,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 +9,19,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 +9,20,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 +9,21,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 +10,22,Cratylia argentea (forage),30,9.4,24 +11,23,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 +12,24,Dichanthium aristatum (forage),33,7.25,8 +49,25,Digitaria swazilandensis (forage),24,9.7,9.9 +54,26,Fava bean (grain),86.6,13.3,29 +54,27,Fava bean (straw),89.7,6.4,7.4 +15,28,Gliricidia sepium (forage),30,11.5,22.3 +17,29,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52 +17,30,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2 +17,31,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29 +19,32,Guazuma ulmifolia (forage),30,11,15 +24,33,Hyparrhenia rufa (forage),26,6.129315068,6 +25,34,Ischaemum ciliare (forage),24,6.003835616,6 +28,35,Italian ryegrass (forage),19,8.7,7 +28,36,Italian ryegrass (hay),85,8.36,6.01 +28,37,Italian ryegrass (silage),33.5,9.07,5.3 +26,38,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94 +26,39,Lablab (Lablab purpureus) - hay,90,9.29,16.6 +26,40,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51 +27,41,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +32,42,Lucerne (Medicago sativa) - forage,21,10.08,19.7 +32,43,Lucerne (Medicago sativa) - hay,85,8.36,12.5 +32,44,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 +57,45,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44 +57,46,Lupins (Lupinus angustifolius) - grain,90,19,30 +57,47,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54 +43,48,Maize (Zea mays) - bought stover,87,9.127224,5.9 +29,49,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8 +30,50,Maize (Zea mays) - cracked grains IP,89,13.020948,10 +29,51,Maize (Zea mays) - forage,82,10.215792,8.9 +31,52,Maize (Zea mays) - silage,30,10.79,4.4 +29,53,Maize (Zea mays) - stover,87,9.127224,5.9 +29,54,Maize (Zea mays) - whole grain,90,15,9 +33,55,Moringa oleifera (forage),26.2,10.6,24.3 +58,56,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77 +58,57,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77 +58,58,Mucuna (Mucuna pruriens) - hay,90.6,10.89,14.8 +58,59,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3 +59,60,Mulberry (Morus alba),28.4,10,19.4 +35,61,N/A,0,0,0 +36,62,Naturally occuring pasture - grazing,60,5,6 +36,63,Naturally occuring pasture - grazing OFR,60,5,6 +36,64,Naturally occuring pasture - green fodder,60,5,6 +2,65,Oats (Avena sativa) - grain IP,89,12.267324,13.6 +3,66,Oats (Avena sativa) - green fodder,31,8.36,4 +3,67,Oats (Avena sativa) - hay,85,7.48,3.5 +3,68,Oats (Avena sativa) - hay OFR,85,7.48,3.5 +2,69,Oats (Avena sativa) - hulls,92.4,5.317236,4.1 +43,70,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2 +3,71,Oats (Avena sativa) - silage,36.4,8.917884,12.7 +2,72,Oats (Avena sativa) - straw,88,6.47,0 +60,73,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1 +60,74,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4 +61,75,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15 +38,76,Panicum maximum (forage),26,7.543013699,9.882191781 +38,77,Panicum maximum (green fodder),26,7.58,10 +39,78,Paspalum notatum (forage),28,7.543013699,8.254794521 +62,79,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4 +62,80,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88 +63,81,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81 +40,82,Pennisetum purpureum - forage,15,9.880848,11 +41,83,Pennisetum purpureum - silage,19.5,7.5,6.5 +42,84,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3 +42,85,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39 +42,86,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6 +64,87,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1 +64,88,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94 +65,89,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96 +65,90,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13 +43,91,Poultry litter,78.7,8.16426,17.78 +66,92,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44 +67,93,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8 +67,94,Red clover (Trifolium pratense) - hay,88.4,8.331732,15 +68,95,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1 +68,96,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7 +43,97,Rice (Oryza sativa) - bran (with germs),91,10.425132,14 +45,98,Rice (Oryza sativa) - hulls,92,1.423512,3.1 +45,99,Rice (Oryza sativa) - straw,91.88,5.64,3.85 +69,100,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 +70,101,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3 +70,102,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6 +46,103,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 +47,104,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 +46,105,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 +47,106,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 +16,107,Soybean (Glycine max) - crop residue,88,6.322068,5.2 +16,108,Soybean (Glycine max) - meal,89,13.18842,49.6 +16,109,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2 +16,110,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 +71,111,Stipa (grazing) OF,72,5.6,5 +72,112,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69 +4,113,Sugar beet (pulp) OFR,89,11.4,8.9 +43,114,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 +48,115,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69 +48,116,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 +43,117,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 +48,118,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 +48,119,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5 +20,120,Sulla,12.3,9.7,20.2 +43,121,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9 +73,122,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 +73,123,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1 +73,124,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6 +73,125,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 +14,126,Tall fescue,21,9.11,8.9 +74,127,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21 +53,128,Wheat (bran) IP,87,11,17.3 +52,129,Wheat (bran) OFC,87,11,17.3 +51,130,Wheat (straw),88,5.63,4.2 +51,131,Wheat (straw) OFR,88,5.63,4.2 +75,132,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5 +36,142,Natural hay,60,5,6 +40,133,Pennisetum purpureum- hay,86,9.88,11 +55,134,Guatemala grass forage,20,10,19 +3,135,Oats(Avena sativa)- bran,26,7.48,3.5 +16,136,Soybean(Glycine max) straw,86,7,5.9 +38,137,Panicum maximum (hay),,7.54,9.88 +51,138,Wheat (bran),87,11,17.3 +5,139,Brachiaria hay,86,7.25,8.25 +56,140,Greenleaf desmodium(Desmodium intoturm),25,8,15 diff --git a/data/primary_database/lkp_feeditem.csv b/data/primary_database/lkp_feeditem.csv index dd871bb..dd90ee5 100644 --- a/data/primary_database/lkp_feeditem.csv +++ b/data/primary_database/lkp_feeditem.csv @@ -1,142 +1,142 @@ -crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content,de,, -1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521,0.4686,, -34,2,Banana (fruit),22,12.3,5.2,0.8118,, -34,3,Banana leaves,16,10,9.5,0.66,, -21,4,Barley (forage),34,8.69,4.5,0.57354,, -23,5,Barley (grains) IP,87.1,12.4,11.8,0.8184,, -22,6,Barley (grains) OFC,87.1,12.4,11.8,0.8184,, -22,7,Barley (straw),87,5.88,0.3,0.38808,, -11,8,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6,0.638319528,, -11,9,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6,0.489101976,, -50,10,Berseem clover,11,12.39,26,0.81774,, -5,11,Brachiaria brizantha (forage),26,7.254794521,7.254794521,0.478816438,, -6,12,Brachiaria hybrid (forage),26,7.254794521,8.254794521,0.478816438,, -7,13,Canavalia brasiliensis (forage),30,12.1,22,0.7986,, -8,14,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94,0.660425832,, -8,15,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45,0.2846184,, -8,16,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81,0.71016,, -43,17,Concentrate (commercial),90,12.1,16,0.7986,, -9,18,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4,0.652135968,, -9,19,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56,0.6897,, -9,20,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88,0.87186,, -9,21,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53,0.924,, -10,22,Cratylia argentea (forage),30,9.4,24,0.6204,, -11,23,Cynodon nlemfuensis (forage),30.3,9.671508,12.6,0.638319528,, -12,24,Dichanthium aristatum (forage),33,7.25,8,0.4785,, -49,25,Digitaria swazilandensis (forage),24,9.7,9.9,0.6402,, -54,26,Fava bean (grain),86.6,13.3,29,0.8778,, -54,27,Fava bean (straw),89.7,6.4,7.4,0.4224,, -15,28,Gliricidia sepium (forage),30,11.5,22.3,0.759,, -17,29,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52,0.52734,, -17,30,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2,1.3982232,, -17,31,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29,0.43296,, -19,32,Guazuma ulmifolia (forage),30,11,15,0.726,, -24,33,Hyparrhenia rufa (forage),26,6.129315068,6,0.404534795,, -25,34,Ischaemum ciliare (forage),24,6.003835616,6,0.396253151,, -28,35,Italian ryegrass (forage),19,8.7,7,0.5742,, -28,36,Italian ryegrass (hay),85,8.36,6.01,0.55176,, -28,37,Italian ryegrass (silage),33.5,9.07,5.3,0.59862,, -26,38,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94,0.75438,, -26,39,Lablab (Lablab purpureus) - hay,90,9.29,16.6,0.61314,, -26,40,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51,0.49104,, -27,41,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93,0.627,, -32,42,Lucerne (Medicago sativa) - forage,21,10.08,19.7,0.66528,, -32,43,Lucerne (Medicago sativa) - hay,85,8.36,12.5,0.55176,, -32,44,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5,0.630029664,, -57,45,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44,0.36762,, -57,46,Lupins (Lupinus angustifolius) - grain,90,19,30,1.254,, -57,47,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54,0.48576,, -43,48,Maize (Zea mays) - bought stover,87,9.127224,5.9,0.602396784,, -29,49,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8,0.500155128,, -30,50,Maize (Zea mays) - cracked grains IP,89,13.020948,10,0.859382568,, -29,51,Maize (Zea mays) - forage,82,10.215792,8.9,0.674242272,, -31,52,Maize (Zea mays) - silage,30,10.79,4.4,0.71214,, -29,53,Maize (Zea mays) - stover,87,9.127224,5.9,0.602396784,, -29,54,Maize (Zea mays) - whole grain,90,15,9,0.99,, -33,55,Moringa oleifera (forage),26.2,10.6,24.3,0.6996,, -58,56,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77,0.7128,, -58,57,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77,0.7128,, -58,58,Mucuna (Mucuna pruriens) - hay,90.6,10.89,14.8,0.71874,, -58,59,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3,0.936738,, -59,60,Mulberry (Morus alba),28.4,10,19.4,0.66,, -35,61,N/A,0,0,0,0,, -36,62,Naturally occuring pasture - grazing,60,5,6,0.33,, -36,63,Naturally occuring pasture - grazing OFR,60,5,6,0.33,, -36,64,Naturally occuring pasture - green fodder,60,5,6,0.33,, -2,65,Oats (Avena sativa) - grain IP,89,12.267324,13.6,0.809643384,, -3,66,Oats (Avena sativa) - green fodder,31,8.36,4,0.55176,, -3,67,Oats (Avena sativa) - hay,85,7.48,3.5,0.49368,, -3,68,Oats (Avena sativa) - hay OFR,85,7.48,3.5,0.49368,, -2,69,Oats (Avena sativa) - hulls,92.4,5.317236,4.1,0.350937576,, -43,70,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2,1.00860012,, -3,71,Oats (Avena sativa) - silage,36.4,8.917884,12.7,0.588580344,, -2,72,Oats (Avena sativa) - straw,88,6.47,0,0.42702,, -60,73,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1,0.569237328,, -60,74,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4,0.53884116,, -61,75,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15,0.49462842,, -38,76,Panicum maximum (forage),26,7.543013699,9.882191781,0.497838904,, -38,77,Panicum maximum (green fodder),26,7.58,10,0.50028,, -39,78,Paspalum notatum (forage),28,7.543013699,8.254794521,0.497838904,, -62,79,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4,0.624503088,, -62,80,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88,0.82038,, -63,81,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81,0.5643,, -40,82,Pennisetum purpureum - forage,15,9.880848,11,0.652135968,, -41,83,Pennisetum purpureum - silage,19.5,7.5,6.5,0.495,, -42,84,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3,0.527788008,, -42,85,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39,0.73128,, -42,86,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6,0.759,, -64,87,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1,0.7599042,, -64,88,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94,0.54252,, -65,89,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96,0.6765,, -65,90,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13,0.85734,, -43,91,Poultry litter,78.7,8.16426,17.78,0.53884116,, -66,92,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44,0.65406,, -67,93,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8,0.688058712,, -67,94,Red clover (Trifolium pratense) - hay,88.4,8.331732,15,0.549894312,, -68,95,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1,0.49764,, -68,96,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7,0.6006,, -43,97,Rice (Oryza sativa) - bran (with germs),91,10.425132,14,0.688058712,, -45,98,Rice (Oryza sativa) - hulls,92,1.423512,3.1,0.093951792,, -45,99,Rice (Oryza sativa) - straw,91.88,5.64,3.85,0.37224,, -69,100,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3,0.56364,, -70,101,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3,0.740561184,, -70,102,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6,0.530551296,, -46,103,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9,0.464232384,, -47,104,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7,0.56562,, -46,105,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6,0.817933248,, -47,106,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7,0.56562,, -16,107,Soybean (Glycine max) - crop residue,88,6.322068,5.2,0.417256488,, -16,108,Soybean (Glycine max) - meal,89,13.18842,49.6,0.87043572,, -16,109,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2,0.823459824,, -16,110,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3,0.93951792,, -71,111,Stipa (grazing) OF,72,5.6,5,0.3696,, -72,112,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69,0.630029664,, -4,113,Sugar beet (pulp) OFR,89,11.4,8.9,0.7524,, -43,114,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9,0.4554,, -48,115,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69,0.49104,, -48,116,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3,0.594,, -43,117,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8,0.71845488,, -48,118,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9,0.4554,, -48,119,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5,0.462,, -20,120,Sulla,12.3,9.7,20.2,0.6402,, -43,121,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9,0.602396784,, -73,122,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4,0.66066,, -73,123,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1,0.89628,, -73,124,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6,0.7491,, -73,125,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4,0.66066,, -14,126,Tall fescue,21,9.11,8.9,0.60126,, -74,127,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21,0.49038,, -53,128,Wheat (bran) IP,87,11,17.3,0.726,, -52,129,Wheat (bran) OFC,87,11,17.3,0.726,, -51,130,Wheat (straw),88,5.63,4.2,0.37158,, -51,131,Wheat (straw) OFR,88,5.63,4.2,0.37158,, -75,132,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5,0.6006,, -36,142,Natural hay,60,5,6,0.33,, -40,133,Pennisetum purpureum- hay,86,9.88,11,0.6521,, -55,134,Guatemala grass forage,20,10,19,0.66,, -3,135,Oats(Avena sativa)- bran,26,7.48,3.5,0.4936,, -16,136,Soybean(Glycine max) straw,86,7,5.9,0.462,, -38,137,Panicum maximum (hay),,7.54,9.88,0.4976,, -51,138,Wheat (bran),87,11,17.3,0.726,, -5,139,Brachiaria hay,86,7.25,8.25,0.4785,, -56,140,Greenleaf desmodium(Desmodium intoturm),25,8,15,0.528,, +crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content +1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521 +34,2,Banana (fruit),22,12.3,5.2 +34,3,Banana leaves,16,10,9.5 +21,4,Barley (forage),34,8.69,4.5 +23,5,Barley (grains) IP,87.1,12.4,11.8 +22,6,Barley (grains) OFC,87.1,12.4,11.8 +22,7,Barley (straw),87,5.88,0.3 +11,8,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6 +11,9,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6 +50,10,Berseem clover,11,12.39,26 +5,11,Brachiaria brizantha (forage),26,7.254794521,7.254794521 +6,12,Brachiaria hybrid (forage),26,7.254794521,8.254794521 +7,13,Canavalia brasiliensis (forage),30,12.1,22 +8,14,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94 +8,15,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45 +8,16,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81 +43,17,Concentrate (commercial),90,12.1,16 +9,18,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 +9,19,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 +9,20,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 +9,21,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 +10,22,Cratylia argentea (forage),30,9.4,24 +11,23,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 +12,24,Dichanthium aristatum (forage),33,7.25,8 +49,25,Digitaria swazilandensis (forage),24,9.7,9.9 +54,26,Fava bean (grain),86.6,13.3,29 +54,27,Fava bean (straw),89.7,6.4,7.4 +15,28,Gliricidia sepium (forage),30,11.5,22.3 +17,29,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52 +17,30,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2 +17,31,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29 +19,32,Guazuma ulmifolia (forage),30,11,15 +24,33,Hyparrhenia rufa (forage),26,6.129315068,6 +25,34,Ischaemum ciliare (forage),24,6.003835616,6 +28,35,Italian ryegrass (forage),19,8.7,7 +28,36,Italian ryegrass (hay),85,8.36,6.01 +28,37,Italian ryegrass (silage),33.5,9.07,5.3 +26,38,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94 +26,39,Lablab (Lablab purpureus) - hay,90,9.29,16.6 +26,40,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51 +27,41,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +32,42,Lucerne (Medicago sativa) - forage,21,10.08,19.7 +32,43,Lucerne (Medicago sativa) - hay,85,8.36,12.5 +32,44,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 +57,45,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44 +57,46,Lupins (Lupinus angustifolius) - grain,90,19,30 +57,47,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54 +43,48,Maize (Zea mays) - bought stover,87,9.127224,5.9 +29,49,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8 +30,50,Maize (Zea mays) - cracked grains IP,89,13.020948,10 +29,51,Maize (Zea mays) - forage,82,10.215792,8.9 +31,52,Maize (Zea mays) - silage,30,10.79,4.4 +29,53,Maize (Zea mays) - stover,87,9.127224,5.9 +29,54,Maize (Zea mays) - whole grain,90,15,9 +33,55,Moringa oleifera (forage),26.2,10.6,24.3 +58,56,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77 +58,57,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77 +58,58,Mucuna (Mucuna pruriens) - hay,90.6,10.89,14.8 +58,59,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3 +59,60,Mulberry (Morus alba),28.4,10,19.4 +35,61,N/A,0,0,0 +36,62,Naturally occuring pasture - grazing,60,5,6 +36,63,Naturally occuring pasture - grazing OFR,60,5,6 +36,64,Naturally occuring pasture - green fodder,60,5,6 +2,65,Oats (Avena sativa) - grain IP,89,12.267324,13.6 +3,66,Oats (Avena sativa) - green fodder,31,8.36,4 +3,67,Oats (Avena sativa) - hay,85,7.48,3.5 +3,68,Oats (Avena sativa) - hay OFR,85,7.48,3.5 +2,69,Oats (Avena sativa) - hulls,92.4,5.317236,4.1 +43,70,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2 +3,71,Oats (Avena sativa) - silage,36.4,8.917884,12.7 +2,72,Oats (Avena sativa) - straw,88,6.47,0 +60,73,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1 +60,74,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4 +61,75,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15 +38,76,Panicum maximum (forage),26,7.543013699,9.882191781 +38,77,Panicum maximum (green fodder),26,7.58,10 +39,78,Paspalum notatum (forage),28,7.543013699,8.254794521 +62,79,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4 +62,80,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88 +63,81,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81 +40,82,Pennisetum purpureum - forage,15,9.880848,11 +41,83,Pennisetum purpureum - silage,19.5,7.5,6.5 +42,84,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3 +42,85,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39 +42,86,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6 +64,87,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1 +64,88,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94 +65,89,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96 +65,90,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13 +43,91,Poultry litter,78.7,8.16426,17.78 +66,92,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44 +67,93,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8 +67,94,Red clover (Trifolium pratense) - hay,88.4,8.331732,15 +68,95,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1 +68,96,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7 +43,97,Rice (Oryza sativa) - bran (with germs),91,10.425132,14 +45,98,Rice (Oryza sativa) - hulls,92,1.423512,3.1 +45,99,Rice (Oryza sativa) - straw,91.88,5.64,3.85 +69,100,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 +70,101,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3 +70,102,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6 +46,103,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 +47,104,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 +46,105,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 +47,106,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 +16,107,Soybean (Glycine max) - crop residue,88,6.322068,5.2 +16,108,Soybean (Glycine max) - meal,89,13.18842,49.6 +16,109,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2 +16,110,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 +71,111,Stipa (grazing) OF,72,5.6,5 +72,112,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69 +4,113,Sugar beet (pulp) OFR,89,11.4,8.9 +43,114,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 +48,115,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69 +48,116,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 +43,117,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 +48,118,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 +48,119,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5 +20,120,Sulla,12.3,9.7,20.2 +43,121,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9 +73,122,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 +73,123,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1 +73,124,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6 +73,125,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 +14,126,Tall fescue,21,9.11,8.9 +74,127,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21 +53,128,Wheat (bran) IP,87,11,17.3 +52,129,Wheat (bran) OFC,87,11,17.3 +51,130,Wheat (straw),88,5.63,4.2 +51,131,Wheat (straw) OFR,88,5.63,4.2 +75,132,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5 +36,142,Natural hay,60,5,6 +40,133,Pennisetum purpureum- hay,86,9.88,11 +55,134,Guatemala grass forage,20,10,19 +3,135,Oats(Avena sativa)- bran,26,7.48,3.5 +16,136,Soybean(Glycine max) straw,86,7,5.9 +38,137,Panicum maximum (hay),,7.54,9.88 +51,138,Wheat (bran),87,11,17.3 +5,139,Brachiaria hay,86,7.25,8.25 +56,140,Greenleaf desmodium(Desmodium intoturm),25,8,15 diff --git a/data/shared_folder/parameters_database/Params_1/lkp_feeditem.csv b/data/shared_folder/parameters_database/Params_1/lkp_feeditem.csv index dd871bb..dd90ee5 100644 --- a/data/shared_folder/parameters_database/Params_1/lkp_feeditem.csv +++ b/data/shared_folder/parameters_database/Params_1/lkp_feeditem.csv @@ -1,142 +1,142 @@ -crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content,de,, -1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521,0.4686,, -34,2,Banana (fruit),22,12.3,5.2,0.8118,, -34,3,Banana leaves,16,10,9.5,0.66,, -21,4,Barley (forage),34,8.69,4.5,0.57354,, -23,5,Barley (grains) IP,87.1,12.4,11.8,0.8184,, -22,6,Barley (grains) OFC,87.1,12.4,11.8,0.8184,, -22,7,Barley (straw),87,5.88,0.3,0.38808,, -11,8,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6,0.638319528,, -11,9,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6,0.489101976,, -50,10,Berseem clover,11,12.39,26,0.81774,, -5,11,Brachiaria brizantha (forage),26,7.254794521,7.254794521,0.478816438,, -6,12,Brachiaria hybrid (forage),26,7.254794521,8.254794521,0.478816438,, -7,13,Canavalia brasiliensis (forage),30,12.1,22,0.7986,, -8,14,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94,0.660425832,, -8,15,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45,0.2846184,, -8,16,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81,0.71016,, -43,17,Concentrate (commercial),90,12.1,16,0.7986,, -9,18,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4,0.652135968,, -9,19,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56,0.6897,, -9,20,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88,0.87186,, -9,21,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53,0.924,, -10,22,Cratylia argentea (forage),30,9.4,24,0.6204,, -11,23,Cynodon nlemfuensis (forage),30.3,9.671508,12.6,0.638319528,, -12,24,Dichanthium aristatum (forage),33,7.25,8,0.4785,, -49,25,Digitaria swazilandensis (forage),24,9.7,9.9,0.6402,, -54,26,Fava bean (grain),86.6,13.3,29,0.8778,, -54,27,Fava bean (straw),89.7,6.4,7.4,0.4224,, -15,28,Gliricidia sepium (forage),30,11.5,22.3,0.759,, -17,29,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52,0.52734,, -17,30,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2,1.3982232,, -17,31,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29,0.43296,, -19,32,Guazuma ulmifolia (forage),30,11,15,0.726,, -24,33,Hyparrhenia rufa (forage),26,6.129315068,6,0.404534795,, -25,34,Ischaemum ciliare (forage),24,6.003835616,6,0.396253151,, -28,35,Italian ryegrass (forage),19,8.7,7,0.5742,, -28,36,Italian ryegrass (hay),85,8.36,6.01,0.55176,, -28,37,Italian ryegrass (silage),33.5,9.07,5.3,0.59862,, -26,38,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94,0.75438,, -26,39,Lablab (Lablab purpureus) - hay,90,9.29,16.6,0.61314,, -26,40,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51,0.49104,, -27,41,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93,0.627,, -32,42,Lucerne (Medicago sativa) - forage,21,10.08,19.7,0.66528,, -32,43,Lucerne (Medicago sativa) - hay,85,8.36,12.5,0.55176,, -32,44,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5,0.630029664,, -57,45,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44,0.36762,, -57,46,Lupins (Lupinus angustifolius) - grain,90,19,30,1.254,, -57,47,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54,0.48576,, -43,48,Maize (Zea mays) - bought stover,87,9.127224,5.9,0.602396784,, -29,49,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8,0.500155128,, -30,50,Maize (Zea mays) - cracked grains IP,89,13.020948,10,0.859382568,, -29,51,Maize (Zea mays) - forage,82,10.215792,8.9,0.674242272,, -31,52,Maize (Zea mays) - silage,30,10.79,4.4,0.71214,, -29,53,Maize (Zea mays) - stover,87,9.127224,5.9,0.602396784,, -29,54,Maize (Zea mays) - whole grain,90,15,9,0.99,, -33,55,Moringa oleifera (forage),26.2,10.6,24.3,0.6996,, -58,56,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77,0.7128,, -58,57,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77,0.7128,, -58,58,Mucuna (Mucuna pruriens) - hay,90.6,10.89,14.8,0.71874,, -58,59,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3,0.936738,, -59,60,Mulberry (Morus alba),28.4,10,19.4,0.66,, -35,61,N/A,0,0,0,0,, -36,62,Naturally occuring pasture - grazing,60,5,6,0.33,, -36,63,Naturally occuring pasture - grazing OFR,60,5,6,0.33,, -36,64,Naturally occuring pasture - green fodder,60,5,6,0.33,, -2,65,Oats (Avena sativa) - grain IP,89,12.267324,13.6,0.809643384,, -3,66,Oats (Avena sativa) - green fodder,31,8.36,4,0.55176,, -3,67,Oats (Avena sativa) - hay,85,7.48,3.5,0.49368,, -3,68,Oats (Avena sativa) - hay OFR,85,7.48,3.5,0.49368,, -2,69,Oats (Avena sativa) - hulls,92.4,5.317236,4.1,0.350937576,, -43,70,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2,1.00860012,, -3,71,Oats (Avena sativa) - silage,36.4,8.917884,12.7,0.588580344,, -2,72,Oats (Avena sativa) - straw,88,6.47,0,0.42702,, -60,73,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1,0.569237328,, -60,74,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4,0.53884116,, -61,75,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15,0.49462842,, -38,76,Panicum maximum (forage),26,7.543013699,9.882191781,0.497838904,, -38,77,Panicum maximum (green fodder),26,7.58,10,0.50028,, -39,78,Paspalum notatum (forage),28,7.543013699,8.254794521,0.497838904,, -62,79,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4,0.624503088,, -62,80,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88,0.82038,, -63,81,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81,0.5643,, -40,82,Pennisetum purpureum - forage,15,9.880848,11,0.652135968,, -41,83,Pennisetum purpureum - silage,19.5,7.5,6.5,0.495,, -42,84,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3,0.527788008,, -42,85,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39,0.73128,, -42,86,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6,0.759,, -64,87,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1,0.7599042,, -64,88,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94,0.54252,, -65,89,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96,0.6765,, -65,90,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13,0.85734,, -43,91,Poultry litter,78.7,8.16426,17.78,0.53884116,, -66,92,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44,0.65406,, -67,93,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8,0.688058712,, -67,94,Red clover (Trifolium pratense) - hay,88.4,8.331732,15,0.549894312,, -68,95,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1,0.49764,, -68,96,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7,0.6006,, -43,97,Rice (Oryza sativa) - bran (with germs),91,10.425132,14,0.688058712,, -45,98,Rice (Oryza sativa) - hulls,92,1.423512,3.1,0.093951792,, -45,99,Rice (Oryza sativa) - straw,91.88,5.64,3.85,0.37224,, -69,100,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3,0.56364,, -70,101,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3,0.740561184,, -70,102,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6,0.530551296,, -46,103,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9,0.464232384,, -47,104,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7,0.56562,, -46,105,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6,0.817933248,, -47,106,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7,0.56562,, -16,107,Soybean (Glycine max) - crop residue,88,6.322068,5.2,0.417256488,, -16,108,Soybean (Glycine max) - meal,89,13.18842,49.6,0.87043572,, -16,109,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2,0.823459824,, -16,110,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3,0.93951792,, -71,111,Stipa (grazing) OF,72,5.6,5,0.3696,, -72,112,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69,0.630029664,, -4,113,Sugar beet (pulp) OFR,89,11.4,8.9,0.7524,, -43,114,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9,0.4554,, -48,115,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69,0.49104,, -48,116,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3,0.594,, -43,117,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8,0.71845488,, -48,118,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9,0.4554,, -48,119,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5,0.462,, -20,120,Sulla,12.3,9.7,20.2,0.6402,, -43,121,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9,0.602396784,, -73,122,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4,0.66066,, -73,123,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1,0.89628,, -73,124,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6,0.7491,, -73,125,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4,0.66066,, -14,126,Tall fescue,21,9.11,8.9,0.60126,, -74,127,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21,0.49038,, -53,128,Wheat (bran) IP,87,11,17.3,0.726,, -52,129,Wheat (bran) OFC,87,11,17.3,0.726,, -51,130,Wheat (straw),88,5.63,4.2,0.37158,, -51,131,Wheat (straw) OFR,88,5.63,4.2,0.37158,, -75,132,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5,0.6006,, -36,142,Natural hay,60,5,6,0.33,, -40,133,Pennisetum purpureum- hay,86,9.88,11,0.6521,, -55,134,Guatemala grass forage,20,10,19,0.66,, -3,135,Oats(Avena sativa)- bran,26,7.48,3.5,0.4936,, -16,136,Soybean(Glycine max) straw,86,7,5.9,0.462,, -38,137,Panicum maximum (hay),,7.54,9.88,0.4976,, -51,138,Wheat (bran),87,11,17.3,0.726,, -5,139,Brachiaria hay,86,7.25,8.25,0.4785,, -56,140,Greenleaf desmodium(Desmodium intoturm),25,8,15,0.528,, +crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content +1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521 +34,2,Banana (fruit),22,12.3,5.2 +34,3,Banana leaves,16,10,9.5 +21,4,Barley (forage),34,8.69,4.5 +23,5,Barley (grains) IP,87.1,12.4,11.8 +22,6,Barley (grains) OFC,87.1,12.4,11.8 +22,7,Barley (straw),87,5.88,0.3 +11,8,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6 +11,9,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6 +50,10,Berseem clover,11,12.39,26 +5,11,Brachiaria brizantha (forage),26,7.254794521,7.254794521 +6,12,Brachiaria hybrid (forage),26,7.254794521,8.254794521 +7,13,Canavalia brasiliensis (forage),30,12.1,22 +8,14,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94 +8,15,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45 +8,16,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81 +43,17,Concentrate (commercial),90,12.1,16 +9,18,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 +9,19,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 +9,20,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 +9,21,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 +10,22,Cratylia argentea (forage),30,9.4,24 +11,23,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 +12,24,Dichanthium aristatum (forage),33,7.25,8 +49,25,Digitaria swazilandensis (forage),24,9.7,9.9 +54,26,Fava bean (grain),86.6,13.3,29 +54,27,Fava bean (straw),89.7,6.4,7.4 +15,28,Gliricidia sepium (forage),30,11.5,22.3 +17,29,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52 +17,30,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2 +17,31,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29 +19,32,Guazuma ulmifolia (forage),30,11,15 +24,33,Hyparrhenia rufa (forage),26,6.129315068,6 +25,34,Ischaemum ciliare (forage),24,6.003835616,6 +28,35,Italian ryegrass (forage),19,8.7,7 +28,36,Italian ryegrass (hay),85,8.36,6.01 +28,37,Italian ryegrass (silage),33.5,9.07,5.3 +26,38,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94 +26,39,Lablab (Lablab purpureus) - hay,90,9.29,16.6 +26,40,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51 +27,41,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +32,42,Lucerne (Medicago sativa) - forage,21,10.08,19.7 +32,43,Lucerne (Medicago sativa) - hay,85,8.36,12.5 +32,44,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 +57,45,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44 +57,46,Lupins (Lupinus angustifolius) - grain,90,19,30 +57,47,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54 +43,48,Maize (Zea mays) - bought stover,87,9.127224,5.9 +29,49,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8 +30,50,Maize (Zea mays) - cracked grains IP,89,13.020948,10 +29,51,Maize (Zea mays) - forage,82,10.215792,8.9 +31,52,Maize (Zea mays) - silage,30,10.79,4.4 +29,53,Maize (Zea mays) - stover,87,9.127224,5.9 +29,54,Maize (Zea mays) - whole grain,90,15,9 +33,55,Moringa oleifera (forage),26.2,10.6,24.3 +58,56,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77 +58,57,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77 +58,58,Mucuna (Mucuna pruriens) - hay,90.6,10.89,14.8 +58,59,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3 +59,60,Mulberry (Morus alba),28.4,10,19.4 +35,61,N/A,0,0,0 +36,62,Naturally occuring pasture - grazing,60,5,6 +36,63,Naturally occuring pasture - grazing OFR,60,5,6 +36,64,Naturally occuring pasture - green fodder,60,5,6 +2,65,Oats (Avena sativa) - grain IP,89,12.267324,13.6 +3,66,Oats (Avena sativa) - green fodder,31,8.36,4 +3,67,Oats (Avena sativa) - hay,85,7.48,3.5 +3,68,Oats (Avena sativa) - hay OFR,85,7.48,3.5 +2,69,Oats (Avena sativa) - hulls,92.4,5.317236,4.1 +43,70,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2 +3,71,Oats (Avena sativa) - silage,36.4,8.917884,12.7 +2,72,Oats (Avena sativa) - straw,88,6.47,0 +60,73,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1 +60,74,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4 +61,75,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15 +38,76,Panicum maximum (forage),26,7.543013699,9.882191781 +38,77,Panicum maximum (green fodder),26,7.58,10 +39,78,Paspalum notatum (forage),28,7.543013699,8.254794521 +62,79,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4 +62,80,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88 +63,81,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81 +40,82,Pennisetum purpureum - forage,15,9.880848,11 +41,83,Pennisetum purpureum - silage,19.5,7.5,6.5 +42,84,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3 +42,85,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39 +42,86,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6 +64,87,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1 +64,88,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94 +65,89,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96 +65,90,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13 +43,91,Poultry litter,78.7,8.16426,17.78 +66,92,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44 +67,93,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8 +67,94,Red clover (Trifolium pratense) - hay,88.4,8.331732,15 +68,95,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1 +68,96,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7 +43,97,Rice (Oryza sativa) - bran (with germs),91,10.425132,14 +45,98,Rice (Oryza sativa) - hulls,92,1.423512,3.1 +45,99,Rice (Oryza sativa) - straw,91.88,5.64,3.85 +69,100,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 +70,101,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3 +70,102,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6 +46,103,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 +47,104,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 +46,105,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 +47,106,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 +16,107,Soybean (Glycine max) - crop residue,88,6.322068,5.2 +16,108,Soybean (Glycine max) - meal,89,13.18842,49.6 +16,109,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2 +16,110,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 +71,111,Stipa (grazing) OF,72,5.6,5 +72,112,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69 +4,113,Sugar beet (pulp) OFR,89,11.4,8.9 +43,114,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 +48,115,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69 +48,116,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 +43,117,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 +48,118,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 +48,119,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5 +20,120,Sulla,12.3,9.7,20.2 +43,121,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9 +73,122,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 +73,123,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1 +73,124,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6 +73,125,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 +14,126,Tall fescue,21,9.11,8.9 +74,127,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21 +53,128,Wheat (bran) IP,87,11,17.3 +52,129,Wheat (bran) OFC,87,11,17.3 +51,130,Wheat (straw),88,5.63,4.2 +51,131,Wheat (straw) OFR,88,5.63,4.2 +75,132,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5 +36,142,Natural hay,60,5,6 +40,133,Pennisetum purpureum- hay,86,9.88,11 +55,134,Guatemala grass forage,20,10,19 +3,135,Oats(Avena sativa)- bran,26,7.48,3.5 +16,136,Soybean(Glycine max) straw,86,7,5.9 +38,137,Panicum maximum (hay),,7.54,9.88 +51,138,Wheat (bran),87,11,17.3 +5,139,Brachiaria hay,86,7.25,8.25 +56,140,Greenleaf desmodium(Desmodium intoturm),25,8,15 diff --git a/data/shared_folder/parameters_database/Params_2/lkp_feeditem.csv b/data/shared_folder/parameters_database/Params_2/lkp_feeditem.csv index dd871bb..dd90ee5 100644 --- a/data/shared_folder/parameters_database/Params_2/lkp_feeditem.csv +++ b/data/shared_folder/parameters_database/Params_2/lkp_feeditem.csv @@ -1,142 +1,142 @@ -crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content,de,, -1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521,0.4686,, -34,2,Banana (fruit),22,12.3,5.2,0.8118,, -34,3,Banana leaves,16,10,9.5,0.66,, -21,4,Barley (forage),34,8.69,4.5,0.57354,, -23,5,Barley (grains) IP,87.1,12.4,11.8,0.8184,, -22,6,Barley (grains) OFC,87.1,12.4,11.8,0.8184,, -22,7,Barley (straw),87,5.88,0.3,0.38808,, -11,8,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6,0.638319528,, -11,9,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6,0.489101976,, -50,10,Berseem clover,11,12.39,26,0.81774,, -5,11,Brachiaria brizantha (forage),26,7.254794521,7.254794521,0.478816438,, -6,12,Brachiaria hybrid (forage),26,7.254794521,8.254794521,0.478816438,, -7,13,Canavalia brasiliensis (forage),30,12.1,22,0.7986,, -8,14,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94,0.660425832,, -8,15,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45,0.2846184,, -8,16,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81,0.71016,, -43,17,Concentrate (commercial),90,12.1,16,0.7986,, -9,18,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4,0.652135968,, -9,19,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56,0.6897,, -9,20,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88,0.87186,, -9,21,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53,0.924,, -10,22,Cratylia argentea (forage),30,9.4,24,0.6204,, -11,23,Cynodon nlemfuensis (forage),30.3,9.671508,12.6,0.638319528,, -12,24,Dichanthium aristatum (forage),33,7.25,8,0.4785,, -49,25,Digitaria swazilandensis (forage),24,9.7,9.9,0.6402,, -54,26,Fava bean (grain),86.6,13.3,29,0.8778,, -54,27,Fava bean (straw),89.7,6.4,7.4,0.4224,, -15,28,Gliricidia sepium (forage),30,11.5,22.3,0.759,, -17,29,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52,0.52734,, -17,30,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2,1.3982232,, -17,31,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29,0.43296,, -19,32,Guazuma ulmifolia (forage),30,11,15,0.726,, -24,33,Hyparrhenia rufa (forage),26,6.129315068,6,0.404534795,, -25,34,Ischaemum ciliare (forage),24,6.003835616,6,0.396253151,, -28,35,Italian ryegrass (forage),19,8.7,7,0.5742,, -28,36,Italian ryegrass (hay),85,8.36,6.01,0.55176,, -28,37,Italian ryegrass (silage),33.5,9.07,5.3,0.59862,, -26,38,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94,0.75438,, -26,39,Lablab (Lablab purpureus) - hay,90,9.29,16.6,0.61314,, -26,40,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51,0.49104,, -27,41,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93,0.627,, -32,42,Lucerne (Medicago sativa) - forage,21,10.08,19.7,0.66528,, -32,43,Lucerne (Medicago sativa) - hay,85,8.36,12.5,0.55176,, -32,44,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5,0.630029664,, -57,45,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44,0.36762,, -57,46,Lupins (Lupinus angustifolius) - grain,90,19,30,1.254,, -57,47,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54,0.48576,, -43,48,Maize (Zea mays) - bought stover,87,9.127224,5.9,0.602396784,, -29,49,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8,0.500155128,, -30,50,Maize (Zea mays) - cracked grains IP,89,13.020948,10,0.859382568,, -29,51,Maize (Zea mays) - forage,82,10.215792,8.9,0.674242272,, -31,52,Maize (Zea mays) - silage,30,10.79,4.4,0.71214,, -29,53,Maize (Zea mays) - stover,87,9.127224,5.9,0.602396784,, -29,54,Maize (Zea mays) - whole grain,90,15,9,0.99,, -33,55,Moringa oleifera (forage),26.2,10.6,24.3,0.6996,, -58,56,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77,0.7128,, -58,57,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77,0.7128,, -58,58,Mucuna (Mucuna pruriens) - hay,90.6,10.89,14.8,0.71874,, -58,59,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3,0.936738,, -59,60,Mulberry (Morus alba),28.4,10,19.4,0.66,, -35,61,N/A,0,0,0,0,, -36,62,Naturally occuring pasture - grazing,60,5,6,0.33,, -36,63,Naturally occuring pasture - grazing OFR,60,5,6,0.33,, -36,64,Naturally occuring pasture - green fodder,60,5,6,0.33,, -2,65,Oats (Avena sativa) - grain IP,89,12.267324,13.6,0.809643384,, -3,66,Oats (Avena sativa) - green fodder,31,8.36,4,0.55176,, -3,67,Oats (Avena sativa) - hay,85,7.48,3.5,0.49368,, -3,68,Oats (Avena sativa) - hay OFR,85,7.48,3.5,0.49368,, -2,69,Oats (Avena sativa) - hulls,92.4,5.317236,4.1,0.350937576,, -43,70,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2,1.00860012,, -3,71,Oats (Avena sativa) - silage,36.4,8.917884,12.7,0.588580344,, -2,72,Oats (Avena sativa) - straw,88,6.47,0,0.42702,, -60,73,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1,0.569237328,, -60,74,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4,0.53884116,, -61,75,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15,0.49462842,, -38,76,Panicum maximum (forage),26,7.543013699,9.882191781,0.497838904,, -38,77,Panicum maximum (green fodder),26,7.58,10,0.50028,, -39,78,Paspalum notatum (forage),28,7.543013699,8.254794521,0.497838904,, -62,79,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4,0.624503088,, -62,80,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88,0.82038,, -63,81,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81,0.5643,, -40,82,Pennisetum purpureum - forage,15,9.880848,11,0.652135968,, -41,83,Pennisetum purpureum - silage,19.5,7.5,6.5,0.495,, -42,84,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3,0.527788008,, -42,85,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39,0.73128,, -42,86,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6,0.759,, -64,87,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1,0.7599042,, -64,88,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94,0.54252,, -65,89,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96,0.6765,, -65,90,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13,0.85734,, -43,91,Poultry litter,78.7,8.16426,17.78,0.53884116,, -66,92,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44,0.65406,, -67,93,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8,0.688058712,, -67,94,Red clover (Trifolium pratense) - hay,88.4,8.331732,15,0.549894312,, -68,95,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1,0.49764,, -68,96,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7,0.6006,, -43,97,Rice (Oryza sativa) - bran (with germs),91,10.425132,14,0.688058712,, -45,98,Rice (Oryza sativa) - hulls,92,1.423512,3.1,0.093951792,, -45,99,Rice (Oryza sativa) - straw,91.88,5.64,3.85,0.37224,, -69,100,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3,0.56364,, -70,101,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3,0.740561184,, -70,102,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6,0.530551296,, -46,103,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9,0.464232384,, -47,104,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7,0.56562,, -46,105,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6,0.817933248,, -47,106,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7,0.56562,, -16,107,Soybean (Glycine max) - crop residue,88,6.322068,5.2,0.417256488,, -16,108,Soybean (Glycine max) - meal,89,13.18842,49.6,0.87043572,, -16,109,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2,0.823459824,, -16,110,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3,0.93951792,, -71,111,Stipa (grazing) OF,72,5.6,5,0.3696,, -72,112,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69,0.630029664,, -4,113,Sugar beet (pulp) OFR,89,11.4,8.9,0.7524,, -43,114,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9,0.4554,, -48,115,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69,0.49104,, -48,116,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3,0.594,, -43,117,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8,0.71845488,, -48,118,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9,0.4554,, -48,119,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5,0.462,, -20,120,Sulla,12.3,9.7,20.2,0.6402,, -43,121,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9,0.602396784,, -73,122,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4,0.66066,, -73,123,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1,0.89628,, -73,124,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6,0.7491,, -73,125,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4,0.66066,, -14,126,Tall fescue,21,9.11,8.9,0.60126,, -74,127,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21,0.49038,, -53,128,Wheat (bran) IP,87,11,17.3,0.726,, -52,129,Wheat (bran) OFC,87,11,17.3,0.726,, -51,130,Wheat (straw),88,5.63,4.2,0.37158,, -51,131,Wheat (straw) OFR,88,5.63,4.2,0.37158,, -75,132,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5,0.6006,, -36,142,Natural hay,60,5,6,0.33,, -40,133,Pennisetum purpureum- hay,86,9.88,11,0.6521,, -55,134,Guatemala grass forage,20,10,19,0.66,, -3,135,Oats(Avena sativa)- bran,26,7.48,3.5,0.4936,, -16,136,Soybean(Glycine max) straw,86,7,5.9,0.462,, -38,137,Panicum maximum (hay),,7.54,9.88,0.4976,, -51,138,Wheat (bran),87,11,17.3,0.726,, -5,139,Brachiaria hay,86,7.25,8.25,0.4785,, -56,140,Greenleaf desmodium(Desmodium intoturm),25,8,15,0.528,, +crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content +1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521 +34,2,Banana (fruit),22,12.3,5.2 +34,3,Banana leaves,16,10,9.5 +21,4,Barley (forage),34,8.69,4.5 +23,5,Barley (grains) IP,87.1,12.4,11.8 +22,6,Barley (grains) OFC,87.1,12.4,11.8 +22,7,Barley (straw),87,5.88,0.3 +11,8,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6 +11,9,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6 +50,10,Berseem clover,11,12.39,26 +5,11,Brachiaria brizantha (forage),26,7.254794521,7.254794521 +6,12,Brachiaria hybrid (forage),26,7.254794521,8.254794521 +7,13,Canavalia brasiliensis (forage),30,12.1,22 +8,14,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94 +8,15,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45 +8,16,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81 +43,17,Concentrate (commercial),90,12.1,16 +9,18,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 +9,19,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 +9,20,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 +9,21,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 +10,22,Cratylia argentea (forage),30,9.4,24 +11,23,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 +12,24,Dichanthium aristatum (forage),33,7.25,8 +49,25,Digitaria swazilandensis (forage),24,9.7,9.9 +54,26,Fava bean (grain),86.6,13.3,29 +54,27,Fava bean (straw),89.7,6.4,7.4 +15,28,Gliricidia sepium (forage),30,11.5,22.3 +17,29,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52 +17,30,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2 +17,31,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29 +19,32,Guazuma ulmifolia (forage),30,11,15 +24,33,Hyparrhenia rufa (forage),26,6.129315068,6 +25,34,Ischaemum ciliare (forage),24,6.003835616,6 +28,35,Italian ryegrass (forage),19,8.7,7 +28,36,Italian ryegrass (hay),85,8.36,6.01 +28,37,Italian ryegrass (silage),33.5,9.07,5.3 +26,38,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94 +26,39,Lablab (Lablab purpureus) - hay,90,9.29,16.6 +26,40,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51 +27,41,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +32,42,Lucerne (Medicago sativa) - forage,21,10.08,19.7 +32,43,Lucerne (Medicago sativa) - hay,85,8.36,12.5 +32,44,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 +57,45,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44 +57,46,Lupins (Lupinus angustifolius) - grain,90,19,30 +57,47,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54 +43,48,Maize (Zea mays) - bought stover,87,9.127224,5.9 +29,49,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8 +30,50,Maize (Zea mays) - cracked grains IP,89,13.020948,10 +29,51,Maize (Zea mays) - forage,82,10.215792,8.9 +31,52,Maize (Zea mays) - silage,30,10.79,4.4 +29,53,Maize (Zea mays) - stover,87,9.127224,5.9 +29,54,Maize (Zea mays) - whole grain,90,15,9 +33,55,Moringa oleifera (forage),26.2,10.6,24.3 +58,56,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77 +58,57,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77 +58,58,Mucuna (Mucuna pruriens) - hay,90.6,10.89,14.8 +58,59,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3 +59,60,Mulberry (Morus alba),28.4,10,19.4 +35,61,N/A,0,0,0 +36,62,Naturally occuring pasture - grazing,60,5,6 +36,63,Naturally occuring pasture - grazing OFR,60,5,6 +36,64,Naturally occuring pasture - green fodder,60,5,6 +2,65,Oats (Avena sativa) - grain IP,89,12.267324,13.6 +3,66,Oats (Avena sativa) - green fodder,31,8.36,4 +3,67,Oats (Avena sativa) - hay,85,7.48,3.5 +3,68,Oats (Avena sativa) - hay OFR,85,7.48,3.5 +2,69,Oats (Avena sativa) - hulls,92.4,5.317236,4.1 +43,70,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2 +3,71,Oats (Avena sativa) - silage,36.4,8.917884,12.7 +2,72,Oats (Avena sativa) - straw,88,6.47,0 +60,73,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1 +60,74,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4 +61,75,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15 +38,76,Panicum maximum (forage),26,7.543013699,9.882191781 +38,77,Panicum maximum (green fodder),26,7.58,10 +39,78,Paspalum notatum (forage),28,7.543013699,8.254794521 +62,79,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4 +62,80,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88 +63,81,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81 +40,82,Pennisetum purpureum - forage,15,9.880848,11 +41,83,Pennisetum purpureum - silage,19.5,7.5,6.5 +42,84,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3 +42,85,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39 +42,86,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6 +64,87,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1 +64,88,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94 +65,89,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96 +65,90,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13 +43,91,Poultry litter,78.7,8.16426,17.78 +66,92,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44 +67,93,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8 +67,94,Red clover (Trifolium pratense) - hay,88.4,8.331732,15 +68,95,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1 +68,96,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7 +43,97,Rice (Oryza sativa) - bran (with germs),91,10.425132,14 +45,98,Rice (Oryza sativa) - hulls,92,1.423512,3.1 +45,99,Rice (Oryza sativa) - straw,91.88,5.64,3.85 +69,100,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 +70,101,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3 +70,102,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6 +46,103,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 +47,104,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 +46,105,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 +47,106,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 +16,107,Soybean (Glycine max) - crop residue,88,6.322068,5.2 +16,108,Soybean (Glycine max) - meal,89,13.18842,49.6 +16,109,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2 +16,110,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 +71,111,Stipa (grazing) OF,72,5.6,5 +72,112,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69 +4,113,Sugar beet (pulp) OFR,89,11.4,8.9 +43,114,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 +48,115,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69 +48,116,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 +43,117,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 +48,118,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 +48,119,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5 +20,120,Sulla,12.3,9.7,20.2 +43,121,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9 +73,122,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 +73,123,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1 +73,124,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6 +73,125,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 +14,126,Tall fescue,21,9.11,8.9 +74,127,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21 +53,128,Wheat (bran) IP,87,11,17.3 +52,129,Wheat (bran) OFC,87,11,17.3 +51,130,Wheat (straw),88,5.63,4.2 +51,131,Wheat (straw) OFR,88,5.63,4.2 +75,132,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5 +36,142,Natural hay,60,5,6 +40,133,Pennisetum purpureum- hay,86,9.88,11 +55,134,Guatemala grass forage,20,10,19 +3,135,Oats(Avena sativa)- bran,26,7.48,3.5 +16,136,Soybean(Glycine max) straw,86,7,5.9 +38,137,Panicum maximum (hay),,7.54,9.88 +51,138,Wheat (bran),87,11,17.3 +5,139,Brachiaria hay,86,7.25,8.25 +56,140,Greenleaf desmodium(Desmodium intoturm),25,8,15 From 9ae0c5aa3a46c74788887e9696c2affa95a7b64c Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 24 Dec 2025 23:53:04 +0100 Subject: [PATCH 44/69] Remove unnecessary variables - Remove `cp_lactation` from the livestock dataframe in the app. - Remove `milk_production` and `live_weight_gain` from the livestock dataframe in the parameters database. - Remove `n_content` from the feedtype initialization table, --- R/30_mod_scenario_init.R | 4 -- R/30_mod_scenario_server.R | 6 +-- .../Params DB - Default/lkp_livetype.csv | 46 +++++++++---------- data/primary_database/lkp_livetype.csv | 46 +++++++++---------- .../Params_1/lkp_livetype.csv | 46 +++++++++---------- .../Params_2/lkp_livetype.csv | 46 +++++++++---------- data/shared_folder/study_objects/Study_1.json | 9 ---- data/shared_folder/study_objects/Study_2.json | 5 -- 8 files changed, 94 insertions(+), 114 deletions(-) diff --git a/R/30_mod_scenario_init.R b/R/30_mod_scenario_init.R index 57c9005..ea4f3fa 100644 --- a/R/30_mod_scenario_init.R +++ b/R/30_mod_scenario_init.R @@ -27,7 +27,6 @@ feedtype_colnames <- c( "Slope P Factor", "Main product dry yield (t DM/ha)", "Residue dry yield (t DM/ha)", - "Main product N content (kg N/kg DM)", "Reside N content (kg N/kg DM)", "Kc: Initial", "Kc: MidSeason", @@ -86,7 +85,6 @@ livestock_table_colnames <- c( "Crude Protein/Lysine requirement maintenance (kg/day)", "Crude Protein requirement grazing (kg/km)", "Crude Protein/ Lysine requirement pregnancy (kg)", - "Crude Protein/ Lysine requirement lactation (kg/ lactation)", "Crude Protein requirement (kg/kg milk)", "Crude Protein/ Lysine requirement growth (kg/kg LWG)", "Parturition interval (years)", @@ -170,7 +168,6 @@ livestock_data_initialization <- data.frame( cp_maintenance = numeric(), cp_grazing = numeric(), cp_pregnancy = numeric(), - cp_lactation = numeric(), cp_lactmilk = numeric(), cp_growth = numeric(), birth_interval = numeric(), @@ -219,7 +216,6 @@ feedtype_initialization <- data.frame( slope_p_factor = numeric(), dry_yield = numeric(), residue_dry_yield = numeric(), - n_content = numeric(), residue_n = numeric(), kc_initial = numeric(), kc_midseason = numeric(), diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index 8c64de7..017e2af 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -999,7 +999,6 @@ scenario_server <- function( cp_maintenance = selected_livestock$cp_maintenance, cp_grazing = selected_livestock$cp_grazing, cp_pregnancy = selected_livestock$cp_pregnancy, - cp_lactation = selected_livestock$cp_lactation, cp_lactmilk = selected_livestock$cp_lactmilk, cp_growth = selected_livestock$cp_growth, birth_interval = selected_livestock$birth_interval, @@ -1112,7 +1111,7 @@ scenario_server <- function( "body_weight", "body_weight_weaning", "body_weight_year_one", "adult_weight", "work_hour", "litter_size", "piglets_relying_on_milk", "lactation_length", "proportion_growth", "lw_gain", "grazing_displacement", - "cp_maintenance", "cp_grazing", "cp_pregnancy", "cp_lactation", + "cp_maintenance", "cp_grazing", "cp_pregnancy", "cp_lactmilk", "cp_growth", "birth_interval", "protein_milkcontent", "fat_content", "energy_milkcontent", "energy_meatcontent", "protein_meatcontent", "carcass_fraction", "energy_eggcontent", @@ -1412,7 +1411,6 @@ scenario_server <- function( slope_p_factor = lkp_slope()$p_factor[1], dry_yield = lkp_crops()$dry_yield[lkp_crops()$crop_code == input$crop], residue_dry_yield = lkp_crops()$residue_dry_yield[lkp_crops()$crop_code == input$crop], - n_content = 0, residue_n = lkp_crops()$residue_n[lkp_crops()$crop_code == input$crop], kc_initial = lkp_crops()$kc_initial[lkp_crops()$crop_code == input$crop], kc_midseason = lkp_crops()$kc_midseason[lkp_crops()$crop_code == input$crop], @@ -1640,7 +1638,7 @@ scenario_server <- function( ) %>% formatStyle( columns = c( - "dry_yield", "residue_dry_yield", "n_content", "residue_n", "kc_initial", + "dry_yield", "residue_dry_yield", "residue_n", "kc_initial", "kc_midseason", "kc_late", "category", "trees_ha", "trees_dhb", "trees_growth", "trees_removal", "trees_ha_dbh25", "average_dbh25", "increase_dbh25", "trees_ha_dbh2550", "average_dbh2550", diff --git a/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv b/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv index 7a309e6..cee5285 100644 --- a/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv +++ b/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv @@ -1,23 +1,23 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth","lw_gain","grazing_displacement","cp_maintenance","cp_grazing","cp_pregnancy","cp_lactation","cp_lactmilk","cp_growth","milk_production","live_weight_gain","birth_interval","protein_milkcontent","fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" -1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0,0.09,0,0,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" -2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0,0.09,0,0,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0,0.09,0,0,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -4,"Cattle - Adult male",580,0,0,0,0,0,0.58,0,0,0,0,0,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" -5,"Cattle - Steers/heifers",200,0,0,0,0,0,0.2,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,2,0.3,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -7,"Cattle - Calves",90,0,0,0,0,0,0.09,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -8,"Cattle - Calves (improved)",90,0,0,0,0,2,0.09,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.52,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -9,"Buffalo - Cows",450,0,0,0,0,0,0.45,0,9.64,0,0.09,0,0,0,1.2,3.7,4.3,970,2200,26,0,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" -10,"Buffalo - Steers/heifers",270,0,0,0,0,0,0.27,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -11,"Buffalo - Calves",110,0,0,0,0,0,0.11,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -12,"Sheep - Ewes",53,0,60,0,0,0,0.106,0,8.374,12.72,0.09,0,0,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -13,"Sheep - Breeding Rams",30,0,0,0,0,0,0.06,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -14,"Sheep - Fattening Rams",20,0,0,0,0,0,0.04,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -15,"Sheep - Lambs",15,0,0,0,0,0,0.03,0,0,0,0,0.45,0,0,0,3.2,5.8,970,2200,25,0.5,0,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -16,"Goats - Does",53,0,60,0,0,0,0.106,0,8.374,12.72,0.09,0,0,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" -17,"Goats - Breeding Bucks",30,0,0,0,0,0,0.06,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -18,"Goats - Fattening Bucks",20,0,0,0,0,0,0.04,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -19,"Goats - Kids",15,0,0,0,0,0,0.03,0,0,0,0,0.45,0,0,0,3.2,5.8,970,2200,25,0.5,0,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" -20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0,0.0297824570228919,0,0.33396,1.2348,0,0,0,0,0.5,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -21,"Pigs - dry sows/boars",200,0,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,0,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -22,"Pigs - growers",80,0,0,0,0,0,0.0149797828314718,0,0,0,0,0.05,0,0,0,0,0,0,2580,21,0.6,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth","lw_gain","grazing_displacement","cp_maintenance","cp_grazing","cp_pregnancy","cp_lactmilk","cp_growth","birth_interval","protein_milkcontent","fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" +2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +4,"Cattle - Adult male",580,0,0,0,0,0,0.58,0,0,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" +5,"Cattle - Steers/heifers",200,0,0,0,0,0,0.2,0,0,0,0.4,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,2,0.3,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +7,"Cattle - Calves",90,0,0,0,0,0,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +8,"Cattle - Calves (improved)",90,0,0,0,0,2,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.52,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +9,"Buffalo - Cows",450,0,0,0,0,0,0.45,0,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" +10,"Buffalo - Steers/heifers",270,0,0,0,0,0,0.27,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +11,"Buffalo - Calves",110,0,0,0,0,0,0.11,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +12,"Sheep - Ewes",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +13,"Sheep - Breeding Rams",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +14,"Sheep - Fattening Rams",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +15,"Sheep - Lambs",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +16,"Goats - Does",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" +17,"Goats - Breeding Bucks",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +18,"Goats - Fattening Bucks",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +19,"Goats - Kids",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" +20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0,0.0297824570228919,0,0.33396,0,0,0.5,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +21,"Pigs - dry sows/boars",200,0,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +22,"Pigs - growers",80,0,0,0,0,0,0.0149797828314718,0,0,0,0.05,0,0,0,0,2580,21,0.6,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" diff --git a/data/primary_database/lkp_livetype.csv b/data/primary_database/lkp_livetype.csv index 7a309e6..cee5285 100644 --- a/data/primary_database/lkp_livetype.csv +++ b/data/primary_database/lkp_livetype.csv @@ -1,23 +1,23 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth","lw_gain","grazing_displacement","cp_maintenance","cp_grazing","cp_pregnancy","cp_lactation","cp_lactmilk","cp_growth","milk_production","live_weight_gain","birth_interval","protein_milkcontent","fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" -1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0,0.09,0,0,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" -2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0,0.09,0,0,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0,0.09,0,0,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -4,"Cattle - Adult male",580,0,0,0,0,0,0.58,0,0,0,0,0,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" -5,"Cattle - Steers/heifers",200,0,0,0,0,0,0.2,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,2,0.3,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -7,"Cattle - Calves",90,0,0,0,0,0,0.09,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -8,"Cattle - Calves (improved)",90,0,0,0,0,2,0.09,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.52,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -9,"Buffalo - Cows",450,0,0,0,0,0,0.45,0,9.64,0,0.09,0,0,0,1.2,3.7,4.3,970,2200,26,0,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" -10,"Buffalo - Steers/heifers",270,0,0,0,0,0,0.27,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -11,"Buffalo - Calves",110,0,0,0,0,0,0.11,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -12,"Sheep - Ewes",53,0,60,0,0,0,0.106,0,8.374,12.72,0.09,0,0,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -13,"Sheep - Breeding Rams",30,0,0,0,0,0,0.06,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -14,"Sheep - Fattening Rams",20,0,0,0,0,0,0.04,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -15,"Sheep - Lambs",15,0,0,0,0,0,0.03,0,0,0,0,0.45,0,0,0,3.2,5.8,970,2200,25,0.5,0,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -16,"Goats - Does",53,0,60,0,0,0,0.106,0,8.374,12.72,0.09,0,0,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" -17,"Goats - Breeding Bucks",30,0,0,0,0,0,0.06,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -18,"Goats - Fattening Bucks",20,0,0,0,0,0,0.04,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -19,"Goats - Kids",15,0,0,0,0,0,0.03,0,0,0,0,0.45,0,0,0,3.2,5.8,970,2200,25,0.5,0,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" -20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0,0.0297824570228919,0,0.33396,1.2348,0,0,0,0,0.5,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -21,"Pigs - dry sows/boars",200,0,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,0,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -22,"Pigs - growers",80,0,0,0,0,0,0.0149797828314718,0,0,0,0,0.05,0,0,0,0,0,0,2580,21,0.6,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth","lw_gain","grazing_displacement","cp_maintenance","cp_grazing","cp_pregnancy","cp_lactmilk","cp_growth","birth_interval","protein_milkcontent","fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" +2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +4,"Cattle - Adult male",580,0,0,0,0,0,0.58,0,0,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" +5,"Cattle - Steers/heifers",200,0,0,0,0,0,0.2,0,0,0,0.4,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,2,0.3,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +7,"Cattle - Calves",90,0,0,0,0,0,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +8,"Cattle - Calves (improved)",90,0,0,0,0,2,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.52,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +9,"Buffalo - Cows",450,0,0,0,0,0,0.45,0,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" +10,"Buffalo - Steers/heifers",270,0,0,0,0,0,0.27,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +11,"Buffalo - Calves",110,0,0,0,0,0,0.11,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +12,"Sheep - Ewes",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +13,"Sheep - Breeding Rams",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +14,"Sheep - Fattening Rams",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +15,"Sheep - Lambs",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +16,"Goats - Does",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" +17,"Goats - Breeding Bucks",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +18,"Goats - Fattening Bucks",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +19,"Goats - Kids",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" +20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0,0.0297824570228919,0,0.33396,0,0,0.5,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +21,"Pigs - dry sows/boars",200,0,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +22,"Pigs - growers",80,0,0,0,0,0,0.0149797828314718,0,0,0,0.05,0,0,0,0,2580,21,0.6,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" diff --git a/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv b/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv index 7a309e6..cee5285 100644 --- a/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv +++ b/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv @@ -1,23 +1,23 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth","lw_gain","grazing_displacement","cp_maintenance","cp_grazing","cp_pregnancy","cp_lactation","cp_lactmilk","cp_growth","milk_production","live_weight_gain","birth_interval","protein_milkcontent","fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" -1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0,0.09,0,0,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" -2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0,0.09,0,0,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0,0.09,0,0,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -4,"Cattle - Adult male",580,0,0,0,0,0,0.58,0,0,0,0,0,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" -5,"Cattle - Steers/heifers",200,0,0,0,0,0,0.2,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,2,0.3,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -7,"Cattle - Calves",90,0,0,0,0,0,0.09,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -8,"Cattle - Calves (improved)",90,0,0,0,0,2,0.09,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.52,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -9,"Buffalo - Cows",450,0,0,0,0,0,0.45,0,9.64,0,0.09,0,0,0,1.2,3.7,4.3,970,2200,26,0,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" -10,"Buffalo - Steers/heifers",270,0,0,0,0,0,0.27,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -11,"Buffalo - Calves",110,0,0,0,0,0,0.11,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -12,"Sheep - Ewes",53,0,60,0,0,0,0.106,0,8.374,12.72,0.09,0,0,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -13,"Sheep - Breeding Rams",30,0,0,0,0,0,0.06,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -14,"Sheep - Fattening Rams",20,0,0,0,0,0,0.04,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -15,"Sheep - Lambs",15,0,0,0,0,0,0.03,0,0,0,0,0.45,0,0,0,3.2,5.8,970,2200,25,0.5,0,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -16,"Goats - Does",53,0,60,0,0,0,0.106,0,8.374,12.72,0.09,0,0,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" -17,"Goats - Breeding Bucks",30,0,0,0,0,0,0.06,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -18,"Goats - Fattening Bucks",20,0,0,0,0,0,0.04,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -19,"Goats - Kids",15,0,0,0,0,0,0.03,0,0,0,0,0.45,0,0,0,3.2,5.8,970,2200,25,0.5,0,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" -20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0,0.0297824570228919,0,0.33396,1.2348,0,0,0,0,0.5,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -21,"Pigs - dry sows/boars",200,0,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,0,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -22,"Pigs - growers",80,0,0,0,0,0,0.0149797828314718,0,0,0,0,0.05,0,0,0,0,0,0,2580,21,0.6,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth","lw_gain","grazing_displacement","cp_maintenance","cp_grazing","cp_pregnancy","cp_lactmilk","cp_growth","birth_interval","protein_milkcontent","fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" +2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +4,"Cattle - Adult male",580,0,0,0,0,0,0.58,0,0,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" +5,"Cattle - Steers/heifers",200,0,0,0,0,0,0.2,0,0,0,0.4,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,2,0.3,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +7,"Cattle - Calves",90,0,0,0,0,0,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +8,"Cattle - Calves (improved)",90,0,0,0,0,2,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.52,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +9,"Buffalo - Cows",450,0,0,0,0,0,0.45,0,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" +10,"Buffalo - Steers/heifers",270,0,0,0,0,0,0.27,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +11,"Buffalo - Calves",110,0,0,0,0,0,0.11,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +12,"Sheep - Ewes",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +13,"Sheep - Breeding Rams",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +14,"Sheep - Fattening Rams",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +15,"Sheep - Lambs",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +16,"Goats - Does",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" +17,"Goats - Breeding Bucks",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +18,"Goats - Fattening Bucks",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +19,"Goats - Kids",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" +20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0,0.0297824570228919,0,0.33396,0,0,0.5,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +21,"Pigs - dry sows/boars",200,0,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +22,"Pigs - growers",80,0,0,0,0,0,0.0149797828314718,0,0,0,0.05,0,0,0,0,2580,21,0.6,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" diff --git a/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv b/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv index 7a309e6..cee5285 100644 --- a/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv +++ b/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv @@ -1,23 +1,23 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth","lw_gain","grazing_displacement","cp_maintenance","cp_grazing","cp_pregnancy","cp_lactation","cp_lactmilk","cp_growth","milk_production","live_weight_gain","birth_interval","protein_milkcontent","fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" -1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0,0.09,0,0,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" -2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0,0.09,0,0,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0,0.09,0,0,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -4,"Cattle - Adult male",580,0,0,0,0,0,0.58,0,0,0,0,0,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" -5,"Cattle - Steers/heifers",200,0,0,0,0,0,0.2,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,2,0.3,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -7,"Cattle - Calves",90,0,0,0,0,0,0.09,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -8,"Cattle - Calves (improved)",90,0,0,0,0,2,0.09,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.52,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -9,"Buffalo - Cows",450,0,0,0,0,0,0.45,0,9.64,0,0.09,0,0,0,1.2,3.7,4.3,970,2200,26,0,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" -10,"Buffalo - Steers/heifers",270,0,0,0,0,0,0.27,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -11,"Buffalo - Calves",110,0,0,0,0,0,0.11,0,0,0,0,0.4,0,0,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -12,"Sheep - Ewes",53,0,60,0,0,0,0.106,0,8.374,12.72,0.09,0,0,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -13,"Sheep - Breeding Rams",30,0,0,0,0,0,0.06,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -14,"Sheep - Fattening Rams",20,0,0,0,0,0,0.04,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -15,"Sheep - Lambs",15,0,0,0,0,0,0.03,0,0,0,0,0.45,0,0,0,3.2,5.8,970,2200,25,0.5,0,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -16,"Goats - Does",53,0,60,0,0,0,0.106,0,8.374,12.72,0.09,0,0,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" -17,"Goats - Breeding Bucks",30,0,0,0,0,0,0.06,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -18,"Goats - Fattening Bucks",20,0,0,0,0,0,0.04,0,0,0,0,0.45,0,0,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -19,"Goats - Kids",15,0,0,0,0,0,0.03,0,0,0,0,0.45,0,0,0,3.2,5.8,970,2200,25,0.5,0,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" -20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0,0.0297824570228919,0,0.33396,1.2348,0,0,0,0,0.5,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -21,"Pigs - dry sows/boars",200,0,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,0,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -22,"Pigs - growers",80,0,0,0,0,0,0.0149797828314718,0,0,0,0,0.05,0,0,0,0,0,0,2580,21,0.6,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth","lw_gain","grazing_displacement","cp_maintenance","cp_grazing","cp_pregnancy","cp_lactmilk","cp_growth","birth_interval","protein_milkcontent","fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" +2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +4,"Cattle - Adult male",580,0,0,0,0,0,0.58,0,0,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" +5,"Cattle - Steers/heifers",200,0,0,0,0,0,0.2,0,0,0,0.4,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,2,0.3,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +7,"Cattle - Calves",90,0,0,0,0,0,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +8,"Cattle - Calves (improved)",90,0,0,0,0,2,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.52,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +9,"Buffalo - Cows",450,0,0,0,0,0,0.45,0,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" +10,"Buffalo - Steers/heifers",270,0,0,0,0,0,0.27,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +11,"Buffalo - Calves",110,0,0,0,0,0,0.11,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +12,"Sheep - Ewes",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +13,"Sheep - Breeding Rams",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +14,"Sheep - Fattening Rams",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +15,"Sheep - Lambs",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +16,"Goats - Does",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" +17,"Goats - Breeding Bucks",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +18,"Goats - Fattening Bucks",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +19,"Goats - Kids",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" +20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0,0.0297824570228919,0,0.33396,0,0,0.5,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +21,"Pigs - dry sows/boars",200,0,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +22,"Pigs - growers",80,0,0,0,0,0,0.0149797828314718,0,0,0,0.05,0,0,0,0,2580,21,0.6,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" diff --git a/data/shared_folder/study_objects/Study_1.json b/data/shared_folder/study_objects/Study_1.json index c9ca49b..c0d565a 100644 --- a/data/shared_folder/study_objects/Study_1.json +++ b/data/shared_folder/study_objects/Study_1.json @@ -84,7 +84,6 @@ "cp_maintenance": 0.56, "cp_grazing": 0, "cp_pregnancy": 12.21, - "cp_lactation": 0, "cp_lactmilk": 0.09, "cp_growth": 0, "birth_interval": 1.2, @@ -138,7 +137,6 @@ "cp_maintenance": 0.33, "cp_grazing": 0, "cp_pregnancy": 0, - "cp_lactation": 0, "cp_lactmilk": 0, "cp_growth": 0.4, "birth_interval": 0, @@ -187,7 +185,6 @@ "organic_amendment": "", "dry_yield": 0, "residue_dry_yield": 0, - "n_content": 0, "residue_n": 0, "kc_initial": 0, "kc_midseason": 0, @@ -251,7 +248,6 @@ "organic_amendment": "", "dry_yield": 12.6, "residue_dry_yield": 0, - "n_content": 0.08, "residue_n": 0, "kc_initial": 0.3, "kc_midseason": 0.75, @@ -315,7 +311,6 @@ "organic_amendment": "", "dry_yield": 12.24, "residue_dry_yield": 0, - "n_content": 0.013, "residue_n": 0, "kc_initial": 0.6, "kc_midseason": 1.1, @@ -379,7 +374,6 @@ "organic_amendment": "", "dry_yield": 0, "residue_dry_yield": 2.65, - "n_content": 0, "residue_n": 0.013, "kc_initial": 0, "kc_midseason": 1.05, @@ -443,7 +437,6 @@ "organic_amendment": "", "dry_yield": 14.38, "residue_dry_yield": 0, - "n_content": 0.022, "residue_n": 0, "kc_initial": 0.6, "kc_midseason": 1.1, @@ -507,7 +500,6 @@ "organic_amendment": "", "dry_yield": 0, "residue_dry_yield": 23.33, - "n_content": 0, "residue_n": 0.014, "kc_initial": 0.5, "kc_midseason": 1.1, @@ -571,7 +563,6 @@ "organic_amendment": "", "dry_yield": 12, "residue_dry_yield": 0, - "n_content": 0.037, "residue_n": 0, "kc_initial": 0.4, "kc_midseason": 1.15, diff --git a/data/shared_folder/study_objects/Study_2.json b/data/shared_folder/study_objects/Study_2.json index a2fe564..1c36d30 100644 --- a/data/shared_folder/study_objects/Study_2.json +++ b/data/shared_folder/study_objects/Study_2.json @@ -84,7 +84,6 @@ "cp_maintenance": 0.6, "cp_grazing": 0, "cp_pregnancy": 12.21, - "cp_lactation": 0, "cp_lactmilk": 0.09, "cp_growth": 0, "birth_interval": 1.2, @@ -138,7 +137,6 @@ "cp_maintenance": 0.3, "cp_grazing": 0, "cp_pregnancy": 0, - "cp_lactation": 0, "cp_lactmilk": 0, "cp_growth": 0.4, "birth_interval": 0, @@ -187,7 +185,6 @@ "organic_amendment": "", "dry_yield": 0.609, "residue_dry_yield": 1.584, - "n_content": 0, "residue_n": 0.04, "kc_initial": 0.1, "kc_midseason": 1.1, @@ -251,7 +248,6 @@ "organic_amendment": "", "dry_yield": 13.7644, "residue_dry_yield": 0, - "n_content": 0.012, "residue_n": 0, "kc_initial": 0.6, "kc_midseason": 1.1, @@ -315,7 +311,6 @@ "organic_amendment": "Straw incorporated in soil shortly (<30 days) before cultivation", "dry_yield": 1.6, "residue_dry_yield": 2.4059, - "n_content": 0, "residue_n": 0.04, "kc_initial": 1.05, "kc_midseason": 1.2, From 7f142953d2ee0b2ff7f84f7ec9d30224cdb9bc17 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Thu, 25 Dec 2025 00:29:23 +0100 Subject: [PATCH 45/69] Change variable names across the app&database --- R/30_mod_scenario_init.R | 14 +++++----- R/30_mod_scenario_server.R | 24 ++++++++-------- .../Params DB - Default/lkp_livetype.csv | 2 +- data/primary_database/lkp_livetype.csv | 2 +- .../Params_1/lkp_livetype.csv | 2 +- .../Params_2/lkp_livetype.csv | 2 +- data/shared_folder/study_objects/Study_1.json | 28 +++++++++---------- data/shared_folder/study_objects/Study_2.json | 28 +++++++++---------- 8 files changed, 51 insertions(+), 51 deletions(-) diff --git a/R/30_mod_scenario_init.R b/R/30_mod_scenario_init.R index ea4f3fa..d2b914d 100644 --- a/R/30_mod_scenario_init.R +++ b/R/30_mod_scenario_init.R @@ -162,23 +162,23 @@ livestock_data_initialization <- data.frame( litter_size = numeric(), piglets_relying_on_milk = numeric(), lactation_length = numeric(), - proportion_growth = numeric(), - lw_gain = numeric(), - grazing_displacement = numeric(), + proportion_growth_piglets_milk = numeric(), + lw_gain_piglets = numeric(), + grazing_displacement_energy = numeric(), cp_maintenance = numeric(), cp_grazing = numeric(), - cp_pregnancy = numeric(), + cp_lys_pregnancy = numeric(), cp_lactmilk = numeric(), - cp_growth = numeric(), + cp_lys_growth = numeric(), birth_interval = numeric(), protein_milkcontent = numeric(), - fat_content = numeric(), + milk_fat_content = numeric(), energy_milkcontent = numeric(), energy_meatcontent = numeric(), protein_meatcontent = numeric(), carcass_fraction = numeric(), energy_eggcontent = numeric(), - n_content = numeric(), + n_manure_content = numeric(), meat_product = character(), milk_product = character(), ipcc_ef_category_t1 = character(), diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index 017e2af..82c8aeb 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -993,23 +993,23 @@ scenario_server <- function( litter_size = selected_livestock$litter_size, piglets_relying_on_milk = 0, lactation_length = selected_livestock$lactation_length, - proportion_growth = selected_livestock$proportion_growth, - lw_gain = selected_livestock$lw_gain, - grazing_displacement = selected_livestock$grazing_displacement, + proportion_growth_piglets_milk = selected_livestock$proportion_growth_piglets_milk, + lw_gain_piglets = selected_livestock$lw_gain_piglets, + grazing_displacement_energy = selected_livestock$grazing_displacement_energy, cp_maintenance = selected_livestock$cp_maintenance, cp_grazing = selected_livestock$cp_grazing, - cp_pregnancy = selected_livestock$cp_pregnancy, + cp_lys_pregnancy = selected_livestock$cp_lys_pregnancy, cp_lactmilk = selected_livestock$cp_lactmilk, - cp_growth = selected_livestock$cp_growth, + cp_lys_growth = selected_livestock$cp_lys_growth, birth_interval = selected_livestock$birth_interval, protein_milkcontent = selected_livestock$protein_milkcontent, - fat_content = selected_livestock$fat_content, + milk_fat_content = selected_livestock$milk_fat_content, energy_milkcontent = selected_livestock$energy_milkcontent, energy_meatcontent = selected_livestock$energy_meatcontent, protein_meatcontent = selected_livestock$protein_meatcontent, carcass_fraction = selected_livestock$carcass_fraction, energy_eggcontent = selected_livestock$energy_eggcontent, - n_content = selected_livestock$n_content, + n_manure_content = selected_livestock$n_manure_content, meat_product = selected_livestock$meat_product, milk_product = selected_livestock$milk_product, ipcc_ef_category_t1 = selected_livestock$ipcc_meth_ef_t1, @@ -1110,12 +1110,12 @@ scenario_server <- function( columns = c( "body_weight", "body_weight_weaning", "body_weight_year_one", "adult_weight", "work_hour", "litter_size", "piglets_relying_on_milk", - "lactation_length", "proportion_growth", "lw_gain", "grazing_displacement", - "cp_maintenance", "cp_grazing", "cp_pregnancy", - "cp_lactmilk", "cp_growth", "birth_interval", "protein_milkcontent", - "fat_content", "energy_milkcontent", "energy_meatcontent", + "lactation_length", "proportion_growth_piglets_milk", "lw_gain_piglets", "grazing_displacement_energy", + "cp_maintenance", "cp_grazing", "cp_lys_pregnancy", + "cp_lactmilk", "cp_lys_growth", "birth_interval", "protein_milkcontent", + "milk_fat_content", "energy_milkcontent", "energy_meatcontent", "protein_meatcontent", "carcass_fraction", "energy_eggcontent", - "n_content", "meat_product", "milk_product", "ipcc_ef_category_t1", + "n_manure_content", "meat_product", "milk_product", "ipcc_ef_category_t1", "ipcc_ef_category_t2", "ipcc_meth_man_category", "ipcc_n_exc_category" ), backgroundColor = "#f4b183" diff --git a/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv b/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv index cee5285..8322728 100644 --- a/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv +++ b/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv @@ -1,4 +1,4 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth","lw_gain","grazing_displacement","cp_maintenance","cp_grazing","cp_pregnancy","cp_lactmilk","cp_growth","birth_interval","protein_milkcontent","fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","milk_fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" 1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" 2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" 3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" diff --git a/data/primary_database/lkp_livetype.csv b/data/primary_database/lkp_livetype.csv index cee5285..8322728 100644 --- a/data/primary_database/lkp_livetype.csv +++ b/data/primary_database/lkp_livetype.csv @@ -1,4 +1,4 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth","lw_gain","grazing_displacement","cp_maintenance","cp_grazing","cp_pregnancy","cp_lactmilk","cp_growth","birth_interval","protein_milkcontent","fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","milk_fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" 1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" 2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" 3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" diff --git a/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv b/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv index cee5285..8322728 100644 --- a/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv +++ b/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv @@ -1,4 +1,4 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth","lw_gain","grazing_displacement","cp_maintenance","cp_grazing","cp_pregnancy","cp_lactmilk","cp_growth","birth_interval","protein_milkcontent","fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","milk_fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" 1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" 2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" 3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" diff --git a/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv b/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv index cee5285..8322728 100644 --- a/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv +++ b/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv @@ -1,4 +1,4 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth","lw_gain","grazing_displacement","cp_maintenance","cp_grazing","cp_pregnancy","cp_lactmilk","cp_growth","birth_interval","protein_milkcontent","fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","milk_fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" 1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" 2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" 3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" diff --git a/data/shared_folder/study_objects/Study_1.json b/data/shared_folder/study_objects/Study_1.json index c0d565a..8f3c8a7 100644 --- a/data/shared_folder/study_objects/Study_1.json +++ b/data/shared_folder/study_objects/Study_1.json @@ -78,23 +78,23 @@ "litter_size": 0, "piglets_relying_on_milk": 0, "lactation_length": 0, - "proportion_growth": 0, - "lw_gain": 0, - "grazing_displacement": 0, + "proportion_growth_piglets_milk": 0, + "lw_gain_piglets": 0, + "grazing_displacement_energy": 0, "cp_maintenance": 0.56, "cp_grazing": 0, - "cp_pregnancy": 12.21, + "cp_lys_pregnancy": 12.21, "cp_lactmilk": 0.09, - "cp_growth": 0, + "cp_lys_growth": 0, "birth_interval": 1.2, "protein_milkcontent": 3.7, - "fat_content": 4.3, + "milk_fat_content": 4.3, "energy_milkcontent": 970, "energy_meatcontent": 2200, "protein_meatcontent": 26, "carcass_fraction": 0.48, "energy_eggcontent": 0, - "n_content": 0.029, + "n_manure_content": 0.029, "meat_product": "beef", "milk_product": "cow milk", "ipcc_ef_category_t1": "Dairy cattle", @@ -131,23 +131,23 @@ "litter_size": 0, "piglets_relying_on_milk": 0, "lactation_length": 0, - "proportion_growth": 0, - "lw_gain": 0, - "grazing_displacement": 0, + "proportion_growth_piglets_milk": 0, + "lw_gain_piglets": 0, + "grazing_displacement_energy": 0, "cp_maintenance": 0.33, "cp_grazing": 0, - "cp_pregnancy": 0, + "cp_lys_pregnancy": 0, "cp_lactmilk": 0, - "cp_growth": 0.4, + "cp_lys_growth": 0.4, "birth_interval": 0, "protein_milkcontent": 0, - "fat_content": 0, + "milk_fat_content": 0, "energy_milkcontent": 0, "energy_meatcontent": 2200, "protein_meatcontent": 26, "carcass_fraction": 0.49, "energy_eggcontent": 0, - "n_content": 0.029, + "n_manure_content": 0.029, "meat_product": "beef", "milk_product": "cow milk", "ipcc_ef_category_t1": "Other mature female-grazing", diff --git a/data/shared_folder/study_objects/Study_2.json b/data/shared_folder/study_objects/Study_2.json index 1c36d30..5f985b3 100644 --- a/data/shared_folder/study_objects/Study_2.json +++ b/data/shared_folder/study_objects/Study_2.json @@ -78,23 +78,23 @@ "litter_size": 0, "piglets_relying_on_milk": 0, "lactation_length": 0, - "proportion_growth": 0, - "lw_gain": 0, - "grazing_displacement": 0, + "proportion_growth_piglets_milk": 0, + "lw_gain_piglets": 0, + "grazing_displacement_energy": 0, "cp_maintenance": 0.6, "cp_grazing": 0, - "cp_pregnancy": 12.21, + "cp_lys_pregnancy": 12.21, "cp_lactmilk": 0.09, - "cp_growth": 0, + "cp_lys_growth": 0, "birth_interval": 1.2, "protein_milkcontent": 3.7, - "fat_content": 4.3, + "milk_fat_content": 4.3, "energy_milkcontent": 970, "energy_meatcontent": 2200, "protein_meatcontent": 26, "carcass_fraction": 0.48, "energy_eggcontent": 0, - "n_content": 0.029, + "n_manure_content": 0.029, "meat_product": "beef", "milk_product": "cow milk", "ipcc_ef_category_t1": "Dairy cattle", @@ -131,23 +131,23 @@ "litter_size": 0, "piglets_relying_on_milk": 0, "lactation_length": 0, - "proportion_growth": 0, - "lw_gain": 0, - "grazing_displacement": 0, + "proportion_growth_piglets_milk": 0, + "lw_gain_piglets": 0, + "grazing_displacement_energy": 0, "cp_maintenance": 0.3, "cp_grazing": 0, - "cp_pregnancy": 0, + "cp_lys_pregnancy": 0, "cp_lactmilk": 0, - "cp_growth": 0.4, + "cp_lys_growth": 0.4, "birth_interval": 0, "protein_milkcontent": 0, - "fat_content": 0, + "milk_fat_content": 0, "energy_milkcontent": 0, "energy_meatcontent": 2200, "protein_meatcontent": 26, "carcass_fraction": 0.49, "energy_eggcontent": 0, - "n_content": 0.029, + "n_manure_content": 0.029, "meat_product": "beef", "milk_product": "cow milk", "ipcc_ef_category_t1": "Other mature female-grazing", From 886a604ec64d1c63a389a7ffe6c039ea65058cca Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Thu, 25 Dec 2025 13:49:15 +0100 Subject: [PATCH 46/69] Fix header redisplay bug on cell edit --- R/40_mod_params_db_fct.R | 16 ++++++++++------ R/40_mod_params_db_server.R | 20 ++++++++++++++++++-- R/40_mod_params_db_ui.R | 2 +- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/R/40_mod_params_db_fct.R b/R/40_mod_params_db_fct.R index 70e72f5..06ced40 100644 --- a/R/40_mod_params_db_fct.R +++ b/R/40_mod_params_db_fct.R @@ -50,17 +50,21 @@ add_cursor_to_disabled_column_js <- function() { }' } -# Initialize column search inputs for DataTables +# Initialize column search inputs in DataTables header (initComplete callback) +# Cleans up FixedHeader artifacts, adds search row to original and cloned headers init_column_search_js <- function() { 'function(settings, json) { var api = this.api(); - // Prevent duplicate search rows on table redraws - // Use a flag in settings to track if we already initialized the search row - if (settings.oInit.searchRowInitialized) { - return; + // CLEANUP: Always remove old FixedHeader artifacts on every table initialization + // This prevents memory leaks and progressive slowdown + $(".dtfh-floatingparent").remove(); + + // Check if search row already exists in the DOM (prevents duplicates) + var existingSearchRow = $(api.table().header()).find("tr.search-row"); + if (existingSearchRow.length > 0) { + return; // Search row already exists, skip re-adding } - settings.oInit.searchRowInitialized = true; // Create the search row element that will hold all search inputs var searchRow = $(""); diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index 3911e08..ecbcc81 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -654,13 +654,29 @@ params_db_server <- function( # database tables lapply(parameters_db_names, function(name) { observe({ + # Only check duplicates for lkp_feeditem and lkp_crops + if (!name %in% c("lkp_feeditem", "lkp_crops")) { + return() + } + # Ensure database is selected and data table is available req(input$database_name) req(session$userData$parameters_db[[name]]) - # Extract table and identify the code column (always first column) + # Extract table and identify the code column by name data_table <- session$userData$parameters_db[[name]] - code_column <- names(data_table)[1] + # Determine which column to check based on table name + code_column <- if (name == "lkp_feeditem") { + "feed_item_code" + } else if (name == "lkp_crops") { + "crop_code" + } + + # Verify the column exists in the data table + if (!code_column %in% names(data_table)) { + return() + } + # Count occurrences of each code to find duplicates code_counts <- table(data_table[[code_column]]) duplicate_codes <- names(code_counts[code_counts > 1]) diff --git a/R/40_mod_params_db_ui.R b/R/40_mod_params_db_ui.R index f3afb3b..2a6ba96 100644 --- a/R/40_mod_params_db_ui.R +++ b/R/40_mod_params_db_ui.R @@ -262,7 +262,7 @@ params_db_ui <- function(id) { function(tab_name) { # Custom tab titles mapping tab_titles <- c( - "lkp_feeditem" = "Feeditem", + "lkp_feeditem" = "Feeditems", "lkp_crops" = "Crops", "lkp_livetype" = "Livetype" ) From 72ea0a238750d642f931c2033b427ccaabe5244b Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 28 Dec 2025 18:42:15 +0100 Subject: [PATCH 47/69] Improve Feeditems tab UX --- R/40_mod_params_db_fct.R | 117 +++++++++++++++++++++- R/40_mod_params_db_server.R | 191 +++++++++++++++++++++++++++++++++++- www/sass/app.scss | 11 +++ 3 files changed, 313 insertions(+), 6 deletions(-) diff --git a/R/40_mod_params_db_fct.R b/R/40_mod_params_db_fct.R index 06ced40..d1a059d 100644 --- a/R/40_mod_params_db_fct.R +++ b/R/40_mod_params_db_fct.R @@ -1,4 +1,3 @@ - checkbox_link_multi <- function(id, ns, table_name) { JS( paste0( @@ -74,9 +73,16 @@ init_column_search_js <- function() { var column = this; var th = $(""); + // Check if this column is visible + var isVisible = column.visible(); + // First column is the checkbox column - leave it empty if (index === 0) { th.appendTo(searchRow); + } else if (!isVisible) { + // Skip creating search input for hidden columns (but they remain searchable) + // This prevents empty search boxes from appearing for hidden columns like crop_code + // Note: We don\'t append anything, so this column won\'t have a search input } else { // Create a text input for filtering this column var input = $(\'\') @@ -141,3 +147,112 @@ generate_next_code <- function(data, code_column) { next_code <- max(existing_codes) + 1 return(next_code) } + +#' Hide Column JavaScript +#' +#' JavaScript function to hide a column's cells and header. +#' +#' @return JS code for DataTables createdCell callback +hide_column_js <- function() { + JS( + "function(td, cellData, rowData, row, col) { + $(td).css('display', 'none'); + // Also hide the header for this column + var table = $(td).closest('table'); + var thIndex = $(td).index(); + table.find('thead th').eq(thIndex).css('display', 'none'); + }" + ) +} + +#' Reorder FeedItem Columns +#' +#' Dynamically inserts `crop_name` column at the position of `crop_code`, +#' and moves `crop_code` to the end of the data frame. +#' +#' @param data A data frame containing the feed item data +#' +#' @return A data frame with reordered columns +reorder_feeditem_columns <- function(data) { + col_order <- names(data) + crop_code_idx <- which(col_order == "crop_code") + + if (length(crop_code_idx) > 0) { + # Construct new order: cols_before, crop_name, cols_after, crop_code + + # Safely get columns before + if (crop_code_idx > 1) { + cols_before <- col_order[1:(crop_code_idx - 1)] + } else { + cols_before <- character(0) + } + + # Safely get columns after + if (crop_code_idx < length(col_order)) { + cols_after <- col_order[(crop_code_idx + 1):length(col_order)] + } else { + cols_after <- character(0) + } + + # Remove 'crop_name' and 'crop_code' from cols_after if they got in there + # This acts as a sanity check against duplicates + cols_after <- setdiff(cols_after, c("crop_name", "crop_code")) + + new_col_order <- c(cols_before, "crop_name", cols_after, "crop_code") + + # Return reordered data + return(data[, new_col_order, drop = FALSE]) + } + + return(data) +} + +#' Get Valid Crop Choices for Picker +#' +#' Prepares the list of unique crop choices for the input picker, +#' ensuring the current selection is valid and included. +#' +#' @param crops_table Data frame, the lookup table for crops +#' @param current_crop_code Numeric/Integer, currently selected crop code (can be NA) +#' +#' @return A list with two elements: choices (named vector) and selected (numeric) +get_valid_crop_choices <- function(crops_table, current_crop_code) { + # Prepare unique choices for the picker + # Ensure crop names are unique to avoid duplicates in the dropdown + unique_crops <- crops_table[!duplicated(crops_table$crop_name), ] + + # Remove cases where crop_name is empty or NA + unique_crops <- unique_crops[ + !is.na(unique_crops$crop_name) & unique_crops$crop_name != "", + ] + + # Update current_crop_code if necessary to match the unique list + # Handles cases where valid duplicates existed in source but were filtered out + if (!is.na(current_crop_code) && !current_crop_code %in% unique_crops$crop_code) { + + # Find name associated with current code in full table + current_name_matches <- crops_table$crop_name[ + crops_table$crop_code == current_crop_code + ] + + if (length(current_name_matches) > 0 && !is.na(current_name_matches[1])) { + current_name <- current_name_matches[1] + + # If that name exists in our filtered unique list + if (current_name %in% unique_crops$crop_name) { + # Return the code from the unique list that corresponds to this name + # This ensures the picker sees it as a valid "selected" value + # We do not change the data here, just logic to help the UI state + # (The UI update logic elsewhere handles the actual save) + current_crop_code <- unique_crops$crop_code[ + unique_crops$crop_name == current_name + ] + } + } + } + + # Create named vector + choices <- setNames(unique_crops$crop_code, unique_crops$crop_name) + + return(list(choices = choices, selected = current_crop_code)) +} diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index ecbcc81..0a4c8d2 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -4,6 +4,9 @@ params_db_server <- function( ns <- session$ns jns <- function(x) paste0("#", ns(x)) + + # Reactive value to track if modal is open (prevents multiple modals) + modal_open <- reactiveVal(FALSE) # ------ * Initialize the parameters database inputs ------------------------- observe({ @@ -555,6 +558,23 @@ params_db_server <- function( req(input$database_name) data_table <- session$userData$parameters_db[[name]] + # For feeditem table, add crop_name from crops table + if (name == "lkp_feeditem") { + crops_table <- session$userData$parameters_db[["lkp_crops"]] + if (!is.null(crops_table)) { + # Ensure data_table is a data.frame + data_table <- as.data.frame(data_table) + + # Add crop_name by matching crop_code + data_table$crop_name <- crops_table$crop_name[ + match(data_table$crop_code, crops_table$crop_code) + ] + + # Reorder columns: Insert crop_name at crop_code's position, move crop_code to end + data_table <- reorder_feeditem_columns(data_table) + } + } + # Checkboxes for selecting rows (to be deleted) data_table$selected_row <- generate_shiny_inputs( FUN = checkboxInput, @@ -575,6 +595,32 @@ params_db_server <- function( list(width = "2px", targets = 0) ) + # Add specific column definitions for the "lkp_feeditem" table + if (name == "lkp_feeditem") { + # Find crop_code column index using the NEW column order + # The data_table has already been reordered above, so names(data_table) reflects the new order + # Note: We subtract 1 because DataTables uses 0-based indexing for targets + col_names <- names(data_table) + crop_code_col_idx <- which(col_names == "crop_code") - 1 + crop_name_col_idx <- which(col_names == "crop_name") - 1 + + column_defs <- append(column_defs, list( + # Hide crop_code column (keep in data but don't display) + # Using visible=FALSE, width=0px, and CSS to hide both header and cells + list( + targets = crop_code_col_idx, + visible = FALSE, + width = "0px", + createdCell = hide_column_js() + ), + # Make crop_name clickable with pointer cursor + list( + targets = crop_name_col_idx, + className = "crop-name-cell dt-body-left" + ) + )) + } + # Add specific column definition for the "lkp_livetype" table if (name == "lkp_livetype") { column_defs <- append(column_defs, list( @@ -610,11 +656,22 @@ params_db_server <- function( shinyjs::disable(id = paste0("delete_rows_", name)) shinyjs::disable(id = paste0("clone_rows_", name)) } else { - editablity <- list( - target = "cell", - # Prevent editing of the first column (check boxes for delete rows) - disable = list(columns = 0) - ) + # For feeditem table, disable crop_name editing (click only) + if (name == "lkp_feeditem") { + editablity <- list( + target = "cell", + # Prevent editing of checkbox and crop_name columns + disable = list( + columns = c(0, which(names(data_table) == "crop_name") - 1) + ) + ) + } else { + editablity <- list( + target = "cell", + # Prevent editing of the first column (check boxes for delete rows) + disable = list(columns = 0) + ) + } } # Render datatable with all rows and frozen headers @@ -762,6 +819,130 @@ params_db_server <- function( }) }) + # ------ * Handle crop_name click for feeditem table ------------------------ + # Show modal dialog to select a crop when clicking crop_name cell + observeEvent(input$table_lkp_feeditem_cell_clicked, { + info <- input$table_lkp_feeditem_cell_clicked + req(length(info) > 0) + # Don't allow editing default DB + req(input$database_name != "Params DB - Default") + + # Get data tables + feeditem_data <- session$userData$parameters_db[["lkp_feeditem"]] + crops_table <- session$userData$parameters_db[["lkp_crops"]] + + if (is.null(crops_table) || is.null(feeditem_data)) { + return() + } + + # Reconstruct the display table structure to get correct column names + temp_data <- as.data.frame(feeditem_data) + temp_data$crop_name <- crops_table$crop_name[ + match(temp_data$crop_code, crops_table$crop_code) + ] + + # Reorder same as display + temp_data <- reorder_feeditem_columns(temp_data) + + # Add checkbox column (first column in display) + temp_data <- data.frame( + selected_row = rep(FALSE, nrow(temp_data)), + temp_data, + stringsAsFactors = FALSE + ) + + # Check if clicked column is crop_name + clicked_col_name <- names(temp_data)[info$col + 1] + + if (!is.null(info$col) && clicked_col_name == "crop_name") { + if (modal_open()) { + return() + } + modal_open(TRUE) + + # Use row index directly as the unique identifier + # DataTables sends 1-based indices for this table config + clicked_row_idx <- info$row + + # Verify row index is valid + if (clicked_row_idx < 1 || clicked_row_idx > nrow(feeditem_data)) { + return() + } + + current_crop_code <- feeditem_data$crop_code[clicked_row_idx] + + # Get valid choices using helper function + crop_data <- get_valid_crop_choices(crops_table, current_crop_code) + + showModal(modalDialog( + title = "Select a Crop Name", + shinyWidgets::pickerInput( + inputId = ns("crop_selector"), + label = NULL, + choices = crop_data$choices, + selected = crop_data$selected, + options = list(`live-search` = TRUE) + ), + easyClose = FALSE, + footer = tagList( + actionButton(ns("ok_update_crop"), "OK"), + actionButton(ns("cancel_crop_selector"), "Cancel") + ) + )) + + # Store the row index (unique identifier) instead of code + session$userData$feeditem_clicked_row_idx <- clicked_row_idx + } + }) + + # ------ * Update crop_code when crop selection confirmed -------------------- + observeEvent(input$ok_update_crop, { + req(input$crop_selector) + clicked_row_idx <- session$userData$feeditem_clicked_row_idx + + if (!is.null(clicked_row_idx)) { + new_data <- session$userData$parameters_db[["lkp_feeditem"]] + + if (clicked_row_idx < 1 || clicked_row_idx > nrow(new_data)) { + modal_open(FALSE) + removeModal() + return() + } + + # Update crop_code for the specific row index + new_data$crop_code[clicked_row_idx] <- as.integer(input$crop_selector) + + # Update in session - reassign entire parameters_db to trigger reactivity + temp_params_db <- session$userData$parameters_db + temp_params_db[["lkp_feeditem"]] <- new_data + session$userData$parameters_db <- temp_params_db + + # Write updated table back to CSV + fwrite( + new_data, + file.path( + session$userData$user_folder, "parameters_database", + input$database_name, "lkp_feeditem.csv" + ) + ) + + # Freeze and restore scroll position after the table re-renders + freeze_and_unfreeze_scroll(session, ns("table_lkp_feeditem")) + } + + # Clear stored identifier + session$userData$feeditem_clicked_code <- NULL + modal_open(FALSE) + removeModal() + }) + + # Handle cancel button click + observeEvent(input$cancel_crop_selector, { + modal_open(FALSE) + session$userData$feeditem_clicked_code <- NULL + removeModal() + }) + # ------ DELETE ROW BUTTON --------------------------------------------------- # Delete selected parameter records and update memory + disk immediately. lapply(parameters_db_names, function(table_name) { diff --git a/www/sass/app.scss b/www/sass/app.scss index 075a62a..ae35c4c 100644 --- a/www/sass/app.scss +++ b/www/sass/app.scss @@ -1594,3 +1594,14 @@ table.dataTable thead tr:nth-child(2) th { display: none !important; } +/* ===================== */ +/* ==== CROP NAME ===== */ +/* ===================== */ +.crop-name-cell { + cursor: pointer; + color: #005275; + text-align: left !important; + &:hover { + text-decoration: underline; + } +} \ No newline at end of file From f8c56fb93d9553e99f82aeda0d576a15f4c6831b Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 28 Dec 2025 18:45:55 +0100 Subject: [PATCH 48/69] Reorder feeditem dataset columns - Update all lkp_feeditem.csv files with feed_item_code as first column --- .../Params DB - Default/lkp_feeditem.csv | 280 +++++++++--------- data/primary_database/lkp_feeditem.csv | 280 +++++++++--------- .../Params_1/lkp_feeditem.csv | 280 +++++++++--------- .../Params_2/lkp_feeditem.csv | 280 +++++++++--------- 4 files changed, 560 insertions(+), 560 deletions(-) diff --git a/data/default_data/parameters_database/Params DB - Default/lkp_feeditem.csv b/data/default_data/parameters_database/Params DB - Default/lkp_feeditem.csv index dd90ee5..6418f26 100644 --- a/data/default_data/parameters_database/Params DB - Default/lkp_feeditem.csv +++ b/data/default_data/parameters_database/Params DB - Default/lkp_feeditem.csv @@ -1,142 +1,142 @@ -crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content 1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521 -34,2,Banana (fruit),22,12.3,5.2 -34,3,Banana leaves,16,10,9.5 -21,4,Barley (forage),34,8.69,4.5 -23,5,Barley (grains) IP,87.1,12.4,11.8 -22,6,Barley (grains) OFC,87.1,12.4,11.8 -22,7,Barley (straw),87,5.88,0.3 -11,8,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6 -11,9,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6 -50,10,Berseem clover,11,12.39,26 -5,11,Brachiaria brizantha (forage),26,7.254794521,7.254794521 -6,12,Brachiaria hybrid (forage),26,7.254794521,8.254794521 -7,13,Canavalia brasiliensis (forage),30,12.1,22 -8,14,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94 -8,15,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45 -8,16,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81 -43,17,Concentrate (commercial),90,12.1,16 -9,18,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 -9,19,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 -9,20,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 -9,21,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 -10,22,Cratylia argentea (forage),30,9.4,24 -11,23,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 -12,24,Dichanthium aristatum (forage),33,7.25,8 -49,25,Digitaria swazilandensis (forage),24,9.7,9.9 -54,26,Fava bean (grain),86.6,13.3,29 -54,27,Fava bean (straw),89.7,6.4,7.4 -15,28,Gliricidia sepium (forage),30,11.5,22.3 -17,29,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52 -17,30,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2 -17,31,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29 -19,32,Guazuma ulmifolia (forage),30,11,15 -24,33,Hyparrhenia rufa (forage),26,6.129315068,6 -25,34,Ischaemum ciliare (forage),24,6.003835616,6 -28,35,Italian ryegrass (forage),19,8.7,7 -28,36,Italian ryegrass (hay),85,8.36,6.01 -28,37,Italian ryegrass (silage),33.5,9.07,5.3 -26,38,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94 -26,39,Lablab (Lablab purpureus) - hay,90,9.29,16.6 -26,40,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51 -27,41,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 -32,42,Lucerne (Medicago sativa) - forage,21,10.08,19.7 -32,43,Lucerne (Medicago sativa) - hay,85,8.36,12.5 -32,44,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 -57,45,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44 -57,46,Lupins (Lupinus angustifolius) - grain,90,19,30 -57,47,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54 -43,48,Maize (Zea mays) - bought stover,87,9.127224,5.9 -29,49,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8 -30,50,Maize (Zea mays) - cracked grains IP,89,13.020948,10 -29,51,Maize (Zea mays) - forage,82,10.215792,8.9 -31,52,Maize (Zea mays) - silage,30,10.79,4.4 -29,53,Maize (Zea mays) - stover,87,9.127224,5.9 -29,54,Maize (Zea mays) - whole grain,90,15,9 -33,55,Moringa oleifera (forage),26.2,10.6,24.3 -58,56,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77 -58,57,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77 +2,34,Banana (fruit),22,12.3,5.2 +3,34,Banana leaves,16,10,9.5 +4,21,Barley (forage),34,8.69,4.5 +5,23,Barley (grains) IP,87.1,12.4,11.8 +6,22,Barley (grains) OFC,87.1,12.4,11.8 +7,22,Barley (straw),87,5.88,0.3 +8,11,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6 +9,11,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6 +10,50,Berseem clover,11,12.39,26 +11,5,Brachiaria brizantha (forage),26,7.254794521,7.254794521 +12,6,Brachiaria hybrid (forage),26,7.254794521,8.254794521 +13,7,Canavalia brasiliensis (forage),30,12.1,22 +14,8,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94 +15,8,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45 +16,8,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81 +17,43,Concentrate (commercial),90,12.1,16 +18,9,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 +19,9,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 +20,9,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 +21,9,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 +22,10,Cratylia argentea (forage),30,9.4,24 +23,11,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 +24,12,Dichanthium aristatum (forage),33,7.25,8 +25,49,Digitaria swazilandensis (forage),24,9.7,9.9 +26,54,Fava bean (grain),86.6,13.3,29 +27,54,Fava bean (straw),89.7,6.4,7.4 +28,15,Gliricidia sepium (forage),30,11.5,22.3 +29,17,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52 +30,17,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2 +31,17,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29 +32,19,Guazuma ulmifolia (forage),30,11,15 +33,24,Hyparrhenia rufa (forage),26,6.129315068,6 +34,25,Ischaemum ciliare (forage),24,6.003835616,6 +35,28,Italian ryegrass (forage),19,8.7,7 +36,28,Italian ryegrass (hay),85,8.36,6.01 +37,28,Italian ryegrass (silage),33.5,9.07,5.3 +38,26,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94 +39,26,Lablab (Lablab purpureus) - hay,90,9.29,16.6 +40,26,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51 +41,27,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +42,32,Lucerne (Medicago sativa) - forage,21,10.08,19.7 +43,32,Lucerne (Medicago sativa) - hay,85,8.36,12.5 +44,32,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 +45,57,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44 +46,57,Lupins (Lupinus angustifolius) - grain,90,19,30 +47,57,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54 +48,43,Maize (Zea mays) - bought stover,87,9.127224,5.9 +49,29,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8 +50,30,Maize (Zea mays) - cracked grains IP,89,13.020948,10 +51,29,Maize (Zea mays) - forage,82,10.215792,8.9 +52,31,Maize (Zea mays) - silage,30,10.79,4.4 +53,29,Maize (Zea mays) - stover,87,9.127224,5.9 +54,29,Maize (Zea mays) - whole grain,90,15,9 +55,33,Moringa oleifera (forage),26.2,10.6,24.3 +56,58,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77 +57,58,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77 58,58,Mucuna (Mucuna pruriens) - hay,90.6,10.89,14.8 -58,59,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3 -59,60,Mulberry (Morus alba),28.4,10,19.4 -35,61,N/A,0,0,0 -36,62,Naturally occuring pasture - grazing,60,5,6 -36,63,Naturally occuring pasture - grazing OFR,60,5,6 -36,64,Naturally occuring pasture - green fodder,60,5,6 -2,65,Oats (Avena sativa) - grain IP,89,12.267324,13.6 -3,66,Oats (Avena sativa) - green fodder,31,8.36,4 -3,67,Oats (Avena sativa) - hay,85,7.48,3.5 -3,68,Oats (Avena sativa) - hay OFR,85,7.48,3.5 -2,69,Oats (Avena sativa) - hulls,92.4,5.317236,4.1 -43,70,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2 -3,71,Oats (Avena sativa) - silage,36.4,8.917884,12.7 -2,72,Oats (Avena sativa) - straw,88,6.47,0 -60,73,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1 -60,74,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4 -61,75,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15 -38,76,Panicum maximum (forage),26,7.543013699,9.882191781 -38,77,Panicum maximum (green fodder),26,7.58,10 -39,78,Paspalum notatum (forage),28,7.543013699,8.254794521 -62,79,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4 -62,80,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88 -63,81,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81 -40,82,Pennisetum purpureum - forage,15,9.880848,11 -41,83,Pennisetum purpureum - silage,19.5,7.5,6.5 -42,84,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3 -42,85,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39 -42,86,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6 -64,87,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1 -64,88,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94 -65,89,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96 -65,90,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13 -43,91,Poultry litter,78.7,8.16426,17.78 -66,92,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44 -67,93,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8 -67,94,Red clover (Trifolium pratense) - hay,88.4,8.331732,15 -68,95,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1 -68,96,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7 -43,97,Rice (Oryza sativa) - bran (with germs),91,10.425132,14 -45,98,Rice (Oryza sativa) - hulls,92,1.423512,3.1 -45,99,Rice (Oryza sativa) - straw,91.88,5.64,3.85 -69,100,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 -70,101,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3 -70,102,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6 -46,103,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 -47,104,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 -46,105,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 -47,106,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 -16,107,Soybean (Glycine max) - crop residue,88,6.322068,5.2 -16,108,Soybean (Glycine max) - meal,89,13.18842,49.6 -16,109,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2 -16,110,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 -71,111,Stipa (grazing) OF,72,5.6,5 -72,112,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69 -4,113,Sugar beet (pulp) OFR,89,11.4,8.9 -43,114,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 -48,115,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69 -48,116,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 -43,117,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 -48,118,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 -48,119,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5 -20,120,Sulla,12.3,9.7,20.2 -43,121,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9 -73,122,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 -73,123,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1 -73,124,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6 -73,125,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 -14,126,Tall fescue,21,9.11,8.9 -74,127,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21 -53,128,Wheat (bran) IP,87,11,17.3 -52,129,Wheat (bran) OFC,87,11,17.3 -51,130,Wheat (straw),88,5.63,4.2 -51,131,Wheat (straw) OFR,88,5.63,4.2 -75,132,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5 -36,142,Natural hay,60,5,6 -40,133,Pennisetum purpureum- hay,86,9.88,11 -55,134,Guatemala grass forage,20,10,19 -3,135,Oats(Avena sativa)- bran,26,7.48,3.5 -16,136,Soybean(Glycine max) straw,86,7,5.9 -38,137,Panicum maximum (hay),,7.54,9.88 -51,138,Wheat (bran),87,11,17.3 -5,139,Brachiaria hay,86,7.25,8.25 -56,140,Greenleaf desmodium(Desmodium intoturm),25,8,15 +59,58,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3 +60,59,Mulberry (Morus alba),28.4,10,19.4 +61,35,N/A,0,0,0 +62,36,Naturally occuring pasture - grazing,60,5,6 +63,36,Naturally occuring pasture - grazing OFR,60,5,6 +64,36,Naturally occuring pasture - green fodder,60,5,6 +65,2,Oats (Avena sativa) - grain IP,89,12.267324,13.6 +66,3,Oats (Avena sativa) - green fodder,31,8.36,4 +67,3,Oats (Avena sativa) - hay,85,7.48,3.5 +68,3,Oats (Avena sativa) - hay OFR,85,7.48,3.5 +69,2,Oats (Avena sativa) - hulls,92.4,5.317236,4.1 +70,43,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2 +71,3,Oats (Avena sativa) - silage,36.4,8.917884,12.7 +72,2,Oats (Avena sativa) - straw,88,6.47,0 +73,60,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1 +74,60,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4 +75,61,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15 +76,38,Panicum maximum (forage),26,7.543013699,9.882191781 +77,38,Panicum maximum (green fodder),26,7.58,10 +78,39,Paspalum notatum (forage),28,7.543013699,8.254794521 +79,62,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4 +80,62,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88 +81,63,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81 +82,40,Pennisetum purpureum - forage,15,9.880848,11 +83,41,Pennisetum purpureum - silage,19.5,7.5,6.5 +84,42,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3 +85,42,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39 +86,42,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6 +87,64,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1 +88,64,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94 +89,65,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96 +90,65,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13 +91,43,Poultry litter,78.7,8.16426,17.78 +92,66,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44 +93,67,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8 +94,67,Red clover (Trifolium pratense) - hay,88.4,8.331732,15 +95,68,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1 +96,68,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7 +97,43,Rice (Oryza sativa) - bran (with germs),91,10.425132,14 +98,45,Rice (Oryza sativa) - hulls,92,1.423512,3.1 +99,45,Rice (Oryza sativa) - straw,91.88,5.64,3.85 +100,69,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 +101,70,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3 +102,70,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6 +103,46,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 +104,47,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 +105,46,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 +106,47,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 +107,16,Soybean (Glycine max) - crop residue,88,6.322068,5.2 +108,16,Soybean (Glycine max) - meal,89,13.18842,49.6 +109,16,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2 +110,16,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 +111,71,Stipa (grazing) OF,72,5.6,5 +112,72,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69 +113,4,Sugar beet (pulp) OFR,89,11.4,8.9 +114,43,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 +115,48,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69 +116,48,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 +117,43,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 +118,48,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 +119,48,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5 +120,20,Sulla,12.3,9.7,20.2 +121,43,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9 +122,73,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 +123,73,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1 +124,73,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6 +125,73,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 +126,14,Tall fescue,21,9.11,8.9 +127,74,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21 +128,53,Wheat (bran) IP,87,11,17.3 +129,52,Wheat (bran) OFC,87,11,17.3 +130,51,Wheat (straw),88,5.63,4.2 +131,51,Wheat (straw) OFR,88,5.63,4.2 +132,75,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5 +142,36,Natural hay,60,5,6 +133,40,Pennisetum purpureum- hay,86,9.88,11 +134,55,Guatemala grass forage,20,10,19 +135,3,Oats(Avena sativa)- bran,26,7.48,3.5 +136,16,Soybean(Glycine max) straw,86,7,5.9 +137,38,Panicum maximum (hay),,7.54,9.88 +138,51,Wheat (bran),87,11,17.3 +139,5,Brachiaria hay,86,7.25,8.25 +140,56,Greenleaf desmodium(Desmodium intoturm),25,8,15 diff --git a/data/primary_database/lkp_feeditem.csv b/data/primary_database/lkp_feeditem.csv index dd90ee5..6418f26 100644 --- a/data/primary_database/lkp_feeditem.csv +++ b/data/primary_database/lkp_feeditem.csv @@ -1,142 +1,142 @@ -crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content 1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521 -34,2,Banana (fruit),22,12.3,5.2 -34,3,Banana leaves,16,10,9.5 -21,4,Barley (forage),34,8.69,4.5 -23,5,Barley (grains) IP,87.1,12.4,11.8 -22,6,Barley (grains) OFC,87.1,12.4,11.8 -22,7,Barley (straw),87,5.88,0.3 -11,8,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6 -11,9,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6 -50,10,Berseem clover,11,12.39,26 -5,11,Brachiaria brizantha (forage),26,7.254794521,7.254794521 -6,12,Brachiaria hybrid (forage),26,7.254794521,8.254794521 -7,13,Canavalia brasiliensis (forage),30,12.1,22 -8,14,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94 -8,15,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45 -8,16,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81 -43,17,Concentrate (commercial),90,12.1,16 -9,18,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 -9,19,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 -9,20,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 -9,21,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 -10,22,Cratylia argentea (forage),30,9.4,24 -11,23,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 -12,24,Dichanthium aristatum (forage),33,7.25,8 -49,25,Digitaria swazilandensis (forage),24,9.7,9.9 -54,26,Fava bean (grain),86.6,13.3,29 -54,27,Fava bean (straw),89.7,6.4,7.4 -15,28,Gliricidia sepium (forage),30,11.5,22.3 -17,29,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52 -17,30,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2 -17,31,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29 -19,32,Guazuma ulmifolia (forage),30,11,15 -24,33,Hyparrhenia rufa (forage),26,6.129315068,6 -25,34,Ischaemum ciliare (forage),24,6.003835616,6 -28,35,Italian ryegrass (forage),19,8.7,7 -28,36,Italian ryegrass (hay),85,8.36,6.01 -28,37,Italian ryegrass (silage),33.5,9.07,5.3 -26,38,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94 -26,39,Lablab (Lablab purpureus) - hay,90,9.29,16.6 -26,40,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51 -27,41,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 -32,42,Lucerne (Medicago sativa) - forage,21,10.08,19.7 -32,43,Lucerne (Medicago sativa) - hay,85,8.36,12.5 -32,44,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 -57,45,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44 -57,46,Lupins (Lupinus angustifolius) - grain,90,19,30 -57,47,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54 -43,48,Maize (Zea mays) - bought stover,87,9.127224,5.9 -29,49,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8 -30,50,Maize (Zea mays) - cracked grains IP,89,13.020948,10 -29,51,Maize (Zea mays) - forage,82,10.215792,8.9 -31,52,Maize (Zea mays) - silage,30,10.79,4.4 -29,53,Maize (Zea mays) - stover,87,9.127224,5.9 -29,54,Maize (Zea mays) - whole grain,90,15,9 -33,55,Moringa oleifera (forage),26.2,10.6,24.3 -58,56,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77 -58,57,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77 +2,34,Banana (fruit),22,12.3,5.2 +3,34,Banana leaves,16,10,9.5 +4,21,Barley (forage),34,8.69,4.5 +5,23,Barley (grains) IP,87.1,12.4,11.8 +6,22,Barley (grains) OFC,87.1,12.4,11.8 +7,22,Barley (straw),87,5.88,0.3 +8,11,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6 +9,11,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6 +10,50,Berseem clover,11,12.39,26 +11,5,Brachiaria brizantha (forage),26,7.254794521,7.254794521 +12,6,Brachiaria hybrid (forage),26,7.254794521,8.254794521 +13,7,Canavalia brasiliensis (forage),30,12.1,22 +14,8,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94 +15,8,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45 +16,8,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81 +17,43,Concentrate (commercial),90,12.1,16 +18,9,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 +19,9,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 +20,9,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 +21,9,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 +22,10,Cratylia argentea (forage),30,9.4,24 +23,11,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 +24,12,Dichanthium aristatum (forage),33,7.25,8 +25,49,Digitaria swazilandensis (forage),24,9.7,9.9 +26,54,Fava bean (grain),86.6,13.3,29 +27,54,Fava bean (straw),89.7,6.4,7.4 +28,15,Gliricidia sepium (forage),30,11.5,22.3 +29,17,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52 +30,17,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2 +31,17,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29 +32,19,Guazuma ulmifolia (forage),30,11,15 +33,24,Hyparrhenia rufa (forage),26,6.129315068,6 +34,25,Ischaemum ciliare (forage),24,6.003835616,6 +35,28,Italian ryegrass (forage),19,8.7,7 +36,28,Italian ryegrass (hay),85,8.36,6.01 +37,28,Italian ryegrass (silage),33.5,9.07,5.3 +38,26,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94 +39,26,Lablab (Lablab purpureus) - hay,90,9.29,16.6 +40,26,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51 +41,27,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +42,32,Lucerne (Medicago sativa) - forage,21,10.08,19.7 +43,32,Lucerne (Medicago sativa) - hay,85,8.36,12.5 +44,32,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 +45,57,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44 +46,57,Lupins (Lupinus angustifolius) - grain,90,19,30 +47,57,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54 +48,43,Maize (Zea mays) - bought stover,87,9.127224,5.9 +49,29,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8 +50,30,Maize (Zea mays) - cracked grains IP,89,13.020948,10 +51,29,Maize (Zea mays) - forage,82,10.215792,8.9 +52,31,Maize (Zea mays) - silage,30,10.79,4.4 +53,29,Maize (Zea mays) - stover,87,9.127224,5.9 +54,29,Maize (Zea mays) - whole grain,90,15,9 +55,33,Moringa oleifera (forage),26.2,10.6,24.3 +56,58,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77 +57,58,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77 58,58,Mucuna (Mucuna pruriens) - hay,90.6,10.89,14.8 -58,59,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3 -59,60,Mulberry (Morus alba),28.4,10,19.4 -35,61,N/A,0,0,0 -36,62,Naturally occuring pasture - grazing,60,5,6 -36,63,Naturally occuring pasture - grazing OFR,60,5,6 -36,64,Naturally occuring pasture - green fodder,60,5,6 -2,65,Oats (Avena sativa) - grain IP,89,12.267324,13.6 -3,66,Oats (Avena sativa) - green fodder,31,8.36,4 -3,67,Oats (Avena sativa) - hay,85,7.48,3.5 -3,68,Oats (Avena sativa) - hay OFR,85,7.48,3.5 -2,69,Oats (Avena sativa) - hulls,92.4,5.317236,4.1 -43,70,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2 -3,71,Oats (Avena sativa) - silage,36.4,8.917884,12.7 -2,72,Oats (Avena sativa) - straw,88,6.47,0 -60,73,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1 -60,74,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4 -61,75,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15 -38,76,Panicum maximum (forage),26,7.543013699,9.882191781 -38,77,Panicum maximum (green fodder),26,7.58,10 -39,78,Paspalum notatum (forage),28,7.543013699,8.254794521 -62,79,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4 -62,80,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88 -63,81,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81 -40,82,Pennisetum purpureum - forage,15,9.880848,11 -41,83,Pennisetum purpureum - silage,19.5,7.5,6.5 -42,84,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3 -42,85,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39 -42,86,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6 -64,87,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1 -64,88,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94 -65,89,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96 -65,90,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13 -43,91,Poultry litter,78.7,8.16426,17.78 -66,92,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44 -67,93,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8 -67,94,Red clover (Trifolium pratense) - hay,88.4,8.331732,15 -68,95,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1 -68,96,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7 -43,97,Rice (Oryza sativa) - bran (with germs),91,10.425132,14 -45,98,Rice (Oryza sativa) - hulls,92,1.423512,3.1 -45,99,Rice (Oryza sativa) - straw,91.88,5.64,3.85 -69,100,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 -70,101,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3 -70,102,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6 -46,103,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 -47,104,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 -46,105,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 -47,106,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 -16,107,Soybean (Glycine max) - crop residue,88,6.322068,5.2 -16,108,Soybean (Glycine max) - meal,89,13.18842,49.6 -16,109,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2 -16,110,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 -71,111,Stipa (grazing) OF,72,5.6,5 -72,112,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69 -4,113,Sugar beet (pulp) OFR,89,11.4,8.9 -43,114,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 -48,115,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69 -48,116,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 -43,117,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 -48,118,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 -48,119,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5 -20,120,Sulla,12.3,9.7,20.2 -43,121,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9 -73,122,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 -73,123,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1 -73,124,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6 -73,125,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 -14,126,Tall fescue,21,9.11,8.9 -74,127,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21 -53,128,Wheat (bran) IP,87,11,17.3 -52,129,Wheat (bran) OFC,87,11,17.3 -51,130,Wheat (straw),88,5.63,4.2 -51,131,Wheat (straw) OFR,88,5.63,4.2 -75,132,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5 -36,142,Natural hay,60,5,6 -40,133,Pennisetum purpureum- hay,86,9.88,11 -55,134,Guatemala grass forage,20,10,19 -3,135,Oats(Avena sativa)- bran,26,7.48,3.5 -16,136,Soybean(Glycine max) straw,86,7,5.9 -38,137,Panicum maximum (hay),,7.54,9.88 -51,138,Wheat (bran),87,11,17.3 -5,139,Brachiaria hay,86,7.25,8.25 -56,140,Greenleaf desmodium(Desmodium intoturm),25,8,15 +59,58,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3 +60,59,Mulberry (Morus alba),28.4,10,19.4 +61,35,N/A,0,0,0 +62,36,Naturally occuring pasture - grazing,60,5,6 +63,36,Naturally occuring pasture - grazing OFR,60,5,6 +64,36,Naturally occuring pasture - green fodder,60,5,6 +65,2,Oats (Avena sativa) - grain IP,89,12.267324,13.6 +66,3,Oats (Avena sativa) - green fodder,31,8.36,4 +67,3,Oats (Avena sativa) - hay,85,7.48,3.5 +68,3,Oats (Avena sativa) - hay OFR,85,7.48,3.5 +69,2,Oats (Avena sativa) - hulls,92.4,5.317236,4.1 +70,43,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2 +71,3,Oats (Avena sativa) - silage,36.4,8.917884,12.7 +72,2,Oats (Avena sativa) - straw,88,6.47,0 +73,60,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1 +74,60,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4 +75,61,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15 +76,38,Panicum maximum (forage),26,7.543013699,9.882191781 +77,38,Panicum maximum (green fodder),26,7.58,10 +78,39,Paspalum notatum (forage),28,7.543013699,8.254794521 +79,62,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4 +80,62,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88 +81,63,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81 +82,40,Pennisetum purpureum - forage,15,9.880848,11 +83,41,Pennisetum purpureum - silage,19.5,7.5,6.5 +84,42,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3 +85,42,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39 +86,42,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6 +87,64,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1 +88,64,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94 +89,65,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96 +90,65,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13 +91,43,Poultry litter,78.7,8.16426,17.78 +92,66,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44 +93,67,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8 +94,67,Red clover (Trifolium pratense) - hay,88.4,8.331732,15 +95,68,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1 +96,68,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7 +97,43,Rice (Oryza sativa) - bran (with germs),91,10.425132,14 +98,45,Rice (Oryza sativa) - hulls,92,1.423512,3.1 +99,45,Rice (Oryza sativa) - straw,91.88,5.64,3.85 +100,69,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 +101,70,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3 +102,70,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6 +103,46,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 +104,47,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 +105,46,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 +106,47,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 +107,16,Soybean (Glycine max) - crop residue,88,6.322068,5.2 +108,16,Soybean (Glycine max) - meal,89,13.18842,49.6 +109,16,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2 +110,16,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 +111,71,Stipa (grazing) OF,72,5.6,5 +112,72,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69 +113,4,Sugar beet (pulp) OFR,89,11.4,8.9 +114,43,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 +115,48,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69 +116,48,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 +117,43,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 +118,48,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 +119,48,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5 +120,20,Sulla,12.3,9.7,20.2 +121,43,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9 +122,73,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 +123,73,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1 +124,73,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6 +125,73,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 +126,14,Tall fescue,21,9.11,8.9 +127,74,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21 +128,53,Wheat (bran) IP,87,11,17.3 +129,52,Wheat (bran) OFC,87,11,17.3 +130,51,Wheat (straw),88,5.63,4.2 +131,51,Wheat (straw) OFR,88,5.63,4.2 +132,75,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5 +142,36,Natural hay,60,5,6 +133,40,Pennisetum purpureum- hay,86,9.88,11 +134,55,Guatemala grass forage,20,10,19 +135,3,Oats(Avena sativa)- bran,26,7.48,3.5 +136,16,Soybean(Glycine max) straw,86,7,5.9 +137,38,Panicum maximum (hay),,7.54,9.88 +138,51,Wheat (bran),87,11,17.3 +139,5,Brachiaria hay,86,7.25,8.25 +140,56,Greenleaf desmodium(Desmodium intoturm),25,8,15 diff --git a/data/shared_folder/parameters_database/Params_1/lkp_feeditem.csv b/data/shared_folder/parameters_database/Params_1/lkp_feeditem.csv index dd90ee5..6418f26 100644 --- a/data/shared_folder/parameters_database/Params_1/lkp_feeditem.csv +++ b/data/shared_folder/parameters_database/Params_1/lkp_feeditem.csv @@ -1,142 +1,142 @@ -crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content 1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521 -34,2,Banana (fruit),22,12.3,5.2 -34,3,Banana leaves,16,10,9.5 -21,4,Barley (forage),34,8.69,4.5 -23,5,Barley (grains) IP,87.1,12.4,11.8 -22,6,Barley (grains) OFC,87.1,12.4,11.8 -22,7,Barley (straw),87,5.88,0.3 -11,8,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6 -11,9,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6 -50,10,Berseem clover,11,12.39,26 -5,11,Brachiaria brizantha (forage),26,7.254794521,7.254794521 -6,12,Brachiaria hybrid (forage),26,7.254794521,8.254794521 -7,13,Canavalia brasiliensis (forage),30,12.1,22 -8,14,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94 -8,15,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45 -8,16,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81 -43,17,Concentrate (commercial),90,12.1,16 -9,18,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 -9,19,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 -9,20,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 -9,21,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 -10,22,Cratylia argentea (forage),30,9.4,24 -11,23,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 -12,24,Dichanthium aristatum (forage),33,7.25,8 -49,25,Digitaria swazilandensis (forage),24,9.7,9.9 -54,26,Fava bean (grain),86.6,13.3,29 -54,27,Fava bean (straw),89.7,6.4,7.4 -15,28,Gliricidia sepium (forage),30,11.5,22.3 -17,29,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52 -17,30,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2 -17,31,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29 -19,32,Guazuma ulmifolia (forage),30,11,15 -24,33,Hyparrhenia rufa (forage),26,6.129315068,6 -25,34,Ischaemum ciliare (forage),24,6.003835616,6 -28,35,Italian ryegrass (forage),19,8.7,7 -28,36,Italian ryegrass (hay),85,8.36,6.01 -28,37,Italian ryegrass (silage),33.5,9.07,5.3 -26,38,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94 -26,39,Lablab (Lablab purpureus) - hay,90,9.29,16.6 -26,40,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51 -27,41,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 -32,42,Lucerne (Medicago sativa) - forage,21,10.08,19.7 -32,43,Lucerne (Medicago sativa) - hay,85,8.36,12.5 -32,44,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 -57,45,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44 -57,46,Lupins (Lupinus angustifolius) - grain,90,19,30 -57,47,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54 -43,48,Maize (Zea mays) - bought stover,87,9.127224,5.9 -29,49,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8 -30,50,Maize (Zea mays) - cracked grains IP,89,13.020948,10 -29,51,Maize (Zea mays) - forage,82,10.215792,8.9 -31,52,Maize (Zea mays) - silage,30,10.79,4.4 -29,53,Maize (Zea mays) - stover,87,9.127224,5.9 -29,54,Maize (Zea mays) - whole grain,90,15,9 -33,55,Moringa oleifera (forage),26.2,10.6,24.3 -58,56,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77 -58,57,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77 +2,34,Banana (fruit),22,12.3,5.2 +3,34,Banana leaves,16,10,9.5 +4,21,Barley (forage),34,8.69,4.5 +5,23,Barley (grains) IP,87.1,12.4,11.8 +6,22,Barley (grains) OFC,87.1,12.4,11.8 +7,22,Barley (straw),87,5.88,0.3 +8,11,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6 +9,11,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6 +10,50,Berseem clover,11,12.39,26 +11,5,Brachiaria brizantha (forage),26,7.254794521,7.254794521 +12,6,Brachiaria hybrid (forage),26,7.254794521,8.254794521 +13,7,Canavalia brasiliensis (forage),30,12.1,22 +14,8,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94 +15,8,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45 +16,8,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81 +17,43,Concentrate (commercial),90,12.1,16 +18,9,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 +19,9,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 +20,9,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 +21,9,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 +22,10,Cratylia argentea (forage),30,9.4,24 +23,11,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 +24,12,Dichanthium aristatum (forage),33,7.25,8 +25,49,Digitaria swazilandensis (forage),24,9.7,9.9 +26,54,Fava bean (grain),86.6,13.3,29 +27,54,Fava bean (straw),89.7,6.4,7.4 +28,15,Gliricidia sepium (forage),30,11.5,22.3 +29,17,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52 +30,17,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2 +31,17,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29 +32,19,Guazuma ulmifolia (forage),30,11,15 +33,24,Hyparrhenia rufa (forage),26,6.129315068,6 +34,25,Ischaemum ciliare (forage),24,6.003835616,6 +35,28,Italian ryegrass (forage),19,8.7,7 +36,28,Italian ryegrass (hay),85,8.36,6.01 +37,28,Italian ryegrass (silage),33.5,9.07,5.3 +38,26,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94 +39,26,Lablab (Lablab purpureus) - hay,90,9.29,16.6 +40,26,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51 +41,27,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +42,32,Lucerne (Medicago sativa) - forage,21,10.08,19.7 +43,32,Lucerne (Medicago sativa) - hay,85,8.36,12.5 +44,32,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 +45,57,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44 +46,57,Lupins (Lupinus angustifolius) - grain,90,19,30 +47,57,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54 +48,43,Maize (Zea mays) - bought stover,87,9.127224,5.9 +49,29,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8 +50,30,Maize (Zea mays) - cracked grains IP,89,13.020948,10 +51,29,Maize (Zea mays) - forage,82,10.215792,8.9 +52,31,Maize (Zea mays) - silage,30,10.79,4.4 +53,29,Maize (Zea mays) - stover,87,9.127224,5.9 +54,29,Maize (Zea mays) - whole grain,90,15,9 +55,33,Moringa oleifera (forage),26.2,10.6,24.3 +56,58,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77 +57,58,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77 58,58,Mucuna (Mucuna pruriens) - hay,90.6,10.89,14.8 -58,59,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3 -59,60,Mulberry (Morus alba),28.4,10,19.4 -35,61,N/A,0,0,0 -36,62,Naturally occuring pasture - grazing,60,5,6 -36,63,Naturally occuring pasture - grazing OFR,60,5,6 -36,64,Naturally occuring pasture - green fodder,60,5,6 -2,65,Oats (Avena sativa) - grain IP,89,12.267324,13.6 -3,66,Oats (Avena sativa) - green fodder,31,8.36,4 -3,67,Oats (Avena sativa) - hay,85,7.48,3.5 -3,68,Oats (Avena sativa) - hay OFR,85,7.48,3.5 -2,69,Oats (Avena sativa) - hulls,92.4,5.317236,4.1 -43,70,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2 -3,71,Oats (Avena sativa) - silage,36.4,8.917884,12.7 -2,72,Oats (Avena sativa) - straw,88,6.47,0 -60,73,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1 -60,74,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4 -61,75,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15 -38,76,Panicum maximum (forage),26,7.543013699,9.882191781 -38,77,Panicum maximum (green fodder),26,7.58,10 -39,78,Paspalum notatum (forage),28,7.543013699,8.254794521 -62,79,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4 -62,80,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88 -63,81,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81 -40,82,Pennisetum purpureum - forage,15,9.880848,11 -41,83,Pennisetum purpureum - silage,19.5,7.5,6.5 -42,84,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3 -42,85,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39 -42,86,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6 -64,87,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1 -64,88,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94 -65,89,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96 -65,90,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13 -43,91,Poultry litter,78.7,8.16426,17.78 -66,92,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44 -67,93,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8 -67,94,Red clover (Trifolium pratense) - hay,88.4,8.331732,15 -68,95,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1 -68,96,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7 -43,97,Rice (Oryza sativa) - bran (with germs),91,10.425132,14 -45,98,Rice (Oryza sativa) - hulls,92,1.423512,3.1 -45,99,Rice (Oryza sativa) - straw,91.88,5.64,3.85 -69,100,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 -70,101,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3 -70,102,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6 -46,103,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 -47,104,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 -46,105,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 -47,106,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 -16,107,Soybean (Glycine max) - crop residue,88,6.322068,5.2 -16,108,Soybean (Glycine max) - meal,89,13.18842,49.6 -16,109,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2 -16,110,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 -71,111,Stipa (grazing) OF,72,5.6,5 -72,112,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69 -4,113,Sugar beet (pulp) OFR,89,11.4,8.9 -43,114,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 -48,115,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69 -48,116,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 -43,117,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 -48,118,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 -48,119,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5 -20,120,Sulla,12.3,9.7,20.2 -43,121,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9 -73,122,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 -73,123,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1 -73,124,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6 -73,125,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 -14,126,Tall fescue,21,9.11,8.9 -74,127,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21 -53,128,Wheat (bran) IP,87,11,17.3 -52,129,Wheat (bran) OFC,87,11,17.3 -51,130,Wheat (straw),88,5.63,4.2 -51,131,Wheat (straw) OFR,88,5.63,4.2 -75,132,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5 -36,142,Natural hay,60,5,6 -40,133,Pennisetum purpureum- hay,86,9.88,11 -55,134,Guatemala grass forage,20,10,19 -3,135,Oats(Avena sativa)- bran,26,7.48,3.5 -16,136,Soybean(Glycine max) straw,86,7,5.9 -38,137,Panicum maximum (hay),,7.54,9.88 -51,138,Wheat (bran),87,11,17.3 -5,139,Brachiaria hay,86,7.25,8.25 -56,140,Greenleaf desmodium(Desmodium intoturm),25,8,15 +59,58,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3 +60,59,Mulberry (Morus alba),28.4,10,19.4 +61,35,N/A,0,0,0 +62,36,Naturally occuring pasture - grazing,60,5,6 +63,36,Naturally occuring pasture - grazing OFR,60,5,6 +64,36,Naturally occuring pasture - green fodder,60,5,6 +65,2,Oats (Avena sativa) - grain IP,89,12.267324,13.6 +66,3,Oats (Avena sativa) - green fodder,31,8.36,4 +67,3,Oats (Avena sativa) - hay,85,7.48,3.5 +68,3,Oats (Avena sativa) - hay OFR,85,7.48,3.5 +69,2,Oats (Avena sativa) - hulls,92.4,5.317236,4.1 +70,43,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2 +71,3,Oats (Avena sativa) - silage,36.4,8.917884,12.7 +72,2,Oats (Avena sativa) - straw,88,6.47,0 +73,60,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1 +74,60,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4 +75,61,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15 +76,38,Panicum maximum (forage),26,7.543013699,9.882191781 +77,38,Panicum maximum (green fodder),26,7.58,10 +78,39,Paspalum notatum (forage),28,7.543013699,8.254794521 +79,62,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4 +80,62,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88 +81,63,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81 +82,40,Pennisetum purpureum - forage,15,9.880848,11 +83,41,Pennisetum purpureum - silage,19.5,7.5,6.5 +84,42,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3 +85,42,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39 +86,42,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6 +87,64,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1 +88,64,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94 +89,65,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96 +90,65,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13 +91,43,Poultry litter,78.7,8.16426,17.78 +92,66,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44 +93,67,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8 +94,67,Red clover (Trifolium pratense) - hay,88.4,8.331732,15 +95,68,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1 +96,68,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7 +97,43,Rice (Oryza sativa) - bran (with germs),91,10.425132,14 +98,45,Rice (Oryza sativa) - hulls,92,1.423512,3.1 +99,45,Rice (Oryza sativa) - straw,91.88,5.64,3.85 +100,69,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 +101,70,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3 +102,70,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6 +103,46,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 +104,47,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 +105,46,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 +106,47,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 +107,16,Soybean (Glycine max) - crop residue,88,6.322068,5.2 +108,16,Soybean (Glycine max) - meal,89,13.18842,49.6 +109,16,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2 +110,16,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 +111,71,Stipa (grazing) OF,72,5.6,5 +112,72,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69 +113,4,Sugar beet (pulp) OFR,89,11.4,8.9 +114,43,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 +115,48,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69 +116,48,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 +117,43,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 +118,48,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 +119,48,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5 +120,20,Sulla,12.3,9.7,20.2 +121,43,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9 +122,73,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 +123,73,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1 +124,73,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6 +125,73,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 +126,14,Tall fescue,21,9.11,8.9 +127,74,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21 +128,53,Wheat (bran) IP,87,11,17.3 +129,52,Wheat (bran) OFC,87,11,17.3 +130,51,Wheat (straw),88,5.63,4.2 +131,51,Wheat (straw) OFR,88,5.63,4.2 +132,75,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5 +142,36,Natural hay,60,5,6 +133,40,Pennisetum purpureum- hay,86,9.88,11 +134,55,Guatemala grass forage,20,10,19 +135,3,Oats(Avena sativa)- bran,26,7.48,3.5 +136,16,Soybean(Glycine max) straw,86,7,5.9 +137,38,Panicum maximum (hay),,7.54,9.88 +138,51,Wheat (bran),87,11,17.3 +139,5,Brachiaria hay,86,7.25,8.25 +140,56,Greenleaf desmodium(Desmodium intoturm),25,8,15 diff --git a/data/shared_folder/parameters_database/Params_2/lkp_feeditem.csv b/data/shared_folder/parameters_database/Params_2/lkp_feeditem.csv index dd90ee5..6418f26 100644 --- a/data/shared_folder/parameters_database/Params_2/lkp_feeditem.csv +++ b/data/shared_folder/parameters_database/Params_2/lkp_feeditem.csv @@ -1,142 +1,142 @@ -crop_code,feed_item_code,feed_item_name,dm_content,me_content,cp_content +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content 1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521 -34,2,Banana (fruit),22,12.3,5.2 -34,3,Banana leaves,16,10,9.5 -21,4,Barley (forage),34,8.69,4.5 -23,5,Barley (grains) IP,87.1,12.4,11.8 -22,6,Barley (grains) OFC,87.1,12.4,11.8 -22,7,Barley (straw),87,5.88,0.3 -11,8,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6 -11,9,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6 -50,10,Berseem clover,11,12.39,26 -5,11,Brachiaria brizantha (forage),26,7.254794521,7.254794521 -6,12,Brachiaria hybrid (forage),26,7.254794521,8.254794521 -7,13,Canavalia brasiliensis (forage),30,12.1,22 -8,14,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94 -8,15,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45 -8,16,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81 -43,17,Concentrate (commercial),90,12.1,16 -9,18,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 -9,19,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 -9,20,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 -9,21,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 -10,22,Cratylia argentea (forage),30,9.4,24 -11,23,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 -12,24,Dichanthium aristatum (forage),33,7.25,8 -49,25,Digitaria swazilandensis (forage),24,9.7,9.9 -54,26,Fava bean (grain),86.6,13.3,29 -54,27,Fava bean (straw),89.7,6.4,7.4 -15,28,Gliricidia sepium (forage),30,11.5,22.3 -17,29,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52 -17,30,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2 -17,31,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29 -19,32,Guazuma ulmifolia (forage),30,11,15 -24,33,Hyparrhenia rufa (forage),26,6.129315068,6 -25,34,Ischaemum ciliare (forage),24,6.003835616,6 -28,35,Italian ryegrass (forage),19,8.7,7 -28,36,Italian ryegrass (hay),85,8.36,6.01 -28,37,Italian ryegrass (silage),33.5,9.07,5.3 -26,38,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94 -26,39,Lablab (Lablab purpureus) - hay,90,9.29,16.6 -26,40,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51 -27,41,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 -32,42,Lucerne (Medicago sativa) - forage,21,10.08,19.7 -32,43,Lucerne (Medicago sativa) - hay,85,8.36,12.5 -32,44,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 -57,45,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44 -57,46,Lupins (Lupinus angustifolius) - grain,90,19,30 -57,47,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54 -43,48,Maize (Zea mays) - bought stover,87,9.127224,5.9 -29,49,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8 -30,50,Maize (Zea mays) - cracked grains IP,89,13.020948,10 -29,51,Maize (Zea mays) - forage,82,10.215792,8.9 -31,52,Maize (Zea mays) - silage,30,10.79,4.4 -29,53,Maize (Zea mays) - stover,87,9.127224,5.9 -29,54,Maize (Zea mays) - whole grain,90,15,9 -33,55,Moringa oleifera (forage),26.2,10.6,24.3 -58,56,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77 -58,57,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77 +2,34,Banana (fruit),22,12.3,5.2 +3,34,Banana leaves,16,10,9.5 +4,21,Barley (forage),34,8.69,4.5 +5,23,Barley (grains) IP,87.1,12.4,11.8 +6,22,Barley (grains) OFC,87.1,12.4,11.8 +7,22,Barley (straw),87,5.88,0.3 +8,11,Bermuda grass (Cynodon dactylon) - forage,30.3,9.671508,12.6 +9,11,Bermuda grass (Cynodon dactylon) - hay,93,7.410636,7.6 +10,50,Berseem clover,11,12.39,26 +11,5,Brachiaria brizantha (forage),26,7.254794521,7.254794521 +12,6,Brachiaria hybrid (forage),26,7.254794521,8.254794521 +13,7,Canavalia brasiliensis (forage),30,12.1,22 +14,8,Cassava (Manihot esculenta) - crop residue,16.1,10.006452,19.94 +15,8,Cassava (Manihot esculenta) - fresh peelings,27.9,4.3124,5.45 +16,8,Cassava (Manihot esculenta) - tubers,88.84,10.76,1.81 +17,43,Concentrate (commercial),90,12.1,16 +18,9,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 +19,9,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 +20,9,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 +21,9,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 +22,10,Cratylia argentea (forage),30,9.4,24 +23,11,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 +24,12,Dichanthium aristatum (forage),33,7.25,8 +25,49,Digitaria swazilandensis (forage),24,9.7,9.9 +26,54,Fava bean (grain),86.6,13.3,29 +27,54,Fava bean (straw),89.7,6.4,7.4 +28,15,Gliricidia sepium (forage),30,11.5,22.3 +29,17,Groundnut (Arachis hypogaea) - crop residue,89.53,7.99,6.52 +30,17,Groundnut (Arachis hypogaea) - Kernel,92.7,21.1852,33.2 +31,17,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,16.29 +32,19,Guazuma ulmifolia (forage),30,11,15 +33,24,Hyparrhenia rufa (forage),26,6.129315068,6 +34,25,Ischaemum ciliare (forage),24,6.003835616,6 +35,28,Italian ryegrass (forage),19,8.7,7 +36,28,Italian ryegrass (hay),85,8.36,6.01 +37,28,Italian ryegrass (silage),33.5,9.07,5.3 +38,26,Lablab (Lablab purpureus) - forage,18.3,11.43,22.94 +39,26,Lablab (Lablab purpureus) - hay,90,9.29,16.6 +40,26,Lablab (Lablab purpureus) - silage,27.83,7.44,17.51 +41,27,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +42,32,Lucerne (Medicago sativa) - forage,21,10.08,19.7 +43,32,Lucerne (Medicago sativa) - hay,85,8.36,12.5 +44,32,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 +45,57,Lupins (Lupinus angustifolius) - crop residue,93.85,5.57,6.44 +46,57,Lupins (Lupinus angustifolius) - grain,90,19,30 +47,57,Lupins (Lupinus angustifolius) - pods,91.89,7.36,5.54 +48,43,Maize (Zea mays) - bought stover,87,9.127224,5.9 +49,29,Maize (Zea mays) - cobs ground,90.1,7.578108,2.8 +50,30,Maize (Zea mays) - cracked grains IP,89,13.020948,10 +51,29,Maize (Zea mays) - forage,82,10.215792,8.9 +52,31,Maize (Zea mays) - silage,30,10.79,4.4 +53,29,Maize (Zea mays) - stover,87,9.127224,5.9 +54,29,Maize (Zea mays) - whole grain,90,15,9 +55,33,Moringa oleifera (forage),26.2,10.6,24.3 +56,58,Mucuna (Mucuna pruriens) - forage,20.967,10.8,15.77 +57,58,Mucuna (Mucuna pruriens) - green fodder,20.967,10.8,15.77 58,58,Mucuna (Mucuna pruriens) - hay,90.6,10.89,14.8 -58,59,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3 -59,60,Mulberry (Morus alba),28.4,10,19.4 -35,61,N/A,0,0,0 -36,62,Naturally occuring pasture - grazing,60,5,6 -36,63,Naturally occuring pasture - grazing OFR,60,5,6 -36,64,Naturally occuring pasture - green fodder,60,5,6 -2,65,Oats (Avena sativa) - grain IP,89,12.267324,13.6 -3,66,Oats (Avena sativa) - green fodder,31,8.36,4 -3,67,Oats (Avena sativa) - hay,85,7.48,3.5 -3,68,Oats (Avena sativa) - hay OFR,85,7.48,3.5 -2,69,Oats (Avena sativa) - hulls,92.4,5.317236,4.1 -43,70,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2 -3,71,Oats (Avena sativa) - silage,36.4,8.917884,12.7 -2,72,Oats (Avena sativa) - straw,88,6.47,0 -60,73,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1 -60,74,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4 -61,75,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15 -38,76,Panicum maximum (forage),26,7.543013699,9.882191781 -38,77,Panicum maximum (green fodder),26,7.58,10 -39,78,Paspalum notatum (forage),28,7.543013699,8.254794521 -62,79,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4 -62,80,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88 -63,81,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81 -40,82,Pennisetum purpureum - forage,15,9.880848,11 -41,83,Pennisetum purpureum - silage,19.5,7.5,6.5 -42,84,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3 -42,85,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39 -42,86,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6 -64,87,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1 -64,88,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94 -65,89,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96 -65,90,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13 -43,91,Poultry litter,78.7,8.16426,17.78 -66,92,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44 -67,93,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8 -67,94,Red clover (Trifolium pratense) - hay,88.4,8.331732,15 -68,95,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1 -68,96,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7 -43,97,Rice (Oryza sativa) - bran (with germs),91,10.425132,14 -45,98,Rice (Oryza sativa) - hulls,92,1.423512,3.1 -45,99,Rice (Oryza sativa) - straw,91.88,5.64,3.85 -69,100,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 -70,101,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3 -70,102,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6 -46,103,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 -47,104,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 -46,105,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 -47,106,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 -16,107,Soybean (Glycine max) - crop residue,88,6.322068,5.2 -16,108,Soybean (Glycine max) - meal,89,13.18842,49.6 -16,109,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2 -16,110,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 -71,111,Stipa (grazing) OF,72,5.6,5 -72,112,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69 -4,113,Sugar beet (pulp) OFR,89,11.4,8.9 -43,114,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 -48,115,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69 -48,116,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 -43,117,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 -48,118,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 -48,119,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5 -20,120,Sulla,12.3,9.7,20.2 -43,121,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9 -73,122,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 -73,123,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1 -73,124,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6 -73,125,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 -14,126,Tall fescue,21,9.11,8.9 -74,127,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21 -53,128,Wheat (bran) IP,87,11,17.3 -52,129,Wheat (bran) OFC,87,11,17.3 -51,130,Wheat (straw),88,5.63,4.2 -51,131,Wheat (straw) OFR,88,5.63,4.2 -75,132,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5 -36,142,Natural hay,60,5,6 -40,133,Pennisetum purpureum- hay,86,9.88,11 -55,134,Guatemala grass forage,20,10,19 -3,135,Oats(Avena sativa)- bran,26,7.48,3.5 -16,136,Soybean(Glycine max) straw,86,7,5.9 -38,137,Panicum maximum (hay),,7.54,9.88 -51,138,Wheat (bran),87,11,17.3 -5,139,Brachiaria hay,86,7.25,8.25 -56,140,Greenleaf desmodium(Desmodium intoturm),25,8,15 +59,58,Mucuna (Mucuna pruriens) - seed,92.37,14.193,27.3 +60,59,Mulberry (Morus alba),28.4,10,19.4 +61,35,N/A,0,0,0 +62,36,Naturally occuring pasture - grazing,60,5,6 +63,36,Naturally occuring pasture - grazing OFR,60,5,6 +64,36,Naturally occuring pasture - green fodder,60,5,6 +65,2,Oats (Avena sativa) - grain IP,89,12.267324,13.6 +66,3,Oats (Avena sativa) - green fodder,31,8.36,4 +67,3,Oats (Avena sativa) - hay,85,7.48,3.5 +68,3,Oats (Avena sativa) - hay OFR,85,7.48,3.5 +69,2,Oats (Avena sativa) - hulls,92.4,5.317236,4.1 +70,43,Oats (Avena sativa) - meal/cereal by-product,91,15.28182,16.2 +71,3,Oats (Avena sativa) - silage,36.4,8.917884,12.7 +72,2,Oats (Avena sativa) - straw,88,6.47,0 +73,60,Orchard grass (Dactylis glomerata) - green fodder,27.4,8.624808,10.1 +74,60,Orchard grass (Dactylis glomerata) - hay,90.6,8.16426,8.4 +75,61,Orchard tree (Bauhinia variegata) - green leaves,42.85,7.49437,16.15 +76,38,Panicum maximum (forage),26,7.543013699,9.882191781 +77,38,Panicum maximum (green fodder),26,7.58,10 +78,39,Paspalum notatum (forage),28,7.543013699,8.254794521 +79,62,Pearl Millet (Pennisetum glaucum) - crop residue,86,9.462168,6.4 +80,62,Pearl Millet (Pennisetum glaucum) - grain,90.34,12.43,13.88 +81,63,Pearl Millet (Pennisetum glaucum) - green fodder,25,8.55,13.81 +82,40,Pennisetum purpureum - forage,15,9.880848,11 +83,41,Pennisetum purpureum - silage,19.5,7.5,6.5 +84,42,Pigeon Pea (Cajanus cajan) - crop residue,91.69,7.996788,16.3 +85,42,Pigeon Pea (Cajanus cajan) - meal,89.4,11.08,19.39 +86,42,Pigeon Pea (Cajanus cajan) - seed,68.7,11.5,21.6 +87,64,Pineapple (Ananas comosus) - crop residue,20.6,11.5137,9.1 +88,64,Pineapple (Ananas comosus) - leaf silage,35.12,8.22,7.94 +89,65,Potato (Solanum tuberosum) - peelings,15.44,10.25,6.96 +90,65,Potato (Solanum tuberosum) - tuber,16.34,12.99,14.13 +91,43,Poultry litter,78.7,8.16426,17.78 +92,66,Pumpkin (Cucurbita maxima) - fruit,22.73,9.91,15.44 +93,67,Red clover (Trifolium pratense) - green fodder,19.6,10.425132,20.8 +94,67,Red clover (Trifolium pratense) - hay,88.4,8.331732,15 +95,68,Rhodes grass (Chloris gayana) - forage,28.06,7.54,14.1 +96,68,Rhodes grass (Chloris gayana) - hay,92.4,9.1,7.7 +97,43,Rice (Oryza sativa) - bran (with germs),91,10.425132,14 +98,45,Rice (Oryza sativa) - hulls,92,1.423512,3.1 +99,45,Rice (Oryza sativa) - straw,91.88,5.64,3.85 +100,69,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 +101,70,Smooth Broome (Bromus inermis) - green fodder,26.1,11.220624,21.3 +102,70,Smooth Broome (Bromus inermis) - hay,92.6,8.038656,6 +103,46,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 +104,47,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 +105,46,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 +106,47,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 +107,16,Soybean (Glycine max) - crop residue,88,6.322068,5.2 +108,16,Soybean (Glycine max) - meal,89,13.18842,49.6 +109,16,Soybean (Glycine max) - seed coats,90.3,12.476664,12.2 +110,16,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 +111,71,Stipa (grazing) OF,72,5.6,5 +112,72,Stylo (Stylosanthes guianensis) - forage,19.42,9.545904,18.69 +113,4,Sugar beet (pulp) OFR,89,11.4,8.9 +114,43,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 +115,48,Sugarcane (Saccharum officinarum) - crop residue,96.27,7.44,3.69 +116,48,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 +117,43,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 +118,48,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 +119,48,Sugarcane (Saccharum officinarum) - tops (hay),85,7,5.5 +120,20,Sulla,12.3,9.7,20.2 +121,43,Sunflower (Helianthus annuus) - seed cake,94.9,9.127224,17.9 +122,73,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 +123,73,Sweet potato (Ipomoea batatas) - tubers (fresh),59,13.58,5.1 +124,73,Sweet potato (Ipomoea batatas) - tubers meal (dried),87.1,11.35,4.6 +125,73,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 +126,14,Tall fescue,21,9.11,8.9 +127,74,Tomato (Lycopersicon esculentum) - waste fruits,44.08,7.43,21 +128,53,Wheat (bran) IP,87,11,17.3 +129,52,Wheat (bran) OFC,87,11,17.3 +130,51,Wheat (straw),88,5.63,4.2 +131,51,Wheat (straw) OFR,88,5.63,4.2 +132,75,White sweet clover (Melilotus alba) - green fodder,15,9.1,22.5 +142,36,Natural hay,60,5,6 +133,40,Pennisetum purpureum- hay,86,9.88,11 +134,55,Guatemala grass forage,20,10,19 +135,3,Oats(Avena sativa)- bran,26,7.48,3.5 +136,16,Soybean(Glycine max) straw,86,7,5.9 +137,38,Panicum maximum (hay),,7.54,9.88 +138,51,Wheat (bran),87,11,17.3 +139,5,Brachiaria hay,86,7.25,8.25 +140,56,Greenleaf desmodium(Desmodium intoturm),25,8,15 From 2b0dc72d8a4164ae39f7809fc1cf48874bc05ddf Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 28 Dec 2025 19:26:16 +0100 Subject: [PATCH 49/69] Remove sub-climate & Update Climate PickerInputa --- R/30_mod_scenario_server.R | 12 +--------- R/30_mod_scenario_ui.R | 14 ++---------- .../Params DB - Default/lkp_climate.csv | 8 +++++-- data/default_data/study_objects/New_file.json | 1 - data/primary_database/lkp_climate.csv | 8 +++++-- data/primary_json.json | 1 - .../Params_1/lkp_climate.csv | 8 +++++-- .../Params_2/lkp_climate.csv | 8 +++++-- data/shared_folder/study_objects/Study_1.json | 1 - data/shared_folder/study_objects/Study_2.json | 1 - www/sass/hack.scss | 22 +++++++++++++++++++ 11 files changed, 49 insertions(+), 35 deletions(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index 82c8aeb..493e39b 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -2784,20 +2784,10 @@ scenario_server <- function( ) #Reconstruct the select inputs - shinyWidgets::updatePickerInput( - session, "climate_zone", - choices = sort( - lkp_climate()$climate_desc - ), - selected = session$userData$study_object()$climate_zone - ) - shinyWidgets::updatePickerInput( session, "climate_zone_2", choices = sort( - lkp_climate2() %>% - filter(climate_code == "Temperate") %>% - pull(climate2_desc) + session$userData$parameters_db[["lkp_climate"]]$climate_desc ), selected = session$userData$study_object()$climate_zone_2 ) diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index 39d97f0..f2fc807 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -293,23 +293,13 @@ scenario_ui <- function(id) { ), h2("Climate:", class = "mb-3"), tags$div( - class = "mb-4", - shinyWidgets::pickerInput( - inputId = ns("climate_zone"), - label = NULL, - choices = NULL, - options = list(`live-search` = TRUE) - ), - ), - h2("Sub-climate:", class = "mb-3"), - tags$div( - class = "mb-4", + class = "mb-4 climate-picker", shinyWidgets::pickerInput( inputId = ns("climate_zone_2"), label = NULL, choices = NULL, options = list(`live-search` = TRUE) - ), + ) ), h2("Farm name:", class = "mb-3"), tags$div( diff --git a/data/default_data/parameters_database/Params DB - Default/lkp_climate.csv b/data/default_data/parameters_database/Params DB - Default/lkp_climate.csv index 32c065b..f86f7e1 100644 --- a/data/default_data/parameters_database/Params DB - Default/lkp_climate.csv +++ b/data/default_data/parameters_database/Params DB - Default/lkp_climate.csv @@ -1,3 +1,7 @@ "climate_code","climate_desc" -"Temperate","Temperate" -"Tropical","Tropical" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/default_data/study_objects/New_file.json b/data/default_data/study_objects/New_file.json index 086514a..5e76941 100644 --- a/data/default_data/study_objects/New_file.json +++ b/data/default_data/study_objects/New_file.json @@ -3,7 +3,6 @@ "database_code": "Params DB - Default", "region": "AFRICA", "farm_name": "", - "climate_zone": "Temperate", "climate_zone_2": "Warm Temperate Moist", "soil_description": "Andosol", "cropland_system": "Long term cultivated, temperate/boreal, dry", diff --git a/data/primary_database/lkp_climate.csv b/data/primary_database/lkp_climate.csv index 32c065b..f86f7e1 100644 --- a/data/primary_database/lkp_climate.csv +++ b/data/primary_database/lkp_climate.csv @@ -1,3 +1,7 @@ "climate_code","climate_desc" -"Temperate","Temperate" -"Tropical","Tropical" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_json.json b/data/primary_json.json index 086514a..5e76941 100644 --- a/data/primary_json.json +++ b/data/primary_json.json @@ -3,7 +3,6 @@ "database_code": "Params DB - Default", "region": "AFRICA", "farm_name": "", - "climate_zone": "Temperate", "climate_zone_2": "Warm Temperate Moist", "soil_description": "Andosol", "cropland_system": "Long term cultivated, temperate/boreal, dry", diff --git a/data/shared_folder/parameters_database/Params_1/lkp_climate.csv b/data/shared_folder/parameters_database/Params_1/lkp_climate.csv index 32c065b..f86f7e1 100644 --- a/data/shared_folder/parameters_database/Params_1/lkp_climate.csv +++ b/data/shared_folder/parameters_database/Params_1/lkp_climate.csv @@ -1,3 +1,7 @@ "climate_code","climate_desc" -"Temperate","Temperate" -"Tropical","Tropical" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/shared_folder/parameters_database/Params_2/lkp_climate.csv b/data/shared_folder/parameters_database/Params_2/lkp_climate.csv index 32c065b..f86f7e1 100644 --- a/data/shared_folder/parameters_database/Params_2/lkp_climate.csv +++ b/data/shared_folder/parameters_database/Params_2/lkp_climate.csv @@ -1,3 +1,7 @@ "climate_code","climate_desc" -"Temperate","Temperate" -"Tropical","Tropical" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/shared_folder/study_objects/Study_1.json b/data/shared_folder/study_objects/Study_1.json index 8f3c8a7..1cbcc33 100644 --- a/data/shared_folder/study_objects/Study_1.json +++ b/data/shared_folder/study_objects/Study_1.json @@ -12,7 +12,6 @@ "database_code": "Params DB - Default", "region": "AFRICA", "farm_name": "Rungwe", - "climate_zone": "Warm", "climate_zone_2": "Warm Temperate Dry", "soil_description": "Lixisol", "cropland_system": "Long term cultivated, tropical, moist/wet", diff --git a/data/shared_folder/study_objects/Study_2.json b/data/shared_folder/study_objects/Study_2.json index 5f985b3..040ee0a 100644 --- a/data/shared_folder/study_objects/Study_2.json +++ b/data/shared_folder/study_objects/Study_2.json @@ -12,7 +12,6 @@ "database_code": "Params DB - Default", "region": "LATIN", "farm_name": "Lao PDR", - "climate_zone": "Temperate", "climate_zone_2": "Warm Temperate Dry", "soil_description": "Cambisol", "cropland_system": "Long term cultivated, temperate/boreal, dry", diff --git a/www/sass/hack.scss b/www/sass/hack.scss index a23a1e7..995b735 100644 --- a/www/sass/hack.scss +++ b/www/sass/hack.scss @@ -28,3 +28,25 @@ display: block !important; } } + +// Force climate picker to show all available options +.climate-picker { + // Allow dropdown to overflow parent containers + overflow: visible !important; + + .bootstrap-select { + .inner.open { + max-height: 90px !important; + overflow-y: auto !important; + } + .dropdown-menu { + max-height: 90px !important; + } + } +} + +// Ensure carousel containers don't clip the dropdown +.carousel-item:has(.climate-picker), +.carousel-inner:has(.climate-picker) { + overflow: visible !important; +} \ No newline at end of file From fa95efb91ae0fd5241fc89ed415a4cee6d881f6b Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 28 Dec 2025 19:57:42 +0100 Subject: [PATCH 50/69] Fix crop_code hiding for default DB --- R/40_mod_params_db_server.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index 0a4c8d2..8edfb44 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -644,12 +644,14 @@ params_db_server <- function( if (input$database_name == "Params DB - Default") { editablity <- FALSE - column_defs <- list( + # Append disabled cursor to existing column_defs + # This preserves table-specific column definitions like crop_code hiding + column_defs <- append(column_defs, list( list( targets = "_all", # Apply to all cells createdCell = JS(add_cursor_to_disabled_column_js()) ) - ) + )) # Disable all modification buttons shinyjs::disable(id = paste0("add_rows_", name)) From baa66595b84d5b01190be7915f7440971c56f94d Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 28 Dec 2025 22:12:01 +0100 Subject: [PATCH 51/69] Remove unnecesary 'lkp_climate2.csv' file --- .../Params DB - Default/lkp_climate2.csv | 7 ------- data/primary_database/lkp_climate2.csv | 7 ------- .../parameters_database/Params_1/lkp_climate2.csv | 7 ------- .../parameters_database/Params_2/lkp_climate2.csv | 7 ------- 4 files changed, 28 deletions(-) delete mode 100644 data/default_data/parameters_database/Params DB - Default/lkp_climate2.csv delete mode 100644 data/primary_database/lkp_climate2.csv delete mode 100644 data/shared_folder/parameters_database/Params_1/lkp_climate2.csv delete mode 100644 data/shared_folder/parameters_database/Params_2/lkp_climate2.csv diff --git a/data/default_data/parameters_database/Params DB - Default/lkp_climate2.csv b/data/default_data/parameters_database/Params DB - Default/lkp_climate2.csv deleted file mode 100644 index ecf34cf..0000000 --- a/data/default_data/parameters_database/Params DB - Default/lkp_climate2.csv +++ /dev/null @@ -1,7 +0,0 @@ -"climate_code","climate2_code","climate2_desc" -"Temperate","Warm Temperate Moist","Warm Temperate Moist" -"Temperate","Warm Temperate Dry","Warm Temperate Dry" -"Tropical","Tropical Montane","Tropical Montane" -"Tropical","Tropical Wet","Tropical Wet" -"Tropical","Tropical Moist","Tropical Moist" -"Tropical","Tropical Dry","Tropical Dry" diff --git a/data/primary_database/lkp_climate2.csv b/data/primary_database/lkp_climate2.csv deleted file mode 100644 index ecf34cf..0000000 --- a/data/primary_database/lkp_climate2.csv +++ /dev/null @@ -1,7 +0,0 @@ -"climate_code","climate2_code","climate2_desc" -"Temperate","Warm Temperate Moist","Warm Temperate Moist" -"Temperate","Warm Temperate Dry","Warm Temperate Dry" -"Tropical","Tropical Montane","Tropical Montane" -"Tropical","Tropical Wet","Tropical Wet" -"Tropical","Tropical Moist","Tropical Moist" -"Tropical","Tropical Dry","Tropical Dry" diff --git a/data/shared_folder/parameters_database/Params_1/lkp_climate2.csv b/data/shared_folder/parameters_database/Params_1/lkp_climate2.csv deleted file mode 100644 index a6e694f..0000000 --- a/data/shared_folder/parameters_database/Params_1/lkp_climate2.csv +++ /dev/null @@ -1,7 +0,0 @@ -climate_code,climate2_code,climate2_desc -Temperate,Warm Temperate Moist,Warm Temperate Moist -Temperate,Warm Temperate Dry,Warm Temperate Dry -Tropical,Tropical Montane,Tropical Montane -Tropical,Tropical Wet,Tropical Wet -Tropical,Tropical Moist,Tropical Moist -Tropical,Tropical Dry,Tropical Dry diff --git a/data/shared_folder/parameters_database/Params_2/lkp_climate2.csv b/data/shared_folder/parameters_database/Params_2/lkp_climate2.csv deleted file mode 100644 index a6e694f..0000000 --- a/data/shared_folder/parameters_database/Params_2/lkp_climate2.csv +++ /dev/null @@ -1,7 +0,0 @@ -climate_code,climate2_code,climate2_desc -Temperate,Warm Temperate Moist,Warm Temperate Moist -Temperate,Warm Temperate Dry,Warm Temperate Dry -Tropical,Tropical Montane,Tropical Montane -Tropical,Tropical Wet,Tropical Wet -Tropical,Tropical Moist,Tropical Moist -Tropical,Tropical Dry,Tropical Dry From da76ff722b16ca84fed918e45d285da6abe5a1a6 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sat, 3 Jan 2026 17:11:58 +0100 Subject: [PATCH 52/69] Improve scenario and parameters db tabs layout --- R/30_mod_scenario_ui.R | 4 ++-- R/40_mod_params_db_ui.R | 27 +++++++++++++-------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/R/30_mod_scenario_ui.R b/R/30_mod_scenario_ui.R index 6bea915..8b3108b 100644 --- a/R/30_mod_scenario_ui.R +++ b/R/30_mod_scenario_ui.R @@ -12,7 +12,7 @@ scenario_ui <- function(id) { class = "container", # ------ Dernière mise à jour ------------------------------------------ p( - class = "pt-3 pb-5 text-end text-primary text-small", + class = "pt-3 pb-4 text-end text-primary text-small", span("Last update: "), span(strong(id = ns("last_update_date"))) ), @@ -29,7 +29,7 @@ scenario_ui <- function(id) { ) ), fixedPage( - class = "bg-light px-4 pt-5 pb-5 mt-4 mb-5", + class = "bg-light px-4 pt-5 pb-5 mt-4 mb-4", style = "margin-top: 20px;", h2("Choose a file option:", class = "mb-3"), fluidRow( diff --git a/R/40_mod_params_db_ui.R b/R/40_mod_params_db_ui.R index 66f5964..f859477 100644 --- a/R/40_mod_params_db_ui.R +++ b/R/40_mod_params_db_ui.R @@ -7,13 +7,23 @@ params_db_ui <- function(id) { class = "container", # ------ Last Update ----------------------------------------------------- p( - class = "pt-3 pb-5 text-end text-primary text-small", + class = "pt-3 pb-4 text-end text-primary text-small", span("Last update: "), span(strong(id = ns("last_update_date"))) ), ), + div( + class = "container mt-2 mb-2", + style = "text-align: left", + a( + class = "editInformationBtn", + icon("chevron-left", class = "editInfoIcon"), + "Scenario - Enterprise Description", + onclick = go_to(target = "scenario") + ) + ), fixedPage( - class = "bg-light px-4 pt-5 pb-5 mt-5 mb-5", + class = "bg-light px-4 pt-5 pb-5 mt-4 mb-4", style = "margin-top: 20px;", h2("Choose a parameters database option:", class = "mb-3"), fluidRow( @@ -235,21 +245,10 @@ params_db_ui <- function(id) { ) ) ), - div( - class = "container mt-2 mb-2", - style = "text-align: left", - a( - class = "editInformationBtn", - icon("chevron-left", class = "editInfoIcon"), - "Scenario - Enterprise Description", - onclick = go_to(target = "scenario") - ) - ), fixedPage( - style = "margin-top: 50px;", fluidRow( class = "bg-light", - style = "margin-top: 50px;", + style = "margin-top: 40px;", div( class = "custom-tab-width", # Use lapply to loop over each tab name and generate the tabPanels From cd6236db6198867f0b2da0fce49d8bfdfe8eeb06 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sat, 3 Jan 2026 17:27:35 +0100 Subject: [PATCH 53/69] Improve livetype disabling logic code --- R/40_mod_params_db_server.R | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index e81bf70..e2c9d4c 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -598,18 +598,18 @@ params_db_server <- function( )) } - # reset the buttons - shinyjs::enable(id = paste0("add_rows_", name)) - shinyjs::enable(id = paste0("delete_rows_", name)) - shinyjs::enable(id = paste0("clone_rows_", name)) - # Disable buttons specifically for lkp_livetype if (name == "lkp_livetype") { shinyjs::disable(id = paste0("add_rows_", name)) shinyjs::disable(id = paste0("delete_rows_", name)) shinyjs::disable(id = paste0("clone_rows_", name)) + } else { + # reset the buttons + shinyjs::enable(id = paste0("add_rows_", name)) + shinyjs::enable(id = paste0("delete_rows_", name)) + shinyjs::enable(id = paste0("clone_rows_", name)) } - + # Check if the database is the default one if (input$database_name == "Params DB - Default") { editablity <- FALSE @@ -810,7 +810,7 @@ params_db_server <- function( # Get the info of the edited cell info <- input[[paste0("table_", name, "_cell_edit")]] new_data <- session$userData$parameters_db[[name]] - + page_var <- paste0(name, "_page") current_page <- pagination_state[[page_var]] if (is.null(current_page) || !is.finite(current_page)) { From 239e3c2d577a7ad9dc77fc54f8bf6561b981345d Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sat, 3 Jan 2026 22:44:27 +0100 Subject: [PATCH 54/69] remove unnecessary req --- R/30_mod_scenario_server.R | 1 - 1 file changed, 1 deletion(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index 493e39b..ca955b6 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1811,7 +1811,6 @@ scenario_server <- function( # Render the crop inputs table output$crop_inputs_table <- renderDT({ - req(fertilizers()) # Observe fertilizers to show/hide the warning message if (nrow(fertilizers()) == 0) { From 2acb2d415c44a4d3978f2fba7b5e28a3b0222bb5 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sat, 3 Jan 2026 23:24:49 +0100 Subject: [PATCH 55/69] reinforce fertilizer warning message logic --- R/30_mod_scenario_server.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index ca955b6..10f3034 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1813,7 +1813,7 @@ scenario_server <- function( output$crop_inputs_table <- renderDT({ # Observe fertilizers to show/hide the warning message - if (nrow(fertilizers()) == 0) { + if (nrow(fertilizers()) == 0 & nrow(crop_inputs_data()) != 0) { shinyjs::show("alert_no_fertilizers") } else { shinyjs::hide("alert_no_fertilizers") From 8681d0d0b9ec318e8a9b9a56ee0fae60fa2e9270 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Mon, 5 Jan 2026 20:22:27 +0100 Subject: [PATCH 56/69] remove old pagination code --- www/sass/app.scss | 65 ----------------------------------------------- 1 file changed, 65 deletions(-) diff --git a/www/sass/app.scss b/www/sass/app.scss index ae35c4c..efa8664 100644 --- a/www/sass/app.scss +++ b/www/sass/app.scss @@ -1407,71 +1407,6 @@ table.dataTable tbody tr>.dtfc-fixed-left{ } } - -// ------ Compact Pagination Bar (centered + scaled) -------------------------- - -.pagination-bar-container { - display: flex; - align-items: center; - justify-content: flex-end; - gap: 6px; // spacing between buttons - padding-right: 4px; - - // Base button style - .btn { - font-size: 13px !important; - width: 34px; - height: 32px; - padding: 0 !important; - line-height: 32px; - border-radius: 6px; - border: 1px solid #005275 !important; - color: #005275 !important; - background-color: transparent !important; - text-align: center; - vertical-align: middle; - display: inline-flex; - align-items: center; - justify-content: center; - transition: all 0.15s ease-in-out; - - // Arrow icons - i, - svg { - font-size: 15px !important; - line-height: 1; - vertical-align: middle; - } - - // Hover state for unselected buttons - &:hover { - background-color: #005275 !important; - color: #fff !important; - } - - // Active (selected) page - &.btn-primary, - &.fw-bold { - background-color: #e5e9ea !important; - color: #005275 !important; - border-color: #00527533 !important; - box-shadow: inset 0 0 0 1px #0052751a; - - &:hover { - background-color: #e5e9ea !important; - } - } - } - - // Ellipsis - .text-muted { - font-size: 13px; - opacity: 0.7; - margin: 0 4px; - line-height: 32px; - } -} - :root { // Default sizing constraints used by all Bootstrap-select menus --picker-min-height: 96px; // ensure a usable scroll pane From c1700b7b39a2118e7521a51af4a8867b854e3b0f Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Wed, 7 Jan 2026 21:38:25 +0100 Subject: [PATCH 57/69] Change variable milk_fat_content to fat_milkcontent --- R/30_mod_scenario_init.R | 2 +- R/30_mod_scenario_server.R | 4 ++-- .../Params DB - Default/lkp_livetype.csv | 2 +- data/primary_database/lkp_livetype.csv | 2 +- .../parameters_database/Params_1/lkp_livetype.csv | 2 +- .../parameters_database/Params_2/lkp_livetype.csv | 2 +- data/shared_folder/study_objects/Study_1.json | 6 +++--- data/shared_folder/study_objects/Study_2.json | 6 +++--- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/R/30_mod_scenario_init.R b/R/30_mod_scenario_init.R index d2b914d..6b96219 100644 --- a/R/30_mod_scenario_init.R +++ b/R/30_mod_scenario_init.R @@ -172,7 +172,7 @@ livestock_data_initialization <- data.frame( cp_lys_growth = numeric(), birth_interval = numeric(), protein_milkcontent = numeric(), - milk_fat_content = numeric(), + fat_milkcontent = numeric(), energy_milkcontent = numeric(), energy_meatcontent = numeric(), protein_meatcontent = numeric(), diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index a606e8f..b66b208 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -1006,7 +1006,7 @@ scenario_server <- function( cp_lys_growth = selected_livestock$cp_lys_growth, birth_interval = selected_livestock$birth_interval, protein_milkcontent = selected_livestock$protein_milkcontent, - milk_fat_content = selected_livestock$milk_fat_content, + fat_milkcontent = selected_livestock$fat_milkcontent, energy_milkcontent = selected_livestock$energy_milkcontent, energy_meatcontent = selected_livestock$energy_meatcontent, protein_meatcontent = selected_livestock$protein_meatcontent, @@ -1116,7 +1116,7 @@ scenario_server <- function( "lactation_length", "proportion_growth_piglets_milk", "lw_gain_piglets", "grazing_displacement_energy", "cp_maintenance", "cp_grazing", "cp_lys_pregnancy", "cp_lactmilk", "cp_lys_growth", "birth_interval", "protein_milkcontent", - "milk_fat_content", "energy_milkcontent", "energy_meatcontent", + "fat_milkcontent", "energy_milkcontent", "energy_meatcontent", "protein_meatcontent", "carcass_fraction", "energy_eggcontent", "n_manure_content", "meat_product", "milk_product", "ipcc_ef_category_t1", "ipcc_ef_category_t2", "ipcc_meth_man_category", "ipcc_n_exc_category" diff --git a/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv b/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv index 8322728..ca4316c 100644 --- a/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv +++ b/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv @@ -1,4 +1,4 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","milk_fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","fat_milkcontent","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" 1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" 2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" 3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" diff --git a/data/primary_database/lkp_livetype.csv b/data/primary_database/lkp_livetype.csv index 8322728..ca4316c 100644 --- a/data/primary_database/lkp_livetype.csv +++ b/data/primary_database/lkp_livetype.csv @@ -1,4 +1,4 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","milk_fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","fat_milkcontent","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" 1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" 2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" 3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" diff --git a/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv b/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv index 8322728..ca4316c 100644 --- a/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv +++ b/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv @@ -1,4 +1,4 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","milk_fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","fat_milkcontent","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" 1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" 2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" 3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" diff --git a/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv b/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv index 8322728..ca4316c 100644 --- a/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv +++ b/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv @@ -1,4 +1,4 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","milk_fat_content","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","fat_milkcontent","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" 1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" 2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" 3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" diff --git a/data/shared_folder/study_objects/Study_1.json b/data/shared_folder/study_objects/Study_1.json index 1cbcc33..417389a 100644 --- a/data/shared_folder/study_objects/Study_1.json +++ b/data/shared_folder/study_objects/Study_1.json @@ -1,4 +1,4 @@ -{ +{ "seasons": [ { "season_name": "wet", @@ -87,7 +87,7 @@ "cp_lys_growth": 0, "birth_interval": 1.2, "protein_milkcontent": 3.7, - "milk_fat_content": 4.3, + "fat_milkcontent": 4.3, "energy_milkcontent": 970, "energy_meatcontent": 2200, "protein_meatcontent": 26, @@ -140,7 +140,7 @@ "cp_lys_growth": 0.4, "birth_interval": 0, "protein_milkcontent": 0, - "milk_fat_content": 0, + "fat_milkcontent": 0, "energy_milkcontent": 0, "energy_meatcontent": 2200, "protein_meatcontent": 26, diff --git a/data/shared_folder/study_objects/Study_2.json b/data/shared_folder/study_objects/Study_2.json index 040ee0a..078a198 100644 --- a/data/shared_folder/study_objects/Study_2.json +++ b/data/shared_folder/study_objects/Study_2.json @@ -1,4 +1,4 @@ -{ +{ "seasons": [ { "season_name": "wet", @@ -87,7 +87,7 @@ "cp_lys_growth": 0, "birth_interval": 1.2, "protein_milkcontent": 3.7, - "milk_fat_content": 4.3, + "fat_milkcontent": 4.3, "energy_milkcontent": 970, "energy_meatcontent": 2200, "protein_meatcontent": 26, @@ -140,7 +140,7 @@ "cp_lys_growth": 0.4, "birth_interval": 0, "protein_milkcontent": 0, - "milk_fat_content": 0, + "fat_milkcontent": 0, "energy_milkcontent": 0, "energy_meatcontent": 2200, "protein_meatcontent": 26, From b36bcdb42fb7f1857ac932f3d3c6bec269c09149 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sat, 17 Jan 2026 13:10:47 +0100 Subject: [PATCH 58/69] Remove unused variables (part 2) - Remove `grazing_displacement_energy` - Remove `energy_eggcontent` - Remove `cp_grazing` --- R/30_mod_scenario_init.R | 3 -- R/30_mod_scenario_server.R | 13 ++---- .../Params DB - Default/lkp_livetype.csv | 46 +++++++++---------- data/primary_database/lkp_livetype.csv | 46 +++++++++---------- .../Params_1/lkp_livetype.csv | 46 +++++++++---------- .../Params_2/lkp_livetype.csv | 46 +++++++++---------- data/shared_folder/study_objects/Study_1.json | 6 --- data/shared_folder/study_objects/Study_2.json | 6 --- 8 files changed, 97 insertions(+), 115 deletions(-) diff --git a/R/30_mod_scenario_init.R b/R/30_mod_scenario_init.R index 6b96219..4952a1e 100644 --- a/R/30_mod_scenario_init.R +++ b/R/30_mod_scenario_init.R @@ -164,9 +164,7 @@ livestock_data_initialization <- data.frame( lactation_length = numeric(), proportion_growth_piglets_milk = numeric(), lw_gain_piglets = numeric(), - grazing_displacement_energy = numeric(), cp_maintenance = numeric(), - cp_grazing = numeric(), cp_lys_pregnancy = numeric(), cp_lactmilk = numeric(), cp_lys_growth = numeric(), @@ -177,7 +175,6 @@ livestock_data_initialization <- data.frame( energy_meatcontent = numeric(), protein_meatcontent = numeric(), carcass_fraction = numeric(), - energy_eggcontent = numeric(), n_manure_content = numeric(), meat_product = character(), milk_product = character(), diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index b66b208..af8aed5 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -998,9 +998,7 @@ scenario_server <- function( lactation_length = selected_livestock$lactation_length, proportion_growth_piglets_milk = selected_livestock$proportion_growth_piglets_milk, lw_gain_piglets = selected_livestock$lw_gain_piglets, - grazing_displacement_energy = selected_livestock$grazing_displacement_energy, cp_maintenance = selected_livestock$cp_maintenance, - cp_grazing = selected_livestock$cp_grazing, cp_lys_pregnancy = selected_livestock$cp_lys_pregnancy, cp_lactmilk = selected_livestock$cp_lactmilk, cp_lys_growth = selected_livestock$cp_lys_growth, @@ -1011,7 +1009,6 @@ scenario_server <- function( energy_meatcontent = selected_livestock$energy_meatcontent, protein_meatcontent = selected_livestock$protein_meatcontent, carcass_fraction = selected_livestock$carcass_fraction, - energy_eggcontent = selected_livestock$energy_eggcontent, n_manure_content = selected_livestock$n_manure_content, meat_product = selected_livestock$meat_product, milk_product = selected_livestock$milk_product, @@ -1113,12 +1110,12 @@ scenario_server <- function( columns = c( "body_weight", "body_weight_weaning", "body_weight_year_one", "adult_weight", "work_hour", "litter_size", "piglets_relying_on_milk", - "lactation_length", "proportion_growth_piglets_milk", "lw_gain_piglets", "grazing_displacement_energy", - "cp_maintenance", "cp_grazing", "cp_lys_pregnancy", - "cp_lactmilk", "cp_lys_growth", "birth_interval", "protein_milkcontent", + "lactation_length", "proportion_growth_piglets_milk", "lw_gain_piglets", + "cp_maintenance", "cp_lys_pregnancy", "cp_lactmilk", + "cp_lys_growth", "birth_interval", "protein_milkcontent", "fat_milkcontent", "energy_milkcontent", "energy_meatcontent", - "protein_meatcontent", "carcass_fraction", "energy_eggcontent", - "n_manure_content", "meat_product", "milk_product", "ipcc_ef_category_t1", + "protein_meatcontent", "carcass_fraction", "n_manure_content", + "meat_product", "milk_product", "ipcc_ef_category_t1", "ipcc_ef_category_t2", "ipcc_meth_man_category", "ipcc_n_exc_category" ), backgroundColor = "#f4b183" diff --git a/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv b/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv index ca4316c..9f12e9b 100644 --- a/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv +++ b/data/default_data/parameters_database/Params DB - Default/lkp_livetype.csv @@ -1,23 +1,23 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","fat_milkcontent","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" -1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" -2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -4,"Cattle - Adult male",580,0,0,0,0,0,0.58,0,0,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" -5,"Cattle - Steers/heifers",200,0,0,0,0,0,0.2,0,0,0,0.4,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,2,0.3,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -7,"Cattle - Calves",90,0,0,0,0,0,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -8,"Cattle - Calves (improved)",90,0,0,0,0,2,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.52,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -9,"Buffalo - Cows",450,0,0,0,0,0,0.45,0,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" -10,"Buffalo - Steers/heifers",270,0,0,0,0,0,0.27,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -11,"Buffalo - Calves",110,0,0,0,0,0,0.11,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -12,"Sheep - Ewes",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -13,"Sheep - Breeding Rams",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -14,"Sheep - Fattening Rams",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -15,"Sheep - Lambs",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -16,"Goats - Does",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" -17,"Goats - Breeding Bucks",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -18,"Goats - Fattening Bucks",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -19,"Goats - Kids",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" -20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0,0.0297824570228919,0,0.33396,0,0,0.5,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -21,"Pigs - dry sows/boars",200,0,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -22,"Pigs - growers",80,0,0,0,0,0,0.0149797828314718,0,0,0,0.05,0,0,0,0,2580,21,0.6,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","cp_maintenance","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","fat_milkcontent","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +1,"Cattle - Cows (local)",350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" +2,"Cattle - Cows (improved)",600,0,0,0,0,0.6,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +3,"Cattle - Cows (high productive)",600,0,0,0,0,0.6,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +4,"Cattle - Adult male",580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" +5,"Cattle - Steers/heifers",200,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +7,"Cattle - Calves",90,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +8,"Cattle - Calves (improved)",90,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +9,"Buffalo - Cows",450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" +10,"Buffalo - Steers/heifers",270,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +11,"Buffalo - Calves",110,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +12,"Sheep - Ewes",53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +13,"Sheep - Breeding Rams",30,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +14,"Sheep - Fattening Rams",20,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +15,"Sheep - Lambs",15,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +16,"Goats - Does",53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" +17,"Goats - Breeding Bucks",30,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +18,"Goats - Fattening Bucks",20,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +19,"Goats - Kids",15,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" +20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0.0297824570228919,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +21,"Pigs - dry sows/boars",200,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,2580,21,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +22,"Pigs - growers",80,0,0,0,0,0.0149797828314718,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" diff --git a/data/primary_database/lkp_livetype.csv b/data/primary_database/lkp_livetype.csv index ca4316c..9f12e9b 100644 --- a/data/primary_database/lkp_livetype.csv +++ b/data/primary_database/lkp_livetype.csv @@ -1,23 +1,23 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","fat_milkcontent","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" -1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" -2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -4,"Cattle - Adult male",580,0,0,0,0,0,0.58,0,0,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" -5,"Cattle - Steers/heifers",200,0,0,0,0,0,0.2,0,0,0,0.4,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,2,0.3,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -7,"Cattle - Calves",90,0,0,0,0,0,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -8,"Cattle - Calves (improved)",90,0,0,0,0,2,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.52,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -9,"Buffalo - Cows",450,0,0,0,0,0,0.45,0,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" -10,"Buffalo - Steers/heifers",270,0,0,0,0,0,0.27,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -11,"Buffalo - Calves",110,0,0,0,0,0,0.11,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -12,"Sheep - Ewes",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -13,"Sheep - Breeding Rams",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -14,"Sheep - Fattening Rams",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -15,"Sheep - Lambs",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -16,"Goats - Does",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" -17,"Goats - Breeding Bucks",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -18,"Goats - Fattening Bucks",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -19,"Goats - Kids",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" -20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0,0.0297824570228919,0,0.33396,0,0,0.5,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -21,"Pigs - dry sows/boars",200,0,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -22,"Pigs - growers",80,0,0,0,0,0,0.0149797828314718,0,0,0,0.05,0,0,0,0,2580,21,0.6,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","cp_maintenance","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","fat_milkcontent","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +1,"Cattle - Cows (local)",350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" +2,"Cattle - Cows (improved)",600,0,0,0,0,0.6,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +3,"Cattle - Cows (high productive)",600,0,0,0,0,0.6,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +4,"Cattle - Adult male",580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" +5,"Cattle - Steers/heifers",200,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +7,"Cattle - Calves",90,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +8,"Cattle - Calves (improved)",90,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +9,"Buffalo - Cows",450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" +10,"Buffalo - Steers/heifers",270,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +11,"Buffalo - Calves",110,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +12,"Sheep - Ewes",53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +13,"Sheep - Breeding Rams",30,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +14,"Sheep - Fattening Rams",20,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +15,"Sheep - Lambs",15,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +16,"Goats - Does",53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" +17,"Goats - Breeding Bucks",30,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +18,"Goats - Fattening Bucks",20,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +19,"Goats - Kids",15,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" +20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0.0297824570228919,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +21,"Pigs - dry sows/boars",200,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,2580,21,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +22,"Pigs - growers",80,0,0,0,0,0.0149797828314718,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" diff --git a/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv b/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv index ca4316c..9f12e9b 100644 --- a/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv +++ b/data/shared_folder/parameters_database/Params_1/lkp_livetype.csv @@ -1,23 +1,23 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","fat_milkcontent","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" -1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" -2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -4,"Cattle - Adult male",580,0,0,0,0,0,0.58,0,0,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" -5,"Cattle - Steers/heifers",200,0,0,0,0,0,0.2,0,0,0,0.4,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,2,0.3,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -7,"Cattle - Calves",90,0,0,0,0,0,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -8,"Cattle - Calves (improved)",90,0,0,0,0,2,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.52,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -9,"Buffalo - Cows",450,0,0,0,0,0,0.45,0,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" -10,"Buffalo - Steers/heifers",270,0,0,0,0,0,0.27,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -11,"Buffalo - Calves",110,0,0,0,0,0,0.11,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -12,"Sheep - Ewes",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -13,"Sheep - Breeding Rams",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -14,"Sheep - Fattening Rams",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -15,"Sheep - Lambs",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -16,"Goats - Does",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" -17,"Goats - Breeding Bucks",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -18,"Goats - Fattening Bucks",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -19,"Goats - Kids",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" -20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0,0.0297824570228919,0,0.33396,0,0,0.5,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -21,"Pigs - dry sows/boars",200,0,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -22,"Pigs - growers",80,0,0,0,0,0,0.0149797828314718,0,0,0,0.05,0,0,0,0,2580,21,0.6,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","cp_maintenance","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","fat_milkcontent","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +1,"Cattle - Cows (local)",350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" +2,"Cattle - Cows (improved)",600,0,0,0,0,0.6,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +3,"Cattle - Cows (high productive)",600,0,0,0,0,0.6,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +4,"Cattle - Adult male",580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" +5,"Cattle - Steers/heifers",200,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +7,"Cattle - Calves",90,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +8,"Cattle - Calves (improved)",90,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +9,"Buffalo - Cows",450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" +10,"Buffalo - Steers/heifers",270,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +11,"Buffalo - Calves",110,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +12,"Sheep - Ewes",53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +13,"Sheep - Breeding Rams",30,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +14,"Sheep - Fattening Rams",20,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +15,"Sheep - Lambs",15,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +16,"Goats - Does",53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" +17,"Goats - Breeding Bucks",30,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +18,"Goats - Fattening Bucks",20,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +19,"Goats - Kids",15,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" +20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0.0297824570228919,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +21,"Pigs - dry sows/boars",200,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,2580,21,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +22,"Pigs - growers",80,0,0,0,0,0.0149797828314718,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" diff --git a/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv b/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv index ca4316c..9f12e9b 100644 --- a/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv +++ b/data/shared_folder/parameters_database/Params_2/lkp_livetype.csv @@ -1,23 +1,23 @@ -"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","grazing_displacement_energy","cp_maintenance","cp_grazing","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","fat_milkcontent","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","energy_eggcontent","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" -1,"Cattle - Cows (local)",350,0,0,0,0,0,0.35,0,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" -2,"Cattle - Cows (improved)",600,0,0,0,0,0,0.6,0,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -3,"Cattle - Cows (high productive)",600,0,0,0,0,2,0.6,0,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" -4,"Cattle - Adult male",580,0,0,0,0,0,0.58,0,0,0,0,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" -5,"Cattle - Steers/heifers",200,0,0,0,0,0,0.2,0,0,0,0.4,0,0,0,0,2200,26,0.48,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,2,0.3,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" -7,"Cattle - Calves",90,0,0,0,0,0,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.49,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -8,"Cattle - Calves (improved)",90,0,0,0,0,2,0.09,0,0,0,0.4,0,0,0,0,2200,26,0.52,0,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" -9,"Buffalo - Cows",450,0,0,0,0,0,0.45,0,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" -10,"Buffalo - Steers/heifers",270,0,0,0,0,0,0.27,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -11,"Buffalo - Calves",110,0,0,0,0,0,0.11,0,0,0,0.4,0,0,0,0,2200,26,0.58,0,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" -12,"Sheep - Ewes",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -13,"Sheep - Breeding Rams",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -14,"Sheep - Fattening Rams",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -15,"Sheep - Lambs",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" -16,"Goats - Does",53,0,60,0,0,0,0.106,0,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" -17,"Goats - Breeding Bucks",30,0,0,0,0,0,0.06,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -18,"Goats - Fattening Bucks",20,0,0,0,0,0,0.04,0,0,0,0.45,0,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" -19,"Goats - Kids",15,0,0,0,0,0,0.03,0,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" -20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0,0.0297824570228919,0,0.33396,0,0,0.5,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -21,"Pigs - dry sows/boars",200,0,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,0,2580,21,0,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" -22,"Pigs - growers",80,0,0,0,0,0,0.0149797828314718,0,0,0,0.05,0,0,0,0,2580,21,0.6,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +"livetype_code","livetype_desc","body_weight","litter_size","lactation_length","proportion_growth_piglets_milk","lw_gain_piglets","cp_maintenance","cp_lys_pregnancy","cp_lactmilk","cp_lys_growth","birth_interval","protein_milkcontent","fat_milkcontent","energy_milkcontent","energy_meatcontent","protein_meatcontent","carcass_fraction","n_manure_content","meat_product","milk_product","ipcc_meth_ef_t1","ipcc_meth_ef_t2","ipcc_meth_man","ipcc_meth_exc" +1,"Cattle - Cows (local)",350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,"beef","cow milk","Other mature female","Dairy cows","Dairy cows","Dairy cattle" +2,"Cattle - Cows (improved)",600,0,0,0,0,0.6,12.21,0.09,0,1.16666666666667,3.7,4.3,970,2200,26,0.48,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +3,"Cattle - Cows (high productive)",600,0,0,0,0,0.6,15,0.09,0,1.16666666666667,3.7,4,970,2200,26,0.45,0.029,"beef","cow milk","Dairy cattle","Dairy cows","Dairy cows","Dairy cattle" +4,"Cattle - Adult male",580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,"beef","cow milk","Other draft bull","Non-dairy","Other cattle","Other cattle" +5,"Cattle - Steers/heifers",200,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +6,"Cattle - Steers/heifers (improved)",300,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,"beef","cow milk","Other mature female-grazing","Non-dairy","Other cattle","Other cattle" +7,"Cattle - Calves",90,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +8,"Cattle - Calves (improved)",90,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,"beef","cow milk","Other young","Non-dairy","Other cattle","Other cattle" +9,"Buffalo - Cows",450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,"buffalo","buffalo milk","Other mature female-grazing","Dairy cows","Dairy cows","Dairy cattle" +10,"Buffalo - Steers/heifers",270,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +11,"Buffalo - Calves",110,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,"buffalo","buffalo milk","Other young","Non-dairy","Other cattle","Other cattle" +12,"Sheep - Ewes",53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +13,"Sheep - Breeding Rams",30,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +14,"Sheep - Fattening Rams",20,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +15,"Sheep - Lambs",15,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,"mutton","sheep milk","Goats","Sheep","Sheep","Sheep" +16,"Goats - Does",53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,"goat","goat milk","Goats","Goats","Sheep","Sheep" +17,"Goats - Breeding Bucks",30,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +18,"Goats - Fattening Bucks",20,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0,"goat","goat milk","Goats","Goats","Sheep","Sheep" +19,"Goats - Kids",15,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,"goat","goat milk","Goats","Goats","Sheep","Sheep" +20,"Pigs - lactating/pregnant sows",200,10,21,60,0.2,0.0297824570228919,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +21,"Pigs - dry sows/boars",200,0,0,0,0,0.0297824570228919,0,0,0,0,0,0,0,2580,21,0,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" +22,"Pigs - growers",80,0,0,0,0,0.0149797828314718,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,"pork","N/A","Pigs","N/A","Swine","Pigs" diff --git a/data/shared_folder/study_objects/Study_1.json b/data/shared_folder/study_objects/Study_1.json index 417389a..e20691d 100644 --- a/data/shared_folder/study_objects/Study_1.json +++ b/data/shared_folder/study_objects/Study_1.json @@ -79,9 +79,7 @@ "lactation_length": 0, "proportion_growth_piglets_milk": 0, "lw_gain_piglets": 0, - "grazing_displacement_energy": 0, "cp_maintenance": 0.56, - "cp_grazing": 0, "cp_lys_pregnancy": 12.21, "cp_lactmilk": 0.09, "cp_lys_growth": 0, @@ -92,7 +90,6 @@ "energy_meatcontent": 2200, "protein_meatcontent": 26, "carcass_fraction": 0.48, - "energy_eggcontent": 0, "n_manure_content": 0.029, "meat_product": "beef", "milk_product": "cow milk", @@ -132,9 +129,7 @@ "lactation_length": 0, "proportion_growth_piglets_milk": 0, "lw_gain_piglets": 0, - "grazing_displacement_energy": 0, "cp_maintenance": 0.33, - "cp_grazing": 0, "cp_lys_pregnancy": 0, "cp_lactmilk": 0, "cp_lys_growth": 0.4, @@ -145,7 +140,6 @@ "energy_meatcontent": 2200, "protein_meatcontent": 26, "carcass_fraction": 0.49, - "energy_eggcontent": 0, "n_manure_content": 0.029, "meat_product": "beef", "milk_product": "cow milk", diff --git a/data/shared_folder/study_objects/Study_2.json b/data/shared_folder/study_objects/Study_2.json index 078a198..7dfbb72 100644 --- a/data/shared_folder/study_objects/Study_2.json +++ b/data/shared_folder/study_objects/Study_2.json @@ -79,9 +79,7 @@ "lactation_length": 0, "proportion_growth_piglets_milk": 0, "lw_gain_piglets": 0, - "grazing_displacement_energy": 0, "cp_maintenance": 0.6, - "cp_grazing": 0, "cp_lys_pregnancy": 12.21, "cp_lactmilk": 0.09, "cp_lys_growth": 0, @@ -92,7 +90,6 @@ "energy_meatcontent": 2200, "protein_meatcontent": 26, "carcass_fraction": 0.48, - "energy_eggcontent": 0, "n_manure_content": 0.029, "meat_product": "beef", "milk_product": "cow milk", @@ -132,9 +129,7 @@ "lactation_length": 0, "proportion_growth_piglets_milk": 0, "lw_gain_piglets": 0, - "grazing_displacement_energy": 0, "cp_maintenance": 0.3, - "cp_grazing": 0, "cp_lys_pregnancy": 0, "cp_lactmilk": 0, "cp_lys_growth": 0.4, @@ -145,7 +140,6 @@ "energy_meatcontent": 2200, "protein_meatcontent": 26, "carcass_fraction": 0.49, - "energy_eggcontent": 0, "n_manure_content": 0.029, "meat_product": "beef", "milk_product": "cow milk", From 4e008bc540c04dedd3d2acad1ea877b3717e7766 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 18 Jan 2026 10:46:53 +0100 Subject: [PATCH 59/69] Fix table performance and scrollbar visibility issues --- R/40_mod_params_db_fct.R | 32 +++++++++++++------------- R/40_mod_params_db_server.R | 6 ++--- www/js/hack.js | 18 +++++++++++++++ www/sass/app.scss | 45 +++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+), 19 deletions(-) diff --git a/R/40_mod_params_db_fct.R b/R/40_mod_params_db_fct.R index d1a059d..0525b74 100644 --- a/R/40_mod_params_db_fct.R +++ b/R/40_mod_params_db_fct.R @@ -50,15 +50,10 @@ add_cursor_to_disabled_column_js <- function() { } # Initialize column search inputs in DataTables header (initComplete callback) -# Cleans up FixedHeader artifacts, adds search row to original and cloned headers init_column_search_js <- function() { 'function(settings, json) { var api = this.api(); - // CLEANUP: Always remove old FixedHeader artifacts on every table initialization - // This prevents memory leaks and progressive slowdown - $(".dtfh-floatingparent").remove(); - // Check if search row already exists in the DOM (prevents duplicates) var existingSearchRow = $(api.table().header()).find("tr.search-row"); if (existingSearchRow.length > 0) { @@ -82,7 +77,6 @@ init_column_search_js <- function() { } else if (!isVisible) { // Skip creating search input for hidden columns (but they remain searchable) // This prevents empty search boxes from appearing for hidden columns like crop_code - // Note: We don\'t append anything, so this column won\'t have a search input } else { // Create a text input for filtering this column var input = $(\'\') @@ -104,18 +98,24 @@ init_column_search_js <- function() { // Add the completed search row to the table header $(api.table().header()).append(searchRow); - - // Update FixedHeader and FixedColumns to include the new search row in their clones + + // Force header to match body width including scrollbar space setTimeout(function() { - if (api.fixedHeader) { - api.fixedHeader.adjust(); - } - if (api.fixedColumns) { - api.fixedColumns().update(); + var wrapper = $(api.table().container()); + var scrollHead = wrapper.find(".dataTables_scrollHead"); + var scrollBody = wrapper.find(".dataTables_scrollBody"); + + if (scrollBody.length && scrollHead.length) { + // Make header scrollable and match body overflow behavior + scrollHead.css({ + "overflow-y": "scroll", + "overflow-x": "hidden" + }); } - // Recalculate column widths and redraw to ensure proper alignment - api.columns.adjust().draw(false); - }, 30); + + // Recalculate column widths to ensure proper alignment + api.columns.adjust(); + }, 50); }' } diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index ea95e4a..0588c73 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -683,17 +683,18 @@ params_db_server <- function( } } - # Render datatable with all rows and frozen headers + # Render datatable with all rows and frozen columns datatable( data = data_table, editable = editablity, rownames = FALSE, escape = FALSE, - extensions = c("FixedColumns", "FixedHeader"), + extensions = c("FixedColumns"), selection = "none", colnames = c("", colnames(data_table)[-1]), # Hide first column name options = list( scrollX = TRUE, + scrollY = "480px", processing = FALSE, paging = FALSE, searching = TRUE, @@ -707,7 +708,6 @@ params_db_server <- function( ) ), fixedColumns = list(leftColumns = 1), - fixedHeader = TRUE, initComplete = JS(init_column_search_js()) ) ) diff --git a/www/js/hack.js b/www/js/hack.js index 702c09c..8c0fe08 100644 --- a/www/js/hack.js +++ b/www/js/hack.js @@ -20,4 +20,22 @@ $(function () { if (!isActive) $menu.addClass('active'); } }); + + // Fix DataTables column alignment when switching tabs + $(document).on('shown.bs.tab', 'a[data-bs-toggle="tab"]', function (e) { + var target = $(e.target).attr("href"); + + setTimeout(function() { + $(target).find('.dataTable').each(function() { + try { + var table = $(this).DataTable(); + if (table) { + table.columns.adjust().draw(false); + } + } catch (error) { + console.log('Could not adjust table:', error); + } + }); + }, 10); + }); }); diff --git a/www/sass/app.scss b/www/sass/app.scss index efa8664..0cf81da 100644 --- a/www/sass/app.scss +++ b/www/sass/app.scss @@ -704,12 +704,45 @@ table tbody tr{ .dataTables_wrapper { overflow-x: auto; } + +/* Style the header scrollbar to match header background */ +.dataTables_scrollHead { + overflow-y: scroll !important; + overflow-x: hidden !important; + + /* Chrome, Safari, Opera */ + &::-webkit-scrollbar { + width: 17px; + } + + &::-webkit-scrollbar-track, + &::-webkit-scrollbar-thumb { + background-color: #f5f5f5; + border: none; + } + + &::-webkit-scrollbar-button { + display: none; + } +} + +/* Hide the FixedColumns top-right blocker */ +.dtfc-right-top-blocker { + display: none !important; +} + table.dataTable thead tr>.dtfc-fixed-left { background-color: #f5f5f5; } table.dataTable tbody tr>.dtfc-fixed-left{ background-color: #ebeff1; } + +/* Ensure search row in fixed column matches main header */ +.dtfc-fixed-left thead tr.search-row th { + background-color: #f5f5f5 !important; + padding: 2px !important; +} .modal-dialog:not(.modal-lg) { max-width: 60%; width: 60%; @@ -1502,6 +1535,10 @@ table.dataTable thead tr:nth-child(2) th { padding: 2px !important; line-height: 1 !important; box-sizing: border-box !important; + background-color: #f5f5f5 !important; + overflow: hidden !important; + max-width: 100% !important; + min-width: 0 !important; /* Search input field styling */ input[type="text"] { @@ -1524,6 +1561,14 @@ table.dataTable thead tr:nth-child(2) th { } } +/* Fix first column search cell to stay with fixed column */ +table.dataTable thead tr.search-row th:first-child { + position: sticky !important; + left: 0 !important; + z-index: 3 !important; + background-color: #f5f5f5 !important; +} + /* Hide the global DataTables search filter */ .dataTables_filter { display: none !important; From b28f63693a175f4ddb0f87fbdba69b0246bd91db Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 18 Jan 2026 11:59:27 +0100 Subject: [PATCH 60/69] Auto-jump after adding a row --- R/40_mod_params_db_fct.R | 10 ++++++++++ R/40_mod_params_db_server.R | 5 +++++ ui.R | 2 ++ www/js/vertical-scroll.js | 18 ++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 www/js/vertical-scroll.js diff --git a/R/40_mod_params_db_fct.R b/R/40_mod_params_db_fct.R index 0525b74..0add241 100644 --- a/R/40_mod_params_db_fct.R +++ b/R/40_mod_params_db_fct.R @@ -256,3 +256,13 @@ get_valid_crop_choices <- function(crops_table, current_crop_code) { return(list(choices = choices, selected = current_crop_code)) } + +#' Scroll DataTable to Bottom +#' +#' Scrolls a DataTable to the bottom and highlights the last row. +#' +#' @param session Shiny session object +#' @param table_id Namespaced table ID +scroll_to_bottom <- function(session, table_id) { + session$sendCustomMessage("scrollToBottom", list(tableId = table_id)) +} diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index 0588c73..40599fd 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -1025,6 +1025,11 @@ params_db_server <- function( # Keep table scroll position to prevent UI jump freeze_and_unfreeze_scroll(session, ns(paste0("table_", table_name))) + + # Auto-jump to the bottom to show newly added row + session$onFlushed(function() { + scroll_to_bottom(session, ns(paste0("table_", table_name))) + }, once = TRUE) }) }) diff --git a/ui.R b/ui.R index f797f13..aadfb2f 100644 --- a/ui.R +++ b/ui.R @@ -22,6 +22,8 @@ ui <- fluidPage( includeScript("www/js/bg-modal.js"), # Change backdrop modal # Add JS code to freeze the horizontal scroll on table edit includeScript("www/js/horizontal-scroll.js"), + # Add JS handler for vertical scroll (auto-jump to new rows) + includeScript("www/js/vertical-scroll.js"), includeScript("www/js/auth-url-cleanup.js"), # Clean the URL after login # # ------ Header ---------------------------------------------------------- tags$header( diff --git a/www/js/vertical-scroll.js b/www/js/vertical-scroll.js new file mode 100644 index 0000000..eef08ec --- /dev/null +++ b/www/js/vertical-scroll.js @@ -0,0 +1,18 @@ +// Vertical scroll handler for DataTables +// Automatically jumps to bottom and highlights newly added rows + +Shiny.addCustomMessageHandler('scrollToBottom', function(message) { + var tableId = message.tableId; + + if (!tableId) return; + + // Use setTimeout to ensure table has finished rendering + setTimeout(function() { + var scrollBody = $('#' + tableId + ' .dataTables_scrollBody'); + + if (scrollBody.length > 0) { + // Scroll to the bottom + scrollBody.scrollTop(scrollBody[0].scrollHeight); + } + }, 150); +}); From 90011d0d1392ef4a06a53e4e7d3135fad370840f Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 18 Jan 2026 12:11:13 +0100 Subject: [PATCH 61/69] Reduce code column's width --- www/sass/app.scss | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/www/sass/app.scss b/www/sass/app.scss index 0cf81da..19870b5 100644 --- a/www/sass/app.scss +++ b/www/sass/app.scss @@ -669,6 +669,15 @@ table.dataTable { > tbody > tr > td:not(:first-child) { min-width: $common-width; } + + /* Reduce width for code column (second column after checkbox) */ + > thead > tr > th:nth-child(2), + > thead > tr > td:nth-child(2), + > tbody > tr > td:nth-child(2) { + width: 120px; + min-width: 120px; + max-width: 120px; + } } } From b3b705917bc588c033282587e9a3e0d93118065e Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Sun, 18 Jan 2026 14:01:50 +0100 Subject: [PATCH 62/69] Freeze key columns in Crops & Livetype --- R/40_mod_params_db_fct.R | 10 ++++++++++ R/40_mod_params_db_server.R | 9 ++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/R/40_mod_params_db_fct.R b/R/40_mod_params_db_fct.R index 0add241..c0103a0 100644 --- a/R/40_mod_params_db_fct.R +++ b/R/40_mod_params_db_fct.R @@ -66,8 +66,18 @@ init_column_search_js <- function() { // Loop through each column to create search inputs api.columns().every(function(index) { var column = this; + var $originalTh = $(column.header()); var th = $(""); + // copy sticky styles from the original header + var position = $originalTh.css("position"); + if (position === "sticky") { + th.css({ + "position": "sticky", + "left": $originalTh.css("left") + }); + } + // Check if this column is visible var isVisible = column.visible(); diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index 40599fd..b660c45 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -683,6 +683,13 @@ params_db_server <- function( } } + # Determine number of fixed columns based on table type + fixed_columns_count <- if (name %in% c("lkp_crops", "lkp_livetype")) { + 3 # Freeze checkbox + code + name columns + } else { + 1 # Only freeze checkbox column + } + # Render datatable with all rows and frozen columns datatable( data = data_table, @@ -707,7 +714,7 @@ params_db_server <- function( table_name = name ) ), - fixedColumns = list(leftColumns = 1), + fixedColumns = list(leftColumns = fixed_columns_count), initComplete = JS(init_column_search_js()) ) ) From c390a24e4d24b58f51694e1c0e2c5fbbd6fb12b7 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Mon, 26 Jan 2026 21:23:17 +0100 Subject: [PATCH 63/69] save vertical scroll position --- www/js/horizontal-scroll.js | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/www/js/horizontal-scroll.js b/www/js/horizontal-scroll.js index d9d0b34..5332cac 100644 --- a/www/js/horizontal-scroll.js +++ b/www/js/horizontal-scroll.js @@ -7,11 +7,17 @@ Shiny.addCustomMessageHandler('freezeScroll', function(message) { if (!tableId) return; var scrollContainer = $('#' + tableId + ' .dataTables_scrollBody'); - // Save scroll position - scrollPositions[tableId] = scrollContainer.scrollLeft(); + // Save both horizontal and vertical scroll positions + scrollPositions[tableId] = { + left: scrollContainer.scrollLeft(), + top: scrollContainer.scrollTop() + }; - // Disable horizontal scrolling by setting overflow to hidden - scrollContainer.css('overflow-x', 'hidden'); + // Disable scrolling by setting overflow to hidden + scrollContainer.css({ + 'overflow-x': 'hidden', + 'overflow-y': 'hidden' + }); }); // Restore scroll position and re-enable scrolling after rerendering @@ -20,9 +26,15 @@ Shiny.addCustomMessageHandler('unfreezeScroll', function(message) { if (!tableId) return; var scrollContainer = $('#' + tableId + ' .dataTables_scrollBody'); - // Restore scroll position - scrollContainer.scrollLeft(scrollPositions[tableId]); + // Restore both horizontal and vertical scroll positions + if (scrollPositions[tableId]) { + scrollContainer.scrollLeft(scrollPositions[tableId].left); + scrollContainer.scrollTop(scrollPositions[tableId].top); + } - // Re-enable horizontal scrolling by setting overflow to auto - scrollContainer.css('overflow-x', 'auto'); + // Re-enable scrolling by setting overflow to auto + scrollContainer.css({ + 'overflow-x': 'auto', + 'overflow-y': 'auto' + }); }); \ No newline at end of file From dd94816db48f59ba0bc2fbc60df20b76bb02d41d Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Mon, 16 Feb 2026 04:13:53 +0000 Subject: [PATCH 64/69] Implement new default parameters database --- R/30_mod_scenario_server.R | 26 +++-- R/40_mod_params_db_server.R | 49 +++++----- .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 0 .../lkp_crops.csv | 18 ++++ .../lkp_feeditem.csv | 21 ++++ .../lkp_grassinputlevel.csv | 0 .../lkp_grasslandman.csv | 0 .../lkp_landcover.csv | 0 .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 0 .../lkp_organicmatter.csv | 0 .../lkp_orgfertilizer.csv | 0 .../lkp_region.csv | 0 .../lkp_slope.csv | 0 .../lkp_soil.csv | 0 .../lkp_tillageregime.csv | 0 .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 29 ++++++ .../lkp_feeditem.csv | 33 +++++++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 0 .../lkp_croplandsystem.csv | 11 +++ .../Ethiopia - Small Ruminants/lkp_crops.csv | 15 +++ .../lkp_feeditem.csv | 16 +++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../Ethiopia - Small Ruminants/lkp_region.csv | 4 + .../Ethiopia - Small Ruminants/lkp_slope.csv | 6 ++ .../Ethiopia - Small Ruminants/lkp_soil.csv | 13 +++ .../lkp_tillageregime.csv | 12 +++ .../Haiti - Mixed Livestock/lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../Haiti - Mixed Livestock/lkp_crops.csv | 10 ++ .../Haiti - Mixed Livestock/lkp_feeditem.csv | 11 +++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../Haiti - Mixed Livestock/lkp_landcover.csv | 15 +++ .../Haiti - Mixed Livestock/lkp_livetype.csv | 23 +++++ .../Haiti - Mixed Livestock/lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../Haiti - Mixed Livestock/lkp_region.csv | 4 + .../Haiti - Mixed Livestock/lkp_slope.csv | 6 ++ .../Haiti - Mixed Livestock/lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 24 +++++ .../lkp_feeditem.csv | 26 +++++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../Mongolia- Livestock General/lkp_crops.csv | 9 ++ .../lkp_feeditem.csv | 10 ++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../Mongolia- Livestock General/lkp_slope.csv | 6 ++ .../Mongolia- Livestock General/lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../Nepal - Goat Fattening/lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../Nepal - Goat Fattening/lkp_crops.csv | 20 ++++ .../Nepal - Goat Fattening/lkp_feeditem.csv | 25 +++++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../Nepal - Goat Fattening/lkp_landcover.csv | 15 +++ .../Nepal - Goat Fattening/lkp_livetype.csv | 23 +++++ .../Nepal - Goat Fattening/lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../Nepal - Goat Fattening/lkp_region.csv | 4 + .../Nepal - Goat Fattening/lkp_slope.csv | 6 ++ .../Nepal - Goat Fattening/lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 17 ++++ .../lkp_feeditem.csv | 20 ++++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 9 ++ .../lkp_feeditem.csv | 11 +++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../Northern Tanzania - Dairy/lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../Northern Tanzania - Dairy/lkp_crops.csv | 13 +++ .../lkp_feeditem.csv | 11 +++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../Northern Tanzania - Dairy/lkp_region.csv | 4 + .../Northern Tanzania - Dairy/lkp_slope.csv | 6 ++ .../Northern Tanzania - Dairy/lkp_soil.csv | 10 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 12 +++ .../lkp_feeditem.csv | 12 +++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 10 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 37 +++++++ .../lkp_feeditem.csv | 61 ++++++++++++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 9 ++ .../lkp_feeditem.csv | 10 ++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../Uzbekistan - Mixed livestock/lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../Western Kenya - Dairy/lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../Western Kenya - Dairy/lkp_crops.csv | 14 +++ .../Western Kenya - Dairy/lkp_feeditem.csv | 16 +++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../Western Kenya - Dairy/lkp_landcover.csv | 15 +++ .../Western Kenya - Dairy/lkp_livetype.csv | 23 +++++ .../Western Kenya - Dairy/lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../Western Kenya - Dairy/lkp_region.csv | 4 + .../Western Kenya - Dairy/lkp_slope.csv | 6 ++ .../Western Kenya - Dairy/lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 18 ++++ .../lkp_feeditem.csv | 21 ++++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 29 ++++++ .../lkp_feeditem.csv | 33 +++++++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../Ethiopia - Small Ruminants/lkp_crops.csv | 15 +++ .../lkp_feeditem.csv | 16 +++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../Ethiopia - Small Ruminants/lkp_region.csv | 4 + .../Ethiopia - Small Ruminants/lkp_slope.csv | 6 ++ .../Ethiopia - Small Ruminants/lkp_soil.csv | 13 +++ .../lkp_tillageregime.csv | 12 +++ .../Haiti - Mixed Livestock/lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../Haiti - Mixed Livestock/lkp_crops.csv | 10 ++ .../Haiti - Mixed Livestock/lkp_feeditem.csv | 11 +++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../Haiti - Mixed Livestock/lkp_landcover.csv | 15 +++ .../Haiti - Mixed Livestock/lkp_livetype.csv | 23 +++++ .../Haiti - Mixed Livestock/lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../Haiti - Mixed Livestock/lkp_region.csv | 4 + .../Haiti - Mixed Livestock/lkp_slope.csv | 6 ++ .../Haiti - Mixed Livestock/lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 24 +++++ .../lkp_feeditem.csv | 26 +++++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../Mongolia- Livestock General/lkp_crops.csv | 9 ++ .../lkp_feeditem.csv | 10 ++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../Mongolia- Livestock General/lkp_slope.csv | 6 ++ .../Mongolia- Livestock General/lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../Nepal - Goat Fattening/lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../Nepal - Goat Fattening/lkp_crops.csv | 20 ++++ .../Nepal - Goat Fattening/lkp_feeditem.csv | 25 +++++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../Nepal - Goat Fattening/lkp_landcover.csv | 15 +++ .../Nepal - Goat Fattening/lkp_livetype.csv | 23 +++++ .../Nepal - Goat Fattening/lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../Nepal - Goat Fattening/lkp_region.csv | 4 + .../Nepal - Goat Fattening/lkp_slope.csv | 6 ++ .../Nepal - Goat Fattening/lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 17 ++++ .../lkp_feeditem.csv | 20 ++++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 9 ++ .../lkp_feeditem.csv | 11 +++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../Northern Tanzania - Dairy/lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../Northern Tanzania - Dairy/lkp_crops.csv | 13 +++ .../lkp_feeditem.csv | 11 +++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../Northern Tanzania - Dairy/lkp_region.csv | 4 + .../Northern Tanzania - Dairy/lkp_slope.csv | 6 ++ .../Northern Tanzania - Dairy/lkp_soil.csv | 10 ++ .../lkp_tillageregime.csv | 12 +++ .../Params DB - Default/lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../{ => Params DB - Default}/lkp_crops.csv | 0 .../lkp_feeditem.csv | 0 .../lkp_grassinputlevel.csv | 4 + .../Params DB - Default/lkp_grasslandman.csv | 9 ++ .../Params DB - Default/lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 0 .../Params DB - Default/lkp_manureman.csv | 36 +++++++ .../Params DB - Default/lkp_organicmatter.csv | 13 +++ .../Params DB - Default/lkp_orgfertilizer.csv | 8 ++ .../Params DB - Default/lkp_region.csv | 4 + .../Params DB - Default/lkp_slope.csv | 6 ++ .../Params DB - Default/lkp_soil.csv | 9 ++ .../Params DB - Default/lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 12 +++ .../lkp_feeditem.csv | 12 +++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 10 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 37 +++++++ .../lkp_feeditem.csv | 61 ++++++++++++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../lkp_crops.csv | 9 ++ .../lkp_feeditem.csv | 10 ++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../lkp_landcover.csv | 15 +++ .../lkp_livetype.csv | 23 +++++ .../lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../lkp_region.csv | 4 + .../lkp_slope.csv | 6 ++ .../Uzbekistan - Mixed livestock/lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ .../Western Kenya - Dairy/lkp_climate.csv | 7 ++ .../lkp_croplandsystem.csv | 11 +++ .../Western Kenya - Dairy/lkp_crops.csv | 14 +++ .../Western Kenya - Dairy/lkp_feeditem.csv | 16 +++ .../lkp_grassinputlevel.csv | 4 + .../lkp_grasslandman.csv | 9 ++ .../Western Kenya - Dairy/lkp_landcover.csv | 15 +++ .../Western Kenya - Dairy/lkp_livetype.csv | 23 +++++ .../Western Kenya - Dairy/lkp_manureman.csv | 36 +++++++ .../lkp_organicmatter.csv | 13 +++ .../lkp_orgfertilizer.csv | 8 ++ .../Western Kenya - Dairy/lkp_region.csv | 4 + .../Western Kenya - Dairy/lkp_slope.csv | 6 ++ .../Western Kenya - Dairy/lkp_soil.csv | 9 ++ .../lkp_tillageregime.csv | 12 +++ global.R | 6 ++ server.R | 98 +------------------ 439 files changed, 5497 insertions(+), 128 deletions(-) create mode 100644 data/default_data/parameters_database/Central Uganda - Livestock General/lkp_climate.csv rename data/{primary_database => default_data/parameters_database/Central Uganda - Livestock General}/lkp_croplandsystem.csv (100%) create mode 100644 data/default_data/parameters_database/Central Uganda - Livestock General/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Central Uganda - Livestock General/lkp_feeditem.csv rename data/{primary_database => default_data/parameters_database/Central Uganda - Livestock General}/lkp_grassinputlevel.csv (100%) rename data/{primary_database => default_data/parameters_database/Central Uganda - Livestock General}/lkp_grasslandman.csv (100%) rename data/{primary_database => default_data/parameters_database/Central Uganda - Livestock General}/lkp_landcover.csv (100%) create mode 100644 data/default_data/parameters_database/Central Uganda - Livestock General/lkp_livetype.csv rename data/{primary_database => default_data/parameters_database/Central Uganda - Livestock General}/lkp_manureman.csv (100%) rename data/{primary_database => default_data/parameters_database/Central Uganda - Livestock General}/lkp_organicmatter.csv (100%) rename data/{primary_database => default_data/parameters_database/Central Uganda - Livestock General}/lkp_orgfertilizer.csv (100%) rename data/{primary_database => default_data/parameters_database/Central Uganda - Livestock General}/lkp_region.csv (100%) rename data/{primary_database => default_data/parameters_database/Central Uganda - Livestock General}/lkp_slope.csv (100%) rename data/{primary_database => default_data/parameters_database/Central Uganda - Livestock General}/lkp_soil.csv (100%) rename data/{primary_database => default_data/parameters_database/Central Uganda - Livestock General}/lkp_tillageregime.csv (100%) create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_climate.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_region.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_slope.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_soil.csv create mode 100644 data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_tillageregime.csv rename data/{primary_database => default_data/parameters_database/Ethiopia - Small Ruminants}/lkp_climate.csv (100%) create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_region.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_slope.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_soil.csv create mode 100644 data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_tillageregime.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_climate.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_region.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_slope.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_soil.csv create mode 100644 data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_tillageregime.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_climate.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_region.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_slope.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_soil.csv create mode 100644 data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_tillageregime.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_climate.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_region.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_slope.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_soil.csv create mode 100644 data/default_data/parameters_database/Mongolia- Livestock General/lkp_tillageregime.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_climate.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_region.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_slope.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_soil.csv create mode 100644 data/default_data/parameters_database/Nepal - Goat Fattening/lkp_tillageregime.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_climate.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_region.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_slope.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_soil.csv create mode 100644 data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_tillageregime.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_climate.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_crops.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_region.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_slope.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_soil.csv create mode 100644 data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_tillageregime.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_climate.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_region.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_slope.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_soil.csv create mode 100644 data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_tillageregime.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_climate.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_region.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_slope.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_soil.csv create mode 100644 data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_tillageregime.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_climate.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_region.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_slope.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_soil.csv create mode 100644 data/default_data/parameters_database/Tunisia - National livestock general/lkp_tillageregime.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_climate.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_region.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_slope.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_soil.csv create mode 100644 data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_tillageregime.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_climate.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_croplandsystem.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_crops.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_feeditem.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_grassinputlevel.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_grasslandman.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_landcover.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_livetype.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_manureman.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_organicmatter.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_orgfertilizer.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_region.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_slope.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_soil.csv create mode 100644 data/default_data/parameters_database/Western Kenya - Dairy/lkp_tillageregime.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_climate.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_croplandsystem.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_crops.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_feeditem.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_grasslandman.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_landcover.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_livetype.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_manureman.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_organicmatter.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_region.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_slope.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_soil.csv create mode 100644 data/primary_database/Central Uganda - Livestock General/lkp_tillageregime.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_climate.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_croplandsystem.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_crops.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_feeditem.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_grasslandman.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_landcover.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_livetype.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_manureman.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_organicmatter.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_region.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_slope.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_soil.csv create mode 100644 data/primary_database/Ecuador-National dual-purpose cattle/lkp_tillageregime.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_climate.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_croplandsystem.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_crops.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_feeditem.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_grasslandman.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_landcover.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_livetype.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_manureman.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_organicmatter.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_region.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_slope.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_soil.csv create mode 100644 data/primary_database/Ethiopia - Small Ruminants/lkp_tillageregime.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_climate.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_croplandsystem.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_crops.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_feeditem.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_grasslandman.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_landcover.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_livetype.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_manureman.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_organicmatter.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_region.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_slope.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_soil.csv create mode 100644 data/primary_database/Haiti - Mixed Livestock/lkp_tillageregime.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_climate.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_croplandsystem.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_crops.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_feeditem.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_grasslandman.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_landcover.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_livetype.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_manureman.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_organicmatter.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_region.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_slope.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_soil.csv create mode 100644 data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_tillageregime.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_climate.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_croplandsystem.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_crops.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_feeditem.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_grasslandman.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_landcover.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_livetype.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_manureman.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_organicmatter.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_region.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_slope.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_soil.csv create mode 100644 data/primary_database/Mongolia- Livestock General/lkp_tillageregime.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_climate.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_croplandsystem.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_crops.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_feeditem.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_grasslandman.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_landcover.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_livetype.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_manureman.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_organicmatter.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_region.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_slope.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_soil.csv create mode 100644 data/primary_database/Nepal - Goat Fattening/lkp_tillageregime.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_climate.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_croplandsystem.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_crops.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_feeditem.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_grasslandman.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_landcover.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_livetype.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_manureman.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_organicmatter.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_region.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_slope.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_soil.csv create mode 100644 data/primary_database/Nicaragua-National dual-purpose cattle/lkp_tillageregime.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_climate.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_croplandsystem.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_crops.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_feeditem.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_grassinputlevel.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_grasslandman.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_landcover.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_livetype.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_manureman.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_organicmatter.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_orgfertilizer.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_region.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_slope.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_soil.csv create mode 100644 data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_tillageregime.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_climate.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_croplandsystem.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_crops.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_feeditem.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_grasslandman.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_landcover.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_livetype.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_manureman.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_organicmatter.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_region.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_slope.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_soil.csv create mode 100644 data/primary_database/Northern Tanzania - Dairy/lkp_tillageregime.csv create mode 100644 data/primary_database/Params DB - Default/lkp_climate.csv create mode 100644 data/primary_database/Params DB - Default/lkp_croplandsystem.csv rename data/primary_database/{ => Params DB - Default}/lkp_crops.csv (100%) rename data/primary_database/{ => Params DB - Default}/lkp_feeditem.csv (100%) create mode 100644 data/primary_database/Params DB - Default/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Params DB - Default/lkp_grasslandman.csv create mode 100644 data/primary_database/Params DB - Default/lkp_landcover.csv rename data/primary_database/{ => Params DB - Default}/lkp_livetype.csv (100%) create mode 100644 data/primary_database/Params DB - Default/lkp_manureman.csv create mode 100644 data/primary_database/Params DB - Default/lkp_organicmatter.csv create mode 100644 data/primary_database/Params DB - Default/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Params DB - Default/lkp_region.csv create mode 100644 data/primary_database/Params DB - Default/lkp_slope.csv create mode 100644 data/primary_database/Params DB - Default/lkp_soil.csv create mode 100644 data/primary_database/Params DB - Default/lkp_tillageregime.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_climate.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_croplandsystem.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_crops.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_feeditem.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_grasslandman.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_landcover.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_livetype.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_manureman.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_organicmatter.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_region.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_slope.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_soil.csv create mode 100644 data/primary_database/Southern Highland Tanzania Dairy/lkp_tillageregime.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_climate.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_croplandsystem.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_crops.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_feeditem.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_grasslandman.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_landcover.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_livetype.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_manureman.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_organicmatter.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_region.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_slope.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_soil.csv create mode 100644 data/primary_database/Tunisia - National livestock general/lkp_tillageregime.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_climate.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_croplandsystem.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_crops.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_feeditem.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_grasslandman.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_landcover.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_livetype.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_manureman.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_organicmatter.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_region.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_slope.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_soil.csv create mode 100644 data/primary_database/Uzbekistan - Mixed livestock/lkp_tillageregime.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_climate.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_croplandsystem.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_crops.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_feeditem.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_grassinputlevel.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_grasslandman.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_landcover.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_livetype.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_manureman.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_organicmatter.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_orgfertilizer.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_region.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_slope.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_soil.csv create mode 100644 data/primary_database/Western Kenya - Dairy/lkp_tillageregime.csv diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index af8aed5..072d6ae 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -262,8 +262,8 @@ scenario_server <- function( if (file.exists(source_file_path)) { file.copy(source_file_path, share_file_path, overwrite = TRUE) - # Share the related database if it's not the default database - if (input$database_code != "Params DB - Default") { + # Share the related database if it's not a default (read-only) database + if (!(input$database_code %in% primary_database_names())) { # Define the source and destination paths for the database directory db_path <- file.path( session$userData$user_folder, "parameters_database", input$database_code @@ -566,9 +566,9 @@ scenario_server <- function( json_data <- fromJSON(source_file_path) db_name <- json_data$database_code - # If the database is not the default database and is available on + # If the database is not a default (read-only) database and is available on # the shared_pool folder, clone the database as well - if (db_name != "Params DB - Default" && + if (!(db_name %in% primary_database_names()) && db_name %in% list.files( file.path(Sys.getenv("DATA_DIR"), "shared_pool", "parameters_database") )) { @@ -2616,14 +2616,20 @@ scenario_server <- function( } else { - # Set the default database as the selected one - selected_database <- "Params DB - Default" + # Use first available default, or first available database + default_available <- intersect(primary_database_names(), available_databases) + selected_database <- if (length(default_available) > 0) { + sort(default_available)[1] + } else if (length(available_databases) > 0) { + sort(available_databases)[1] + } else { + character(0) + } - if (related_database != "Params DB - Default") { - # Show a warning message to the user + if (!is.null(related_database) && length(selected_database) > 0 && related_database != selected_database) { showNotification( - "The specified parameters database is not available. - 'Params DB - Default' will be used instead.", + paste0("The specified parameters database is not available. '", + selected_database, "' will be used instead."), duration = 5, type = "warning" ) diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index b660c45..0d70658 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -93,10 +93,10 @@ params_db_server <- function( # on renaming a database observeEvent(input$rename_database, { - # If the selected database is the Default database, show an error message - if (input$database_name == "Params DB - Default") { + # If the selected database is a default (read-only) database, show an error message + if (input$database_name %in% primary_database_names()) { showNotification( - "The Default database cannot be renamed.", + "Default parameters databases cannot be renamed. Clone one to create an editable copy.", duration = 3, type = "error" ) @@ -125,10 +125,10 @@ params_db_server <- function( # on deleting a database observeEvent(input$delete_database, { - # If the selected database is the Default database, show an error message - if (input$database_name == "Params DB - Default") { + # If the selected database is a default (read-only) database, show an error message + if (input$database_name %in% primary_database_names()) { showNotification( - "The Default database cannot be deleted.", + "Default parameters databases cannot be deleted. Clone one to create an editable copy.", duration = 3, type = "error" ) @@ -185,29 +185,22 @@ params_db_server <- function( # ----------- Database Management Tab ---------------------------------------- - # Create Database + # Create Database: clone Params DB - Default into user folder observeEvent(input$create_database, { cat(file = stderr(), "40 - Creating a new database...\n") - # Define source and destination paths - source_path <- file.path("data", "primary_database") + source_path <- file.path("data", "primary_database", "Params DB - Default") destination_dir <- file.path(session$userData$user_folder, "parameters_database") - - # Copy the directory with versioning clone_file_path <- versioned_copy( source_path = source_path, destination_dir = destination_dir, base_name = "Params DB - Default", versioning = TRUE ) - - # Update the session with the new list of databases session$userData$databases( list.files( file.path(session$userData$user_folder, "parameters_database"), full.names = FALSE ) ) - - # Update the selectInput with the new database shinyWidgets::updatePickerInput( session = session, inputId = "database_name", @@ -218,8 +211,6 @@ params_db_server <- function( ), selected = basename(clone_file_path) ) - - # Database creation success showNotification( ui = "The parameters database has been created successfully!", duration = 3, @@ -336,8 +327,8 @@ params_db_server <- function( observeEvent(input$share_to_pool_confirmation, { req(input$share_to_pool_confirmation) - # Share the related database if it's not the default database - if (input$database_name != "Params DB - Default") { + # Share the related database if it's not a default (read-only) database + if (!(input$database_name %in% primary_database_names())) { db_path <- file.path( session$userData$user_folder, "parameters_database", input$database_name ) @@ -519,7 +510,12 @@ params_db_server <- function( req(input$database_name) selected_db <- input$database_name - db_path <- file.path(session$userData$user_folder, "parameters_database", selected_db) + # Load from canonical primary_database for defaults, else from user's folder + db_path <- if (selected_db %in% primary_database_names()) { + file.path("data", "primary_database", selected_db) + } else { + file.path(session$userData$user_folder, "parameters_database", selected_db) + } db_files <- list.files(db_path, full.names = TRUE) lapply(seq_along(db_files), function(i) { @@ -647,8 +643,8 @@ params_db_server <- function( shinyjs::enable(id = paste0("clone_rows_", name)) } - # Check if the database is the default one - if (input$database_name == "Params DB - Default") { + # Check if the database is a default (read-only) one + if (input$database_name %in% primary_database_names()) { editablity <- FALSE # Append disabled cursor to existing column_defs @@ -813,6 +809,7 @@ params_db_server <- function( lapply(parameters_db_names, function(name) { observeEvent(input[[paste0("table_", name, "_cell_edit")]], { req(input$database_name) + req(!(input$database_name %in% primary_database_names())) # Get the info of the edited cell info <- input[[paste0("table_", name, "_cell_edit")]] new_data <- session$userData$parameters_db[[name]] @@ -840,8 +837,8 @@ params_db_server <- function( observeEvent(input$table_lkp_feeditem_cell_clicked, { info <- input$table_lkp_feeditem_cell_clicked req(length(info) > 0) - # Don't allow editing default DB - req(input$database_name != "Params DB - Default") + # Don't allow editing default (read-only) DBs + req(!(input$database_name %in% primary_database_names())) # Get data tables feeditem_data <- session$userData$parameters_db[["lkp_feeditem"]] @@ -914,6 +911,7 @@ params_db_server <- function( # ------ * Update crop_code when crop selection confirmed -------------------- observeEvent(input$ok_update_crop, { req(input$crop_selector) + req(!(input$database_name %in% primary_database_names())) clicked_row_idx <- session$userData$feeditem_clicked_row_idx if (!is.null(clicked_row_idx)) { @@ -964,6 +962,7 @@ params_db_server <- function( lapply(parameters_db_names, function(table_name) { observeEvent(input[[paste0("delete_rows_", table_name)]], { req(input$database_name) + req(!(input$database_name %in% primary_database_names())) parameter_table <- session$userData$parameters_db[[table_name]] if (nrow(parameter_table) == 0) return() @@ -1003,6 +1002,7 @@ params_db_server <- function( lapply(parameters_db_names, function(table_name) { observeEvent(input[[paste0("add_rows_", table_name)]], { req(input$database_name) + req(!(input$database_name %in% primary_database_names())) # Retrieve current table from memory parameter_table <- session$userData$parameters_db[[table_name]] @@ -1046,6 +1046,7 @@ params_db_server <- function( lapply(parameters_db_names, function(table_name) { observeEvent(input[[paste0("clone_rows_", table_name)]], { req(input$database_name) + req(!(input$database_name %in% primary_database_names())) parameter_table <- session$userData$parameters_db[[table_name]] if (nrow(parameter_table) == 0) return() diff --git a/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_climate.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_climate.csv new file mode 100644 index 0000000..f97c539 --- /dev/null +++ b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_climate.csv @@ -0,0 +1,7 @@ +climate_code,climate_desc +Warm Temperate Moist,Warm Temperate Moist +Warm Temperate Dry,Warm Temperate Dry +Tropical Montane,Tropical Montane +Tropical Moist,Tropical Moist +Tropical Dry,Tropical Dry +Tropical Wet,Tropical Wet diff --git a/data/primary_database/lkp_croplandsystem.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_croplandsystem.csv similarity index 100% rename from data/primary_database/lkp_croplandsystem.csv rename to data/default_data/parameters_database/Central Uganda - Livestock General/lkp_croplandsystem.csv diff --git a/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_crops.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_crops.csv new file mode 100644 index 0000000..802029f --- /dev/null +++ b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_crops.csv @@ -0,0 +1,18 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Amaranthus – local ,5.6,0,0.04,0.04,0.01,0.3,0.8,0.9,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Avena sativa,7.5,2.64,0,0.04,0.6,0.35,1.1,0.45,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Brachiaria hybrid,7,0,0.02,0,0.05,0.35,1.1,0.45,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Cassava ,4.27,2.89,0.03,0,0.46,0.15,1.2,0.6,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Centrosema,10,0,0.03,0,0.6,0.35,1.1,0.45,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Cocoyam,0.72,1.12,0.039,0.03,0.32,0.3,1.1,0.5,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Groundnut,0,2.79,0,0.01,0.12,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Hordeum vulgare,4.35,1.58,0.02,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Lablab,1.62,0,0.04,0,0,0.48,0.67,0.65,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Maize,1.3,3.58,0.013,0.006,0.1,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Medicago sativa,12,35.6,0.03,0.03,0.37,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Musa spp.,22.86,70,0,0.02,0.6,0.5,1.2,0.7,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,"Natural pasture - Mpigi, Mukono, and Masaka areas",13.05,5,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Natural pasture - Nakasongola area,10,7.14,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Pennisetum purpureum,15,8.39,0.02,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +16,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Sweet potato,4.11,0.97,0,0.003,0.01,0.3,0.75,0.75,tuber,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_feeditem.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_feeditem.csv new file mode 100644 index 0000000..30625ef --- /dev/null +++ b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_feeditem.csv @@ -0,0 +1,21 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,1,Amaranthus – local,13.9,5.93,24.3 +2,12,Banana leaves,16.03,10,6.84 +3,12,banana Peel – cooked,17.9,13.8,8.4 +4,8,Barley (grains) IP,87.1,12.4,11.04 +5,8,Barley (straw),90.9,6.5,3.8 +6,3,Brachiaria hybrid,90,7.254794521,13 +7,4,Cassava (Manihot esculenta) residue ,87.4,13.2,5.2 +8,5,Centrosema,90,9.3,18.9 +9,6,Cocoyam leaf,11.4,8.64,24.3 +10,16,Concentrate (commercial),90,12.1,16 +11,7,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,15.92 +12,9,Lablab (Lablab purpureus) - forage,18.3,11.43,16.69 +13,11,Lucerne (Medicago sativa) - hay,85,8.36,11.56 +14,10,Maize (Zea mays) - forage,36.9,10.22,7.02 +15,16,Maize bran,90.9,13.1,11.3 +16,14,Naturally occuring pasture - Nakasongola district,60,7.75,4.89 +17,13,"Naturally occurring pasture - green fodder- Mpigi, Mukono, and Masaka districts",29.05,6.55,7.5 +18,2,Oats (Avena sativa) - hulls,92.4,5.32,4 +19,15,Pennisetum purpureum - forage,15,9.88,7.88 +20,17,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 diff --git a/data/primary_database/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_grassinputlevel.csv similarity index 100% rename from data/primary_database/lkp_grassinputlevel.csv rename to data/default_data/parameters_database/Central Uganda - Livestock General/lkp_grassinputlevel.csv diff --git a/data/primary_database/lkp_grasslandman.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_grasslandman.csv similarity index 100% rename from data/primary_database/lkp_grasslandman.csv rename to data/default_data/parameters_database/Central Uganda - Livestock General/lkp_grasslandman.csv diff --git a/data/primary_database/lkp_landcover.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_landcover.csv similarity index 100% rename from data/primary_database/lkp_landcover.csv rename to data/default_data/parameters_database/Central Uganda - Livestock General/lkp_landcover.csv diff --git a/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_livetype.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_livetype.csv new file mode 100644 index 0000000..8e4a2b5 --- /dev/null +++ b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),413,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),513,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),250,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,110,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),125,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,85,0,0,200,7,21,60,0.15,0.01,0.23,0,0,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,75,0,0,200,0,0,0,0,0.01,0,0,0,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,36,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/lkp_manureman.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_manureman.csv similarity index 100% rename from data/primary_database/lkp_manureman.csv rename to data/default_data/parameters_database/Central Uganda - Livestock General/lkp_manureman.csv diff --git a/data/primary_database/lkp_organicmatter.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_organicmatter.csv similarity index 100% rename from data/primary_database/lkp_organicmatter.csv rename to data/default_data/parameters_database/Central Uganda - Livestock General/lkp_organicmatter.csv diff --git a/data/primary_database/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_orgfertilizer.csv similarity index 100% rename from data/primary_database/lkp_orgfertilizer.csv rename to data/default_data/parameters_database/Central Uganda - Livestock General/lkp_orgfertilizer.csv diff --git a/data/primary_database/lkp_region.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_region.csv similarity index 100% rename from data/primary_database/lkp_region.csv rename to data/default_data/parameters_database/Central Uganda - Livestock General/lkp_region.csv diff --git a/data/primary_database/lkp_slope.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_slope.csv similarity index 100% rename from data/primary_database/lkp_slope.csv rename to data/default_data/parameters_database/Central Uganda - Livestock General/lkp_slope.csv diff --git a/data/primary_database/lkp_soil.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_soil.csv similarity index 100% rename from data/primary_database/lkp_soil.csv rename to data/default_data/parameters_database/Central Uganda - Livestock General/lkp_soil.csv diff --git a/data/primary_database/lkp_tillageregime.csv b/data/default_data/parameters_database/Central Uganda - Livestock General/lkp_tillageregime.csv similarity index 100% rename from data/primary_database/lkp_tillageregime.csv rename to data/default_data/parameters_database/Central Uganda - Livestock General/lkp_tillageregime.csv diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_climate.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_climate.csv new file mode 100644 index 0000000..f97c539 --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_climate.csv @@ -0,0 +1,7 @@ +climate_code,climate_desc +Warm Temperate Moist,Warm Temperate Moist +Warm Temperate Dry,Warm Temperate Dry +Tropical Montane,Tropical Montane +Tropical Moist,Tropical Moist +Tropical Dry,Tropical Dry +Tropical Wet,Tropical Wet diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_croplandsystem.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_crops.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_crops.csv new file mode 100644 index 0000000..9471e81 --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_crops.csv @@ -0,0 +1,29 @@ +crop_code ,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Andropogon gayanus,7.8,,0.0104,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Arachis pintoi,5,,0.032,,,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Axonopus scoparius,15,,0.013,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Brachiaria brizantha ,11.7,,0.0176,,,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Brachiaria decumbens,10,,0.014,,,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Brachiaria hybrid,15,,0.0224,,,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Cenchrus clandestinus,12,,0.024,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Dactylis glomerata,6,,0.026,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Echinochloa polystachya,10,,0.0184,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Gliricidia,10,,0.0356,,,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Leucaena,14,,0.034,,,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Lolium multiflorum,11.4,,0.012,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Maize,3,4,0.017,0.007,,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Maize-silage,18,,0.007,,,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Medicago sativa,8.4,,0.032,,,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +16,Mulberry,2,,0.031,,,0.15,1.1,0.25,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Musa spp.,5,1.6,0.008,0.0152,,0.15,1.2,0.7,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +18,Natural pasture,10,,0.007,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +19,Panicum maximum,12.4,,0.0192,,,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +20,Paspalum notatum,5.2,,0.016,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +21,Pennisetum purpureum,19,,0.023,,,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +22,Pennisetum purpureum-silage,19,,0.01,,,1,1,1,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +23,Plantago spp,10,,0.032,,,1.05,1.1,1.1,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +24,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +25,Samanea saman,1,,0.027,,,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +26,Sambucus peruviana,3.5,,0.023,,,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +27,Trichantera gigantea,10,,0.028,,,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +28,Trifolium repens,3,,0.04,,,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_feeditem.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_feeditem.csv new file mode 100644 index 0000000..b2b3b44 --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_feeditem.csv @@ -0,0 +1,33 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,1,Andropogon gayanus (forage),27.8,7.1,6.25 +2,17,Banana (fruit),22,12.3,5.2 +3,17,Banana leaves,16,10,9.5 +4,4,Brachiaria brizantha (forage),26,7.25,7.25 +5,5,Brachiaria decumbens,26.8,7.7,7 +6,6,Brachiaria hybrid (forage),26,7.25,8.25 +7,7,Cenchrus clandestinus,20,9.7,15 +8,8,Cocksfoot,20.7,9.5,16.3 +9,24,Concentrates,90,12.1,16 +10,9,Echinochloa polystachya,16.7,8.8,10.6 +11,2,Forage peanut,21.4,9.3,20 +12,10,Gliricidia sepium (forage),30,11.5,22.3 +13,3,Gramalote,15.8,9.1,8 +14,12,Italian ryegrass (forage),19,8.7,7 +15,11,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +16,15,Lucerne (Medicago sativa) - forage,21,10.08,19.7 +17,13,Maize (Zea mays) - forage,82,10.22,8.9 +18,14,Maize (Zea mays) - silage,30,10.79,4.4 +19,13,Maize (Zea mays) - stover,87,9.13,5.9 +20,16,Mulberry (Morus alba),28.4,10,19.4 +21,27,Nacedero,17.5,5.3,17.9 +22,18,Naturally occuring pasture - grazing,60,5,6 +23,19,Panicum maximum (forage),26,7.54,9.88 +24,20,Paspalum notatum (forage),28,7.54,8.25 +25,21,Pennisetum purpureum - forage,15,9.88,11 +26,22,Pennisetum purpureum - silage,19.5,7.5,6.5 +27,25,Rain tree (pods),83.1,12.1,16.6 +28,23,Ribwort plantain,15.7,10.9,20 +29,25,Sambucus peruviana,20,11.34,14.2 +30,24,Sugarcane (Saccharum officinarum) - molasses,74.3,10.89,5.8 +31,24,Sugarcane (Saccharum officinarum) - molasses,74.3,10.89,5.8 +32,28,Trifolium repens,16.8,11.1,24.9 diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_grasslandman.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_landcover.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_livetype.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_livetype.csv new file mode 100644 index 0000000..09628e7 --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,4,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_manureman.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_organicmatter.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_region.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_slope.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_soil.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_tillageregime.csv b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/Ecuador-National dual-purpose cattle/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/lkp_climate.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_climate.csv similarity index 100% rename from data/primary_database/lkp_climate.csv rename to data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_climate.csv diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_croplandsystem.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_crops.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_crops.csv new file mode 100644 index 0000000..eb627fb --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_crops.csv @@ -0,0 +1,15 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Aftermath,0.5,0,0.03,0,0,0,0,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Banana,8.8,4.58,0.02,0.03,0.15,0.5,1.1,1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Barley,2.55,3.83,0.62,0,0.15,0.6,1.1,1,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Cowpea,6,6.86,0.03,0.01,0.15,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Enset,8.8,17.6,0.56,0.03,0.15,0.5,1.1,1,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,faba bean (vicia faba),2.34,1.99,1.18,1.18,0.15,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Kocho,8.8,0,0,0.03,0,0,0,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Lentils (Lens esculenta),1.5,4.51,1.12,1.12,0.15,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Natural pasture,2.5,1.67,0.01,0,0.05,0.4,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Natural pasture hay,1.98,0,0,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Oats,2.88,4.32,0.02,0.01,0.15,0.6,1.1,1,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Sorghum,4,8.79,0.02,0.01,0.05,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Wheat,3.4,7.6,0.35,0.01,0.15,0.6,1.1,1,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_feeditem.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_feeditem.csv new file mode 100644 index 0000000..22d50c6 --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_feeditem.csv @@ -0,0 +1,16 @@ +feed_item_code,crop_code ,feed_item_name,dm_content,me_content,cp_content +1,1,Aftermath grazing,90,7.38,5 +2,2,Banana waste,22,8.66,9.5 +3,3,Barley (Hordeum vulgare) straw,88,7.2,4.1 +4,12,Concentrate (commercial),90,12.1,16 +5,4,Cowpea (Vigna unguiculata) - crop residue,90,9.88,18.4 +6,6,faba bean (vicia faba),92.2,8.3,6.8 +7,5,False banana waste,22,8.66,9.5 +8,5,False banana waste (Ensete ventricosum) - leave & stem,91,10.8,3.5 +9,8,Lentils (Lens esculenta),90,7.9,6.9 +10,10,Natural occuring pasture hay,89,10,5 +11,9,Natural pasture (grazing) -bonga,30,5,4.5 +12,9,Naturally occuring pasture - grazing,53,5,6 +13,11,Oats (Avena sativa) - straw,90,6.7,4.4 +14,13,Sorghum (Sorghum bicolor) - crop residue,85,7.03,4.9 +15,14,wheat straw,89,6.8,4.2 diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_grasslandman.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_landcover.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_livetype.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_livetype.csv new file mode 100644 index 0000000..440f9a2 --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),0,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),0,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),0,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,0,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,0,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),0,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,0,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),0,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,0,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,0,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,0,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,27,10,30,53,0,140,0,0,0.05,4.25,0.09,0.4,0.62,3.2,5.8,970,2200,25,0.58,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,28,10,30,53,0,0,0,0,0.06,0,0.09,0.45,0,3.7,4.3,970,2200,25,0.58,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,29,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,2200,25,0.58,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,13,10,30,53,0,0,0,0,0.03,0,0,0.45,0,0,0,0,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,25,10,30,53,0,60,0,0,0.05,3.95,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,11,10,30,53,0,0,0,0,0.02,0,0,0.45,0,0,0,0,0,0,0.58,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,13,10,30,53,0,0,0,0,0.03,0,0,0.45,0,0,0,0,0,0,0.58,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,12,10,30,53,0,0,0,0,0.02,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,0,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,0,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,0,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_manureman.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_organicmatter.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_region.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_slope.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_soil.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_soil.csv new file mode 100644 index 0000000..dca2334 --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_soil.csv @@ -0,0 +1,13 @@ +soil_code,soil_desc,k_value +andosol,Andosol,0.15 +cambisol,Cambisol,0.2 +lixisol,Lixisol,0.25 +fluvisol,Fluvisol,0.3 +vertisol,Vertisol,0.15 +phaeozem,Phaeozem,0.2 +nitosol,Nitosol,0.25 +xerosol,Xerosol,0.3 +rendzic Leptosols,Rendzic Leptosols ,0.2 +aluandic Andosols,Aluandic Andosols,0.21 +haplic Vertisols- Abergele,Haplic Vertisols- Abergele,0.19 +haplic Vertisols - Menz,Haplic Vertisols - Menz ,0.22 diff --git a/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_tillageregime.csv b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/Ethiopia - Small Ruminants/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_climate.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_croplandsystem.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_crops.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_crops.csv new file mode 100644 index 0000000..878c56d --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_crops.csv @@ -0,0 +1,10 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Cowpea,0.85,2.97,0.04,0.02,0.12,0.15,1.05,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Gliricidia,5,0,0.04,0,0,1.05,1.1,1.1,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Leucaena,14,0,0.03,0.03,0,1.05,1.1,1.1,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Maize,8.6,3,0.02,0.01,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Moringa oleifera,20,0,0.04,0.04,0,1.05,1.1,1.1,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Natural pasture,10,0,0.01,0.01,0.03,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Phaseolus vulgaris,0.5,1,0.04,0.01,0,0.15,1.05,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Sugarcane,11,1.38,0,0,0.17,0.15,1.2,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Sweet potato,1.93,1.58,0.01,0,0.05,0.15,1.1,0.55,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_feeditem.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_feeditem.csv new file mode 100644 index 0000000..4aa0607 --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_feeditem.csv @@ -0,0 +1,11 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,7,Bean (crop residue),88,7.4,7.1 +2,1,Cowpea (Vigna unguiculata) - crop residue,90,9.88,18.4 +3,2,Gliricidia sepium (forage),30,11.5,22.3 +4,3,Lucerne (Medicago sativa) - forage,21,10.08,19.7 +5,4,Maize (Zea mays) - stover,87,9.13,5.9 +6,5,Moringa oleifera (forage),26.2,10.6,24.3 +7,6,Naturally occuring pasture - grazing,60,5,6 +8,6,Naturally occuring pasture - grazing OFR,60,5,6 +9,8,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 +10,9,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_grasslandman.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_landcover.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_livetype.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_livetype.csv new file mode 100644 index 0000000..634c07f --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,300,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,190,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,12,10,30,53,0,0,0,0,0.024,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,30,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,35,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,12,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_manureman.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_organicmatter.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_region.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_slope.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_soil.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_tillageregime.csv b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/Haiti - Mixed Livestock/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_climate.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_croplandsystem.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_crops.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_crops.csv new file mode 100644 index 0000000..bdb7414 --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_crops.csv @@ -0,0 +1,24 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Andropogon gayanus,7.8,,0.0104,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Brachiaria brizantha ,11.4,,0.032,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Brachiaria decumbens,10,,0.013,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Brachiaria decumbens (hay),10,,0.0176,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Brachiaria hybrid,15,,0.014,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Canavalia brasiliensis,5,,0.0224,,0.15,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Cratylia,12,,0.024,,0.15,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Cynodon nlemfuensis,10,,0.026,,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Dichanthium aristatum,6.5,,0.0184,,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Gliricidia,10,,0.0356,,0.15,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Guazuma ulmifolia,17,,0.034,,0.15,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Hyparrhenia rufa,5.9,,0.012,,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Leucaena,14,,0.017,0.007,0.15,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Maize,3,3,0.007,,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Maize-silage,9.5,,0.032,,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +16,Mulberry,2,,0.031,,0.05,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Natural pasture,6.5,,0.008,0.0152,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +18,Panicum maximum,12.4,,0.007,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +19,Paspalum notatum,6.5,,0.0192,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +20,Pennisetum purpureum,10,,0.023,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +21,Pennisetum purpureum-silage,19,,0.027,,0.01,1,1,1,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +22,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +23,Tithonia diversifolia,10,,0.04,,0.05,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_feeditem.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_feeditem.csv new file mode 100644 index 0000000..58b9c05 --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_feeditem.csv @@ -0,0 +1,26 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521 +2,2,Brachiaria brizantha (forage),26,7.254794521,10.4 +3,3,Brachiaria decumbens,26.8,7.7,8.9 +4,4,Brachiaria decumbens,83.8,6.6,5.2 +5,5,Brachiaria hybrid (forage),26,7.254794521,13 +6,6,Canavalia brasiliensis (forage),30,12.1,22 +7,7,Cratylia argentea (forage),30,9.4,24 +8,8,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 +9,9,Dichanthium aristatum (forage),33,7.25,8 +10,10,Gliricidia sepium (forage),30,11.5,22.3 +11,11,Guazuma ulmifolia (forage),30,11,15 +12,12,Hyparrhenia rufa (forage),26,6.129315068,6 +13,13,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +14,14,Maize (Zea mays) - stover,87,9.127224,5.9 +15,15,Maize (Zea mays) - silage,30,10.79,4.4 +16,16,Mulberry (Morus alba),28.4,10,19.4 +17,17,Naturally occuring pasture - grazing,25,5,6 +18,17,Naturally occuring pasture - grazing OFR,25,5,6 +19,18,Panicum maximum (forage),26,7.543013699,9.882191781 +20,19,Paspalum notatum (forage),28,7.543013699,8.254794521 +21,20,Pennisetum purpureum - forage,15,9.880848,11 +24,21,Pennisetum purpureum - silage,19.5,7.5,6.5 +25,22,Concentrate (commercial),90,12.1,16 +26,22,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 +27,23,Tithonia diversifolia (forage),19.8,9.9,21.2 diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_grasslandman.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_landcover.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_livetype.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_livetype.csv new file mode 100644 index 0000000..03ce101 --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,600,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_manureman.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_organicmatter.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_region.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_slope.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_soil.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_tillageregime.csv b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/Honduras-Olancho dual-purpose cattle/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_climate.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_croplandsystem.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_crops.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_crops.csv new file mode 100644 index 0000000..b016e87 --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_crops.csv @@ -0,0 +1,9 @@ +crop_code ,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Avena sativa-forage,9.1,0,0.02,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Hordeum vulgare (forage),6.8,0,0.01,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Lolium multiflorum,11.4,0,0.01,0,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Natural pasture - Desert & Desert Steppe,0.34,0,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Natural pasture - Forest & Forest Steppe,0.87,0,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Natural pasture - High Mountain,0.56,0,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Red clover,17,0,0.01,0,0.15,0.1,1.1,0.55,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Triticum OF,0.71,0.85,0.02,0.03,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_feeditem.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_feeditem.csv new file mode 100644 index 0000000..6088419 --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_feeditem.csv @@ -0,0 +1,10 @@ +feed_item_code,crop_code ,feed_item_name,dm_content,me_content,cp_content +1,2,Barley (forage),25,9.2,11 +2,3,Italian ryegrass - hay,85,8.36,6.01 +3,4,Naturally occuring pasture hay - Desert & Desert Steppe,83,5,3.6 +4,5,Naturally occuring pasture hay - Forest & Forest Steppe,83,5,3.6 +5,6,Naturally occuring pasture hay - High Mountain,83,5,3.6 +6,1,Oats (Avena sativa) - green fodder,31,8.36,4 +7,1,Oats (Avena sativa) - silage,36.4,8.92,12.7 +8,7,Red clover (Trifolium pratense) - green fodder,19.6,10.43,20.8 +9,8,Wheat (bran) OFC,87,11,17.9 diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_grasslandman.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_landcover.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_livetype.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_livetype.csv new file mode 100644 index 0000000..d5186d2 --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),180,0,0,350,0,0,0,0,0.24,9.64,0.09,0,1.15,4.3,4.2,764,2700,17,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),320,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,350,0,0,580,0,0,0,0,0.25,0,0,0,0,0,0,0,2700,17,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,163,0,0,350,0,0,0,0,0.16,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),194,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,33,0,0,350,0,0,0,0,0.03,0,0,0.4,0,0,0,0,2700,17,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),55,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,36,10,30,53,0,60,0,0,0.07,5.85,0.09,0,0.4,3.87,3.4,970,1783,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,48,10,30,53,0,60,0,0,0.1,0,0,0.45,0,0,0,0,0,0,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,45,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,19,10,30,53,0,60,0,0,0.05,0,0,0.45,0,3.87,3.4,970,1783,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_manureman.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_organicmatter.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_region.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_slope.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_soil.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/default_data/parameters_database/Mongolia- Livestock General/lkp_tillageregime.csv b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/Mongolia- Livestock General/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_climate.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_croplandsystem.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_crops.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_crops.csv new file mode 100644 index 0000000..73028b4 --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_crops.csv @@ -0,0 +1,20 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Amaranthus caudatus,6.44,0,0.02,0,0.15,0.15,0.95,0.85,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Avena sativa,16,0,0.02,0,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Bauhinia purpurea,1.98,0,0.03,0,0.15,0.575,1.125,0.475,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Brassica spp,1.22,0,0.03,0,0.05,0.2625,1.1375,0.95,oilseed crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Cicer arietinum,1.13,0,0.04,0,0.15,0.575,1.125,0.475,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Eleusine coracana,1.22,0,0.01,0,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Fagopyrum esculentum,3.09,1.79,0.02,0.01,0.05,0.1,1.1,0.55,pseudocereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Ficus semicordata,2.3,0,0.02,0,0.05,0.2625,1.1375,0.95,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Garuga pinnata,2,0,0.03,0,0.05,0.2625,1.1375,0.95,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Lens culinaris,1.23,0,0.04,0,0.15,0.575,1.125,0.475,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Leucena leucocephala,15,0,0.04,0,0.15,1.05,1.1,1.1,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Melia azedarach,2.5,0,0.03,0,0.05,0.2625,1.1375,0.95,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Morus alba,1.35,0,0.02,0,0.05,0.2625,1.1375,0.95,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Natural pasture,27,0,0.01,0,0.05,0.3,0.7,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Oryza sativa,3.8,2.44,0.01,0.01,0.05,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +16,Pennisetum purpureum,20,0,0.02,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +18,Vigna mungo,0.89,0,0.02,0,0.15,0.575,1.125,0.475,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +19,Zea mays,4.02,2.33,0.02,0.01,0.1,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_feeditem.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_feeditem.csv new file mode 100644 index 0000000..e398af7 --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_feeditem.csv @@ -0,0 +1,25 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content,,,,,,,, +1,1,Amaranth (Amaranthus caudatus) - forage,89.1,13.3,15.4,,,,,,,, +2,12,Bakaino (Melia azedarach) - green forage,34.8,8.1,17.1,,,,,,,, +3,18,Black gram (Vigna mungo) - straw ,85,8.3,13,,,,,,,, +4,17,Brewery grains - dehydrated,91,9.9,25.8,,,,,,,, +5,7,Buckwheat (Fagopyrum esculentum) - grain ,84.9,9.6,13.2,,,,,,,, +6,7,Buckwheat (Fagopyrum esculentum) - hulls,88,6.7,7,,,,,,,, +7,5,Chickpea (Cicer arietinum) - grain,89,14.1,22.1,,,,,,,, +8,17,concentrates,90,12.1,16,,,,,,,, +9,9,Dabdabe (Garuga pinnata) - green forage,36.93,7.95,16,,,,,,,, +10,11,Epil-pil (Leucena leucocephala) - green forage,29.9,11,23.3,,,,,,,, +11,6,Finger millet (Eleusine coracana) - grain,89,11.8,8.9,,,,,,,, +12,2,Jai (Avena sativa) - green forage,20.6,11.1,14.8,,,,,,,, +13,8,khanayo (Ficus semicordata) - green forage,32.59,8.2,13.38,,,,,,,, +14,13,Kimbu (Morus alba) - green forage,26.3,11,15.3,,,,,,,, +15,10,Lentil (Lens culinaris) - grain,88.3,13.5,26.9,,,,,,,, +16,19,Maize (Zea mays) - stover ,92.8,6.9,3.9,,,,,,,, +17,19,Maize (Zea mays) - grain ,87.2,13.5,9.7,,,,,,,, +18,16,Napier (Pennisetum purpureum) - green forage,17.9,8.2,9.7,,,,,,,, +19,14,Naturally occurring pasture - gathered forage,60,6.55,7.5,,,,,,,, +20,14,Naturally occurring pasture - grazing,60,5,6,,,,,,,, +21,4,Rapeseed (Brassica spp.) - hulls,87.5,10.2,16.1,,,,,,,, +22,15,Rice (Oryza sativa) - grain,88,10.1,8.3,,,,,,,, +23,15,Rice (Oryza sativa) - straw,92.8,5.8,4.2,,,,,,,, +24,3,Tanki (Bauhinia purpurea) - green forage,34.88,8,15.68,,,,,,,, diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_grasslandman.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_landcover.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_livetype.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_livetype.csv new file mode 100644 index 0000000..f0f8285 --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),0,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),0,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),0,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,0,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,0,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),0,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,0,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),0,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,0,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,0,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,0,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,0,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,0,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,0,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,0,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,25,10,30,53,0,60,0,0,0.05,3.95,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,40,10,30,53,0,60,0,0,0.06,0,0,0.45,0,0,0,0,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,35,10,30,53,0,60,0,0,0.07,0,0,0.45,0,0,0,0,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,13,10,30,53,0,60,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,0,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,0,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,0,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_manureman.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_organicmatter.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_region.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_slope.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_soil.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_tillageregime.csv b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/Nepal - Goat Fattening/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_climate.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_croplandsystem.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_crops.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_crops.csv new file mode 100644 index 0000000..7a2b25b --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_crops.csv @@ -0,0 +1,17 @@ +crop_code ,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Andropogon gayanus,7.8,,0.0104,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Brachiaria brizantha ,11.4,,0.032,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Brachiaria hybrid,15,,0.014,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Canavalia brasiliensis,5,,0.0224,,0.15,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Dichanthium aristatum,6.5,,0.0184,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Gliricidia,10,,0.0356,,0.15,1.05,1.1,1.1,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Hyparrhenia rufa,5.9,,0.012,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Ischaemum ciliare,5.5,,0.013,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Maize,3,3,0.017,0.007,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Natural pasture,6.5,,0.008,,0.15,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Panicum maximum,12.4,,0.007,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Paspalum notatum,6.5,,0.0192,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Pennisetum purpureum,10,,0.023,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Pennisetum purpureum-silage,19,,0.027,,0.01,1,1,1,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +16,Tithonia diversifolia,10,0,0.03,0,0.05,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_feeditem.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_feeditem.csv new file mode 100644 index 0000000..ccae867 --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_feeditem.csv @@ -0,0 +1,20 @@ +feed_item_code,crop_code ,feed_item_name,dm_content,me_content,cp_content +1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521 +2,2,Brachiaria brizantha (forage),26,7.254794521,7.254794521 +3,3,Brachiaria hybrid (forage),26,7.254794521,8.254794521 +4,4,Caña (Saccharum officinarum) - melaza,74.3,10.88568,5.8 +5,4,Canavalia brasiliensis (forage),30,12.1,22 +6,15,Concentrate (commercial),90,12.1,16 +7,5,Dichanthium aristatum (forage),33,7.25,8 +8,6,Gliricidia sepium (forage),30,11.5,22.3 +9,7,Hyparrhenia rufa (forage),26,6.129315068,6 +10,8,Ischaemum ciliare (forage),24,6.003835616,6 +11,9,Maíz (Zea mays) - rastrojo,87,9.127224,5.9 +12,11,Panicum maximum (forage),26,7.543013699,9.882191781 +13,12,Paspalum notatum (forage),28,7.543013699,8.254794521 +14,10,Pastos naturalizados- pastoreo,60,5,6 +15,13,Pennisetum purpureum - forage,15,9.880848,11 +16,14,Pennisetum purpureum - silage,19.5,7.5,6.5 +17,15,Sorgo (Sorghum bicolor) - rastrojo,85,7.033824,4.9 +18,15,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 +19,16,Tithonia diversifolia (forage),19.8,9.9,21.2 diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_grasslandman.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_landcover.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_livetype.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_livetype.csv new file mode 100644 index 0000000..ca6d102 --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.4,3.2,5,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,105,0,0,350,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.5,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_manureman.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_organicmatter.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_region.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_slope.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_soil.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_tillageregime.csv b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/Nicaragua-National dual-purpose cattle/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_climate.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_croplandsystem.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_crops.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_crops.csv new file mode 100644 index 0000000..24701f5 --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_crops.csv @@ -0,0 +1,9 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Banana,4.71,21.49,0.01,0.01,0.6,0.6,1.1,1.05,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,cassava,11.27,5.04,0.004,0,0.05,0,0,0,tuber,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Elephant grass,59.5,6.24,0.02,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Maize,4.15,3.95,0.02,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Natural pasture,13.1,2.43,0.01,0,0.05,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Rice,2,2.42,0.01,0.01,0.15,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Sugarcane,7.72,3.92,0.01,0,0.6,0.15,1.2,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Taro,7.5,18.35,0.03,0.03,0.6,0.72,0.91,1.19,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_feeditem.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_feeditem.csv new file mode 100644 index 0000000..a79ea78 --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_feeditem.csv @@ -0,0 +1,11 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,2,Cassava (Manihot esculenta) - crop residue,16.1,10,19.94 +2,4,Maize (Zea mays) - cracked grains,87.2,13.5,9.7 +3,4,Maize (Zea mays) -stover residue,87,9.13,5.9 +4,5,Naturally occuring pasture - grazing,60,5,6 +5,5,Naturally occuring pasture - green fodder,60,5,6 +6,6,Rice (Oryza sativa) - straw,92.8,5.8,4.2 +7,7,Sugarcane (Saccharum officinarum) - crop residue,26.8,8,4.9 +8,1,Banana trunk,6.9,9.9,3.5 +9,3,Elephant grass,17.9,8.2,9.7 +10,8,Taro leaves,8.05,14.5,16.5 diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_grassinputlevel.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_grasslandman.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_landcover.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_livetype.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_livetype.csv new file mode 100644 index 0000000..715a560 --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),300,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,225,0,0,580,0,0,0,0,0.23,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,190,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,20,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,70,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,70,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,20,0,0,200,0,0,0,0,0,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_manureman.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_organicmatter.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_orgfertilizer.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_region.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_slope.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_soil.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_tillageregime.csv b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/North-west-highlands Vietnam - Multispecies/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_climate.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_climate.csv new file mode 100644 index 0000000..f97c539 --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_climate.csv @@ -0,0 +1,7 @@ +climate_code,climate_desc +Warm Temperate Moist,Warm Temperate Moist +Warm Temperate Dry,Warm Temperate Dry +Tropical Montane,Tropical Montane +Tropical Moist,Tropical Moist +Tropical Dry,Tropical Dry +Tropical Wet,Tropical Wet diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_croplandsystem.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_croplandsystem.csv new file mode 100644 index 0000000..0c2a44e --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +sys_code,sys_desc,change_factor +1,"Long term cultivated, temperate/boreal, dry",0.8 +2,"Long term cultivated, temperate/boreal, moist",0.69 +3,"Long term cultivated, tropical, dry",0.58 +4,"Long term cultivated, tropical, moist/wet",0.48 +5,"Long term cultivated, tropical montane, all",0.64 +6,Paddy rice,1.1 +7,Perennial/tree crop,1 +8,"Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +9,"Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +10,"Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_crops.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_crops.csv new file mode 100644 index 0000000..6bf8c58 --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_crops.csv @@ -0,0 +1,13 @@ +crop_code ,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Banana,0.57,3.45,0.02,0.01,0.05,0.15,1.2,0.7,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Guatemala,19.8,0,0.014,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Leucaena,2.08,0,0.04,0.04,0.05,1.05,1.2,0.75,grass,400,18,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Local mixed grasses,13,0.25,0.014,0.082,0.1,0.6,1,1.04,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Fodder maize,1.06,0,0.017,0,0.05,0.052,0.082,0.112,grass,,,,,,,,,,,,,,, +6,Improved pasture,15,0,0.016,0,0.05,0.6,1,1.04,grass,,,,,,,,,,,,,,, +7,Maize,1.3,3.58,0.013,0.006,0.1,0.15,1.2,0.6,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Natural occurring pasture - Kilimanjaro region,13.05,0,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Natural pasture - Tanga region,12.8,0,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Pennisetum purpureum,30,0,0.013,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Rice,1.4,2.22,0.04,0.01,0.15,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_feeditem.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_feeditem.csv new file mode 100644 index 0000000..b5b8e4a --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_feeditem.csv @@ -0,0 +1,11 @@ +feed_item_code,crop_code ,feed_item_name,dm_content,me_content,cp_content +1,11,Concentrate (commercial),90,12.1,16 +2,2,Guatemala grass (Tripsacum andersonii) - forage,22,8.2,5.5 +3,3,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +4,4,Local mixed grasses (couch/star grass) - green fodder,30.2,10,3.02 +5,7,Maize (Zea mays) - stover,87,6.9,3.9 +6,1,Musa spp.,5.7,8.54,10.5 +7,8,Naturally occurring pasture – Kilimanjaro region,31.9,6.97,4.83 +8,9,Naturally occurring pasture – Tanga highland and lowland,29.05,6.55,7.5 +9,10,Pennisetum purpureum - forage,15,9.88,11 +10,12,Rice (Oryza sativa) - straw,92.8,5.8,3.85 diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_grassinputlevel.csv new file mode 100644 index 0000000..60fb371 --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +grassinputlevel_code,grassinputlevel_desc,change_factor +1,Medium,1 +2,High,1.11 +3,None,1 diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_grasslandman.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_landcover.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_landcover.csv new file mode 100644 index 0000000..fd7bb04 --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_landcover.csv @@ -0,0 +1,15 @@ +landcover_code,landcover_desc,c_factor +1,Dense forest,0.001 +2,Other forest,0.05 +3,Badlands hard,0.05 +4,Badlands soft,0.4 +5,Sorghum,0.1 +6,Maize,0.1 +7,Cereals,0.15 +8,Pulses,0.15 +9,Dense grass,0.01 +10,Degraded grass,0.05 +11,Fallow hard,0.05 +12,Fallow plouged,0.6 +13,Ethiopian teff,0.25 +14,Continuous fallow,1 diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_livetype.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_livetype.csv new file mode 100644 index 0000000..0f0f56b --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),400,0,0,600,0,0,0,0,0.38,12.21,0.09,0,1.2,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),260,0,0,600,0,0,0,0,0.29,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,100,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),110,0,0,600,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_manureman.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_manureman.csv new file mode 100644 index 0000000..032f94c --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_manureman.csv @@ -0,0 +1,36 @@ +manureman_code,manureman_desc +pasture,Pasture / range / paddock +storage,Solid storage +drylot,Dry lot +"Uncovered anaerobic lagoon +",Uncovered anaerobic lagoon +"Liquid/Slurry Pit below animals 1 Month +",Liquid/Slurry Pit below animals 1 Month +Liquid/Slurry Pit below animals 3 Month,Liquid/Slurry Pit below animals 3 Month +Liquid/Slurry Pit below animals 4 Month,Liquid/Slurry Pit below animals 4 Month +"Liquid/Slurry Pit below animals 6 Month +",Liquid/Slurry Pit below animals 6 Month +Liquid/Slurry Pit below animals 12 Month,Liquid/Slurry Pit below animals 12 Month +Cattle and swine deep bedding < 1 month,Cattle and swine deep bedding < 1 month +"Cattle and swine deep bedding > 1 month +",Cattle and swine deep bedding > 1 month +Solid storage,Solid storage +"Solid storage - Covered/compacted +",Solid storage - Covered/compacted +Solid storage - Bulking agent addition,Solid storage - Bulking agent addition +Solid storage - Additives,Solid storage - Additives +Daily spread,Daily spread +Composting - In-vessel,Composting - In-vessel +Composting - Static pile (forced aeration),Composting - Static pile (forced aeration) +Composting - Intensive windrow,Composting - Intensive windrow +Composting - Unfrequent turning,Composting - Unfrequent turning +Pasture/Range/Paddock,Pasture/Range/Paddock +Poultry manure with and without litter,Poultry manure with and without litter +Aerobic treatment,Aerobic treatment +Burned for fuel,Burned for fuel +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_organicmatter.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_organicmatter.csv new file mode 100644 index 0000000..c713cba --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +orgmatter_code,orgmatter_desc,change_factor +1,"Low, temperate/boreal, dry",0.95 +2,"Low, temperate/boreal, moist",0.92 +3,"Low, tropical, dry",0.95 +4,"Low, tropical, moist",0.92 +5,"Low, tropical montane, all",0.94 +6,"Medium, all",1 +7,"High w/OUT manure, temperate/boral and tropical, dry",1.04 +8,"High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +9,"High w/OUT manure, tropical montane",1.08 +10,"High with manure, temperate/boral and tropical, dry",1.37 +11,"High with manure, temperate/boral and tropical, moist/wet",1.44 +12,"High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_region.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_region.csv new file mode 100644 index 0000000..bfa8633 --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_region.csv @@ -0,0 +1,4 @@ +region_code,region_desc +AFRICA,AFRICA +LATIN,LATIN AMERICA +ASIA,ASIA diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_slope.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_soil.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_soil.csv new file mode 100644 index 0000000..04fb0ea --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_soil.csv @@ -0,0 +1,10 @@ +soil_code,soil_desc,k_value +andosol,Andosol,0.15 +cambisol,Cambisol,0.2 +lixisol,Lixisol,0.25 +fluvisol,Fluvisol,0.3 +vertisol,Vertisol,0.15 +phaeozem,Phaeozem,0.2 +nitosol,Nitosol,0.25 +xerosol,Xerosol,0.3 +haplic Ferralsols,Haplic Ferralsols,0.16 diff --git a/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_tillageregime.csv b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/Northern Tanzania - Dairy/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_climate.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_croplandsystem.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_crops.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_crops.csv new file mode 100644 index 0000000..cffa162 --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_crops.csv @@ -0,0 +1,12 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Banana,16.07,23.33,0.015,0.014,0.6,0.5,1.1,1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Brachiaria hybrid,14.38,10.21,0.022,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Desmodium,12.24,5.67,0.025,0,0.15,0.4,1.15,0.55,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Groundnut,0.56,2.65,0.01,0.013,0.15,0,1.05,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Guatemala,3.43,0,0.01408,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Lablab,12,0.89,0.037,0,0.15,0.4,1.15,0.55,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Maize,1.3,3.58,0.013,0.006,0.1,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Natural pasture,12.75,2.39,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Pennisetum purpureum,11.26,7.07,0.014,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Rhodes,14.07,14.22,0.0142,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_feeditem.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_feeditem.csv new file mode 100644 index 0000000..1718cc5 --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_feeditem.csv @@ -0,0 +1,12 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,1,Banana (Musa acuminata)-crop residue,9,8.66,9.5 +2,2,Brachiaria hybrid (forage),94.08,7.24,9.44 +3,10,Concentrate (commercial),90,12.1,16 +4,3,Greenleaf desmodium (Desmodium intortum) - forage,93.45,6.83,12.5 +5,4,Groundnut (Arachis hypogaea) - crop residue,89.83,8.4,14.5 +6,5,Guatemala (Tripsacum andersonii) - forage,94.05,7.1,11.32 +7,6,Lablab (Lablab purpureus) - forage,93.35,7.28,13.24 +8,7,Maize (Zea mays) - stover,87,6.9,3.9 +9,8,Naturally occuring pasture - green fodder,29.65,6.17,6.1 +10,9,Pennisetum purpureum - forage,94.13,6.63,7.78 +11,11,Rhodes grass (Chloris gayana) - forage,93.97,6.65,8.01 diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_grasslandman.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_landcover.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_livetype.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_livetype.csv new file mode 100644 index 0000000..ebe61e8 --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),381,0,0,600,0,0,0,0,0.38,12.21,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),290,0,0,600,0,0,0,0,0.29,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_manureman.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_organicmatter.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_region.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_slope.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_soil.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_soil.csv new file mode 100644 index 0000000..83b0431 --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_soil.csv @@ -0,0 +1,10 @@ +soil_code,soil_desc,k_value +andosol,Andosol,0.15 +cambisol,Cambisol,0.2 +lixisol,Lixisol,0.25 +fluvisol,Fluvisol,0.3 +vertisol,Vertisol,0.15 +phaeozem,Phaeozem,0.2 +nitosol,Nitosol,0.25 +xerosol,Xerosol,0.3 +acrisol,Acrisol,0.25 diff --git a/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_tillageregime.csv b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/Southern Highland Tanzania Dairy/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_climate.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_croplandsystem.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_crops.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_crops.csv new file mode 100644 index 0000000..b852b1b --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_crops.csv @@ -0,0 +1,37 @@ +crop_code ,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Avena sativa,0.352,2.64,0.0176,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Avena sativa-fourrage,4,0,0.016,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Beta vulgaris,10.45,2.75,0.0125,0.0125,0.15,0.72,1.04,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Brachiaria hybrid,13.76438356,0,0.0224,0.02,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Cactus,10,1.5,0.02,0.01,0.15,0.15,1.15,0.5,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Colza,3.1045,2.4836,0.064,0,0.15,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Feed carrot,9,7,0.01,0.01,0.15,0.72,1.04,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Fustuca arundinacea,12.6,0,0.014,0.01,0.15,0.3,0.75,0.75,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Glycine max IP,3.1045,2.4836,0.064,0,0.15,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Hedysarum coronarium,5,0,0.032,0,0.15,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Hordeum vulgare-forage,6.8,0,0.0072,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Hordeum vulgare-grain IP,4.35,1.584,0.01888,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Hordeum vulgare-grain OFC,1.7,1.584,0.01888,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Lolium multiflorum,10,0,0.012,0,0.15,0.3,0.75,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Medicago sativa,10,0,0.032,0,0.15,0.15,1.1,0,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +16,Olive,0,0,0.005,0.01,0.05,0.3,0.75,0.75,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Panicum maximum,17.01917808,0,0.0192,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +18,Pâturage naturel,10,0,0.01,0,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +19,Pâturage naturel OF,10,0,0.01,0,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +20,Pennisetum purpureum,6,0,0.023,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +21,Pennisetum purpureum-silage,6,0,0.01,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +22,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +23,Sorghum bicolor-forage/silage,13.5,0,0.006,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +24,Sorghum bicolor-grain,3.999,8.7892,0.02,0.01,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +25,Stipa tenacissima,1.74,0,0.01,0,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +26,Tomato,23,2.75,0.0125,0.0125,0.15,0.72,1.04,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +27,Trifolium alexandrinum,4.95,0,0.0416,0,0.15,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +28,Triticum,1.566,2.002,0.0202,0.01,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +29,Triticum IP,2,0.4,0.0202,0.03,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +30,Triticum OF,2,0.4,0.0202,0.03,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +31,Vicia faba-grain,1.74,1.8,0.046,0.01,0.15,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +32,Vigna unguiculata,0.85405,2.967413131,0.038,0.02,0.15,0.15,1.05,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +33,Zea mays,8.6,3,0.017,0.01,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +34,Zea mays IP,8.6,3,0.017,0.01,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +35,Zea mays-forage,1.064,1.344259298,0.017,0,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +36,Zea mays-silage,18,0,0.007,0,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_feeditem.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_feeditem.csv new file mode 100644 index 0000000..50eb0ff --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_feeditem.csv @@ -0,0 +1,61 @@ +feed_item_code,crop_code ,feed_item_name,dm_content,me_content,cp_content +1,11,Barley (forage),34,8.2,8.71 +2,12,Barley (grains) IP,87.1,10.5,11.7 +3,13,Barley (grains) OFC,87.1,10.5,11.7 +4,13,Barley (straw),87,5.88,0.3 +5,27,Berseem clover,11,12.39,26 +6,4,Brachiaria hybrid (forage),26,7.254794521,8.254794521 +7,13,Brewer's grain,20,11,20 +8,13,Brewer's waste,20,11,20 +9,5,Cactus,15,9,7 +10,22,Concentrate (commercial),90,12.1,16 +11,32,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 +12,32,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 +13,32,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 +14,32,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 +15,31,Fava bean (grain),86.6,13.3,29 +16,31,Fava bean (straw),89.7,6.4,7.4 +17,7,Feed carrot,15,13,8 +18,14,Italian ryegrass (forage),19,8.7,7 +19,14,Italian ryegrass (hay),85,8.36,6.01 +20,14,Italian ryegrass (silage),33.5,9.07,5.3 +21,15,Lucerne (Medicago sativa) - forage,21,8.7,17.16 +22,15,Lucerne (Medicago sativa) - hay,85,8.36,12.5 +23,15,Lucerne (Medicago sativa) - pellets IP,90,8.6,14 +24,15,Lucerne (Medicago sativa) - pellets OFC,90,8.6,14 +25,15,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 +26,34,Maize (Zea mays) - cracked grains IP,89,10.5,9.1 +27,35,Maize (Zea mays) - forage,82,10.215792,8.9 +28,36,Maize (Zea mays) - silage,30,10.79,4.4 +29,33,Maize (Zea mays) - stover,87,9.127224,5.9 +30,33,Maize (Zea mays) - whole grain,90,15,9 +31,18,Naturally occuring pasture - grazing,60,5,6 +32,19,Naturally occuring pasture - grazing OF,60,5,6 +33,1,Oats (Avena sativa) - grain IP,89,12.267324,13.6 +34,2,Oats (Avena sativa) - green fodder,31,7.4,5.85 +35,2,Oats (Avena sativa) - green fodder,44,7.4,5.85 +36,2,Oats (Avena sativa) - hay,85,6.9,3.51 +37,2,Oats (Avena sativa) - hay OF,85,6.9,3.51 +38,1,Oats (Avena sativa) - straw,88,6.47,0 +39,16,Olive pomace,89,8,7 +40,16,Olive twigs,40,5,7 +41,17,Panicum maximum (forage),26,7.543013699,9.882191781 +42,17,Panicum maximum (green fodder),26,7.58,10 +43,20,Pennisetum purpureum - forage,15,9.880848,11 +44,21,Pennisetum purpureum - silage,19.5,7.5,6.5 +45,6,Rapeseed meal,87,10,30 +46,24,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 +47,23,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 +48,24,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 +49,23,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 +50,9,Soybean (Glycine max) - meal,89,10.5,59.54 +51,9,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 +52,25,Stipa (grazing) OF,72,5.6,5 +53,3,Sugar beet (pulp) OF,89,11.4,8.9 +54,10,Sulla,12.3,9.7,20.2 +55,8,Tall fescue,21,9.11,8.9 +56,26,Tomato pulp,20,11,20 +57,29,Wheat (bran) IP,87,10,15.47 +58,30,Wheat (bran) OF,87,10,15.47 +59,28,Wheat (straw),88,5.63,4.2 +60,28,Wheat (straw),88,5.63,4.2 diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_grasslandman.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_landcover.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_livetype.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_livetype.csv new file mode 100644 index 0000000..817335c --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,0,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,0,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,0,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,0,10,30,53,0,60,0,0,0.11,8.37,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,0,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,0,10,30,53,0,60,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,0,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,0,10,30,53,0,60,0,0,0.11,8.37,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,0,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,0,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,0,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,0,0,0,200,0,21,60,0.2,0.03,0.33,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,0,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,0,0,0,200,0,0,0,0,0.01,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_manureman.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_organicmatter.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_region.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_slope.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_soil.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/default_data/parameters_database/Tunisia - National livestock general/lkp_tillageregime.csv b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/Tunisia - National livestock general/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_climate.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_croplandsystem.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_crops.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_crops.csv new file mode 100644 index 0000000..f197cd0 --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_crops.csv @@ -0,0 +1,9 @@ +crop_code ,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Cotton,3,5,0.05,0.01,0,0.15,1.15,0.5,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Natural pasture,2.6,0.11,0.01,0.01,0.03,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Rice,1.6,8.29,0.01,0.01,0,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Rice (bran),1.6,0,0.01,0.02,0,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Sorghum bicolor (forage/silage),13.5,0,0.01,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Sugarcane,11,0,0,0,0.17,0.15,1.2,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Triticum,3.48,4.89,0.02,0.01,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Triticum OF,3.48,0.4,0.02,0.02,0.03,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_feeditem.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_feeditem.csv new file mode 100644 index 0000000..be33cf3 --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_feeditem.csv @@ -0,0 +1,10 @@ +feed_item_code,crop_code ,feed_item_name,dm_content,me_content,cp_content +1,1,Cotton seed cake OFC,91,13.2,30 +2,1,Cotton straw OFR,76,5.1,6.4 +3,2,Naturally occuring pasture - grazing OFR,60,5,6 +4,4,Rice (Oryza sativa) - bran (with germs) OFC,91,10.43,14 +5,3,Rice (Oryza sativa) - straw,91.88,5.64,3.85 +6,5,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 +7,6,Sugarcane (Saccharum officinarum) - crop residue OFR,96.27,7.44,3.69 +8,8,Wheat (bran) OFC,87,11,17.3 +9,7,Wheat (straw) OFR,88,5.63,4.2 diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_grasslandman.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_landcover.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_livetype.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_livetype.csv new file mode 100644 index 0000000..3119ffe --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_manureman.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_organicmatter.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_region.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_slope.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_soil.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_tillageregime.csv b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/Uzbekistan - Mixed livestock/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_climate.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_croplandsystem.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_crops.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_crops.csv new file mode 100644 index 0000000..1c308a0 --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_crops.csv @@ -0,0 +1,14 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Beans,0.79,2.64,0.041,0.03,0.1,0.35,1.1,0.9,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Brachiaria hybrid,9.5,0,0.022,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Calliandra,8,2.5,0.035,0.015,0.45,0.3,0.6,0.9,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Green leaf desmodium,4,0.05,0.041,0.025,0.1,0.4,1.05,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Leucaena,7,7,0.034,0.034,0.05,1.05,1.2,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Local mixed grasses,3.25,0.06,0.014,0.014,0.1,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Maize,1.06,2.69,0.017,0.007,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Pennisetum purpureum,6.3,3.31,0.023,0.023,0.027,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Sesbania,6,4.5,0.035,0.02,0.47,0.45,0.95,0.75,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Sugarcane,3.46,1.38,0.001,0.001,0.171,0.15,1.2,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Sweet potato,1.93,1.58,0.005,0.002,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Wild desmodium,6,5.67,0.025,0,0.15,0.4,1.05,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_feeditem.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_feeditem.csv new file mode 100644 index 0000000..c88b47f --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_feeditem.csv @@ -0,0 +1,16 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,2,Brachiaria hybrid (forage),26,7,9 +2,3,Calliandra calothyrsus - green leaf material,39,7.68,22 +3,1,Common Beans (Phaseolus vulgaris) - vines,90,8.33,7.62 +4,9,Dairy meal,90,10.5,16 +5,4,Desmodium ( Desmodium intortum ) green leaf,24.2,8.2,15.5 +6,13,Desmodium (wild desmodium),19.36,6.56,12.4 +7,5,Leucaena (Leucaena leucocephala) - green fodder,26.2,9.5,19.93 +8,6,Local mixed grasses (couch/star grass) - green fodder,30.2,10,8.8 +9,7,Maize (Zea mays) - green fodder,82,10.22,8.9 +10,7,Maize (Zea mays) -BOUGHT stover,87,9.13,5.9 +11,8,Napier grass (Pennisetum purpureum) - green fodder,15,9.88,11 +12,10,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 +13,11,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 +14,11,Sugarcane (Saccharum officinarum) - tops (green fodder),29,6.9,5.9 +15,12,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_grassinputlevel.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_grasslandman.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_landcover.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_livetype.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_livetype.csv new file mode 100644 index 0000000..efbae20 --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),410,0,0,600,0,305,0,0,0.5,15,0.09,0,1.2,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.14,0,0,0.4,0,0,0,0,2200,26,0.51,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,0,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,0,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,0,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,0,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,0,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,0,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,0,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,0,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,0,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,0,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,0,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,0,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,0,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,0,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_manureman.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_organicmatter.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_orgfertilizer.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_region.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_slope.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_soil.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_soil.csv new file mode 100644 index 0000000..7d62abc --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_soil.csv @@ -0,0 +1,9 @@ +soil_code,soil_desc,k_value +andosol,Andosol,0.15 +cambisol,Cambisol,0.2 +lixisol,Lixisol,0.25 +fluvisol,Fluvisol,0.3 +vertisol,Vertisol,0.15 +phaeozem,Phaeozem,0.2 +nitosol,Nitosol,0.25 +xerosol,Xerosol,0.3 diff --git a/data/default_data/parameters_database/Western Kenya - Dairy/lkp_tillageregime.csv b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/default_data/parameters_database/Western Kenya - Dairy/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_climate.csv b/data/primary_database/Central Uganda - Livestock General/lkp_climate.csv new file mode 100644 index 0000000..f97c539 --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_climate.csv @@ -0,0 +1,7 @@ +climate_code,climate_desc +Warm Temperate Moist,Warm Temperate Moist +Warm Temperate Dry,Warm Temperate Dry +Tropical Montane,Tropical Montane +Tropical Moist,Tropical Moist +Tropical Dry,Tropical Dry +Tropical Wet,Tropical Wet diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_croplandsystem.csv b/data/primary_database/Central Uganda - Livestock General/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_crops.csv b/data/primary_database/Central Uganda - Livestock General/lkp_crops.csv new file mode 100644 index 0000000..802029f --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_crops.csv @@ -0,0 +1,18 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Amaranthus – local ,5.6,0,0.04,0.04,0.01,0.3,0.8,0.9,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Avena sativa,7.5,2.64,0,0.04,0.6,0.35,1.1,0.45,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Brachiaria hybrid,7,0,0.02,0,0.05,0.35,1.1,0.45,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Cassava ,4.27,2.89,0.03,0,0.46,0.15,1.2,0.6,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Centrosema,10,0,0.03,0,0.6,0.35,1.1,0.45,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Cocoyam,0.72,1.12,0.039,0.03,0.32,0.3,1.1,0.5,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Groundnut,0,2.79,0,0.01,0.12,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Hordeum vulgare,4.35,1.58,0.02,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Lablab,1.62,0,0.04,0,0,0.48,0.67,0.65,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Maize,1.3,3.58,0.013,0.006,0.1,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Medicago sativa,12,35.6,0.03,0.03,0.37,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Musa spp.,22.86,70,0,0.02,0.6,0.5,1.2,0.7,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,"Natural pasture - Mpigi, Mukono, and Masaka areas",13.05,5,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Natural pasture - Nakasongola area,10,7.14,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Pennisetum purpureum,15,8.39,0.02,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +16,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Sweet potato,4.11,0.97,0,0.003,0.01,0.3,0.75,0.75,tuber,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_feeditem.csv b/data/primary_database/Central Uganda - Livestock General/lkp_feeditem.csv new file mode 100644 index 0000000..30625ef --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_feeditem.csv @@ -0,0 +1,21 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,1,Amaranthus – local,13.9,5.93,24.3 +2,12,Banana leaves,16.03,10,6.84 +3,12,banana Peel – cooked,17.9,13.8,8.4 +4,8,Barley (grains) IP,87.1,12.4,11.04 +5,8,Barley (straw),90.9,6.5,3.8 +6,3,Brachiaria hybrid,90,7.254794521,13 +7,4,Cassava (Manihot esculenta) residue ,87.4,13.2,5.2 +8,5,Centrosema,90,9.3,18.9 +9,6,Cocoyam leaf,11.4,8.64,24.3 +10,16,Concentrate (commercial),90,12.1,16 +11,7,Groundnut (Arachis hypogaea) - seed hulls,93.12,6.56,15.92 +12,9,Lablab (Lablab purpureus) - forage,18.3,11.43,16.69 +13,11,Lucerne (Medicago sativa) - hay,85,8.36,11.56 +14,10,Maize (Zea mays) - forage,36.9,10.22,7.02 +15,16,Maize bran,90.9,13.1,11.3 +16,14,Naturally occuring pasture - Nakasongola district,60,7.75,4.89 +17,13,"Naturally occurring pasture - green fodder- Mpigi, Mukono, and Masaka districts",29.05,6.55,7.5 +18,2,Oats (Avena sativa) - hulls,92.4,5.32,4 +19,15,Pennisetum purpureum - forage,15,9.88,7.88 +20,17,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_grassinputlevel.csv b/data/primary_database/Central Uganda - Livestock General/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_grasslandman.csv b/data/primary_database/Central Uganda - Livestock General/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_landcover.csv b/data/primary_database/Central Uganda - Livestock General/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_livetype.csv b/data/primary_database/Central Uganda - Livestock General/lkp_livetype.csv new file mode 100644 index 0000000..8e4a2b5 --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),413,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),513,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),250,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,110,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),125,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,85,0,0,200,7,21,60,0.15,0.01,0.23,0,0,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,75,0,0,200,0,0,0,0,0.01,0,0,0,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,36,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_manureman.csv b/data/primary_database/Central Uganda - Livestock General/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_organicmatter.csv b/data/primary_database/Central Uganda - Livestock General/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_orgfertilizer.csv b/data/primary_database/Central Uganda - Livestock General/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_region.csv b/data/primary_database/Central Uganda - Livestock General/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_slope.csv b/data/primary_database/Central Uganda - Livestock General/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_soil.csv b/data/primary_database/Central Uganda - Livestock General/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/primary_database/Central Uganda - Livestock General/lkp_tillageregime.csv b/data/primary_database/Central Uganda - Livestock General/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Central Uganda - Livestock General/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_climate.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_climate.csv new file mode 100644 index 0000000..f97c539 --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_climate.csv @@ -0,0 +1,7 @@ +climate_code,climate_desc +Warm Temperate Moist,Warm Temperate Moist +Warm Temperate Dry,Warm Temperate Dry +Tropical Montane,Tropical Montane +Tropical Moist,Tropical Moist +Tropical Dry,Tropical Dry +Tropical Wet,Tropical Wet diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_croplandsystem.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_crops.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_crops.csv new file mode 100644 index 0000000..9471e81 --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_crops.csv @@ -0,0 +1,29 @@ +crop_code ,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Andropogon gayanus,7.8,,0.0104,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Arachis pintoi,5,,0.032,,,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Axonopus scoparius,15,,0.013,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Brachiaria brizantha ,11.7,,0.0176,,,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Brachiaria decumbens,10,,0.014,,,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Brachiaria hybrid,15,,0.0224,,,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Cenchrus clandestinus,12,,0.024,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Dactylis glomerata,6,,0.026,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Echinochloa polystachya,10,,0.0184,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Gliricidia,10,,0.0356,,,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Leucaena,14,,0.034,,,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Lolium multiflorum,11.4,,0.012,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Maize,3,4,0.017,0.007,,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Maize-silage,18,,0.007,,,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Medicago sativa,8.4,,0.032,,,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +16,Mulberry,2,,0.031,,,0.15,1.1,0.25,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Musa spp.,5,1.6,0.008,0.0152,,0.15,1.2,0.7,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +18,Natural pasture,10,,0.007,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +19,Panicum maximum,12.4,,0.0192,,,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +20,Paspalum notatum,5.2,,0.016,,,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +21,Pennisetum purpureum,19,,0.023,,,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +22,Pennisetum purpureum-silage,19,,0.01,,,1,1,1,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +23,Plantago spp,10,,0.032,,,1.05,1.1,1.1,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +24,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +25,Samanea saman,1,,0.027,,,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +26,Sambucus peruviana,3.5,,0.023,,,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +27,Trichantera gigantea,10,,0.028,,,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +28,Trifolium repens,3,,0.04,,,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_feeditem.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_feeditem.csv new file mode 100644 index 0000000..b2b3b44 --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_feeditem.csv @@ -0,0 +1,33 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,1,Andropogon gayanus (forage),27.8,7.1,6.25 +2,17,Banana (fruit),22,12.3,5.2 +3,17,Banana leaves,16,10,9.5 +4,4,Brachiaria brizantha (forage),26,7.25,7.25 +5,5,Brachiaria decumbens,26.8,7.7,7 +6,6,Brachiaria hybrid (forage),26,7.25,8.25 +7,7,Cenchrus clandestinus,20,9.7,15 +8,8,Cocksfoot,20.7,9.5,16.3 +9,24,Concentrates,90,12.1,16 +10,9,Echinochloa polystachya,16.7,8.8,10.6 +11,2,Forage peanut,21.4,9.3,20 +12,10,Gliricidia sepium (forage),30,11.5,22.3 +13,3,Gramalote,15.8,9.1,8 +14,12,Italian ryegrass (forage),19,8.7,7 +15,11,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +16,15,Lucerne (Medicago sativa) - forage,21,10.08,19.7 +17,13,Maize (Zea mays) - forage,82,10.22,8.9 +18,14,Maize (Zea mays) - silage,30,10.79,4.4 +19,13,Maize (Zea mays) - stover,87,9.13,5.9 +20,16,Mulberry (Morus alba),28.4,10,19.4 +21,27,Nacedero,17.5,5.3,17.9 +22,18,Naturally occuring pasture - grazing,60,5,6 +23,19,Panicum maximum (forage),26,7.54,9.88 +24,20,Paspalum notatum (forage),28,7.54,8.25 +25,21,Pennisetum purpureum - forage,15,9.88,11 +26,22,Pennisetum purpureum - silage,19.5,7.5,6.5 +27,25,Rain tree (pods),83.1,12.1,16.6 +28,23,Ribwort plantain,15.7,10.9,20 +29,25,Sambucus peruviana,20,11.34,14.2 +30,24,Sugarcane (Saccharum officinarum) - molasses,74.3,10.89,5.8 +31,24,Sugarcane (Saccharum officinarum) - molasses,74.3,10.89,5.8 +32,28,Trifolium repens,16.8,11.1,24.9 diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_grassinputlevel.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_grasslandman.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_landcover.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_livetype.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_livetype.csv new file mode 100644 index 0000000..09628e7 --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,4,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_manureman.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_organicmatter.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_orgfertilizer.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_region.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_slope.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_soil.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/primary_database/Ecuador-National dual-purpose cattle/lkp_tillageregime.csv b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Ecuador-National dual-purpose cattle/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_climate.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_croplandsystem.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_crops.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_crops.csv new file mode 100644 index 0000000..eb627fb --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_crops.csv @@ -0,0 +1,15 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Aftermath,0.5,0,0.03,0,0,0,0,0,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Banana,8.8,4.58,0.02,0.03,0.15,0.5,1.1,1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Barley,2.55,3.83,0.62,0,0.15,0.6,1.1,1,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Cowpea,6,6.86,0.03,0.01,0.15,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Enset,8.8,17.6,0.56,0.03,0.15,0.5,1.1,1,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,faba bean (vicia faba),2.34,1.99,1.18,1.18,0.15,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Kocho,8.8,0,0,0.03,0,0,0,0,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Lentils (Lens esculenta),1.5,4.51,1.12,1.12,0.15,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Natural pasture,2.5,1.67,0.01,0,0.05,0.4,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Natural pasture hay,1.98,0,0,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Oats,2.88,4.32,0.02,0.01,0.15,0.6,1.1,1,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Sorghum,4,8.79,0.02,0.01,0.05,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Wheat,3.4,7.6,0.35,0.01,0.15,0.6,1.1,1,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_feeditem.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_feeditem.csv new file mode 100644 index 0000000..22d50c6 --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_feeditem.csv @@ -0,0 +1,16 @@ +feed_item_code,crop_code ,feed_item_name,dm_content,me_content,cp_content +1,1,Aftermath grazing,90,7.38,5 +2,2,Banana waste,22,8.66,9.5 +3,3,Barley (Hordeum vulgare) straw,88,7.2,4.1 +4,12,Concentrate (commercial),90,12.1,16 +5,4,Cowpea (Vigna unguiculata) - crop residue,90,9.88,18.4 +6,6,faba bean (vicia faba),92.2,8.3,6.8 +7,5,False banana waste,22,8.66,9.5 +8,5,False banana waste (Ensete ventricosum) - leave & stem,91,10.8,3.5 +9,8,Lentils (Lens esculenta),90,7.9,6.9 +10,10,Natural occuring pasture hay,89,10,5 +11,9,Natural pasture (grazing) -bonga,30,5,4.5 +12,9,Naturally occuring pasture - grazing,53,5,6 +13,11,Oats (Avena sativa) - straw,90,6.7,4.4 +14,13,Sorghum (Sorghum bicolor) - crop residue,85,7.03,4.9 +15,14,wheat straw,89,6.8,4.2 diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_grassinputlevel.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_grasslandman.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_landcover.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_livetype.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_livetype.csv new file mode 100644 index 0000000..440f9a2 --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),0,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),0,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),0,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,0,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,0,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),0,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,0,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),0,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,0,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,0,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,0,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,27,10,30,53,0,140,0,0,0.05,4.25,0.09,0.4,0.62,3.2,5.8,970,2200,25,0.58,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,28,10,30,53,0,0,0,0,0.06,0,0.09,0.45,0,3.7,4.3,970,2200,25,0.58,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,29,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,2200,25,0.58,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,13,10,30,53,0,0,0,0,0.03,0,0,0.45,0,0,0,0,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,25,10,30,53,0,60,0,0,0.05,3.95,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,11,10,30,53,0,0,0,0,0.02,0,0,0.45,0,0,0,0,0,0,0.58,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,13,10,30,53,0,0,0,0,0.03,0,0,0.45,0,0,0,0,0,0,0.58,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,12,10,30,53,0,0,0,0,0.02,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,0,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,0,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,0,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_manureman.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_organicmatter.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_orgfertilizer.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_region.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_slope.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_soil.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_soil.csv new file mode 100644 index 0000000..dca2334 --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_soil.csv @@ -0,0 +1,13 @@ +soil_code,soil_desc,k_value +andosol,Andosol,0.15 +cambisol,Cambisol,0.2 +lixisol,Lixisol,0.25 +fluvisol,Fluvisol,0.3 +vertisol,Vertisol,0.15 +phaeozem,Phaeozem,0.2 +nitosol,Nitosol,0.25 +xerosol,Xerosol,0.3 +rendzic Leptosols,Rendzic Leptosols ,0.2 +aluandic Andosols,Aluandic Andosols,0.21 +haplic Vertisols- Abergele,Haplic Vertisols- Abergele,0.19 +haplic Vertisols - Menz,Haplic Vertisols - Menz ,0.22 diff --git a/data/primary_database/Ethiopia - Small Ruminants/lkp_tillageregime.csv b/data/primary_database/Ethiopia - Small Ruminants/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Ethiopia - Small Ruminants/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_climate.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_croplandsystem.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_crops.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_crops.csv new file mode 100644 index 0000000..878c56d --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_crops.csv @@ -0,0 +1,10 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Cowpea,0.85,2.97,0.04,0.02,0.12,0.15,1.05,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Gliricidia,5,0,0.04,0,0,1.05,1.1,1.1,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Leucaena,14,0,0.03,0.03,0,1.05,1.1,1.1,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Maize,8.6,3,0.02,0.01,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Moringa oleifera,20,0,0.04,0.04,0,1.05,1.1,1.1,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Natural pasture,10,0,0.01,0.01,0.03,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Phaseolus vulgaris,0.5,1,0.04,0.01,0,0.15,1.05,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Sugarcane,11,1.38,0,0,0.17,0.15,1.2,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Sweet potato,1.93,1.58,0.01,0,0.05,0.15,1.1,0.55,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_feeditem.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_feeditem.csv new file mode 100644 index 0000000..4aa0607 --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_feeditem.csv @@ -0,0 +1,11 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,7,Bean (crop residue),88,7.4,7.1 +2,1,Cowpea (Vigna unguiculata) - crop residue,90,9.88,18.4 +3,2,Gliricidia sepium (forage),30,11.5,22.3 +4,3,Lucerne (Medicago sativa) - forage,21,10.08,19.7 +5,4,Maize (Zea mays) - stover,87,9.13,5.9 +6,5,Moringa oleifera (forage),26.2,10.6,24.3 +7,6,Naturally occuring pasture - grazing,60,5,6 +8,6,Naturally occuring pasture - grazing OFR,60,5,6 +9,8,Sugarcane (Saccharum officinarum) - tops (forage),29,6.9,5.9 +10,9,Sweet potato (Ipomoea batatas) - leaves,10.8,10.01,19.4 diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_grassinputlevel.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_grasslandman.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_landcover.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_livetype.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_livetype.csv new file mode 100644 index 0000000..634c07f --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,300,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,190,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,12,10,30,53,0,0,0,0,0.024,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,30,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,35,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,12,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_manureman.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_organicmatter.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_orgfertilizer.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_region.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_slope.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_soil.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/primary_database/Haiti - Mixed Livestock/lkp_tillageregime.csv b/data/primary_database/Haiti - Mixed Livestock/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Haiti - Mixed Livestock/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_climate.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_croplandsystem.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_crops.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_crops.csv new file mode 100644 index 0000000..bdb7414 --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_crops.csv @@ -0,0 +1,24 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Andropogon gayanus,7.8,,0.0104,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Brachiaria brizantha ,11.4,,0.032,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Brachiaria decumbens,10,,0.013,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Brachiaria decumbens (hay),10,,0.0176,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Brachiaria hybrid,15,,0.014,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Canavalia brasiliensis,5,,0.0224,,0.15,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Cratylia,12,,0.024,,0.15,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Cynodon nlemfuensis,10,,0.026,,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Dichanthium aristatum,6.5,,0.0184,,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Gliricidia,10,,0.0356,,0.15,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Guazuma ulmifolia,17,,0.034,,0.15,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Hyparrhenia rufa,5.9,,0.012,,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Leucaena,14,,0.017,0.007,0.15,1.05,1.1,1.1,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Maize,3,3,0.007,,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Maize-silage,9.5,,0.032,,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +16,Mulberry,2,,0.031,,0.05,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Natural pasture,6.5,,0.008,0.0152,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +18,Panicum maximum,12.4,,0.007,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +19,Paspalum notatum,6.5,,0.0192,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +20,Pennisetum purpureum,10,,0.023,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +21,Pennisetum purpureum-silage,19,,0.027,,0.01,1,1,1,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +22,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +23,Tithonia diversifolia,10,,0.04,,0.05,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_feeditem.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_feeditem.csv new file mode 100644 index 0000000..58b9c05 --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_feeditem.csv @@ -0,0 +1,26 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521 +2,2,Brachiaria brizantha (forage),26,7.254794521,10.4 +3,3,Brachiaria decumbens,26.8,7.7,8.9 +4,4,Brachiaria decumbens,83.8,6.6,5.2 +5,5,Brachiaria hybrid (forage),26,7.254794521,13 +6,6,Canavalia brasiliensis (forage),30,12.1,22 +7,7,Cratylia argentea (forage),30,9.4,24 +8,8,Cynodon nlemfuensis (forage),30.3,9.671508,12.6 +9,9,Dichanthium aristatum (forage),33,7.25,8 +10,10,Gliricidia sepium (forage),30,11.5,22.3 +11,11,Guazuma ulmifolia (forage),30,11,15 +12,12,Hyparrhenia rufa (forage),26,6.129315068,6 +13,13,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +14,14,Maize (Zea mays) - stover,87,9.127224,5.9 +15,15,Maize (Zea mays) - silage,30,10.79,4.4 +16,16,Mulberry (Morus alba),28.4,10,19.4 +17,17,Naturally occuring pasture - grazing,25,5,6 +18,17,Naturally occuring pasture - grazing OFR,25,5,6 +19,18,Panicum maximum (forage),26,7.543013699,9.882191781 +20,19,Paspalum notatum (forage),28,7.543013699,8.254794521 +21,20,Pennisetum purpureum - forage,15,9.880848,11 +24,21,Pennisetum purpureum - silage,19.5,7.5,6.5 +25,22,Concentrate (commercial),90,12.1,16 +26,22,Sugarcane (Saccharum officinarum) - molasses,74.3,10.88568,5.8 +27,23,Tithonia diversifolia (forage),19.8,9.9,21.2 diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_grassinputlevel.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_grasslandman.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_landcover.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_livetype.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_livetype.csv new file mode 100644 index 0000000..03ce101 --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,600,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_manureman.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_organicmatter.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_orgfertilizer.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_region.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_slope.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_soil.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_tillageregime.csv b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Honduras-Olancho dual-purpose cattle/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Mongolia- Livestock General/lkp_climate.csv b/data/primary_database/Mongolia- Livestock General/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_database/Mongolia- Livestock General/lkp_croplandsystem.csv b/data/primary_database/Mongolia- Livestock General/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Mongolia- Livestock General/lkp_crops.csv b/data/primary_database/Mongolia- Livestock General/lkp_crops.csv new file mode 100644 index 0000000..b016e87 --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_crops.csv @@ -0,0 +1,9 @@ +crop_code ,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Avena sativa-forage,9.1,0,0.02,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Hordeum vulgare (forage),6.8,0,0.01,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Lolium multiflorum,11.4,0,0.01,0,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Natural pasture - Desert & Desert Steppe,0.34,0,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Natural pasture - Forest & Forest Steppe,0.87,0,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Natural pasture - High Mountain,0.56,0,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Red clover,17,0,0.01,0,0.15,0.1,1.1,0.55,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Triticum OF,0.71,0.85,0.02,0.03,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Mongolia- Livestock General/lkp_feeditem.csv b/data/primary_database/Mongolia- Livestock General/lkp_feeditem.csv new file mode 100644 index 0000000..6088419 --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_feeditem.csv @@ -0,0 +1,10 @@ +feed_item_code,crop_code ,feed_item_name,dm_content,me_content,cp_content +1,2,Barley (forage),25,9.2,11 +2,3,Italian ryegrass - hay,85,8.36,6.01 +3,4,Naturally occuring pasture hay - Desert & Desert Steppe,83,5,3.6 +4,5,Naturally occuring pasture hay - Forest & Forest Steppe,83,5,3.6 +5,6,Naturally occuring pasture hay - High Mountain,83,5,3.6 +6,1,Oats (Avena sativa) - green fodder,31,8.36,4 +7,1,Oats (Avena sativa) - silage,36.4,8.92,12.7 +8,7,Red clover (Trifolium pratense) - green fodder,19.6,10.43,20.8 +9,8,Wheat (bran) OFC,87,11,17.9 diff --git a/data/primary_database/Mongolia- Livestock General/lkp_grassinputlevel.csv b/data/primary_database/Mongolia- Livestock General/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Mongolia- Livestock General/lkp_grasslandman.csv b/data/primary_database/Mongolia- Livestock General/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Mongolia- Livestock General/lkp_landcover.csv b/data/primary_database/Mongolia- Livestock General/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/Mongolia- Livestock General/lkp_livetype.csv b/data/primary_database/Mongolia- Livestock General/lkp_livetype.csv new file mode 100644 index 0000000..d5186d2 --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),180,0,0,350,0,0,0,0,0.24,9.64,0.09,0,1.15,4.3,4.2,764,2700,17,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),320,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,350,0,0,580,0,0,0,0,0.25,0,0,0,0,0,0,0,2700,17,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,163,0,0,350,0,0,0,0,0.16,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),194,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,33,0,0,350,0,0,0,0,0.03,0,0,0.4,0,0,0,0,2700,17,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),55,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,36,10,30,53,0,60,0,0,0.07,5.85,0.09,0,0.4,3.87,3.4,970,1783,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,48,10,30,53,0,60,0,0,0.1,0,0,0.45,0,0,0,0,0,0,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,45,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,19,10,30,53,0,60,0,0,0.05,0,0,0.45,0,3.87,3.4,970,1783,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Mongolia- Livestock General/lkp_manureman.csv b/data/primary_database/Mongolia- Livestock General/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Mongolia- Livestock General/lkp_organicmatter.csv b/data/primary_database/Mongolia- Livestock General/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Mongolia- Livestock General/lkp_orgfertilizer.csv b/data/primary_database/Mongolia- Livestock General/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Mongolia- Livestock General/lkp_region.csv b/data/primary_database/Mongolia- Livestock General/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Mongolia- Livestock General/lkp_slope.csv b/data/primary_database/Mongolia- Livestock General/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Mongolia- Livestock General/lkp_soil.csv b/data/primary_database/Mongolia- Livestock General/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/primary_database/Mongolia- Livestock General/lkp_tillageregime.csv b/data/primary_database/Mongolia- Livestock General/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Mongolia- Livestock General/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_climate.csv b/data/primary_database/Nepal - Goat Fattening/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_croplandsystem.csv b/data/primary_database/Nepal - Goat Fattening/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_crops.csv b/data/primary_database/Nepal - Goat Fattening/lkp_crops.csv new file mode 100644 index 0000000..73028b4 --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_crops.csv @@ -0,0 +1,20 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Amaranthus caudatus,6.44,0,0.02,0,0.15,0.15,0.95,0.85,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Avena sativa,16,0,0.02,0,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Bauhinia purpurea,1.98,0,0.03,0,0.15,0.575,1.125,0.475,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Brassica spp,1.22,0,0.03,0,0.05,0.2625,1.1375,0.95,oilseed crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Cicer arietinum,1.13,0,0.04,0,0.15,0.575,1.125,0.475,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Eleusine coracana,1.22,0,0.01,0,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Fagopyrum esculentum,3.09,1.79,0.02,0.01,0.05,0.1,1.1,0.55,pseudocereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Ficus semicordata,2.3,0,0.02,0,0.05,0.2625,1.1375,0.95,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Garuga pinnata,2,0,0.03,0,0.05,0.2625,1.1375,0.95,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Lens culinaris,1.23,0,0.04,0,0.15,0.575,1.125,0.475,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Leucena leucocephala,15,0,0.04,0,0.15,1.05,1.1,1.1,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Melia azedarach,2.5,0,0.03,0,0.05,0.2625,1.1375,0.95,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Morus alba,1.35,0,0.02,0,0.05,0.2625,1.1375,0.95,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Natural pasture,27,0,0.01,0,0.05,0.3,0.7,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Oryza sativa,3.8,2.44,0.01,0.01,0.05,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +16,Pennisetum purpureum,20,0,0.02,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +18,Vigna mungo,0.89,0,0.02,0,0.15,0.575,1.125,0.475,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +19,Zea mays,4.02,2.33,0.02,0.01,0.1,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_feeditem.csv b/data/primary_database/Nepal - Goat Fattening/lkp_feeditem.csv new file mode 100644 index 0000000..e398af7 --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_feeditem.csv @@ -0,0 +1,25 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content,,,,,,,, +1,1,Amaranth (Amaranthus caudatus) - forage,89.1,13.3,15.4,,,,,,,, +2,12,Bakaino (Melia azedarach) - green forage,34.8,8.1,17.1,,,,,,,, +3,18,Black gram (Vigna mungo) - straw ,85,8.3,13,,,,,,,, +4,17,Brewery grains - dehydrated,91,9.9,25.8,,,,,,,, +5,7,Buckwheat (Fagopyrum esculentum) - grain ,84.9,9.6,13.2,,,,,,,, +6,7,Buckwheat (Fagopyrum esculentum) - hulls,88,6.7,7,,,,,,,, +7,5,Chickpea (Cicer arietinum) - grain,89,14.1,22.1,,,,,,,, +8,17,concentrates,90,12.1,16,,,,,,,, +9,9,Dabdabe (Garuga pinnata) - green forage,36.93,7.95,16,,,,,,,, +10,11,Epil-pil (Leucena leucocephala) - green forage,29.9,11,23.3,,,,,,,, +11,6,Finger millet (Eleusine coracana) - grain,89,11.8,8.9,,,,,,,, +12,2,Jai (Avena sativa) - green forage,20.6,11.1,14.8,,,,,,,, +13,8,khanayo (Ficus semicordata) - green forage,32.59,8.2,13.38,,,,,,,, +14,13,Kimbu (Morus alba) - green forage,26.3,11,15.3,,,,,,,, +15,10,Lentil (Lens culinaris) - grain,88.3,13.5,26.9,,,,,,,, +16,19,Maize (Zea mays) - stover ,92.8,6.9,3.9,,,,,,,, +17,19,Maize (Zea mays) - grain ,87.2,13.5,9.7,,,,,,,, +18,16,Napier (Pennisetum purpureum) - green forage,17.9,8.2,9.7,,,,,,,, +19,14,Naturally occurring pasture - gathered forage,60,6.55,7.5,,,,,,,, +20,14,Naturally occurring pasture - grazing,60,5,6,,,,,,,, +21,4,Rapeseed (Brassica spp.) - hulls,87.5,10.2,16.1,,,,,,,, +22,15,Rice (Oryza sativa) - grain,88,10.1,8.3,,,,,,,, +23,15,Rice (Oryza sativa) - straw,92.8,5.8,4.2,,,,,,,, +24,3,Tanki (Bauhinia purpurea) - green forage,34.88,8,15.68,,,,,,,, diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_grassinputlevel.csv b/data/primary_database/Nepal - Goat Fattening/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_grasslandman.csv b/data/primary_database/Nepal - Goat Fattening/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_landcover.csv b/data/primary_database/Nepal - Goat Fattening/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_livetype.csv b/data/primary_database/Nepal - Goat Fattening/lkp_livetype.csv new file mode 100644 index 0000000..f0f8285 --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),0,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),0,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),0,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,0,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,0,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),0,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,0,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),0,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,0,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,0,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,0,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,0,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,0,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,0,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,0,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,25,10,30,53,0,60,0,0,0.05,3.95,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,40,10,30,53,0,60,0,0,0.06,0,0,0.45,0,0,0,0,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,35,10,30,53,0,60,0,0,0.07,0,0,0.45,0,0,0,0,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,13,10,30,53,0,60,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,0,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,0,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,0,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_manureman.csv b/data/primary_database/Nepal - Goat Fattening/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_organicmatter.csv b/data/primary_database/Nepal - Goat Fattening/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_orgfertilizer.csv b/data/primary_database/Nepal - Goat Fattening/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_region.csv b/data/primary_database/Nepal - Goat Fattening/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_slope.csv b/data/primary_database/Nepal - Goat Fattening/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_soil.csv b/data/primary_database/Nepal - Goat Fattening/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/primary_database/Nepal - Goat Fattening/lkp_tillageregime.csv b/data/primary_database/Nepal - Goat Fattening/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Nepal - Goat Fattening/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_climate.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_croplandsystem.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_crops.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_crops.csv new file mode 100644 index 0000000..7a2b25b --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_crops.csv @@ -0,0 +1,17 @@ +crop_code ,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Andropogon gayanus,7.8,,0.0104,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Brachiaria brizantha ,11.4,,0.032,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Brachiaria hybrid,15,,0.014,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Canavalia brasiliensis,5,,0.0224,,0.15,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Dichanthium aristatum,6.5,,0.0184,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Gliricidia,10,,0.0356,,0.15,1.05,1.1,1.1,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Hyparrhenia rufa,5.9,,0.012,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Ischaemum ciliare,5.5,,0.013,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Maize,3,3,0.017,0.007,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Natural pasture,6.5,,0.008,,0.15,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Panicum maximum,12.4,,0.007,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Paspalum notatum,6.5,,0.0192,,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Pennisetum purpureum,10,,0.023,,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Pennisetum purpureum-silage,19,,0.027,,0.01,1,1,1,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +16,Tithonia diversifolia,10,0,0.03,0,0.05,1.05,1.1,1.1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_feeditem.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_feeditem.csv new file mode 100644 index 0000000..ccae867 --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_feeditem.csv @@ -0,0 +1,20 @@ +feed_item_code,crop_code ,feed_item_name,dm_content,me_content,cp_content +1,1,Andropogon gayanus (forage),27.8,7.1,6.254794521 +2,2,Brachiaria brizantha (forage),26,7.254794521,7.254794521 +3,3,Brachiaria hybrid (forage),26,7.254794521,8.254794521 +4,4,Caña (Saccharum officinarum) - melaza,74.3,10.88568,5.8 +5,4,Canavalia brasiliensis (forage),30,12.1,22 +6,15,Concentrate (commercial),90,12.1,16 +7,5,Dichanthium aristatum (forage),33,7.25,8 +8,6,Gliricidia sepium (forage),30,11.5,22.3 +9,7,Hyparrhenia rufa (forage),26,6.129315068,6 +10,8,Ischaemum ciliare (forage),24,6.003835616,6 +11,9,Maíz (Zea mays) - rastrojo,87,9.127224,5.9 +12,11,Panicum maximum (forage),26,7.543013699,9.882191781 +13,12,Paspalum notatum (forage),28,7.543013699,8.254794521 +14,10,Pastos naturalizados- pastoreo,60,5,6 +15,13,Pennisetum purpureum - forage,15,9.880848,11 +16,14,Pennisetum purpureum - silage,19.5,7.5,6.5 +17,15,Sorgo (Sorghum bicolor) - rastrojo,85,7.033824,4.9 +18,15,Sugarcane (Saccharum officinarum) - forage,23.2,9,4.3 +19,16,Tithonia diversifolia (forage),19.8,9.9,21.2 diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_grassinputlevel.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_grasslandman.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_landcover.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_livetype.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_livetype.csv new file mode 100644 index 0000000..ca6d102 --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.4,3.2,5,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,105,0,0,350,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.5,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_manureman.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_organicmatter.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_orgfertilizer.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_region.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_slope.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_soil.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_tillageregime.csv b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Nicaragua-National dual-purpose cattle/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_climate.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_croplandsystem.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_crops.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_crops.csv new file mode 100644 index 0000000..24701f5 --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_crops.csv @@ -0,0 +1,9 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Banana,4.71,21.49,0.01,0.01,0.6,0.6,1.1,1.05,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,cassava,11.27,5.04,0.004,0,0.05,0,0,0,tuber,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Elephant grass,59.5,6.24,0.02,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Maize,4.15,3.95,0.02,0,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Natural pasture,13.1,2.43,0.01,0,0.05,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Rice,2,2.42,0.01,0.01,0.15,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Sugarcane,7.72,3.92,0.01,0,0.6,0.15,1.2,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Taro,7.5,18.35,0.03,0.03,0.6,0.72,0.91,1.19,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_feeditem.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_feeditem.csv new file mode 100644 index 0000000..a79ea78 --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_feeditem.csv @@ -0,0 +1,11 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,2,Cassava (Manihot esculenta) - crop residue,16.1,10,19.94 +2,4,Maize (Zea mays) - cracked grains,87.2,13.5,9.7 +3,4,Maize (Zea mays) -stover residue,87,9.13,5.9 +4,5,Naturally occuring pasture - grazing,60,5,6 +5,5,Naturally occuring pasture - green fodder,60,5,6 +6,6,Rice (Oryza sativa) - straw,92.8,5.8,4.2 +7,7,Sugarcane (Saccharum officinarum) - crop residue,26.8,8,4.9 +8,1,Banana trunk,6.9,9.9,3.5 +9,3,Elephant grass,17.9,8.2,9.7 +10,8,Taro leaves,8.05,14.5,16.5 diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_grassinputlevel.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_grasslandman.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_landcover.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_livetype.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_livetype.csv new file mode 100644 index 0000000..715a560 --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),300,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,225,0,0,580,0,0,0,0,0.23,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,190,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,20,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,70,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,70,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,20,0,0,200,0,0,0,0,0,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_manureman.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_organicmatter.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_orgfertilizer.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_region.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_slope.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_soil.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_tillageregime.csv b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/North-west-highlands Vietnam - Multispecies/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_climate.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_climate.csv new file mode 100644 index 0000000..f97c539 --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_climate.csv @@ -0,0 +1,7 @@ +climate_code,climate_desc +Warm Temperate Moist,Warm Temperate Moist +Warm Temperate Dry,Warm Temperate Dry +Tropical Montane,Tropical Montane +Tropical Moist,Tropical Moist +Tropical Dry,Tropical Dry +Tropical Wet,Tropical Wet diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_croplandsystem.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_croplandsystem.csv new file mode 100644 index 0000000..0c2a44e --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +sys_code,sys_desc,change_factor +1,"Long term cultivated, temperate/boreal, dry",0.8 +2,"Long term cultivated, temperate/boreal, moist",0.69 +3,"Long term cultivated, tropical, dry",0.58 +4,"Long term cultivated, tropical, moist/wet",0.48 +5,"Long term cultivated, tropical montane, all",0.64 +6,Paddy rice,1.1 +7,Perennial/tree crop,1 +8,"Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +9,"Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +10,"Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_crops.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_crops.csv new file mode 100644 index 0000000..6bf8c58 --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_crops.csv @@ -0,0 +1,13 @@ +crop_code ,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Banana,0.57,3.45,0.02,0.01,0.05,0.15,1.2,0.7,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Guatemala,19.8,0,0.014,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Leucaena,2.08,0,0.04,0.04,0.05,1.05,1.2,0.75,grass,400,18,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Local mixed grasses,13,0.25,0.014,0.082,0.1,0.6,1,1.04,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Fodder maize,1.06,0,0.017,0,0.05,0.052,0.082,0.112,grass,,,,,,,,,,,,,,, +6,Improved pasture,15,0,0.016,0,0.05,0.6,1,1.04,grass,,,,,,,,,,,,,,, +7,Maize,1.3,3.58,0.013,0.006,0.1,0.15,1.2,0.6,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Natural occurring pasture - Kilimanjaro region,13.05,0,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Natural pasture - Tanga region,12.8,0,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Pennisetum purpureum,30,0,0.013,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Rice,1.4,2.22,0.04,0.01,0.15,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_feeditem.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_feeditem.csv new file mode 100644 index 0000000..b5b8e4a --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_feeditem.csv @@ -0,0 +1,11 @@ +feed_item_code,crop_code ,feed_item_name,dm_content,me_content,cp_content +1,11,Concentrate (commercial),90,12.1,16 +2,2,Guatemala grass (Tripsacum andersonii) - forage,22,8.2,5.5 +3,3,Leucaena (Leucaena leucocephala) - forage,26.2,9.5,19.93 +4,4,Local mixed grasses (couch/star grass) - green fodder,30.2,10,3.02 +5,7,Maize (Zea mays) - stover,87,6.9,3.9 +6,1,Musa spp.,5.7,8.54,10.5 +7,8,Naturally occurring pasture – Kilimanjaro region,31.9,6.97,4.83 +8,9,Naturally occurring pasture – Tanga highland and lowland,29.05,6.55,7.5 +9,10,Pennisetum purpureum - forage,15,9.88,11 +10,12,Rice (Oryza sativa) - straw,92.8,5.8,3.85 diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_grassinputlevel.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_grassinputlevel.csv new file mode 100644 index 0000000..60fb371 --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +grassinputlevel_code,grassinputlevel_desc,change_factor +1,Medium,1 +2,High,1.11 +3,None,1 diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_grasslandman.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_landcover.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_landcover.csv new file mode 100644 index 0000000..fd7bb04 --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_landcover.csv @@ -0,0 +1,15 @@ +landcover_code,landcover_desc,c_factor +1,Dense forest,0.001 +2,Other forest,0.05 +3,Badlands hard,0.05 +4,Badlands soft,0.4 +5,Sorghum,0.1 +6,Maize,0.1 +7,Cereals,0.15 +8,Pulses,0.15 +9,Dense grass,0.01 +10,Degraded grass,0.05 +11,Fallow hard,0.05 +12,Fallow plouged,0.6 +13,Ethiopian teff,0.25 +14,Continuous fallow,1 diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_livetype.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_livetype.csv new file mode 100644 index 0000000..0f0f56b --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),400,0,0,600,0,0,0,0,0.38,12.21,0.09,0,1.2,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),260,0,0,600,0,0,0,0,0.29,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,100,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),110,0,0,600,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_manureman.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_manureman.csv new file mode 100644 index 0000000..032f94c --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_manureman.csv @@ -0,0 +1,36 @@ +manureman_code,manureman_desc +pasture,Pasture / range / paddock +storage,Solid storage +drylot,Dry lot +"Uncovered anaerobic lagoon +",Uncovered anaerobic lagoon +"Liquid/Slurry Pit below animals 1 Month +",Liquid/Slurry Pit below animals 1 Month +Liquid/Slurry Pit below animals 3 Month,Liquid/Slurry Pit below animals 3 Month +Liquid/Slurry Pit below animals 4 Month,Liquid/Slurry Pit below animals 4 Month +"Liquid/Slurry Pit below animals 6 Month +",Liquid/Slurry Pit below animals 6 Month +Liquid/Slurry Pit below animals 12 Month,Liquid/Slurry Pit below animals 12 Month +Cattle and swine deep bedding < 1 month,Cattle and swine deep bedding < 1 month +"Cattle and swine deep bedding > 1 month +",Cattle and swine deep bedding > 1 month +Solid storage,Solid storage +"Solid storage - Covered/compacted +",Solid storage - Covered/compacted +Solid storage - Bulking agent addition,Solid storage - Bulking agent addition +Solid storage - Additives,Solid storage - Additives +Daily spread,Daily spread +Composting - In-vessel,Composting - In-vessel +Composting - Static pile (forced aeration),Composting - Static pile (forced aeration) +Composting - Intensive windrow,Composting - Intensive windrow +Composting - Unfrequent turning,Composting - Unfrequent turning +Pasture/Range/Paddock,Pasture/Range/Paddock +Poultry manure with and without litter,Poultry manure with and without litter +Aerobic treatment,Aerobic treatment +Burned for fuel,Burned for fuel +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_organicmatter.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_organicmatter.csv new file mode 100644 index 0000000..c713cba --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +orgmatter_code,orgmatter_desc,change_factor +1,"Low, temperate/boreal, dry",0.95 +2,"Low, temperate/boreal, moist",0.92 +3,"Low, tropical, dry",0.95 +4,"Low, tropical, moist",0.92 +5,"Low, tropical montane, all",0.94 +6,"Medium, all",1 +7,"High w/OUT manure, temperate/boral and tropical, dry",1.04 +8,"High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +9,"High w/OUT manure, tropical montane",1.08 +10,"High with manure, temperate/boral and tropical, dry",1.37 +11,"High with manure, temperate/boral and tropical, moist/wet",1.44 +12,"High with manure, tropical montane",1.41 diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_orgfertilizer.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_region.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_region.csv new file mode 100644 index 0000000..bfa8633 --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_region.csv @@ -0,0 +1,4 @@ +region_code,region_desc +AFRICA,AFRICA +LATIN,LATIN AMERICA +ASIA,ASIA diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_slope.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_soil.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_soil.csv new file mode 100644 index 0000000..04fb0ea --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_soil.csv @@ -0,0 +1,10 @@ +soil_code,soil_desc,k_value +andosol,Andosol,0.15 +cambisol,Cambisol,0.2 +lixisol,Lixisol,0.25 +fluvisol,Fluvisol,0.3 +vertisol,Vertisol,0.15 +phaeozem,Phaeozem,0.2 +nitosol,Nitosol,0.25 +xerosol,Xerosol,0.3 +haplic Ferralsols,Haplic Ferralsols,0.16 diff --git a/data/primary_database/Northern Tanzania - Dairy/lkp_tillageregime.csv b/data/primary_database/Northern Tanzania - Dairy/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Northern Tanzania - Dairy/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Params DB - Default/lkp_climate.csv b/data/primary_database/Params DB - Default/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/primary_database/Params DB - Default/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_database/Params DB - Default/lkp_croplandsystem.csv b/data/primary_database/Params DB - Default/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Params DB - Default/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/lkp_crops.csv b/data/primary_database/Params DB - Default/lkp_crops.csv similarity index 100% rename from data/primary_database/lkp_crops.csv rename to data/primary_database/Params DB - Default/lkp_crops.csv diff --git a/data/primary_database/lkp_feeditem.csv b/data/primary_database/Params DB - Default/lkp_feeditem.csv similarity index 100% rename from data/primary_database/lkp_feeditem.csv rename to data/primary_database/Params DB - Default/lkp_feeditem.csv diff --git a/data/primary_database/Params DB - Default/lkp_grassinputlevel.csv b/data/primary_database/Params DB - Default/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Params DB - Default/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Params DB - Default/lkp_grasslandman.csv b/data/primary_database/Params DB - Default/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Params DB - Default/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Params DB - Default/lkp_landcover.csv b/data/primary_database/Params DB - Default/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Params DB - Default/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/lkp_livetype.csv b/data/primary_database/Params DB - Default/lkp_livetype.csv similarity index 100% rename from data/primary_database/lkp_livetype.csv rename to data/primary_database/Params DB - Default/lkp_livetype.csv diff --git a/data/primary_database/Params DB - Default/lkp_manureman.csv b/data/primary_database/Params DB - Default/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Params DB - Default/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Params DB - Default/lkp_organicmatter.csv b/data/primary_database/Params DB - Default/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Params DB - Default/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Params DB - Default/lkp_orgfertilizer.csv b/data/primary_database/Params DB - Default/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Params DB - Default/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Params DB - Default/lkp_region.csv b/data/primary_database/Params DB - Default/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Params DB - Default/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Params DB - Default/lkp_slope.csv b/data/primary_database/Params DB - Default/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Params DB - Default/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Params DB - Default/lkp_soil.csv b/data/primary_database/Params DB - Default/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/primary_database/Params DB - Default/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/primary_database/Params DB - Default/lkp_tillageregime.csv b/data/primary_database/Params DB - Default/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Params DB - Default/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_climate.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_croplandsystem.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_crops.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_crops.csv new file mode 100644 index 0000000..cffa162 --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_crops.csv @@ -0,0 +1,12 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Banana,16.07,23.33,0.015,0.014,0.6,0.5,1.1,1,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Brachiaria hybrid,14.38,10.21,0.022,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Desmodium,12.24,5.67,0.025,0,0.15,0.4,1.15,0.55,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Groundnut,0.56,2.65,0.01,0.013,0.15,0,1.05,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Guatemala,3.43,0,0.01408,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Lablab,12,0.89,0.037,0,0.15,0.4,1.15,0.55,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Maize,1.3,3.58,0.013,0.006,0.1,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Natural pasture,12.75,2.39,0.01,0,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Pennisetum purpureum,11.26,7.07,0.014,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Rhodes,14.07,14.22,0.0142,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_feeditem.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_feeditem.csv new file mode 100644 index 0000000..1718cc5 --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_feeditem.csv @@ -0,0 +1,12 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,1,Banana (Musa acuminata)-crop residue,9,8.66,9.5 +2,2,Brachiaria hybrid (forage),94.08,7.24,9.44 +3,10,Concentrate (commercial),90,12.1,16 +4,3,Greenleaf desmodium (Desmodium intortum) - forage,93.45,6.83,12.5 +5,4,Groundnut (Arachis hypogaea) - crop residue,89.83,8.4,14.5 +6,5,Guatemala (Tripsacum andersonii) - forage,94.05,7.1,11.32 +7,6,Lablab (Lablab purpureus) - forage,93.35,7.28,13.24 +8,7,Maize (Zea mays) - stover,87,6.9,3.9 +9,8,Naturally occuring pasture - green fodder,29.65,6.17,6.1 +10,9,Pennisetum purpureum - forage,94.13,6.63,7.78 +11,11,Rhodes grass (Chloris gayana) - forage,93.97,6.65,8.01 diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_grassinputlevel.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_grasslandman.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_landcover.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_livetype.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_livetype.csv new file mode 100644 index 0000000..ebe61e8 --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),381,0,0,600,0,0,0,0,0.38,12.21,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),290,0,0,600,0,0,0,0,0.29,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_manureman.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_organicmatter.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_orgfertilizer.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_region.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_slope.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_soil.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_soil.csv new file mode 100644 index 0000000..83b0431 --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_soil.csv @@ -0,0 +1,10 @@ +soil_code,soil_desc,k_value +andosol,Andosol,0.15 +cambisol,Cambisol,0.2 +lixisol,Lixisol,0.25 +fluvisol,Fluvisol,0.3 +vertisol,Vertisol,0.15 +phaeozem,Phaeozem,0.2 +nitosol,Nitosol,0.25 +xerosol,Xerosol,0.3 +acrisol,Acrisol,0.25 diff --git a/data/primary_database/Southern Highland Tanzania Dairy/lkp_tillageregime.csv b/data/primary_database/Southern Highland Tanzania Dairy/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Southern Highland Tanzania Dairy/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Tunisia - National livestock general/lkp_climate.csv b/data/primary_database/Tunisia - National livestock general/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_database/Tunisia - National livestock general/lkp_croplandsystem.csv b/data/primary_database/Tunisia - National livestock general/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Tunisia - National livestock general/lkp_crops.csv b/data/primary_database/Tunisia - National livestock general/lkp_crops.csv new file mode 100644 index 0000000..b852b1b --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_crops.csv @@ -0,0 +1,37 @@ +crop_code ,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Avena sativa,0.352,2.64,0.0176,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Avena sativa-fourrage,4,0,0.016,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Beta vulgaris,10.45,2.75,0.0125,0.0125,0.15,0.72,1.04,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Brachiaria hybrid,13.76438356,0,0.0224,0.02,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Cactus,10,1.5,0.02,0.01,0.15,0.15,1.15,0.5,shrub legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Colza,3.1045,2.4836,0.064,0,0.15,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Feed carrot,9,7,0.01,0.01,0.15,0.72,1.04,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Fustuca arundinacea,12.6,0,0.014,0.01,0.15,0.3,0.75,0.75,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Glycine max IP,3.1045,2.4836,0.064,0,0.15,0.15,1.15,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Hedysarum coronarium,5,0,0.032,0,0.15,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Hordeum vulgare-forage,6.8,0,0.0072,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Hordeum vulgare-grain IP,4.35,1.584,0.01888,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Hordeum vulgare-grain OFC,1.7,1.584,0.01888,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +14,Lolium multiflorum,10,0,0.012,0,0.15,0.3,0.75,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +15,Medicago sativa,10,0,0.032,0,0.15,0.15,1.1,0,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +16,Olive,0,0,0.005,0.01,0.05,0.3,0.75,0.75,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +17,Panicum maximum,17.01917808,0,0.0192,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +18,Pâturage naturel,10,0,0.01,0,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +19,Pâturage naturel OF,10,0,0.01,0,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +20,Pennisetum purpureum,6,0,0.023,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +21,Pennisetum purpureum-silage,6,0,0.01,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +22,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +23,Sorghum bicolor-forage/silage,13.5,0,0.006,0,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +24,Sorghum bicolor-grain,3.999,8.7892,0.02,0.01,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +25,Stipa tenacissima,1.74,0,0.01,0,0.01,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +26,Tomato,23,2.75,0.0125,0.0125,0.15,0.72,1.04,0.7,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +27,Trifolium alexandrinum,4.95,0,0.0416,0,0.15,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +28,Triticum,1.566,2.002,0.0202,0.01,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +29,Triticum IP,2,0.4,0.0202,0.03,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +30,Triticum OF,2,0.4,0.0202,0.03,0.15,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +31,Vicia faba-grain,1.74,1.8,0.046,0.01,0.15,0.15,1.1,0.25,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +32,Vigna unguiculata,0.85405,2.967413131,0.038,0.02,0.15,0.15,1.05,0.6,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +33,Zea mays,8.6,3,0.017,0.01,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +34,Zea mays IP,8.6,3,0.017,0.01,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +35,Zea mays-forage,1.064,1.344259298,0.017,0,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +36,Zea mays-silage,18,0,0.007,0,0.15,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Tunisia - National livestock general/lkp_feeditem.csv b/data/primary_database/Tunisia - National livestock general/lkp_feeditem.csv new file mode 100644 index 0000000..50eb0ff --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_feeditem.csv @@ -0,0 +1,61 @@ +feed_item_code,crop_code ,feed_item_name,dm_content,me_content,cp_content +1,11,Barley (forage),34,8.2,8.71 +2,12,Barley (grains) IP,87.1,10.5,11.7 +3,13,Barley (grains) OFC,87.1,10.5,11.7 +4,13,Barley (straw),87,5.88,0.3 +5,27,Berseem clover,11,12.39,26 +6,4,Brachiaria hybrid (forage),26,7.254794521,8.254794521 +7,13,Brewer's grain,20,11,20 +8,13,Brewer's waste,20,11,20 +9,5,Cactus,15,9,7 +10,22,Concentrate (commercial),90,12.1,16 +11,32,Cowpea (Vigna unguiculata) - crop residue,90,9.880848,18.4 +12,32,Cowpea (Vigna unguiculata) - forage,12.28,10.45,20.56 +13,32,Cowpea (Vigna unguiculata) - grain,89.83,13.21,23.88 +14,32,Cowpea (Vigna unguiculata) - meal,90.17,14,22.53 +15,31,Fava bean (grain),86.6,13.3,29 +16,31,Fava bean (straw),89.7,6.4,7.4 +17,7,Feed carrot,15,13,8 +18,14,Italian ryegrass (forage),19,8.7,7 +19,14,Italian ryegrass (hay),85,8.36,6.01 +20,14,Italian ryegrass (silage),33.5,9.07,5.3 +21,15,Lucerne (Medicago sativa) - forage,21,8.7,17.16 +22,15,Lucerne (Medicago sativa) - hay,85,8.36,12.5 +23,15,Lucerne (Medicago sativa) - pellets IP,90,8.6,14 +24,15,Lucerne (Medicago sativa) - pellets OFC,90,8.6,14 +25,15,Lucerne (Medicago sativa) - silage,44.1,9.545904,19.5 +26,34,Maize (Zea mays) - cracked grains IP,89,10.5,9.1 +27,35,Maize (Zea mays) - forage,82,10.215792,8.9 +28,36,Maize (Zea mays) - silage,30,10.79,4.4 +29,33,Maize (Zea mays) - stover,87,9.127224,5.9 +30,33,Maize (Zea mays) - whole grain,90,15,9 +31,18,Naturally occuring pasture - grazing,60,5,6 +32,19,Naturally occuring pasture - grazing OF,60,5,6 +33,1,Oats (Avena sativa) - grain IP,89,12.267324,13.6 +34,2,Oats (Avena sativa) - green fodder,31,7.4,5.85 +35,2,Oats (Avena sativa) - green fodder,44,7.4,5.85 +36,2,Oats (Avena sativa) - hay,85,6.9,3.51 +37,2,Oats (Avena sativa) - hay OF,85,6.9,3.51 +38,1,Oats (Avena sativa) - straw,88,6.47,0 +39,16,Olive pomace,89,8,7 +40,16,Olive twigs,40,5,7 +41,17,Panicum maximum (forage),26,7.543013699,9.882191781 +42,17,Panicum maximum (green fodder),26,7.58,10 +43,20,Pennisetum purpureum - forage,15,9.880848,11 +44,21,Pennisetum purpureum - silage,19.5,7.5,6.5 +45,6,Rapeseed meal,87,10,30 +46,24,Sorghum (Sorghum bicolor) - crop residue,85,7.033824,4.9 +47,23,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 +48,24,Sorghum (Sorghum bicolor) - grain,90,12.392928,12.6 +49,23,Sorghum (Sorghum bicolor) - silage,30,8.57,3.7 +50,9,Soybean (Glycine max) - meal,89,10.5,59.54 +51,9,Soybean (Glycine max) - whole seed IP,86.4,14.23512,40.3 +52,25,Stipa (grazing) OF,72,5.6,5 +53,3,Sugar beet (pulp) OF,89,11.4,8.9 +54,10,Sulla,12.3,9.7,20.2 +55,8,Tall fescue,21,9.11,8.9 +56,26,Tomato pulp,20,11,20 +57,29,Wheat (bran) IP,87,10,15.47 +58,30,Wheat (bran) OF,87,10,15.47 +59,28,Wheat (straw),88,5.63,4.2 +60,28,Wheat (straw),88,5.63,4.2 diff --git a/data/primary_database/Tunisia - National livestock general/lkp_grassinputlevel.csv b/data/primary_database/Tunisia - National livestock general/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Tunisia - National livestock general/lkp_grasslandman.csv b/data/primary_database/Tunisia - National livestock general/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Tunisia - National livestock general/lkp_landcover.csv b/data/primary_database/Tunisia - National livestock general/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/Tunisia - National livestock general/lkp_livetype.csv b/data/primary_database/Tunisia - National livestock general/lkp_livetype.csv new file mode 100644 index 0000000..817335c --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,0,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,0,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,0,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,0,10,30,53,0,60,0,0,0.11,8.37,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,0,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,0,10,30,53,0,60,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,0,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,0,10,30,53,0,60,0,0,0.11,8.37,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,0,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,0,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,0,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,0,0,0,200,0,21,60,0.2,0.03,0.33,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,0,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,0,0,0,200,0,0,0,0,0.01,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Tunisia - National livestock general/lkp_manureman.csv b/data/primary_database/Tunisia - National livestock general/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Tunisia - National livestock general/lkp_organicmatter.csv b/data/primary_database/Tunisia - National livestock general/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Tunisia - National livestock general/lkp_orgfertilizer.csv b/data/primary_database/Tunisia - National livestock general/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Tunisia - National livestock general/lkp_region.csv b/data/primary_database/Tunisia - National livestock general/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Tunisia - National livestock general/lkp_slope.csv b/data/primary_database/Tunisia - National livestock general/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Tunisia - National livestock general/lkp_soil.csv b/data/primary_database/Tunisia - National livestock general/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/primary_database/Tunisia - National livestock general/lkp_tillageregime.csv b/data/primary_database/Tunisia - National livestock general/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Tunisia - National livestock general/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_climate.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_croplandsystem.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_crops.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_crops.csv new file mode 100644 index 0000000..f197cd0 --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_crops.csv @@ -0,0 +1,9 @@ +crop_code ,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Cotton,3,5,0.05,0.01,0,0.15,1.15,0.5,tree crop,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Natural pasture,2.6,0.11,0.01,0.01,0.03,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Rice,1.6,8.29,0.01,0.01,0,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Rice (bran),1.6,0,0.01,0.02,0,1.05,1.2,0.75,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Sorghum bicolor (forage/silage),13.5,0,0.01,0,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Sugarcane,11,0,0,0,0.17,0.15,1.2,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Triticum,3.48,4.89,0.02,0.01,0,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Triticum OF,3.48,0.4,0.02,0.02,0.03,0.1,1.1,0.55,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_feeditem.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_feeditem.csv new file mode 100644 index 0000000..be33cf3 --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_feeditem.csv @@ -0,0 +1,10 @@ +feed_item_code,crop_code ,feed_item_name,dm_content,me_content,cp_content +1,1,Cotton seed cake OFC,91,13.2,30 +2,1,Cotton straw OFR,76,5.1,6.4 +3,2,Naturally occuring pasture - grazing OFR,60,5,6 +4,4,Rice (Oryza sativa) - bran (with germs) OFC,91,10.43,14 +5,3,Rice (Oryza sativa) - straw,91.88,5.64,3.85 +6,5,Sorghum (Sorghum bicolor) - forage,27,8.57,3.7 +7,6,Sugarcane (Saccharum officinarum) - crop residue OFR,96.27,7.44,3.69 +8,8,Wheat (bran) OFC,87,11,17.3 +9,7,Wheat (straw) OFR,88,5.63,4.2 diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_grassinputlevel.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_grasslandman.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_landcover.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_livetype.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_livetype.csv new file mode 100644 index 0000000..3119ffe --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),600,0,0,600,0,0,0,0,0.6,12.21,0.09,0,1.166666667,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.52,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,450,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,270,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,110,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,53,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,30,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,20,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,15,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,200,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,200,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,80,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_manureman.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_organicmatter.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_orgfertilizer.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_region.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_slope.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_soil.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_soil.csv new file mode 100644 index 0000000..6e11d35 --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_soil.csv @@ -0,0 +1,9 @@ +"soil_code","soil_desc","k_value" +"andosol","Andosol",0.15 +"cambisol","Cambisol",0.2 +"lixisol","Lixisol",0.25 +"fluvisol","Fluvisol",0.3 +"vertisol","Vertisol",0.15 +"phaeozem","Phaeozem",0.2 +"nitosol","Nitosol",0.25 +"xerosol","Xerosol",0.3 diff --git a/data/primary_database/Uzbekistan - Mixed livestock/lkp_tillageregime.csv b/data/primary_database/Uzbekistan - Mixed livestock/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Uzbekistan - Mixed livestock/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/data/primary_database/Western Kenya - Dairy/lkp_climate.csv b/data/primary_database/Western Kenya - Dairy/lkp_climate.csv new file mode 100644 index 0000000..f86f7e1 --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_climate.csv @@ -0,0 +1,7 @@ +"climate_code","climate_desc" +"Warm Temperate Moist","Warm Temperate Moist" +"Warm Temperate Dry","Warm Temperate Dry" +"Tropical Montane","Tropical Montane" +"Tropical Moist","Tropical Moist" +"Tropical Dry","Tropical Dry" +"Tropical Wet","Tropical Wet" diff --git a/data/primary_database/Western Kenya - Dairy/lkp_croplandsystem.csv b/data/primary_database/Western Kenya - Dairy/lkp_croplandsystem.csv new file mode 100644 index 0000000..2215cef --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_croplandsystem.csv @@ -0,0 +1,11 @@ +"sys_code","sys_desc","change_factor" +"1","Long term cultivated, temperate/boreal, dry",0.8 +"2","Long term cultivated, temperate/boreal, moist",0.69 +"3","Long term cultivated, tropical, dry",0.58 +"4","Long term cultivated, tropical, moist/wet",0.48 +"5","Long term cultivated, tropical montane, all",0.64 +"6","Paddy rice",1.1 +"7","Perennial/tree crop",1 +"8","Set aside (< 20 years), temperate/boreal and tropical, dry",0.93 +"9","Set aside (< 20 years), temperate/boreal and tropical, moist/wet",0.82 +"10","Set aside (< 20 years),tropical montane, all",0.88 diff --git a/data/primary_database/Western Kenya - Dairy/lkp_crops.csv b/data/primary_database/Western Kenya - Dairy/lkp_crops.csv new file mode 100644 index 0000000..1c308a0 --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_crops.csv @@ -0,0 +1,14 @@ +crop_code,crop_name,dry_yield,residue_dry_yield,main_n,residue_n,c_factor,kc_initial,kc_midseason,kc_late,category,trees_ha,trees_dhb,trees_growth,trees_removal,trees_ha_dbh25,average_dbh25,increase_dbh25,trees_ha_dbh2550,average_dbh2550,increase_dbh2550,trees_ha_dbh50,average_dbh50,increase_dbh50,time_horizon,diameter_breast +1,Beans,0.79,2.64,0.041,0.03,0.1,0.35,1.1,0.9,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2,Brachiaria hybrid,9.5,0,0.022,0,0.01,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +3,Calliandra,8,2.5,0.035,0.015,0.45,0.3,0.6,0.9,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +4,Green leaf desmodium,4,0.05,0.041,0.025,0.1,0.4,1.05,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +5,Leucaena,7,7,0.034,0.034,0.05,1.05,1.2,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +6,Local mixed grasses,3.25,0.06,0.014,0.014,0.1,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +7,Maize,1.06,2.69,0.017,0.007,0.05,0.15,1.15,0.3,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +8,Pennisetum purpureum,6.3,3.31,0.023,0.023,0.027,0.6,1.1,1.05,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +9,Purchased,0,0,0,0,0,0,0,0,cereal,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +10,Sesbania,6,4.5,0.035,0.02,0.47,0.45,0.95,0.75,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +11,Sugarcane,3.46,1.38,0.001,0.001,0.171,0.15,1.2,0.7,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +12,Sweet potato,1.93,1.58,0.005,0.002,0.05,0.3,0.75,0.75,grass,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +13,Wild desmodium,6,5.67,0.025,0,0.15,0.4,1.05,0.8,legume,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/primary_database/Western Kenya - Dairy/lkp_feeditem.csv b/data/primary_database/Western Kenya - Dairy/lkp_feeditem.csv new file mode 100644 index 0000000..c88b47f --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_feeditem.csv @@ -0,0 +1,16 @@ +feed_item_code,crop_code,feed_item_name,dm_content,me_content,cp_content +1,2,Brachiaria hybrid (forage),26,7,9 +2,3,Calliandra calothyrsus - green leaf material,39,7.68,22 +3,1,Common Beans (Phaseolus vulgaris) - vines,90,8.33,7.62 +4,9,Dairy meal,90,10.5,16 +5,4,Desmodium ( Desmodium intortum ) green leaf,24.2,8.2,15.5 +6,13,Desmodium (wild desmodium),19.36,6.56,12.4 +7,5,Leucaena (Leucaena leucocephala) - green fodder,26.2,9.5,19.93 +8,6,Local mixed grasses (couch/star grass) - green fodder,30.2,10,8.8 +9,7,Maize (Zea mays) - green fodder,82,10.22,8.9 +10,7,Maize (Zea mays) -BOUGHT stover,87,9.13,5.9 +11,8,Napier grass (Pennisetum purpureum) - green fodder,15,9.88,11 +12,10,Sesbania (Sesbania sesban) - green fodder,28.9,8.54,21.3 +13,11,Sugarcane (Saccharum officinarum) - BOUGHT,29,6.9,5.9 +14,11,Sugarcane (Saccharum officinarum) - tops (green fodder),29,6.9,5.9 +15,12,Sweet potato (Ipomoea batatas) - vines,10.8,10.01,19.4 diff --git a/data/primary_database/Western Kenya - Dairy/lkp_grassinputlevel.csv b/data/primary_database/Western Kenya - Dairy/lkp_grassinputlevel.csv new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_grassinputlevel.csv @@ -0,0 +1,4 @@ +"grassinputlevel_code","grassinputlevel_desc","change_factor" +"1","Medium",1 +"2","High",1.11 +"3","None",1 diff --git a/data/primary_database/Western Kenya - Dairy/lkp_grasslandman.csv b/data/primary_database/Western Kenya - Dairy/lkp_grasslandman.csv new file mode 100644 index 0000000..63f1ccb --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_grasslandman.csv @@ -0,0 +1,9 @@ +"management_code","management_desc","change_factor" +"1","Nominally managed",1 +"2","Moderately degraded grassland, temperate/boreal",0.95 +"3","Moderately degraded grassland, tropical",0.97 +"4","Moderately degraded grassland, tropical montane",0.96 +"5","Severely degraded",0.7 +"6","Improved grassland, temperate/boreal",1.14 +"7","Improved grassland, tropical",1.17 +"8","Improved grassland, tropical montane",1.16 diff --git a/data/primary_database/Western Kenya - Dairy/lkp_landcover.csv b/data/primary_database/Western Kenya - Dairy/lkp_landcover.csv new file mode 100644 index 0000000..4880a92 --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_landcover.csv @@ -0,0 +1,15 @@ +"landcover_code","landcover_desc","c_factor" +"1","Dense forest",0.001 +"2","Other forest",0.05 +"3","Badlands hard",0.05 +"4","Badlands soft",0.4 +"5","Sorghum",0.1 +"6","Maize",0.1 +"7","Cereals",0.15 +"8","Pulses",0.15 +"9","Dense grass",0.01 +"10","Degraded grass",0.05 +"11","Fallow hard",0.05 +"12","Fallow plouged",0.6 +"13","Ethiopian teff",0.25 +"14","Continuous fallow",1 diff --git a/data/primary_database/Western Kenya - Dairy/lkp_livetype.csv b/data/primary_database/Western Kenya - Dairy/lkp_livetype.csv new file mode 100644 index 0000000..efbae20 --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_livetype.csv @@ -0,0 +1,23 @@ +livetype_code,livetype_desc,body_weight,body_weight_weaning,body_weight_year_one,adult_weight,litter_size,lactation_length,proportion_growth_piglets_milk,lw_gain_piglets,cp_maintenance,cp_lys_pregnancy,cp_lactmilk,cp_lys_growth,birth_interval,protein_milkcontent,fat_milkcontent,energy_milkcontent,energy_meatcontent,protein_meatcontent,carcass_fraction,n_manure_content,meat_product,milk_product,ipcc_meth_ef_t1,ipcc_meth_ef_t2,ipcc_meth_man,ipcc_meth_exc +1,Cattle - Cows (local),350,0,0,350,0,0,0,0,0.35,9.64,0.09,0,1.5,3.2,5.8,970,2200,26,0,0.029,beef,cow milk,Other mature female,Dairy cows,Dairy cows,Dairy cattle +2,Cattle - Cows (improved),410,0,0,600,0,305,0,0,0.5,15,0.09,0,1.2,3.7,4.3,970,2200,26,0.48,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +3,Cattle - Cows (high productive),600,0,0,600,0,0,0,0,0.6,15,0.09,0,1.166666667,3.7,4,970,2200,26,0.45,0.029,beef,cow milk,Dairy cattle,Dairy cows,Dairy cows,Dairy cattle +4,Cattle - Adult male,580,0,0,580,0,0,0,0,0.58,0,0,0,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other draft bull,Non-dairy,Other cattle,Other cattle +5,Cattle - Steers/heifers,200,0,0,350,0,0,0,0,0.2,0,0,0.4,0,0,0,0,2200,26,0.48,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +6,Cattle - Steers/heifers (improved),300,0,0,600,0,0,0,0,0.3,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other mature female-grazing,Non-dairy,Other cattle,Other cattle +7,Cattle - Calves,90,0,0,350,0,0,0,0,0.09,0,0,0.4,0,0,0,0,2200,26,0.49,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +8,Cattle - Calves (improved),90,0,0,600,0,0,0,0,0.14,0,0,0.4,0,0,0,0,2200,26,0.51,0.029,beef,cow milk,Other young,Non-dairy,Other cattle,Other cattle +9,Buffalo - Cows,0,0,0,450,0,0,0,0,0.45,9.64,0.09,0,1.2,3.7,4.3,970,2200,26,0,0.029,buffalo,buffalo milk,Other mature female-grazing,Dairy cows,Dairy cows,Dairy cattle +10,Buffalo - Steers/heifers,0,0,0,450,0,0,0,0,0.27,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +11,Buffalo - Calves,0,0,0,450,0,0,0,0,0.11,0,0,0.4,0,0,0,0,2200,26,0.58,0.029,buffalo,buffalo milk,Other young,Non-dairy,Other cattle,Other cattle +12,Sheep - Ewes,0,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +13,Sheep - Breeding Rams,0,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +14,Sheep - Fattening Rams,0,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +15,Sheep - Lambs,0,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,mutton,sheep milk,Goats,Sheep,Sheep,Sheep +16,Goats - Does,0,10,30,53,0,60,0,0,0.106,8.374,0.09,0,1,3.2,5.8,970,2200,25,0.5,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +17,Goats - Breeding Bucks,0,10,30,53,0,0,0,0,0.06,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +18,Goats - Fattening Bucks,0,10,30,53,0,0,0,0,0.04,0,0,0.45,0,0,0,0,0,0,0,0.027,goat,goat milk,Goats,Goats,Sheep,Sheep +19,Goats - Kids,0,10,30,53,0,0,0,0,0.03,0,0,0.45,0,3.2,5.8,970,2200,25,0.5,0.029,goat,goat milk,Goats,Goats,Sheep,Sheep +20,Pigs - lactating/pregnant sows,0,0,0,200,10,21,60,0.2,0.029782457,0.33396,0,0,0.5,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +21,Pigs - dry sows/boars,0,0,0,200,0,0,0,0,0.029782457,0,0,0,0,0,0,0,2580,21,0,0.04,pork,N/A,Pigs,N/A,Swine,Pigs +22,Pigs - growers,0,0,0,200,0,0,0,0,0.014979783,0,0,0.05,0,0,0,0,2580,21,0.6,0.04,pork,N/A,Pigs,N/A,Swine,Pigs diff --git a/data/primary_database/Western Kenya - Dairy/lkp_manureman.csv b/data/primary_database/Western Kenya - Dairy/lkp_manureman.csv new file mode 100644 index 0000000..ed85d2c --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_manureman.csv @@ -0,0 +1,36 @@ +"manureman_code","manureman_desc" +"pasture","Pasture / range / paddock" +"storage","Solid storage" +"drylot","Dry lot" +"Uncovered anaerobic lagoon +","Uncovered anaerobic lagoon" +"Liquid/Slurry Pit below animals 1 Month +","Liquid/Slurry Pit below animals 1 Month" +"Liquid/Slurry Pit below animals 3 Month","Liquid/Slurry Pit below animals 3 Month" +"Liquid/Slurry Pit below animals 4 Month","Liquid/Slurry Pit below animals 4 Month" +"Liquid/Slurry Pit below animals 6 Month +","Liquid/Slurry Pit below animals 6 Month" +"Liquid/Slurry Pit below animals 12 Month","Liquid/Slurry Pit below animals 12 Month" +"Cattle and swine deep bedding < 1 month","Cattle and swine deep bedding < 1 month" +"Cattle and swine deep bedding > 1 month +","Cattle and swine deep bedding > 1 month" +"Solid storage","Solid storage" +"Solid storage - Covered/compacted +","Solid storage - Covered/compacted" +"Solid storage - Bulking agent addition","Solid storage - Bulking agent addition" +"Solid storage - Additives","Solid storage - Additives" +"Daily spread","Daily spread" +"Composting - In-vessel","Composting - In-vessel" +"Composting - Static pile (forced aeration)","Composting - Static pile (forced aeration)" +"Composting - Intensive windrow","Composting - Intensive windrow" +"Composting - Unfrequent turning","Composting - Unfrequent turning" +"Pasture/Range/Paddock","Pasture/Range/Paddock" +"Poultry manure with and without litter","Poultry manure with and without litter" +"Aerobic treatment","Aerobic treatment" +"Burned for fuel","Burned for fuel" +"Anaer digester, Low leak, HQ stor, HQ tec.","Anaer digester, Low leak, HQ stor, HQ tec." +"Anaer digester, Low leak, HQ stor, LQ tec","Anaer digester, Low leak, HQ stor, LQ tec" +"Anaer digester, Low leak, open stor, HQ tec","Anaer digester, Low leak, open stor, HQ tec" +"Anaer digester, High leak, open stor, HQ tec","Anaer digester, High leak, open stor, HQ tec" +"Anaer digester, High leak, LQ stor, LQ tec","Anaer digester, High leak, LQ stor, LQ tec" +"Anaer digester, High leak, open stor, LQ tec","Anaer digester, High leak, open stor, LQ tec" diff --git a/data/primary_database/Western Kenya - Dairy/lkp_organicmatter.csv b/data/primary_database/Western Kenya - Dairy/lkp_organicmatter.csv new file mode 100644 index 0000000..821daab --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_organicmatter.csv @@ -0,0 +1,13 @@ +"orgmatter_code","orgmatter_desc","change_factor" +"1","Low, temperate/boreal, dry",0.95 +"2","Low, temperate/boreal, moist",0.92 +"3","Low, tropical, dry",0.95 +"4","Low, tropical, moist",0.92 +"5","Low, tropical montane, all",0.94 +"6","Medium, all",1 +"7","High w/OUT manure, temperate/boral and tropical, dry",1.04 +"8","High w/OUT manure, temperate/boral and tropical, moist/wet",1.11 +"9","High w/OUT manure, tropical montane",1.08 +"10","High with manure, temperate/boral and tropical, dry",1.37 +"11","High with manure, temperate/boral and tropical, moist/wet",1.44 +"12","High with manure, tropical montane",1.41 diff --git a/data/primary_database/Western Kenya - Dairy/lkp_orgfertilizer.csv b/data/primary_database/Western Kenya - Dairy/lkp_orgfertilizer.csv new file mode 100644 index 0000000..2b46441 --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_orgfertilizer.csv @@ -0,0 +1,8 @@ +fertilizer_code,fertilizer_desc +1,Urea +3,DAP +2,NPK +4,Ammonium nitrate +5,Ammonium sulfate +6,N solutions +7,Ammonia diff --git a/data/primary_database/Western Kenya - Dairy/lkp_region.csv b/data/primary_database/Western Kenya - Dairy/lkp_region.csv new file mode 100644 index 0000000..f5cf325 --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_region.csv @@ -0,0 +1,4 @@ +"region_code","region_desc" +"AFRICA","AFRICA" +"LATIN","LATIN AMERICA" +"ASIA","ASIA" diff --git a/data/primary_database/Western Kenya - Dairy/lkp_slope.csv b/data/primary_database/Western Kenya - Dairy/lkp_slope.csv new file mode 100644 index 0000000..129d951 --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_slope.csv @@ -0,0 +1,6 @@ +"slope_code","slope_desc","p_factor" +"1","Flat (0-5%)",0.11 +"2","Hilly (5-20%)",0.13 +"3","Steep (20-30%)",0.22 +"4","Extremely steep (30%+)",0.37 +"5","Non-agricultural (all slope categories)",1 diff --git a/data/primary_database/Western Kenya - Dairy/lkp_soil.csv b/data/primary_database/Western Kenya - Dairy/lkp_soil.csv new file mode 100644 index 0000000..7d62abc --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_soil.csv @@ -0,0 +1,9 @@ +soil_code,soil_desc,k_value +andosol,Andosol,0.15 +cambisol,Cambisol,0.2 +lixisol,Lixisol,0.25 +fluvisol,Fluvisol,0.3 +vertisol,Vertisol,0.15 +phaeozem,Phaeozem,0.2 +nitosol,Nitosol,0.25 +xerosol,Xerosol,0.3 diff --git a/data/primary_database/Western Kenya - Dairy/lkp_tillageregime.csv b/data/primary_database/Western Kenya - Dairy/lkp_tillageregime.csv new file mode 100644 index 0000000..7558d01 --- /dev/null +++ b/data/primary_database/Western Kenya - Dairy/lkp_tillageregime.csv @@ -0,0 +1,12 @@ +"tillage_code","tillage_desc","change_factor" +"1","Full",1 +"2","Reduced, temperate/boreal, dry",1.02 +"3","Reduced, temperate/boreal, moist",1.08 +"4","Reduced, tropical, dry",1.09 +"5","Reduced, tropical, moist",1.15 +"6","Reduced, tropical montane, all",1.09 +"7","No-till, temperate/boreal, dry",1.1 +"8","No-till, temperate/boreal, moist",1.15 +"9","No-till, tropical, dry",1.17 +"10","No-till, tropical, moist/wet",1.22 +"11","No-till, tropical montane, all",1.16 diff --git a/global.R b/global.R index a821ddf..0571aa3 100644 --- a/global.R +++ b/global.R @@ -39,6 +39,12 @@ Sys.setlocale("LC_TIME", "C") # Set to C locale for English # Ideally, user {renv} package to manage the package versions +# Names of default (read-only) parameters databases - subfolders of data/primary_database. +# Users can only clone these, not edit or delete them. +primary_database_names <- function() { + list.files(file.path("data", "primary_database"), full.names = FALSE) +} + # List of all parameter tables parameters_db_names <- c( "lkp_climate", "lkp_climate2", "lkp_croplandsystem", "lkp_feeditem", diff --git a/server.R b/server.R index 23952ca..2cca2b5 100644 --- a/server.R +++ b/server.R @@ -155,7 +155,10 @@ server <- function(input, output, session) { # Helps to manage the reactivity from update params to scenario inputs # only used database should update the scenario inputs - session$userData$parameters_db_name <- reactiveVal("Params DB - Default") + user_dbs <- list.files(file.path(user_folder, "parameters_database"), full.names = FALSE) + session$userData$parameters_db_name <- reactiveVal( + if (length(user_dbs) > 0) sort(user_dbs)[1] else character(0) + ) # Helps to trigger the update_params_modal from other modules session$userData$observe_update_params_button_click <- reactiveVal(0) @@ -187,101 +190,8 @@ server <- function(input, output, session) { # ------ ONBOARDING Questions ------------------------------------------------ observeEvent(input$ok_onboarding, { - - cat(file = stderr(), "Submitting onboarding responses...\n") - - # Load onboarding questions from the YAML configuration file - onboarding_questions <- yaml::read_yaml("onboarding_questions.yaml") - - # Capture new user responses from the form inputs - user_responses <- sapply(onboarding_questions$questions, function(question) { - input[[question$id]] - }) - - # Retrieve the current user's email from the session data - user_email <- session$userData$auth0_info$name - - # Extract the current question texts (to be used as column names) - question_texts <- sapply(onboarding_questions$questions, function(question) { - question$question - }) - - # Create a new data frame with the user's email and their responses - response_data <- data.frame( - Email = user_email, - t(user_responses), # Transpose the responses to align as columns - stringsAsFactors = FALSE - ) - - # Set the column names: "Email" followed by the actual question texts - colnames(response_data) <- c("Email", question_texts) - - # Define the file path for storing the onboarding responses - onboarding_file_path <- file.path( - Sys.getenv("DATA_DIR"), "Onboarding", "onboarding.csv" - ) - - # Check if the onboarding CSV file already exists - if (file.exists(onboarding_file_path)) { - - # Read the existing data, preserving special characters in the column names - existing_data <- read.csv( - onboarding_file_path, stringsAsFactors = FALSE, check.names = FALSE - ) - - # Extract the existing question column names (excluding the "Email" column) - existing_question_texts <- colnames(existing_data)[-1] # Remove "Email" - - # If the question texts have changed, rename the old file and start fresh - if (!identical(existing_question_texts, question_texts)) { - timestamp <- format(Sys.time(), "%Y-%m-%d_%H-%M-%S") - file.rename( - onboarding_file_path, - file.path( - Sys.getenv("DATA_DIR"), - "Onboarding", - paste0("onboarding_", timestamp, ".csv") - ) - ) - - # Initialize a new data set with the user's responses - updated_data <- response_data - } else { - # If the question texts match, append the new responses to the existing data - updated_data <- rbind(existing_data, response_data) - } - } else { - # If the CSV file doesn't exist, create a new one with the user's responses - updated_data <- response_data - } - - # Save the updated data to the onboarding CSV file - write.csv(updated_data, onboarding_file_path, row.names = FALSE, quote = TRUE) - # Close the modal and show a success alert to the user removeModal() - - shinyWidgets::show_alert( - title = "Success", - text = "Thank you for answering the questions!", - type = "success", - btn_labels = "Get Started", - btn_class = "#009adb" - ) - # ask user consent for data interaction collection - if (!is.null(session$userData$auth0_info$name)) { - shinyWidgets::ask_confirmation( - inputId = "confirm_share_navigation_data", - type = "question", - title = paste( - "To help us improve this tool, may we collect your navigation data?", - "Your data will support ongoing enhancements." - ), - btn_colors = c("grey", "#009ADB"), - btn_labels = c("No", "Yes"), - width = "55%" - ) - } }) observeEvent(input$confirm_share_navigation_data, { From 0dbd9c1d0267a933327f76146918d2a229167ad1 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Mon, 16 Feb 2026 04:38:49 +0000 Subject: [PATCH 65/69] restore onboarding code logic --- server.R | 145 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 119 insertions(+), 26 deletions(-) diff --git a/server.R b/server.R index 2cca2b5..b470770 100644 --- a/server.R +++ b/server.R @@ -190,8 +190,101 @@ server <- function(input, output, session) { # ------ ONBOARDING Questions ------------------------------------------------ observeEvent(input$ok_onboarding, { + + cat(file = stderr(), "Submitting onboarding responses...\n") + + # Load onboarding questions from the YAML configuration file + onboarding_questions <- yaml::read_yaml("onboarding_questions.yaml") + + # Capture new user responses from the form inputs + user_responses <- sapply(onboarding_questions$questions, function(question) { + input[[question$id]] + }) + + # Retrieve the current user's email from the session data + user_email <- session$userData$auth0_info$name + + # Extract the current question texts (to be used as column names) + question_texts <- sapply(onboarding_questions$questions, function(question) { + question$question + }) + + # Create a new data frame with the user's email and their responses + response_data <- data.frame( + Email = user_email, + t(user_responses), # Transpose the responses to align as columns + stringsAsFactors = FALSE + ) + + # Set the column names: "Email" followed by the actual question texts + colnames(response_data) <- c("Email", question_texts) + + # Define the file path for storing the onboarding responses + onboarding_file_path <- file.path( + Sys.getenv("DATA_DIR"), "Onboarding", "onboarding.csv" + ) + + # Check if the onboarding CSV file already exists + if (file.exists(onboarding_file_path)) { + + # Read the existing data, preserving special characters in the column names + existing_data <- read.csv( + onboarding_file_path, stringsAsFactors = FALSE, check.names = FALSE + ) + + # Extract the existing question column names (excluding the "Email" column) + existing_question_texts <- colnames(existing_data)[-1] # Remove "Email" + + # If the question texts have changed, rename the old file and start fresh + if (!identical(existing_question_texts, question_texts)) { + timestamp <- format(Sys.time(), "%Y-%m-%d_%H-%M-%S") + file.rename( + onboarding_file_path, + file.path( + Sys.getenv("DATA_DIR"), + "Onboarding", + paste0("onboarding_", timestamp, ".csv") + ) + ) + + # Initialize a new data set with the user's responses + updated_data <- response_data + } else { + # If the question texts match, append the new responses to the existing data + updated_data <- rbind(existing_data, response_data) + } + } else { + # If the CSV file doesn't exist, create a new one with the user's responses + updated_data <- response_data + } + + # Save the updated data to the onboarding CSV file + write.csv(updated_data, onboarding_file_path, row.names = FALSE, quote = TRUE) + # Close the modal and show a success alert to the user removeModal() + + shinyWidgets::show_alert( + title = "Success", + text = "Thank you for answering the questions!", + type = "success", + btn_labels = "Get Started", + btn_class = "#009adb" + ) + # ask user consent for data interaction collection + if (!is.null(session$userData$auth0_info$name)) { + shinyWidgets::ask_confirmation( + inputId = "confirm_share_navigation_data", + type = "question", + title = paste( + "To help us improve this tool, may we collect your navigation data?", + "Your data will support ongoing enhancements." + ), + btn_colors = c("grey", "#009ADB"), + btn_labels = c("No", "Yes"), + width = "55%" + ) + } }) observeEvent(input$confirm_share_navigation_data, { @@ -217,56 +310,56 @@ server <- function(input, output, session) { # ------ Observe data browsing and show confirmation modal -------------------- # ------ Show confirmation modal when user selects data ----------------------- - + # Reactive values to store selected file paths selected_data_path <- reactiveVal(NULL) relative_path <- reactiveVal(NULL) - + # Browse and handle user data file selection observeEvent(input$browse_users_data, { cat(file = stderr(), "Cloning data confirmation modal\n") - + files <- shinyFiles::parseFilePaths(roots, input$browse_users_data) req(files$datapath) - + path <- files$datapath[[1]] selected_data_path(path) relative_path(str_remove(path, "^.*/Users/")) - - showModal( - modalDialog( - div( - paste0("Do you want to clone or download ", relative_path(), "?"), - style = "font-size: 25px; margin-bottom: 20px; text-align: center; word-wrap: break-word; overflow-wrap: break-word; max-width: 100%;" - ) - , - footer = tagList( - actionButton("confirm_clone_super_user", label = tagList(icon("copy"), "Clone"),, class = "btn-primary"), - downloadButton("download_super_user", "Download", class = "btn-primary"), - modalButton("Cancel") - ), - size = "s", - easyClose = TRUE + + showModal( + modalDialog( + div( + paste0("Do you want to clone or download ", relative_path(), "?"), + style = "font-size: 25px; margin-bottom: 20px; text-align: center; word-wrap: break-word; overflow-wrap: break-word; max-width: 100%;" ) + , + footer = tagList( + actionButton("confirm_clone_super_user", label = tagList(icon("copy"), "Clone"),, class = "btn-primary"), + downloadButton("download_super_user", "Download", class = "btn-primary"), + modalButton("Cancel") + ), + size = "s", + easyClose = TRUE ) + ) }) - + # Handle download of selected user data output$download_super_user <- downloadHandler( filename = function() { rp <- relative_path() safe_name <- gsub("/", "_", rp) paste(safe_name) - }, + }, content = function(file) { sp <- selected_data_path() rp <- relative_path() - + full_file_path <- file.path(roots["Users"], rp) success <- file.copy(full_file_path, file) - + removeModal() - + if (success) { showNotification("Data is ready for download!", duration = 3, type = "message") } else { @@ -280,11 +373,11 @@ server <- function(input, output, session) { removeModal() # Check if the user confirmed or cancelled the cloning if (input$confirm_clone_super_user) { - + # Get the selected file or directory path files <- shinyFiles::parseFilePaths(roots, input$browse_users_data) selected_path <- files$datapath - + # Check if the user is attempting to clone from their own folder if (grepl(session$userData$user_folder, selected_path)) { showNotification( From d03e0421ec5d494c0be8f5b77cc8fec5817163a0 Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Tue, 17 Feb 2026 20:54:20 +0000 Subject: [PATCH 66/69] Remove extra livestock colnames --- R/30_mod_scenario_init.R | 3 --- 1 file changed, 3 deletions(-) diff --git a/R/30_mod_scenario_init.R b/R/30_mod_scenario_init.R index 4952a1e..263b436 100644 --- a/R/30_mod_scenario_init.R +++ b/R/30_mod_scenario_init.R @@ -81,9 +81,7 @@ livestock_table_colnames <- c( "Lactation length (small ruminants/pigs, days)", "Proportion growth piglets covered by milk (%)", "LW gain piglets (kg/day)", - "Grazing displacement (km/day)", "Crude Protein/Lysine requirement maintenance (kg/day)", - "Crude Protein requirement grazing (kg/km)", "Crude Protein/ Lysine requirement pregnancy (kg)", "Crude Protein requirement (kg/kg milk)", "Crude Protein/ Lysine requirement growth (kg/kg LWG)", @@ -94,7 +92,6 @@ livestock_table_colnames <- c( "Energy content meat", "Protein content meat (%)", "Carcass fraction", - "Energy content eggs", "Average N content manure", "Meat product", "Milk product", From eb06cd48bac4fb3e572aa492ad6cef9c2f24feed Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Thu, 19 Feb 2026 02:52:19 +0000 Subject: [PATCH 67/69] remove extra comma --- server.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.R b/server.R index b470770..cadd3d2 100644 --- a/server.R +++ b/server.R @@ -334,7 +334,7 @@ server <- function(input, output, session) { ) , footer = tagList( - actionButton("confirm_clone_super_user", label = tagList(icon("copy"), "Clone"),, class = "btn-primary"), + actionButton("confirm_clone_super_user", label = tagList(icon("copy"), "Clone"), class = "btn-primary"), downloadButton("download_super_user", "Download", class = "btn-primary"), modalButton("Cancel") ), From 1380b6c6b45022bfaa6eb6d59b556165bcf565dd Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Thu, 19 Feb 2026 16:26:18 +0000 Subject: [PATCH 68/69] code improvements --- R/10_mod_board_simulation_server.R | 81 ++---- R/20_mod_board_comparison_server.R | 25 +- R/30_mod_scenario_server.R | 217 ++++----------- R/40_mod_params_db_server.R | 19 +- R/helpers_ui.R | 27 ++ R/scenario/32_scenario_seasons.R | 119 +++++++++ R/scenario/33_scenario_fertilizer.R | 149 +++++++++++ R/scenario/34_scenario_area.R | 42 +++ R/scenario/35_scenario_livestock.R | 393 ++++++++++++++++++++++++++++ 9 files changed, 826 insertions(+), 246 deletions(-) create mode 100644 R/helpers_ui.R create mode 100644 R/scenario/32_scenario_seasons.R create mode 100644 R/scenario/33_scenario_fertilizer.R create mode 100644 R/scenario/34_scenario_area.R create mode 100644 R/scenario/35_scenario_livestock.R diff --git a/R/10_mod_board_simulation_server.R b/R/10_mod_board_simulation_server.R index 82710aa..0781423 100644 --- a/R/10_mod_board_simulation_server.R +++ b/R/10_mod_board_simulation_server.R @@ -139,20 +139,19 @@ board_simulation_server <- function( observeEvent(list(input$run_scenario, input$scenario_name), { cat(file = stderr(), "10 - Display warning text\n") shinyjs::hide(selector = jns("warning_scenario_text")) + req(input$scenario_name) # according to the scenario data - if (!is.null(input$scenario_name)) { - warning_msg <- readRDS( + warning_msg <- readRDS( file.path( session$userData$user_folder, "scenarios", input$scenario_name, "scenario_data.rds" ) )$warning_msg - if (!is.null(warning_msg$warning_text)) { - shinyjs::show(id = "warning_scenario_text") - shinyjs::html( - id = "warning_scenario_text", html = warning_msg$warning_text - ) - } + if (!is.null(warning_msg$warning_text)) { + shinyjs::show(id = "warning_scenario_text") + shinyjs::html( + id = "warning_scenario_text", html = warning_msg$warning_text + ) } }, ignoreInit = FALSE) @@ -477,67 +476,46 @@ board_simulation_server <- function( ) }) - # ------ PLOT GHG emission --------------------------------------------------- - output$plot_ghg_emission <- renderGirafe({ - + # ------ Cached scenario data (read RDS once, shared by all 4 plots) ---------- + scenario_plot_data <- reactive({ req(input$scenario_name) req(session$userData$run_scenario_counter()) - cat(file = stderr(), "10 - Plot GHG emission\n") - - # Read the data - on_farm_table <- readRDS( + readRDS( file.path( session$userData$user_folder, "scenarios", - input$scenario_name, - "scenario_data.rds" + input$scenario_name, "scenario_data.rds" ) - )[["on_farm_table"]] - + ) + }) + + # ------ PLOT GHG emission --------------------------------------------------- + output$plot_ghg_emission <- renderGirafe({ + cat(file = stderr(), "10 - Plot GHG emission\n") + scenario_data <- scenario_plot_data() + on_farm_table <- scenario_data[["on_farm_table"]] unit <- graphs_desc[graphs_desc$indicator == "ghg_emission", ]$unit plot_ghg_emissions(on_farm_table, unit) }) # ------ PLOT N BALANCE ------------------------------------------------------ output$plot_n_balance <- renderGirafe({ - - req(input$scenario_name) - req(session$userData$run_scenario_counter()) cat(file = stderr(), "10 - Plot N Balance\n") - - # Read the data - nitrogen_balance <- readRDS( - file.path( - session$userData$user_folder, - "scenarios", - input$scenario_name, - "scenario_data.rds" - ) - )[["nitrogen_balance"]] - + scenario_data <- scenario_plot_data() + nitrogen_balance <- scenario_data[["nitrogen_balance"]] unit <- graphs_desc[graphs_desc$indicator == "n_balance", ]$unit plot_n_balance(nitrogen_balance, unit) }) # ------ PLOT LAND REQUIRED -------------------------------------------------- output$plot_land_req <- renderGirafe({ - - req(session$userData$run_scenario_counter()) - req(input$scenario_name) cat(file = stderr(), "10 - Plot Land Required\n") - # hide all the seasons legend items lapply(1:max_seasons, function(i) { shinyjs::hide(id = paste0("Seasons_LegendItemtxt_", i)) }) - # Read the data - land_required <- readRDS( - file.path( - session$userData$user_folder, - "scenarios", input$scenario_name, - "scenario_data.rds" - ) - )[["land_required"]] + scenario_data <- scenario_plot_data() + land_required <- scenario_data[["land_required"]] # unique seasons seasons <- unique(land_required$season_name) @@ -555,23 +533,14 @@ board_simulation_server <- function( # ----- PLOT WATER USE PER FEED ---------------------------------------------- output$plot_water_feed <- renderGirafe({ - - req(session$userData$run_scenario_counter()) - req(input$scenario_name) cat(file = stderr(), "10 - Plot Water Use per Feed\n") - # hide all the feeds legend items lapply(1:max_feed_items, function(i) { shinyjs::hide(id = paste0("Feeds_LegendItemtxt_", i)) }) - # Read the data - water_use_per_feed_item <- readRDS( - file.path( - session$userData$user_folder, "scenarios", - input$scenario_name, "scenario_data.rds" - ) - )[["water_use_per_feed_item"]] + scenario_data <- scenario_plot_data() + water_use_per_feed_item <- scenario_data[["water_use_per_feed_item"]] # unique feeds feeds <- unique(water_use_per_feed_item$feed) diff --git a/R/20_mod_board_comparison_server.R b/R/20_mod_board_comparison_server.R index 2bf46e2..be4fad6 100644 --- a/R/20_mod_board_comparison_server.R +++ b/R/20_mod_board_comparison_server.R @@ -386,6 +386,17 @@ board_comparison_server <- function( ) + # ------ Cached comparison results (read RDS once, shared by all 44 plots) ---- + comparison_results <- reactive({ + req(input$comp_name, input$comp_category, input$base_scenario) + readRDS( + file.path( + session$userData$user_folder, "comparisons", + input$comp_name, "results_list.rds" + ) + )[[input$base_scenario]] + }) + # ------ PLOT comparisons graphs --------------------------------------------- lapply( graphs_desc$indicator[5:48], #1st 4 plots removed, belong to the 1st section @@ -394,18 +405,8 @@ board_comparison_server <- function( cat(file = stderr(), "20 - Plot comparison - ", indicator, "\n") - # Check if the inputs are available - req(input$comp_name) - req(input$comp_category) - req(input$base_scenario) - - # Read comparison results - results_list <- readRDS( - file.path( - session$userData$user_folder, "comparisons", - input$comp_name, "results_list.rds" - ) - )[[input$base_scenario]] + # Use cached comparison results (single readRDS for all 44 plots) + results_list <- comparison_results() # Get the data for each indicator datos <- results_list[[indicator]]$datos diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index 072d6ae..d15f3b6 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -157,26 +157,9 @@ scenario_server <- function( }) # ----- UX Interaction logic -------------------------------------------- - # Observe the selection from the radio buttons + # Show/hide folder UIs based on radio selection (uses shared helper) observeEvent(input$scenario_folder, { - if (input$scenario_folder == "user") { - # Show User Folder UI and hide the others - shinyjs::show(id = "user_folder_ui") - shinyjs::hide(id = "shared_examples_ui") - shinyjs::hide(id = "shared_pool_ui") - - } else if (input$scenario_folder == "shared") { - # Show Shared Examples UI and hide the others - shinyjs::show(id = "shared_examples_ui") - shinyjs::hide(id = "user_folder_ui") - shinyjs::hide(id = "shared_pool_ui") - - } else if (input$scenario_folder == "pool") { - # Show Shared Pool UI and hide the others - shinyjs::show(id = "shared_pool_ui") - shinyjs::hide(id = "user_folder_ui") - shinyjs::hide(id = "shared_examples_ui") - } + show_hide_folder_ui(input$scenario_folder, ns) }) # on renaming a scenario observeEvent(input$rename_json, { @@ -622,130 +605,22 @@ scenario_server <- function( } }) - # ----------- Seasons Tab ---------------------------------------------------- - # Reactive value to store the seasons data - seasons <- reactiveVal(seasons_initialization) + # ----------- Seasons Tab (sourced sub-module) -------------------------------- + source("R/scenario/32_scenario_seasons.R", local = TRUE) - # Add season button click - observeEvent(input$add_season, { - req(input$json_file_name) - if (modal_open()) return() - modal_open(TRUE) - showModal(modalDialog( - title = "Add season", - h2("Season name:", class = "mb-3"), - textInput(ns("season_name"), label = NULL), - easyClose = TRUE, - footer = tagList( - actionButton(ns("ok_add_season"), "OK"), - modalButton("Cancel") - ) - )) - }) + # ----------- Manure/Fertilizer Tab (sourced sub-module) --------------------- + source("R/scenario/33_scenario_fertilizer.R", local = TRUE) - # OK button in modal dialog for adding season - observeEvent(input$ok_add_season, { - req(input$season_name) - current_seasons <- seasons() - if (!input$season_name %in% current_seasons$Season) { - days_left <- max(365 - sum(current_seasons$Days), 0) - new_row <- data.frame(Season = input$season_name, Days = days_left) - updated_seasons <- rbind(current_seasons, new_row) - seasons(updated_seasons) - } - updateTextInput(session, "season_name", value = "") - removeModal() - }) + # ----------- Area tab (sourced sub-module) ---------------------------------- + source("R/scenario/34_scenario_area.R", local = TRUE) - # Render the table - output$season_table <- renderDT({ - - # Re-initialize the season data if the columns are missing (show empty table on start) - if (ncol(seasons()) == 0) { - seasons(seasons_initialization) - } - - season_dt <- seasons() - - # Checkboxes for selecting rows (to be deleted) - season_dt$selected_season <- generate_shiny_inputs( - FUN = checkboxInput, - len = nrow(season_dt), - id = ns("selected_season"), - value = rep(FALSE, nrow(season_dt)), - width = "2px" - ) - # Move the 'selected_season' column to the first position - season_dt <- season_dt[, c("selected_season", setdiff(names(season_dt), "selected_season"))] - - datatable( - season_dt, - editable = list( - target = "cell", - # Prevent editing of the first column (check boxes for delete rows) - disable = list(columns = 0) - ), - escape = FALSE, - selection = "none", - rownames = FALSE, - # Set the first column (selected) name to an empty string - colnames = c("", colnames(season_dt)[-1]), - options = list( - dom = "t", - paging = FALSE, - columnDefs = list( - # 2 px width for the first column (checkboxes) - list(width = "50px", targets = 0) - ), - # Link renderDT's checkbox to the shiny input (not automatic) - drawCallback = JS(checkbox_link(id = "selected_season", ns = ns)) - ) - ) - }, server = FALSE) + # ----------- Livestock tab (sourced sub-module) ----------------------------- + source("R/scenario/35_scenario_livestock.R", local = TRUE) - # Delete season button click - observeEvent(input$delete_season, { - req(nrow(seasons()) > 0) # Ensure there are rows to process - selected <- which( - sapply( - seq_len(nrow(seasons())), - function(i) input[[paste0("selected_season", i)]] - ) - ) - if (length(selected)) { - current_seasons <- seasons() - updated_seasons <- current_seasons[-selected, ] - seasons(updated_seasons) - } - }) - - # Update season table data with edited values - observeEvent(input$season_table_cell_edit, { - info <- input$season_table_cell_edit - new_data <- seasons() - - # Update the specific cell while preserving the column's data type - new_data <- update_cell(new_data, info, offset = 0) - - seasons(new_data) - }) - - # Observe the season data and show/hide the error message - observeEvent(seasons(), { - # if the sum of days is 365, hide the error message - if (nrow(seasons()) == 0 || sum(seasons()$Days) == 365) { - shinyjs::hide(id = "alert_message_season") - } else { - shinyjs::show(id = "alert_message_season") - } - }) - - # ----------- Manure/Fertilizer Tab ------------------------------------------ - # Reactive value to store the fertilizer data - fertilizers <- reactiveVal(fertilizers_initialization) - - # Add fertilizer button click - observeEvent(input$add_fertilizer, { + # ----------- Feed production tab -------------------------------------------- + # (Kept inline; seasons/fertilizer/area/livestock are sourced from R/scenario/32-35) + if (FALSE) { # Duplicate of 33-35 - kept for reference, never runs + observeEvent(input$.removed, { req(input$json_file_name) if (modal_open()) return() modal_open(TRUE) @@ -1320,6 +1195,7 @@ scenario_server <- function( # Freeze and restore scroll position for livestock table freeze_and_unfreeze_scroll(session, ns("livestock_table")) }) + } # End if(FALSE) - duplicate fertilizer/area/livestock removed (content in sourced files 33-35) # ----------- Feed production tab -------------------------------------------- # Initial data frame for crops @@ -2430,32 +2306,43 @@ scenario_server <- function( }) # Observe changes and update the "Total" row - observe({ + # (Single observeEvent to avoid handler accumulation when seasons change; + # previously nested observe + lapply created duplicate handlers) + basket_cell_edits <- reactive({ + req(seasons()) lapply(seasons()$Season, function(season) { - observeEvent(input[[paste0("table_", season, "_cell_edit")]], { - info <- input[[paste0("table_", season, "_cell_edit")]] - df <- basket_data[[season]] - - if (!is.null(df) && nrow(df) > 0 && ncol(df) > 0) { - df[info$row, info$col] <- ifelse(info$value == "", 0, as.numeric(info$value)) - - # Reset and recalculate the Total row - df["Total", ] <- colSums(df[1:(nrow(df) - 1), , drop = FALSE], na.rm = TRUE) - basket_data[[season]] <- df - } - }) + input[[paste0("table_", season, "_cell_edit")]] }) }) + last_processed_basket_edit <- reactiveValues() + observeEvent(basket_cell_edits(), { + req(seasons()) + for (season in seasons()$Season) { + info <- input[[paste0("table_", season, "_cell_edit")]] + if (!is.null(info) && is.list(info) && "row" %in% names(info)) { + key <- paste(season, info$row, info$col, info$value) + if (is.null(last_processed_basket_edit[[season]]) || + last_processed_basket_edit[[season]] != key) { + last_processed_basket_edit[[season]] <- key + df <- basket_data[[season]] + if (!is.null(df) && nrow(df) > 0 && ncol(df) > 0) { + df[info$row, info$col] <- ifelse(info$value == "", 0, as.numeric(info$value)) + # Reset and recalculate the Total row + df["Total", ] <- colSums(df[1:(nrow(df) - 1), , drop = FALSE], na.rm = TRUE) + basket_data[[season]] <- df + } + } + } + } + }, ignoreNULL = TRUE) - # ----------- Automatically Save Data as JSON -------------------------------- - observe({ + # ----------- Automatically Save Data as JSON (debounced to reduce write freq) - + study_object_to_save <- reactive({ req(input$json_file_name) req(input$database_code) req(lkp_region()) req(session$userData$study_object()) - cat(file = stderr(), "20 - Saving data as JSON\n") - study_object <- list() # Collect seasons @@ -2564,13 +2451,21 @@ scenario_server <- function( list() } - # Generate the filename based on the input - file_name <- file.path(session$userData$user_folder, "study_objects", input$json_file_name) - + list(study_object = study_object, json_file_name = input$json_file_name) + }) + + study_object_debounced <- debounce(study_object_to_save, 1500) + + observe({ + data <- study_object_debounced() + req(data) + cat(file = stderr(), "20 - Saving data as JSON\n") + file_name <- file.path( + session$userData$user_folder, "study_objects", data$json_file_name + ) write( - toJSON(study_object, pretty = TRUE, auto_unbox = TRUE), file = file_name + toJSON(data$study_object, pretty = TRUE, auto_unbox = TRUE), file = file_name ) - # Update the list of study objects session$userData$study_objects( list.files( diff --git a/R/40_mod_params_db_server.R b/R/40_mod_params_db_server.R index 0d70658..c01e8c1 100644 --- a/R/40_mod_params_db_server.R +++ b/R/40_mod_params_db_server.R @@ -70,25 +70,10 @@ params_db_server <- function( # ----- UX Interaction logic ------------------------------------------------- - # Observe the selection from the radio buttons + # Observe the selection from the radio buttons (uses shared helper) observeEvent(input$parameters_folder, { cat(file = stderr(), "40 - Observe the selection from the radio buttons...\n") - if (input$parameters_folder == "user") { - # Show User Folder UI and hide the others - shinyjs::show(id = "user_folder_ui") - shinyjs::hide(id = "shared_examples_ui") - shinyjs::hide(id = "shared_pool_ui") - } else if (input$parameters_folder == "shared") { - # Show Shared Examples UI and hide the others - shinyjs::show(id = "shared_examples_ui") - shinyjs::hide(id = "user_folder_ui") - shinyjs::hide(id = "shared_pool_ui") - } else if (input$parameters_folder == "pool") { - # Show Shared Pool UI and hide the others - shinyjs::show(id = "shared_pool_ui") - shinyjs::hide(id = "user_folder_ui") - shinyjs::hide(id = "shared_examples_ui") - } + show_hide_folder_ui(input$parameters_folder, ns) }) # on renaming a database observeEvent(input$rename_database, { diff --git a/R/helpers_ui.R b/R/helpers_ui.R new file mode 100644 index 0000000..54dd972 --- /dev/null +++ b/R/helpers_ui.R @@ -0,0 +1,27 @@ +# UI helpers - shared patterns across modules ------------------------------- + +#' Show/hide folder choice UIs based on radio button selection. +#' Used when user selects "User Folder", "Shared Examples", or "Shared Pool". +#' Keeps the same pattern in scenario and params_db modules for consistency. +#' +#' @param folder_value Character: "user", "shared", or "pool" from the radio input +#' @param ns Namespace function (e.g. session$ns from a Shiny module) +#' @noRd +show_hide_folder_ui <- function(folder_value, ns) { + if (folder_value == "user") { + # Show User Folder UI and hide the others + shinyjs::show(id = ns("user_folder_ui")) + shinyjs::hide(id = ns("shared_examples_ui")) + shinyjs::hide(id = ns("shared_pool_ui")) + } else if (folder_value == "shared") { + # Show Shared Examples UI and hide the others + shinyjs::show(id = ns("shared_examples_ui")) + shinyjs::hide(id = ns("user_folder_ui")) + shinyjs::hide(id = ns("shared_pool_ui")) + } else if (folder_value == "pool") { + # Show Shared Pool UI and hide the others + shinyjs::show(id = ns("shared_pool_ui")) + shinyjs::hide(id = ns("user_folder_ui")) + shinyjs::hide(id = ns("shared_examples_ui")) + } +} diff --git a/R/scenario/32_scenario_seasons.R b/R/scenario/32_scenario_seasons.R new file mode 100644 index 0000000..4b73ea0 --- /dev/null +++ b/R/scenario/32_scenario_seasons.R @@ -0,0 +1,119 @@ +# ----------- Seasons Tab -------------------------------------------------------- +# Sub-module: seasons management (reactive, observers, table render) +# Sourced from 30_mod_scenario_server.R with local = TRUE +# Reactive value to store the seasons data +seasons <- reactiveVal(seasons_initialization) + +# Add season button click +observeEvent(input$add_season, { + req(input$json_file_name) + if (modal_open()) return() + modal_open(TRUE) + showModal(modalDialog( + title = "Add season", + h2("Season name:", class = "mb-3"), + textInput(ns("season_name"), label = NULL), + easyClose = TRUE, + footer = tagList( + actionButton(ns("ok_add_season"), "OK"), + modalButton("Cancel") + ) + )) +}) + +# OK button in modal dialog for adding season +observeEvent(input$ok_add_season, { + req(input$season_name) + current_seasons <- seasons() + if (!input$season_name %in% current_seasons$Season) { + days_left <- max(365 - sum(current_seasons$Days), 0) + new_row <- data.frame(Season = input$season_name, Days = days_left) + updated_seasons <- rbind(current_seasons, new_row) + seasons(updated_seasons) + } + updateTextInput(session, "season_name", value = "") + removeModal() +}) + +# Render the table +output$season_table <- renderDT({ + + # Re-initialize the season data if the columns are missing (show empty table on start) + if (ncol(seasons()) == 0) { + seasons(seasons_initialization) + } + + season_dt <- seasons() + + # Checkboxes for selecting rows (to be deleted) + season_dt$selected_season <- generate_shiny_inputs( + FUN = checkboxInput, + len = nrow(season_dt), + id = ns("selected_season"), + value = rep(FALSE, nrow(season_dt)), + width = "2px" + ) + # Move the 'selected_season' column to the first position + season_dt <- season_dt[, c("selected_season", setdiff(names(season_dt), "selected_season"))] + + datatable( + season_dt, + editable = list( + target = "cell", + # Prevent editing of the first column (check boxes for delete rows) + disable = list(columns = 0) + ), + escape = FALSE, + selection = "none", + rownames = FALSE, + # Set the first column (selected) name to an empty string + colnames = c("", colnames(season_dt)[-1]), + options = list( + dom = "t", + paging = FALSE, + columnDefs = list( + # 2 px width for the first column (checkboxes) + list(width = "50px", targets = 0) + ), + # Link renderDT's checkbox to the shiny input (not automatic) + drawCallback = JS(checkbox_link(id = "selected_season", ns = ns)) + ) + ) +}, server = FALSE) + +# Delete season button click +observeEvent(input$delete_season, { + req(nrow(seasons()) > 0) # Ensure there are rows to process + selected <- which( + sapply( + seq_len(nrow(seasons())), + function(i) input[[paste0("selected_season", i)]] + ) + ) + if (length(selected)) { + current_seasons <- seasons() + updated_seasons <- current_seasons[-selected, ] + seasons(updated_seasons) + } +}) + +# Update season table data with edited values +observeEvent(input$season_table_cell_edit, { + info <- input$season_table_cell_edit + new_data <- seasons() + + # Update the specific cell while preserving the column's data type + new_data <- update_cell(new_data, info, offset = 0) + + seasons(new_data) +}) + +# Observe the season data and show/hide the error message +observeEvent(seasons(), { + # if the sum of days is 365, hide the error message + if (nrow(seasons()) == 0 || sum(seasons()$Days) == 365) { + shinyjs::hide(id = "alert_message_season") + } else { + shinyjs::show(id = "alert_message_season") + } +}) diff --git a/R/scenario/33_scenario_fertilizer.R b/R/scenario/33_scenario_fertilizer.R new file mode 100644 index 0000000..3fa6a80 --- /dev/null +++ b/R/scenario/33_scenario_fertilizer.R @@ -0,0 +1,149 @@ +# ----------- Manure/Fertilizer Tab ---------------------------------------------- +# Sub-module: fertilizer management +# Sourced from 30_mod_scenario_server.R with local = TRUE +# Reactive value to store the fertilizer data +fertilizers <- reactiveVal(fertilizers_initialization) + +# Add fertilizer button click +observeEvent(input$add_fertilizer, { + req(input$json_file_name) + if (modal_open()) return() + modal_open(TRUE) + showModal(modalDialog( + title = "Add new fertilizer", + h2("Choose a Fertilizer", class = "mb-3"), + shinyWidgets::pickerInput( + ns("fertilizer_code"), + choices = setNames( + lkp_orgfertilizer()$fertilizer_code, + lkp_orgfertilizer()$fertilizer_desc + )[sort(lkp_orgfertilizer()$fertilizer_desc)], + options = list(`live-search` = TRUE) + ), + easyClose = TRUE, + footer = tagList( + actionButton(ns("ok_add_fertilizer"), "OK"), + modalButton("Cancel") + ) + )) +}) + +# OK button in modal dialog for adding fertilizer +observeEvent(input$ok_add_fertilizer, { + req(input$fertilizer_code) + current_fertilizers <- fertilizers() + if (!input$fertilizer_code %in% current_fertilizers$fertilizer_code) { + fertilizer_name <- lkp_orgfertilizer()$fertilizer_desc[ + lkp_orgfertilizer()$fertilizer_code == input$fertilizer_code + ] + new_row <- data.frame( + fertilizer_code = input$fertilizer_code, + fertilizer_desc = fertilizer_name, + fraction = 0, + percentage_n = ifelse(fertilizer_name %in% names(fertilizer_percentages), + fertilizer_percentages[fertilizer_name], 0) + ) + updated_fertilizers <- rbind(current_fertilizers, new_row) + fertilizers(updated_fertilizers) + } + # Reset the select input + shinyWidgets::updatePickerInput( + session, + "fertilizer_code", + selected = setNames(lkp_orgfertilizer()$fertilizer_code, lkp_orgfertilizer()$fertilizer_desc)[1] + ) + removeModal() +}) + +# Render the fertilizer table +output$fertilizer_table <- renderDT({ + + # Re-initialize the fertilizer data if the columns are missing (show empty table on start) + if (ncol(fertilizers()) == 0) { + fertilizers(fertilizers_initialization) + } + + # Identify rows to disable based on fertilizer names + fertilizers_data <- fertilizers() %>% select(-fertilizer_code, -fraction) + rows_to_disable <- which( + fertilizers_data$fertilizer_desc %in% names(fertilizer_percentages) + ) - 1 + + # Checkboxes for selecting rows (to be deleted) + fertilizers_data$selected_fertilizer <- generate_shiny_inputs( + FUN = checkboxInput, + len = nrow(fertilizers_data), + id = ns("selected_fertilizer"), + value = rep(FALSE, nrow(fertilizers_data)), + width = "2px" + ) + + # Move the 'selected_fertilizer' column to the first position + fertilizers_data <- fertilizers_data[ + , c("selected_fertilizer", setdiff(names(fertilizers_data), "selected_fertilizer")) + ] + + datatable( + fertilizers_data, + colnames = c("", "Fertilizer", "% N"), # Set the first column (selected) name to an empty string + editable = list( + target = "cell", + # Prevent editing of the first column (check boxes for delete rows) + disable = list(columns = 0) + ), + selection = "none", + rownames = FALSE, + escape = FALSE, + options = list( + dom = "t", + paging = FALSE, + columnDefs = list( + list( + width = "2px", # Define the width of the checkbox column + targets = 0 + ), + # Disable editing fertilizer's column + list( + targets = get_column_indices(fertilizers_data, "fertilizer_desc") - 1, + createdCell = JS(disable_all_rows_edit_js()), + searchable = FALSE + ), + # Disable editing for specific rows in the % N column + list( + targets = get_column_indices(fertilizers_data, "percentage_n") - 1, + createdCell = JS(disable_specific_rows_edit_js(rows_to_disable)), + searchable = FALSE + ) + ), + # Link renderDT's checkbox to the shiny input (not automatic) + drawCallback = JS(checkbox_link(id = "selected_fertilizer", ns = ns)) + ) + ) +}, server = FALSE) + +# Delete fertilizer button click +observeEvent(input$delete_fertilizer, { + req(nrow(fertilizers()) > 0) # Ensure there are rows to process + selected <- which( + sapply( + seq_len(nrow(fertilizers())), + function(i) input[[paste0("selected_fertilizer", i)]] + ) + ) + if (length(selected)) { + current_fertilizers <- fertilizers() + updated_fertilizers <- current_fertilizers[-selected, ] + fertilizers(updated_fertilizers) + } +}) + +# Update fertilizer table data with edited values +observeEvent(input$fertilizer_table_cell_edit, { + info <- input$fertilizer_table_cell_edit + new_data <- fertilizers() + + # Update the specific cell while preserving the column's data type + new_data <- update_cell(new_data, info, offset = 2) + + fertilizers(new_data) +}) diff --git a/R/scenario/34_scenario_area.R b/R/scenario/34_scenario_area.R new file mode 100644 index 0000000..c23d28b --- /dev/null +++ b/R/scenario/34_scenario_area.R @@ -0,0 +1,42 @@ +# ----------- Area tab --------------------------------------------------------- +# Sub-module: area/soil/cropland/grassland observers +# Sourced from 30_mod_scenario_server.R with local = TRUE +observeEvent(input$soil_description, { + selected_soil <- input$soil_description + k_value <- lkp_soil()$k_value[lkp_soil()$soil_desc == selected_soil] + updateNumericInput(session, "soil_k_value", value = k_value) +}) + +observeEvent(input$cropland_system, { + selected_system <- input$cropland_system + change_factor <- lkp_croplandsystem()$change_factor[lkp_croplandsystem()$sys_desc == selected_system] + updateNumericInput(session, "cropland_system_ipcc", value = change_factor) +}) + +observeEvent(input$cropland_tillage, { + selected_tillage <- input$cropland_tillage + change_factor <- lkp_tillageregime()$change_factor[lkp_tillageregime()$tillage_desc == selected_tillage] + updateNumericInput(session, "cropland_tillage_ipcc", value = change_factor) +}) + +observeEvent(input$cropland_orgmatter, { + selected_input <- input$cropland_orgmatter + change_factor <- lkp_organicmatter()$change_factor[lkp_organicmatter()$orgmatter_desc == selected_input] + updateNumericInput(session, "cropland_orgmatter_ipcc", value = change_factor) +}) + +observeEvent(input$grassland_management, { + selected_management <- input$grassland_management + change_factor <- lkp_grasslandman()$change_factor[ + lkp_grasslandman()$management_desc == selected_management + ] + updateNumericInput(session, "grassland_management_ipcc", value = change_factor) +}) + +observeEvent(input$grassland_implevel, { + selected_input_level <- input$grassland_implevel + change_factor <- lkp_grassinputlevel()$change_factor[ + lkp_grassinputlevel()$grassinputlevel_desc == selected_input_level + ] + updateNumericInput(session, "grassland_implevel_ipcc", value = change_factor) +}) diff --git a/R/scenario/35_scenario_livestock.R b/R/scenario/35_scenario_livestock.R new file mode 100644 index 0000000..9f590e8 --- /dev/null +++ b/R/scenario/35_scenario_livestock.R @@ -0,0 +1,393 @@ +# ----------- Livestock tab ------------------------------------------------------ +# Sub-module: livestock management +# Sourced from 30_mod_scenario_server.R with local = TRUE +# Initial data frame +livestock_data <- reactiveVal(livestock_data_initialization) + +# Add reactive for the selected cell +selected_cell <- reactiveVal() + +# Add livestock button click +observeEvent(input$add_livestock, { + req(input$json_file_name) + if (modal_open()) return() + modal_open(TRUE) + showModal(modalDialog( + title = "Add livestock", + h2("Choose a livestock category", class = "mb-3"), + shinyWidgets::pickerInput( + ns("livestock"), + label = NULL, + choices = setNames( + lkp_livetype()$livetype_code, + lkp_livetype()$livetype_desc + )[sort(lkp_livetype()$livetype_desc)], + options = list(`live-search` = TRUE) + ), + easyClose = TRUE, + footer = tagList( + actionButton(ns("ok_add_livestock"), "OK"), + modalButton("Cancel") + ) + )) +}) + +# Add new livestock row from modal +observeEvent(input$ok_add_livestock, { + req(input$livestock) + if (!(input$livestock %in% livestock_data()[, "livetype_code"])) { + selected_livestock <- lkp_livetype()[lkp_livetype()$livetype_code == input$livestock, ] + manureman_selection <- lkp_manureman()$manureman_desc[1] + new_row <- data.frame( + livetype_code = as.character(selected_livestock$livetype_code), + livetype_desc = selected_livestock$livetype_desc, + herd_composition = 0, + annual_milk = 0, + annual_wool = 0, + annual_growth = 0, + time_in_stable = 0, + manure_in_stable = 0, + manureman_stable = manureman_selection, + time_in_non_roofed_enclosure = 0, + manure_in_non_roofed_enclosure = 0, + manureman_non_roofed_enclosure = manureman_selection, + time_in_onfarm_grazing = 0, + manure_in_field = 0, + manureman_onfarm_grazing = manureman_selection, + time_in_offfarm_grazing = 0, + manureman_offfarm_grazing = manureman_selection, + distance_to_pasture = 0, + manure_onfarm_fraction = 0, + manure_sales_fraction = 0, + body_weight = selected_livestock$body_weight, + body_weight_weaning = 0, + body_weight_year_one = 0, + adult_weight = 0, + work_hour = 0, + litter_size = selected_livestock$litter_size, + piglets_relying_on_milk = 0, + lactation_length = selected_livestock$lactation_length, + proportion_growth_piglets_milk = selected_livestock$proportion_growth_piglets_milk, + lw_gain_piglets = selected_livestock$lw_gain_piglets, + cp_maintenance = selected_livestock$cp_maintenance, + cp_lys_pregnancy = selected_livestock$cp_lys_pregnancy, + cp_lactmilk = selected_livestock$cp_lactmilk, + cp_lys_growth = selected_livestock$cp_lys_growth, + birth_interval = selected_livestock$birth_interval, + protein_milkcontent = selected_livestock$protein_milkcontent, + fat_milkcontent = selected_livestock$fat_milkcontent, + energy_milkcontent = selected_livestock$energy_milkcontent, + energy_meatcontent = selected_livestock$energy_meatcontent, + protein_meatcontent = selected_livestock$protein_meatcontent, + carcass_fraction = selected_livestock$carcass_fraction, + n_manure_content = selected_livestock$n_manure_content, + meat_product = selected_livestock$meat_product, + milk_product = selected_livestock$milk_product, + ipcc_ef_category_t1 = selected_livestock$ipcc_meth_ef_t1, + ipcc_ef_category_t2 = selected_livestock$ipcc_meth_ef_t2, + ipcc_meth_man_category = selected_livestock$ipcc_meth_man, + ipcc_n_exc_category = selected_livestock$ipcc_meth_exc, + stringsAsFactors = FALSE + ) + livestock_data(rbind(livestock_data(), new_row)) + } + + # Freeze and restore scroll position for livestock table + freeze_and_unfreeze_scroll(session, ns("livestock_table")) + + shinyWidgets::updatePickerInput( + session, + "livestock", + selected = setNames(lkp_livetype()$livetype_code, lkp_livetype()$livetype_desc)[1] + ) + removeModal() +}) + +# Render the table +output$livestock_table <- renderDT({ + livestock_dt <- livestock_data() + + # Apply bold and underline formatting to selectInputs text + livestock_dt[manure_cols] <- lapply(livestock_dt[manure_cols], format_text_displayed) + + # Remove the 'livetype_code' column + livestock_dt <- livestock_dt %>% + select(-livetype_code) + + # Checkboxes for selecting rows (to be deleted) + livestock_dt$selected_livestock <- generate_shiny_inputs( + FUN = checkboxInput, + len = nrow(livestock_dt), + id = ns("selected_livestock"), + value = rep(FALSE, nrow(livestock_dt)), + width = "2px" + ) + # Move the 'selected_livestock' column to the first position + livestock_dt <- livestock_dt[, c("selected_livestock", setdiff(names(livestock_dt), "selected_livestock"))] + + datatable( + livestock_dt, + colnames = livestock_table_colnames, + editable = list( + target = "cell", + # Prevent editing of the first column (check boxes for delete rows) + disable = list(columns = 0) + ), + selection = "none", + rownames = FALSE, + escape = FALSE, + extensions = "FixedColumns", + options = list( + scrollX = TRUE, + dom = "t", + paging = FALSE, + fixedColumns = list(leftColumns = 2), + columnDefs = list( + list( + targets = get_column_indices( + livestock_dt, + c("livetype_desc", # Disable editing for livestock type + "manureman_stable", + "manureman_non_roofed_enclosure", + "manureman_onfarm_grazing", + "manureman_offfarm_grazing", + "ipcc_ef_category_t1", + "ipcc_ef_category_t2", + "ipcc_meth_man_category", + "ipcc_n_exc_category" + ) + ) - 1, + createdCell = JS(disable_all_rows_edit_js()), + searchable = FALSE + ) + ), + # Link renderDT's checkbox to the shiny input (not automatic) + drawCallback = JS(checkbox_link(id = "selected_livestock", ns = ns)) + ) + ) %>% + formatStyle( + columns = c( + "herd_composition", "annual_milk", "annual_wool", "annual_growth", + "time_in_stable", "manure_in_stable", "manureman_stable", + "time_in_non_roofed_enclosure", "manure_in_non_roofed_enclosure", + "manureman_non_roofed_enclosure", "time_in_onfarm_grazing", + "manure_in_field", "manureman_onfarm_grazing", "time_in_offfarm_grazing", + "manureman_offfarm_grazing", "distance_to_pasture", + "manure_onfarm_fraction", "manure_sales_fraction" + ), + backgroundColor = "#a9d18e" + ) %>% + formatStyle( + columns = c( + "body_weight", "body_weight_weaning", "body_weight_year_one", + "adult_weight", "work_hour", "litter_size", "piglets_relying_on_milk", + "lactation_length", "proportion_growth_piglets_milk", "lw_gain_piglets", + "cp_maintenance", "cp_lys_pregnancy", "cp_lactmilk", + "cp_lys_growth", "birth_interval", "protein_milkcontent", + "fat_milkcontent", "energy_milkcontent", "energy_meatcontent", + "protein_meatcontent", "carcass_fraction", "n_manure_content", + "meat_product", "milk_product", "ipcc_ef_category_t1", + "ipcc_ef_category_t2", "ipcc_meth_man_category", "ipcc_n_exc_category" + ), + backgroundColor = "#f4b183" + ) +}, server = FALSE) + +# Update the table data when edited +observeEvent(input$livestock_table_cell_edit, { + info <- input$livestock_table_cell_edit + new_data <- livestock_data() + + # Update the specific cell while preserving the column's data type + new_data <- update_cell(new_data, info, offset = 1) + + # Freeze and restore scroll position for livestock table + freeze_and_unfreeze_scroll(session, ns("livestock_table")) + + livestock_data(new_data) +}) + +# Delete selected row +observeEvent(input$delete_livestock, { + req(nrow(livestock_data()) > 0) # Ensure there are rows to process + selected_row <- which( + sapply( + seq_len(nrow(livestock_data())), + function(i) input[[paste0("selected_livestock", i)]] + ) + ) + if (length(selected_row) > 0) { + new_data <- livestock_data() + new_data <- new_data[-selected_row, ] + livestock_data(new_data) + } + + # Freeze and restore scroll position for livestock table + freeze_and_unfreeze_scroll(session, ns("livestock_table")) +}) + +# ------ LIVESTOCK TIME FRACTIONS VALIDATION --------------------------------- +observeEvent(livestock_data(), { + # Always hide previous warnings at the start to avoid stale messages + shinyjs::hide("alert_message_livestock_invalid_values_inputs") + shinyjs::hide("alert_message_livestock_invalid_sum_inputs") + + # Validate input data: ensure data exists and contains at least one row + time_input <- livestock_data() + if (is.null(time_input) || nrow(time_input) == 0) return() + + # Identify the expected time-fraction columns + expected_columns <- c( + "time_in_stable", + "time_in_non_roofed_enclosure", + "time_in_onfarm_grazing", + "time_in_offfarm_grazing" + ) + + # Keep only columns that exist in the current dataset + valid_columns <- intersect(expected_columns, names(time_input)) + if (length(valid_columns) == 0) return() + + # Extract subset of time allocation data + time_data <- time_input[valid_columns] + + # Map backend variable names to display labels + display_labels <- livestock_table_colnames[ + match(valid_columns, names(livestock_data_initialization)) + ] + + # Initialize result containers + invalid_value_messages <- character(0) + livestock_invalid_values <- character(0) + invalid_sum_messages <- character(0) + livestock_invalid_sums <- character(0) + + # Check for invalid fraction values (<0 or >1) + for (i in seq_along(valid_columns)) { + column_name <- valid_columns[i] + column_label <- display_labels[i] + fraction_values <- time_data[[column_name]] + + invalid_rows <- which(fraction_values < 0 | fraction_values > 1) + if (length(invalid_rows) == 0) next + + livestock_names <- time_input$livetype_desc[invalid_rows] + invalid_values <- fraction_values[invalid_rows] + + messages <- sprintf( + " For %s , the value in + '%s' is %s . It must be ≥ 0 and ≤ 1!", + livestock_names, column_label, invalid_values + ) + + invalid_value_messages <- c(invalid_value_messages, messages) + livestock_invalid_values <- c(livestock_invalid_values, livestock_names) + } + + # Check for invalid totals (sum of all four fractions ≠ 1) + row_sums <- rowSums(time_data, na.rm = TRUE) + + # Use a small tolerance when checking equality to 1 + # This avoids false warnings from floating-point rounding errors + tolerance <- 1e-6 + invalid_sum_rows <- which(abs(row_sums - 1) > tolerance) + + if (length(invalid_sum_rows) > 0) { + livestock_names <- time_input$livetype_desc[invalid_sum_rows] + total_values <- row_sums[invalid_sum_rows] + + # Display decimals only when needed (e.g., 0.9998 vs 1) + formatted_totals <- ifelse( + abs(total_values %% 1) < 1e-6, + as.character(round(total_values, 0)), + formatC(total_values, format = "f", digits = 4) + ) + + messages <- sprintf( + " For %s , the total across + the four time-fraction columns is %s . It must equal 1!", + livestock_names, formatted_totals + ) + + invalid_sum_messages <- c(invalid_sum_messages, messages) + livestock_invalid_sums <- c(livestock_invalid_sums, livestock_names) + } + + # Sort messages alphabetically by livestock name + if (length(invalid_value_messages) > 0) { + order_index <- order(tolower(livestock_invalid_values)) + invalid_value_messages <- invalid_value_messages[order_index] + } + + if (length(invalid_sum_messages) > 0) { + order_index <- order(tolower(livestock_invalid_sums)) + invalid_sum_messages <- invalid_sum_messages[order_index] + } + + # Display messages if there are issues + if (length(invalid_value_messages) > 0) { + shinyjs::html( + "alert_message_livestock_invalid_values_inputs", + html = paste(invalid_value_messages, collapse = "
") + ) + shinyjs::show("alert_message_livestock_invalid_values_inputs") + } + + if (length(invalid_sum_messages) > 0) { + shinyjs::html( + "alert_message_livestock_invalid_sum_inputs", + html = paste(invalid_sum_messages, collapse = "
") + ) + shinyjs::show("alert_message_livestock_invalid_sum_inputs") + } +}) + +# Show modal dialog to update manure management +observeEvent(input$livestock_table_cell_clicked, { + info <- input$livestock_table_cell_clicked + req(length(info) > 0) + + if (!is.null(info) && !is.null(info$col) && (names(livestock_data())[info$col + 1] %in% manure_cols)) { + column_name <- names(livestock_data())[info$col] + if (modal_open()) return() + modal_open(TRUE) + showModal(modalDialog( + title = paste("Select a manure management type"), + shinyWidgets::pickerInput( + inputId = ns("manure_management"), + label = NULL, + choices = sort( + unique(lkp_manureman()$manureman_desc) + ), + options = list(`live-search` = TRUE) + ), + footer = tagList( + actionButton(ns("ok_update_manure_management"), "OK"), + modalButton("Cancel") + ) + )) + + selected_cell(info) + } +}) + +# Update manure management in the table +observeEvent(input$ok_update_manure_management, { + req(input$manure_management) + selected_cell <- selected_cell() + if (!is.null(selected_cell)) { + new_data <- livestock_data() + column_name <- names(new_data)[selected_cell$col + 1] + new_data[selected_cell$row, column_name] <- input$manure_management + livestock_data(new_data) + } + shinyWidgets::updatePickerInput( + session, + "manure_management", + selected = lkp_manureman()$manureman_desc[1] + ) + removeModal() + + # Freeze and restore scroll position for livestock table + freeze_and_unfreeze_scroll(session, ns("livestock_table")) +}) From 85f6c07cea798ada0790478ffa020e432bcc91cd Mon Sep 17 00:00:00 2001 From: elaouniyassine Date: Thu, 19 Feb 2026 17:20:17 +0000 Subject: [PATCH 69/69] remove commented code --- R/30_mod_scenario_server.R | 593 +------------------------------------ 1 file changed, 8 insertions(+), 585 deletions(-) diff --git a/R/30_mod_scenario_server.R b/R/30_mod_scenario_server.R index d15f3b6..3c2b5b2 100644 --- a/R/30_mod_scenario_server.R +++ b/R/30_mod_scenario_server.R @@ -71,7 +71,7 @@ scenario_server <- function( # ----- Validation Module ---------------------------------------------------- farm_validation_server("validation", input = input, parent_session = session) - + # ----- * Show Scenario Editor Section after selection ---------------------- observeEvent(input$json_file_name, { shinyjs::show(id = "scenario_editor_section") @@ -619,583 +619,6 @@ scenario_server <- function( # ----------- Feed production tab -------------------------------------------- # (Kept inline; seasons/fertilizer/area/livestock are sourced from R/scenario/32-35) - if (FALSE) { # Duplicate of 33-35 - kept for reference, never runs - observeEvent(input$.removed, { - req(input$json_file_name) - if (modal_open()) return() - modal_open(TRUE) - showModal(modalDialog( - title = "Add new fertilizer", - h2("Choose a Fertilizer", class = "mb-3"), - shinyWidgets::pickerInput( - ns("fertilizer_code"), - choices = setNames( - lkp_orgfertilizer()$fertilizer_code, - lkp_orgfertilizer()$fertilizer_desc - )[sort(lkp_orgfertilizer()$fertilizer_desc)], - options = list(`live-search` = TRUE) - ), - easyClose = TRUE, - footer = tagList( - actionButton(ns("ok_add_fertilizer"), "OK"), - modalButton("Cancel") - ) - )) - }) - - # OK button in modal dialog for adding fertilizer - observeEvent(input$ok_add_fertilizer, { - req(input$fertilizer_code) - current_fertilizers <- fertilizers() - if (!input$fertilizer_code %in% current_fertilizers$fertilizer_code) { - fertilizer_name <- lkp_orgfertilizer()$fertilizer_desc[ - lkp_orgfertilizer()$fertilizer_code == input$fertilizer_code - ] - new_row <- data.frame( - fertilizer_code = input$fertilizer_code, - fertilizer_desc = fertilizer_name, - fraction = 0, - percentage_n = ifelse(fertilizer_name %in% names(fertilizer_percentages), - fertilizer_percentages[fertilizer_name], 0) - ) - updated_fertilizers <- rbind(current_fertilizers, new_row) - fertilizers(updated_fertilizers) - } - # Reset the select input - shinyWidgets::updatePickerInput( - session, - "fertilizer_code", - selected = setNames(lkp_orgfertilizer()$fertilizer_code, lkp_orgfertilizer()$fertilizer_desc)[1] - ) - removeModal() - }) - - # Render the fertilizer table - output$fertilizer_table <- renderDT({ - - # Re-initialize the fertilizer data if the columns are missing (show empty table on start) - if (ncol(fertilizers()) == 0) { - fertilizers(fertilizers_initialization) - } - - # Identify rows to disable based on fertilizer names - fertilizers_data <- fertilizers() %>% select(-fertilizer_code, -fraction) - rows_to_disable <- which( - fertilizers_data$fertilizer_desc %in% names(fertilizer_percentages) - ) - 1 - - # Checkboxes for selecting rows (to be deleted) - fertilizers_data$selected_fertilizer <- generate_shiny_inputs( - FUN = checkboxInput, - len = nrow(fertilizers_data), - id = ns("selected_fertilizer"), - value = rep(FALSE, nrow(fertilizers_data)), - width = "2px" - ) - - # Move the 'selected_fertilizer' column to the first position - fertilizers_data <- fertilizers_data[ - , c("selected_fertilizer", setdiff(names(fertilizers_data), "selected_fertilizer")) - ] - - datatable( - fertilizers_data, - colnames = c("", "Fertilizer", "% N"), # Set the first column (selected) name to an empty string - editable = list( - target = "cell", - # Prevent editing of the first column (check boxes for delete rows) - disable = list(columns = 0) - ), - selection = "none", - rownames = FALSE, - escape = FALSE, - options = list( - dom = "t", - paging = FALSE, - columnDefs = list( - list( - width = "2px", # Define the width of the checkbox column - targets = 0 - ), - # Disable editing fertilizer's column - list( - targets = get_column_indices(fertilizers_data, "fertilizer_desc") - 1, - createdCell = JS(disable_all_rows_edit_js()), - searchable = FALSE - ), - # Disable editing for specific rows in the % N column - list( - targets = get_column_indices(fertilizers_data, "percentage_n") - 1, - createdCell = JS(disable_specific_rows_edit_js(rows_to_disable)), - searchable = FALSE - ) - ), - # Link renderDT's checkbox to the shiny input (not automatic) - drawCallback = JS(checkbox_link(id = "selected_fertilizer", ns = ns)) - ) - ) - }, server = FALSE) - - # Delete fertilizer button click - observeEvent(input$delete_fertilizer, { - req(nrow(fertilizers()) > 0) # Ensure there are rows to process - selected <- which( - sapply( - seq_len(nrow(fertilizers())), - function(i) input[[paste0("selected_fertilizer", i)]] - ) - ) - if (length(selected)) { - current_fertilizers <- fertilizers() - updated_fertilizers <- current_fertilizers[-selected, ] - fertilizers(updated_fertilizers) - } - }) - - # Update fertilizer table data with edited values - observeEvent(input$fertilizer_table_cell_edit, { - info <- input$fertilizer_table_cell_edit - new_data <- fertilizers() - - # Update the specific cell while preserving the column's data type - new_data <- update_cell(new_data, info, offset = 2) - - fertilizers(new_data) - }) - - # ----------- Area tab ------------------------------------------------------- - observeEvent(input$soil_description, { - selected_soil <- input$soil_description - k_value <- lkp_soil()$k_value[lkp_soil()$soil_desc == selected_soil] - updateNumericInput(session, "soil_k_value", value = k_value) - }) - - observeEvent(input$cropland_system, { - selected_system <- input$cropland_system - change_factor <- lkp_croplandsystem()$change_factor[lkp_croplandsystem()$sys_desc == selected_system] - updateNumericInput(session, "cropland_system_ipcc", value = change_factor) - }) - - observeEvent(input$cropland_tillage, { - selected_tillage <- input$cropland_tillage - change_factor <- lkp_tillageregime()$change_factor[lkp_tillageregime()$tillage_desc == selected_tillage] - updateNumericInput(session, "cropland_tillage_ipcc", value = change_factor) - }) - - observeEvent(input$cropland_orgmatter, { - selected_input <- input$cropland_orgmatter - change_factor <- lkp_organicmatter()$change_factor[lkp_organicmatter()$orgmatter_desc == selected_input] - updateNumericInput(session, "cropland_orgmatter_ipcc", value = change_factor) - }) - - observeEvent(input$grassland_management, { - selected_management <- input$grassland_management - change_factor <- lkp_grasslandman()$change_factor[ - lkp_grasslandman()$management_desc == selected_management - ] - updateNumericInput(session, "grassland_management_ipcc", value = change_factor) - }) - - observeEvent(input$grassland_implevel, { - selected_input_level <- input$grassland_implevel - change_factor <- lkp_grassinputlevel()$change_factor[ - lkp_grassinputlevel()$grassinputlevel_desc == selected_input_level - ] - updateNumericInput(session, "grassland_implevel_ipcc", value = change_factor) - }) - - # ----------- Livestock tab -------------------------------------------------- - # Initial data frame - livestock_data <- reactiveVal(livestock_data_initialization) - - # Add reactive for the selected cell - selected_cell <- reactiveVal() - - # Add livestock button click - observeEvent(input$add_livestock, { - req(input$json_file_name) - if (modal_open()) return() - modal_open(TRUE) - showModal(modalDialog( - title = "Add livestock", - h2("Choose a livestock category", class = "mb-3"), - shinyWidgets::pickerInput( - ns("livestock"), - label = NULL, - choices = setNames( - lkp_livetype()$livetype_code, - lkp_livetype()$livetype_desc - )[sort(lkp_livetype()$livetype_desc)], - options = list(`live-search` = TRUE) - ), - easyClose = TRUE, - footer = tagList( - actionButton(ns("ok_add_livestock"), "OK"), - modalButton("Cancel") - ) - )) - }) - - # Add new livestock row from modal - observeEvent(input$ok_add_livestock, { - req(input$livestock) - if (!(input$livestock %in% livestock_data()[, "livetype_code"])) { - selected_livestock <- lkp_livetype()[lkp_livetype()$livetype_code == input$livestock, ] - manureman_selection <- lkp_manureman()$manureman_desc[1] - new_row <- data.frame( - livetype_code = as.character(selected_livestock$livetype_code), - livetype_desc = selected_livestock$livetype_desc, - herd_composition = 0, - annual_milk = 0, - annual_wool = 0, - annual_growth = 0, - time_in_stable = 0, - manure_in_stable = 0, - manureman_stable = manureman_selection, - time_in_non_roofed_enclosure = 0, - manure_in_non_roofed_enclosure = 0, - manureman_non_roofed_enclosure = manureman_selection, - time_in_onfarm_grazing = 0, - manure_in_field = 0, - manureman_onfarm_grazing = manureman_selection, - time_in_offfarm_grazing = 0, - manureman_offfarm_grazing = manureman_selection, - distance_to_pasture = 0, - manure_onfarm_fraction = 0, - manure_sales_fraction = 0, - body_weight = selected_livestock$body_weight, - body_weight_weaning = 0, - body_weight_year_one = 0, - adult_weight = 0, - work_hour = 0, - litter_size = selected_livestock$litter_size, - piglets_relying_on_milk = 0, - lactation_length = selected_livestock$lactation_length, - proportion_growth_piglets_milk = selected_livestock$proportion_growth_piglets_milk, - lw_gain_piglets = selected_livestock$lw_gain_piglets, - cp_maintenance = selected_livestock$cp_maintenance, - cp_lys_pregnancy = selected_livestock$cp_lys_pregnancy, - cp_lactmilk = selected_livestock$cp_lactmilk, - cp_lys_growth = selected_livestock$cp_lys_growth, - birth_interval = selected_livestock$birth_interval, - protein_milkcontent = selected_livestock$protein_milkcontent, - fat_milkcontent = selected_livestock$fat_milkcontent, - energy_milkcontent = selected_livestock$energy_milkcontent, - energy_meatcontent = selected_livestock$energy_meatcontent, - protein_meatcontent = selected_livestock$protein_meatcontent, - carcass_fraction = selected_livestock$carcass_fraction, - n_manure_content = selected_livestock$n_manure_content, - meat_product = selected_livestock$meat_product, - milk_product = selected_livestock$milk_product, - ipcc_ef_category_t1 = selected_livestock$ipcc_meth_ef_t1, - ipcc_ef_category_t2 = selected_livestock$ipcc_meth_ef_t2, - ipcc_meth_man_category = selected_livestock$ipcc_meth_man, - ipcc_n_exc_category = selected_livestock$ipcc_meth_exc, - stringsAsFactors = FALSE - ) - livestock_data(rbind(livestock_data(), new_row)) - } - - # Freeze and restore scroll position for livestock table - freeze_and_unfreeze_scroll(session, ns("livestock_table")) - - shinyWidgets::updatePickerInput( - session, - "livestock", - selected = setNames(lkp_livetype()$livetype_code, lkp_livetype()$livetype_desc)[1] - ) - removeModal() - }) - - # Render the table - output$livestock_table <- renderDT({ - livestock_dt <- livestock_data() - - # Apply bold and underline formatting to selectInputs text - livestock_dt[manure_cols] <- lapply(livestock_dt[manure_cols], format_text_displayed) - - # Remove the 'livetype_code' column - livestock_dt <- livestock_dt %>% - select(-livetype_code) - - # Checkboxes for selecting rows (to be deleted) - livestock_dt$selected_livestock <- generate_shiny_inputs( - FUN = checkboxInput, - len = nrow(livestock_dt), - id = ns("selected_livestock"), - value = rep(FALSE, nrow(livestock_dt)), - width = "2px" - ) - # Move the 'selected_livestock' column to the first position - livestock_dt <- livestock_dt[, c("selected_livestock", setdiff(names(livestock_dt), "selected_livestock"))] - - datatable( - livestock_dt, - colnames = livestock_table_colnames, - editable = list( - target = "cell", - # Prevent editing of the first column (check boxes for delete rows) - disable = list(columns = 0) - ), - selection = "none", - rownames = FALSE, - escape = FALSE, - extensions = "FixedColumns", - options = list( - scrollX = TRUE, - dom = "t", - paging = FALSE, - fixedColumns = list(leftColumns = 2), - columnDefs = list( - list( - targets = get_column_indices( - livestock_dt, - c("livetype_desc", # Disable editing for livestock type - "manureman_stable", - "manureman_non_roofed_enclosure", - "manureman_onfarm_grazing", - "manureman_offfarm_grazing", - "ipcc_ef_category_t1", - "ipcc_ef_category_t2", - "ipcc_meth_man_category", - "ipcc_n_exc_category" - ) - ) - 1, - createdCell = JS(disable_all_rows_edit_js()), - searchable = FALSE - ) - ), - # Link renderDT's checkbox to the shiny input (not automatic) - drawCallback = JS(checkbox_link(id = "selected_livestock", ns = ns)) - ) - ) %>% - formatStyle( - columns = c( - "herd_composition", "annual_milk", "annual_wool", "annual_growth", - "time_in_stable", "manure_in_stable", "manureman_stable", - "time_in_non_roofed_enclosure", "manure_in_non_roofed_enclosure", - "manureman_non_roofed_enclosure", "time_in_onfarm_grazing", - "manure_in_field", "manureman_onfarm_grazing", "time_in_offfarm_grazing", - "manureman_offfarm_grazing", "distance_to_pasture", - "manure_onfarm_fraction", "manure_sales_fraction" - ), - backgroundColor = "#a9d18e" - ) %>% - formatStyle( - columns = c( - "body_weight", "body_weight_weaning", "body_weight_year_one", - "adult_weight", "work_hour", "litter_size", "piglets_relying_on_milk", - "lactation_length", "proportion_growth_piglets_milk", "lw_gain_piglets", - "cp_maintenance", "cp_lys_pregnancy", "cp_lactmilk", - "cp_lys_growth", "birth_interval", "protein_milkcontent", - "fat_milkcontent", "energy_milkcontent", "energy_meatcontent", - "protein_meatcontent", "carcass_fraction", "n_manure_content", - "meat_product", "milk_product", "ipcc_ef_category_t1", - "ipcc_ef_category_t2", "ipcc_meth_man_category", "ipcc_n_exc_category" - ), - backgroundColor = "#f4b183" - ) - }, server = FALSE) - - # Update the table data when edited - observeEvent(input$livestock_table_cell_edit, { - info <- input$livestock_table_cell_edit - new_data <- livestock_data() - - # Update the specific cell while preserving the column's data type - new_data <- update_cell(new_data, info, offset = 1) - - # Freeze and restore scroll position for livestock table - freeze_and_unfreeze_scroll(session, ns("livestock_table")) - - livestock_data(new_data) - }) - - # Delete selected row - observeEvent(input$delete_livestock, { - req(nrow(livestock_data()) > 0) # Ensure there are rows to process - selected_row <- which( - sapply( - seq_len(nrow(livestock_data())), - function(i) input[[paste0("selected_livestock", i)]] - ) - ) - if (length(selected_row) > 0) { - new_data <- livestock_data() - new_data <- new_data[-selected_row, ] - livestock_data(new_data) - } - - # Freeze and restore scroll position for livestock table - freeze_and_unfreeze_scroll(session, ns("livestock_table")) - }) - - # ------ LIVESTOCK TIME FRACTIONS VALIDATION --------------------------------- - observeEvent(livestock_data(), { - # Always hide previous warnings at the start to avoid stale messages - shinyjs::hide("alert_message_livestock_invalid_values_inputs") - shinyjs::hide("alert_message_livestock_invalid_sum_inputs") - - # Validate input data: ensure data exists and contains at least one row - time_input <- livestock_data() - if (is.null(time_input) || nrow(time_input) == 0) return() - - # Identify the expected time-fraction columns - expected_columns <- c( - "time_in_stable", - "time_in_non_roofed_enclosure", - "time_in_onfarm_grazing", - "time_in_offfarm_grazing" - ) - - # Keep only columns that exist in the current dataset - valid_columns <- intersect(expected_columns, names(time_input)) - if (length(valid_columns) == 0) return() - - # Extract subset of time allocation data - time_data <- time_input[valid_columns] - - # Map backend variable names to display labels - display_labels <- livestock_table_colnames[ - match(valid_columns, names(livestock_data_initialization)) - ] - - # Initialize result containers - invalid_value_messages <- character(0) - livestock_invalid_values <- character(0) - invalid_sum_messages <- character(0) - livestock_invalid_sums <- character(0) - - # Check for invalid fraction values (<0 or >1) - for (i in seq_along(valid_columns)) { - column_name <- valid_columns[i] - column_label <- display_labels[i] - fraction_values <- time_data[[column_name]] - - invalid_rows <- which(fraction_values < 0 | fraction_values > 1) - if (length(invalid_rows) == 0) next - - livestock_names <- time_input$livetype_desc[invalid_rows] - invalid_values <- fraction_values[invalid_rows] - - messages <- sprintf( - " For %s , the value in - '%s' is %s . It must be ≥ 0 and ≤ 1!", - livestock_names, column_label, invalid_values - ) - - invalid_value_messages <- c(invalid_value_messages, messages) - livestock_invalid_values <- c(livestock_invalid_values, livestock_names) - } - - # Check for invalid totals (sum of all four fractions ≠ 1) - row_sums <- rowSums(time_data, na.rm = TRUE) - - # Use a small tolerance when checking equality to 1 - # This avoids false warnings from floating-point rounding errors - tolerance <- 1e-6 - invalid_sum_rows <- which(abs(row_sums - 1) > tolerance) - - if (length(invalid_sum_rows) > 0) { - livestock_names <- time_input$livetype_desc[invalid_sum_rows] - total_values <- row_sums[invalid_sum_rows] - - # Display decimals only when needed (e.g., 0.9998 vs 1) - formatted_totals <- ifelse( - abs(total_values %% 1) < 1e-6, - as.character(round(total_values, 0)), - formatC(total_values, format = "f", digits = 4) - ) - - messages <- sprintf( - " For %s , the total across - the four time-fraction columns is %s . It must equal 1!", - livestock_names, formatted_totals - ) - - invalid_sum_messages <- c(invalid_sum_messages, messages) - livestock_invalid_sums <- c(livestock_invalid_sums, livestock_names) - } - - # Sort messages alphabetically by livestock name - if (length(invalid_value_messages) > 0) { - order_index <- order(tolower(livestock_invalid_values)) - invalid_value_messages <- invalid_value_messages[order_index] - } - - if (length(invalid_sum_messages) > 0) { - order_index <- order(tolower(livestock_invalid_sums)) - invalid_sum_messages <- invalid_sum_messages[order_index] - } - - # Display messages if there are issues - if (length(invalid_value_messages) > 0) { - shinyjs::html( - "alert_message_livestock_invalid_values_inputs", - html = paste(invalid_value_messages, collapse = "
") - ) - shinyjs::show("alert_message_livestock_invalid_values_inputs") - } - - if (length(invalid_sum_messages) > 0) { - shinyjs::html( - "alert_message_livestock_invalid_sum_inputs", - html = paste(invalid_sum_messages, collapse = "
") - ) - shinyjs::show("alert_message_livestock_invalid_sum_inputs") - } - }) - - # Show modal dialog to update manure management - observeEvent(input$livestock_table_cell_clicked, { - info <- input$livestock_table_cell_clicked - req(length(info) > 0) - - if (!is.null(info) && !is.null(info$col) && (names(livestock_data())[info$col + 1] %in% manure_cols)) { - column_name <- names(livestock_data())[info$col] - if (modal_open()) return() - modal_open(TRUE) - showModal(modalDialog( - title = paste("Select a manure management type"), - shinyWidgets::pickerInput( - inputId = ns("manure_management"), - label = NULL, - choices = sort( - unique(lkp_manureman()$manureman_desc) - ), - options = list(`live-search` = TRUE) - ), - footer = tagList( - actionButton(ns("ok_update_manure_management"), "OK"), - modalButton("Cancel") - ) - )) - - selected_cell(info) - } - }) - - # Update manure management in the table - observeEvent(input$ok_update_manure_management, { - req(input$manure_management) - selected_cell <- selected_cell() - if (!is.null(selected_cell)) { - new_data <- livestock_data() - column_name <- names(new_data)[selected_cell$col + 1] - new_data[selected_cell$row, column_name] <- input$manure_management - livestock_data(new_data) - } - shinyWidgets::updatePickerInput( - session, - "manure_management", - selected = lkp_manureman()$manureman_desc[1] - ) - removeModal() - - # Freeze and restore scroll position for livestock table - freeze_and_unfreeze_scroll(session, ns("livestock_table")) - }) - } # End if(FALSE) - duplicate fertilizer/area/livestock removed (content in sourced files 33-35) # ----------- Feed production tab -------------------------------------------- # Initial data frame for crops @@ -1687,29 +1110,29 @@ scenario_server <- function( # Render the crop inputs table output$crop_inputs_table <- renderDT({ - + # Observe fertilizers to show/hide the warning message if (nrow(fertilizers()) == 0 & nrow(crop_inputs_data()) != 0) { shinyjs::show("alert_no_fertilizers") } else { shinyjs::hide("alert_no_fertilizers") } - + # Identifies all available fertilizer columns based on the mapping all_fertilizer_cols <- unname(fertilizer_column_mapping) all_col_names <- colnames(crop_inputs_data()) fertilizer_col_indices <- which(all_col_names %in% all_fertilizer_cols) - + # Identifies currently active fertilizer columns based on user selection active_col_names <- fertilizer_column_mapping[fertilizers()$fertilizer_desc] active_col_indices <- which(all_col_names %in% active_col_names) - + # Calculates indices of inactive fertilizer columns to disable blocked_col_indices <- setdiff(fertilizer_col_indices, active_col_indices) - + # Adjusts indices to 0-based for DataTables (JavaScript) compatibility blocked_js_indices <- blocked_col_indices - 1 - + datatable( crop_inputs_data(), colnames = crop_inputs_table_colnames, @@ -2524,7 +1947,7 @@ scenario_server <- function( if (!is.null(related_database) && length(selected_database) > 0 && related_database != selected_database) { showNotification( paste0("The specified parameters database is not available. '", - selected_database, "' will be used instead."), + selected_database, "' will be used instead."), duration = 5, type = "warning" )