#!/usr/bin/env python
# coding: utf-8

from __future__ import print_function, division

from datetime import datetime, timedelta

import numpy as np
import dplume

# TODO: ipython's autoreload seems to break relative imports (?!)
from smartcarb import io
from smartcarb import map
from smartcarb import noise
from smartcarb import inversion
from smartcarb import misc
from smartcarb import orbit
from smartcarb import config as cfg
from smartcarb import oco2
from smartcarb import gauss


def iter_times(start, end, step):
    current = start
    while current <= end:
        yield current
        current += step



def main(date, name, path):
    """
    Plot maps of XCO2 for given date and tracer.
    """
    output = io.SmartcarbOutput(path)
    rlat = output.read_variable('rlat', date)
    rlon = output.read_variable('rlon', date)

    T = output.read_variable('T', date)
    p = output.read_variable('P', date)
    ps = output.read_variable('PS', date)

    xm = output.read_variable(name, date)

    return rlon, rlat, xm, T, p, ps

    # co2 mass mixing ratio -> xco2









