import scripts_m2m_download_new_modified2 as m2m

#destination_folder = 'C:\\Users\\rhussain\\OneDrive - DOI\\Desktop\\pycharm_project_data\\urban-heat-islands\\cheyenne_m2m/'
#destination_folder = "/caldera/projects/usgs/eros/urban_heat_islands/CheyenneTest"
destination_folder = "/caldera/projects/usgs/eros/urban_heat_islands/Portland"

import config
username = config.USERNAME
password = config.PASSWORD
some_h = 3
some_v = 3

#m2m.download_files(directory=destination_folder, h=3, v=3,acq_date='2018-1-1,2019-12-31',threads=1,username=username,password=password, dataset="ARD_TILE",
#                        products="ST",spacecraft="LANDSAT_7")


a_start_year_inclusive = int(1985)
a_end_year_inclusive = int(2020)
#tile_hv_names_to_match = hv_tilelist
base_dir = destination_folder

for current_year in range(a_start_year_inclusive,a_end_year_inclusive+1):
    acq_date = str(current_year)+"-1-1,"+str(current_year)+"-12-31"
    m2m.download_files(directory=destination_folder, h=some_h, v=some_v, acq_date=acq_date,
                        threads=1,
                        username=username, password=password, dataset="ARD_TILE",
                        products="ST", spacecraft="LANDSAT_4")
    m2m.download_files(directory=destination_folder, h=some_h, v=some_v, acq_date=acq_date,
                        threads=1,
                        username=username, password=password, dataset="ARD_TILE",
                        products="ST", spacecraft="LANDSAT_5")
    m2m.download_files(directory=destination_folder, h=some_h, v=some_v, acq_date=acq_date,
                        threads=1,
                        username=username, password=password, dataset="ARD_TILE",
                        products="ST", spacecraft="LANDSAT_7")
    m2m.download_files(directory=destination_folder, h=some_h, v=some_v, acq_date=acq_date,
                        threads=1,
                        username=username, password=password, dataset="ARD_TILE",
                        products="ST", spacecraft="LANDSAT_8")