Skip to content

Commit

Permalink
Merge pull request #555 from weecology/portalPython
Browse files Browse the repository at this point in the history
Print error form NDVI.py [no version bump]
  • Loading branch information
gmyenni authored Nov 5, 2024
2 parents 2dcb0d0 + 75d9bb1 commit 318c77b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion update-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ message("Updating Plant census table")
source("DataCleaningScripts/update_portal_plant_censuses.R"); writecensustable()

message("Updating NDVI")
system("python3 DataCleaningScripts/NDVI.py")
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")

0 comments on commit 318c77b

Please sign in to comment.