def datenum_to_season(path, datenum):
    """ Transform %Y%m%d into %Y%SEASON, e.g. 20180506 --> 2018S2 """
    month_season_table = {"01":"S1", "02":"S1", "03":"S1",
                          "04":"S2", "05":"S2", "06":"S2",
                          "07":"S3", "08":"S3", "09":"S3",
                          "10":"S4", "11":"S4", "12":"S4"}
    if not isinstance(datenum, str):
        datenum = str(datenum)
    year = datenum[:4]
    month = datenum[4:6]
    return year + month_season_table[month]