debangs / RSAGA

RSAGA Package Code
GNU General Public License v2.0
0 stars 2 forks source link

dates in rsaga.pisr2 #19

Open pauljeco opened 5 years ago

pauljeco commented 5 years ago

Hi, I noticed that the coding for month in this function requires adding one day i.e. this start.date=list(day=1, month = 2,year = 2017),end.date=list(day = 31,month = 2, year = 2017) actually passes this start.date=list(day=1, month = 1,year = 2017),end.date=list(day = 31,month = 1, year = 2017) Best

rhurlin commented 5 years ago

Well, if I understand your issue right, your example shows the need of increasing the month by 1 (month from 1 to 12 instead of 0 to 11 as used in SAGA GIS itself). This behaviour is intended. In the help page of rsaga.pisr2() you can read:

Note SAGA_CMD uses zero-based months, but this R function uses the standard one-based months (e.g. day 1 is the first day of the month, month 1 is January) and translates to the SAGA system.

BTW, this also means, that function rsaga.pisr2() does not require 'adding one day' but increasing month numbering by 1.

HTH, Rainer

pauljeco commented 5 years ago

Thanks Rainer, yes one month instead of a 'day' - my mistake. Otherwise changing the 'Note' (or start.date description) from '(e.g. day 1 is the first day of the month, month 1 is January)' to (e.g. day 1 is the first day of the month, month 0 is January) etc