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

FIX: fix negative date delay when start (m,d) is after end (m,d).

parent 3d311ddf
......@@ -5,6 +5,26 @@ import subprocess
import warnings
from calendar import monthrange
def getDatesFromFiles(fld,
template='MOD13Q1.006__250m_16_days_NDVI_',
date_pos=34,
date_len=7,
date_jul=True,
ext='tif'):
lst = sorted(glob.glob(fld + '/' + template + '*.' + ext))
with open(fld + '/dates.txt', 'wb') as df:
for f in lst:
dt = os.path.basename(f)[date_pos:date_pos + date_len]
if date_jul:
y, jd = int(dt[0:4]), int(dt[4:7])
dt = (datetime.datetime(y, 1, 1) + datetime.timedelta(jd)).strftime('%Y%m%d')
df.write(dt + '\n')
return
def temporalSmoothing(fld,
template='MOD13Q1.006__250m_16_days_NDVI_',
date_pos=34,
......
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