Commit 53089786 authored by Gaetano Raffaele's avatar Gaetano Raffaele
Browse files

Cross-year date interval selection and trend computation (pre).

parent 9c7d836f
......@@ -105,9 +105,11 @@ def getCoherentReferencePeriod(dates_fn,start_date=(1,1),end_date=(12,31),dates_
return min_start,max_end,idx_delay+1
def computeNDVITrends(series_fn,dates_fn,start_date=(1,1),end_date=(12,31),dates_per_year=23):
def computeNDVITrend(series_fn,dates_fn,start_date=(1,1),end_date=(12,31),dates_per_year=23):
cmd = ['otbcli_TimeSeriesIndexTrend', '-ndvits', series_fn, '-ndvidates', dates_fn, '-ndvi.reduce', 'cumul']
sd,ed,N = getCoherentReferencePeriod(dates_fn,start_date,end_date,dates_per_year)
cmd += ['-ndvi.reduce.cumul.month1', str(sd[0]),'-ndvi.reduce.cumul.day1', str(sd[1])]
cmd += ['-ndvi.reduce.cumul.month2', str(ed[0]), '-ndvi.reduce.cumul.day2', str(ed[1])]
cmd += ['-ndvitrend', os.path.dirname(series_fn) + '/' + 'ndvitrend.tif']
cmd += ['-ndvilabel', os.path.dirname(series_fn) + '/' + 'ndvilabel.tif']
subprocess.call(cmd)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment