Read data from ECMWF MACC reanalysis netCDF4 file.

    Parameters
    ----------
    filename : string
        full path to netCDF4 data file.
    latitude : float
        latitude in degrees
    longitude : float
        longitude in degrees
    utc_time_range : sequence of datetime.datetime
        pair of start and stop naive or UTC date-times

    Returns
    -------
    data : pandas.DataFrame
        dataframe for specified range of UTC date-times

def read_ecmwf_macc(filename, latitude, longitude, utc_time_range=None):
    """
    Read data from ECMWF MACC reanalysis netCDF4 file.

    Parameters
    ----------
    filename : string
        full path to netCDF4 data file.
    latitude : float
        latitude in degrees
    longitude : float
        longitude in degrees
    utc_time_range : sequence of datetime.datetime
        pair of start and stop naive or UTC date-times

    Returns
    -------
    data : pandas.DataFrame
        dataframe for specified range of UTC date-times
    """
    ecmwf_macc = ECMWF_MACC(filename)
    try:
        ilat, ilon = ecmwf_macc.get_nearest_indices(latitude, longitude)
        nctime = ecmwf_macc.data['time']
        if utc_time_range:
            start_idx = netCDF4.date2index(
                utc_time_range[0], nctime, select='before')
            stop_idx = netCDF4.date2index(
                utc_time_range[-1], nctime, select='after')
            time_slice = slice(start_idx, stop_idx + 1)
        else:
            time_slice = slice(0, ecmwf_macc.time_size)
        times = netCDF4.num2date(nctime[time_slice], nctime.units)
        df = {k: ecmwf_macc.data[k][time_slice, ilat, ilon]
              for k in ecmwf_macc.keys}
        if ECMWF_MACC.TCWV in df:
            # convert total column water vapor in kg/m^2 at (1-atm, 25-degC) to
            # precipitable water in cm
            df['precipitable_water'] = df[ECMWF_MACC.TCWV] / 10.0
    finally:
        ecmwf_macc.data.close()
    return pd.DataFrame(df, index=times.astype('datetime64[s]'))