-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathupdate-data.R
28 lines (21 loc) · 1.12 KB
/
update-data.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
message("Updating regional weather data")
source("DataCleaningScripts/get_regional_weather.R"); append_regional_weather()
message("Updating weather station data")
source("DataCleaningScripts/new_weather_data.R"); append_weather()
message("Updating Rodent trapping table")
source("DataCleaningScripts/update_portal_rodent_trapping.r"); writetrappingtable()
message("Updating Plots table")
source("DataCleaningScripts/update_portal_plots.R"); writeportalplots()
message("Updating New Moon Numbers")
source("DataCleaningScripts/new_moon_numbers.r"); writenewmoons()
message("Updating Plant census table")
source("DataCleaningScripts/update_portal_plant_censuses.R"); writecensustable()
message("Updating NDVI")
output <- system2("python3", "DataCleaningScripts/NDVI.py", stderr = TRUE, stdout = TRUE)
# Check if the Python script returns an error
if (!is.null(attr(output, "status")) && attr(output, "status") != 0) {
stop("Error in NDVI.py:\n", paste(output, collapse = "\n"))
}
message("NDVI update completed successfully.")
source("DataCleaningScripts/update_ndvi.R"); writendvitable()
system("rm -r ./NDVI/landsat-data ./NDVI/scenes.csv")