-
not sure if this is an issue or if I am doing something wrong. I tried to run the Running
Whats the problem? (btw in the documentation for |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
Hello, Have you tried running the tool using a ":" for the start and end times parameters between the hours, minutes ,and seconds i.e. (00:00:00 and 23:59:59)? The tool documentation does use this format for start and end time. Alternatively you could use the values "sunrise" and "sunset" for the start time and end time to capture the full day. |
Beta Was this translation helpful? Give feedback.
-
It seems that the colons are stripped out of the default values in the R function definitionwhen converted from whitebox_tools.py. So there is an issue here, thanks for bringing it to our attention. It looks like the documentation is correct, but the default arguments are not functional and haven't been for some time. For instance, this works: library(whitebox)
library(terra)
wbt_verbose(TRUE)
wbt_time_in_daylight(sample_dem_data(), output = "test.tif", 44.11856, -72.80839, max_dist=500, end_time='23:59:59')
#> time_in_daylight - Elapsed Time (excluding I/O): 0.566s
plot(rast("test.tif")) |
Beta Was this translation helpful? Give feedback.
-
Good catch indeed. It's fixed in the user manual now. |
Beta Was this translation helpful? Give feedback.
-
Sorry, got a new problem. Running your example works out though. So I thought I would give it a try on terra sample data
but this results again in
|
Beta Was this translation helpful? Give feedback.
-
I just tried to run library(whitebox)
library(terra)
#> terra 1.7.71
wbt_verbose(TRUE)
wbt_time_in_daylight(sample_dem_data(), output = "test.tif", 44.11856, -72.80839, max_dist=500, end_time='23:59:59')
#>
#> Error running WhiteboxTools (TimeInDaylight)
#> whitebox.exe_path: "C:\Users\jwiesehahn\AppData\Roaming/R/data/R/whitebox/WBT/whitebox_tools.exe"; File exists? TRUE
#> Arguments: --run=TimeInDaylight --dem="C:/Program Files/R/R-4.3.3/library/whitebox/extdata/DEM.tif" --output="test.tif" --lat="44.11856" --long="-72.80839" --az_fraction=10 --max_dist=500 --utc_offset=00:00 --start_day=1 --end_day=365 --start_time=00:00:00 --end_time=23:59:59 -v
#> System command had status 101
#> *****************************
#> * Welcome to TimeInDaylight *
#> * Powered by WhiteboxTools *
#> * www.whiteboxgeo.com *
#> *****************************
#> Calculating the local almanac...
#> time_in_daylight - Elapsed Time: NA [did not run] Created on 2024-04-25 with reprex v2.1.0 Standard output and standard errorthread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ComponentRange { name: "ordinal", minimum: 1, maximum: 365, value: 366, conditional_range: true }', whitebox-tools-app\src\tools\terrain_analysis\time_in_daylight.rs:935:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Any ideas? |
Beta Was this translation helpful? Give feedback.
It seems that the colons are stripped out of the default values in the R function definitionwhen converted from whitebox_tools.py. So there is an issue here, thanks for bringing it to our attention. It looks like the documentation is correct, but the default arguments are not functional and haven't been for some time.
For instance, this works: