#!/usr/bin/env python

import pytest
import pandas as pd
import numpy as np
from pathlib import Path
from mapies.viirs import VIIRS

# test data loaded in new directory mapies/tests/test_data this way we can read it in and always test the function


def test_to_da():
    start_date = "202401010000"
    end_date = "202401011630"
    outdir="./"
    indir="test_data"
    c = VIIRS(start_date, end_date, dest=outdir, indir=indir, grid_repr="rotated")
    print(c.dest)
    c.read_nc()
    c.process_data(monthly_avg=False)
    outfiles = c.to_da(frequency="3H", save_nc= True, save_figs=False)
    assert outfiles == [Path("obs202401010000.nc")]