from mapies.tropomi import TROPOMI
import numpy as np
import time
# from dask.distributed import Client


if __name__ == "__main__":
    start_date = "202301010000"
    end_date = "202301012359"

    outdir = "/home/cmeikle/Projects/data/"
    indir = "/home/cmeikle/Projects/data/TROPOMI"

    start_time = time.time()

    c = TROPOMI(start_date, end_date, dest=outdir, indir=indir, grid_repr="regular")
    c.read_nc()
    c.process_data(monthly_avg=False, batch_size = 14, apply_qa=True, geospatial_crop=[[-40, 40], [0, 70]])

    # c.yearly_average()
    c.plot_2D_observations(months=[0], outdir=outdir)
    c.plot_2D_num_obs(months=[0], outdir=outdir)
    end_time = time.time()
    elapsed_time = end_time - start_time
    print(f"Script executed in {elapsed_time:.2f} seconds.")
