Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected Behavior in rsaga.pisr2 Function: Day Step Parameter Not Applied Correctly #5

Open
peterhor opened this issue Feb 15, 2024 · 0 comments

Comments

@peterhor
Copy link

Description

I am using the rsaga.pisr2 function from the RSAGA package (version 1.4.0) in R (version R-4.3.2) with RStudio (2023.12.0+369 "Ocean Storm") on a Windows system. When setting the day.step parameter to 7, the function appears to override this setting and defaults to a resolution of 5 days instead.

Steps to Reproduce

  1. Load the RSAGA package and set up the environment.

  2. Execute the rsaga.pisr2 function with the following parameters:

    rsaga.pisr2(in.dem = dtm,
                out.direct.grid = paste0(output.dir, layer.code, "_insolation.direct.tif"),
                out.diffuse.grid = paste0(output.dir, layer.code, "_insolation.diffuse.tif"),
                out.total.grid = paste0(output.dir, layer.code, "_insolation.total.tif"),
                out.duration = paste0(output.dir, layer.code, "_insolation.duration.tif"),
                start.date = list(day=21, month=7, year=2023),
                end.date = list(day=21, month=10, year=2023),
                time.step = 6,
                day.step = 7,
                env = env)
  3. Observe the parameters passed to the SAGA command, specifically see Resolution [d]: 5, but also note end.date.

Console Output

**Parameters**
Grid system: 0.100000; 1884x 2276y; 584947.870000x 6661632.24y
Elevation: e2_dtm
Sky View Factor: <not set>
Water Vapour Pressure [mbar]: <not set>
Default: 10.000000
Direct Insolation: 
Diffuse Insolation: 
Total Insolation: 
Direct to Diffuse Ratio: 
Compare to Flat Terrain: <not set>
Solar Constant [W / m�]: 1367.000000
Local Sky View Factor: true
Units: kWh / m�
Shadow: slim
Location: constant latitude
Latitude: +053�00'00''
Time Period: range of days
Day: 2023-06-21
Last Day: 2023-10-21
**Resolution [d]: 5**
Time Span [h]: 0.000000; 24.000000
Resolution [h]: 6.000000
Atmospheric Effects: Height of Atmosphere and Vapour Pressure
Height of Atmosphere [m]: 12000.000000

Expected Behavior

I understood from the description of the function () should apply the day.step parameter as specified (7 days in this case) and use it in the SAGA command.

Actual Behavior

The function seems to override the specified day.step parameter with a default of 5 days.

Additional Context

  • RSAGA Package Version: 1.4.0
  • R Version: R-4.3.2
  • RStudio Version: 2023.12.0+369 "Ocean Storm"
  • Operating System: Windows

I have attached the relevant output showing the parameters passed to the SAGA command. The key issue is with the Resolution [d]: 5, which does not correspond to the day.step = 7 that I set.

Possible Solution

I am not sure if this is a bug in the RSAGA package or a misconfiguration on my end. Any guidance on how to ensure the day.step parameter is correctly applied would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant