import shutil
import os


phase2_folders = [
    "UrbanZones","STACK","PERSISTENT_CITYCEN_STATS_STACK","NUGROWTH_CITYCEN_STATS_STACK","LST_CLASS_STATS_TOTAL",
    "LST_CLASS_STATS_ANNUAL","LST_CITYCEN_STATS_ANNUAL","LC_clipped","INTENSITY_STACK","INTENSITY_CLASS_STATS_ANNUAL",
    "INTENSITY_CITYCEN_STATS_TOTAL","INTENSITY_CITYCEN_STATS_ANNUAL","INTENSITY_ANNUAL","HOTSPOT_PROBABILITY",
    "HOTSPOT_CLASS_STATS_ANNUAL","HOTSPOT"
 ]

#all_iata_codes = ["FSD","MSO","ORD","MKE","PHX","RDU","FAR","LIT","PIT","SDF","CYS","BOI","MSP","OMA","ABQ","LAS","DTW","BOS","OKC","MEM","BNA","ELP","DEN","IND","SFO","ATL","CMH","DFW","SAT","PHL","DSM","JAX","IAH","LAX","LGA","BHX","MSY","MIA","BWI","SLC","PHX","CVG","CLT","SMF","SEA","MCI","PDX","COS","SAN","AUS","DCA"]

#finished_iata_codes = ["MSP","ATL","IAH","PHX","OKC","BHX","MSY","PIT","SAT","IND","OMA","ORD","BWI","MIA","ABQ","MKE","MCI","SMF","ATL","DSM","LIT","CLT","BOX","RDU","CYS","MEM","DCA","COS"]
#finished_iata_codes = ["CVG","PDX","FAR","SLC","SAN","LAX","BNA","LAS","ELP","DEN","BOI","SFO"]

#finished_iata_codes = all_iata_codes
#finished_iata_codes = ["CLT","SFO","BOI","LAS", "SEA", "MKE", "FAR", "DSM"]
#finished_iata_codes = ["DCA","BWI","ORD","OMA","IND","SAT","BHX","MSY","PIT","MSP","ATL","IAH","PHX","OKC","DFW","JAX", "DTW","CMH"]

# finished_iata_codes = ["DEN", "LIT", "BNA", "PDX", "MIA", "SMF", "COS", "ELP", "MEM", "SAN", "BOS", "SLC", "RDU", "CVG", "ABQ", "LAX", "LGA", "AUS", 
#                    "MCI", "CYS", "PHL"]

finished_iata_codes = ["FSD","MSO","ORD","MKE","PHX","RDU","FAR","LIT","PIT","SDF","CYS","BOI","MSP","OMA","ABQ","LAS","DTW","BOS","OKC","MEM","BNA","ELP","DEN","IND","SFO","ATL","CMH","DFW","SAT","PHL","DSM","JAX","IAH","LAX","LGA","BHX","MSY","MIA","BWI","SLC","PHX","CVG","CLT","SMF","SEA","MCI","PDX","COS","SAN","AUS","DCA"]

for iata in finished_iata_codes:
    #iata = "MSO"
    base_path = "/caldera/projects/usgs/eros/urban_heat_islands/Phase1/"+iata+"/output_folder"

    for folder in phase2_folders:
        remove_path = os.path.join(base_path,folder)
        print(remove_path)
        if os.path.exists(remove_path):
            shutil.rmtree(remove_path)

    remove_path = os.path.join(base_path,iata+"_zipped")
    print(remove_path)
    if os.path.exists(remove_path):
       shutil.rmtree(remove_path)