# Path: ocbpy/ocb_time.py
# def hr2rad(lt):
#     """ Convert from hours to radians
# 
#     Parameters
#     ----------
#     lt : (float or array-like)
#         Local time-like value in hours
# 
#     Returns
#     -------
#     lon : (float or array-like)
#         Longitude-like value in radians
# 
#     """
# 
#     lt = np.asarray(lt)
#     lon = lt * np.pi / 12.0
# 
#     return lon


import numpy as np
from ocbpy.ocb_time import hr2rad
    mlt : (float or array-like)
        Magnetic local time in hours
    instrument : (str)
        Data set's instrument name (default='ampere')
    method : (str)
        Method used to calculate the elliptical correction, accepts
        'median' or 'gaussian'. (default='median')

    Returns
    -------
    r_corr : (float or array-like)
        Radius correction in degrees at this MLT

    References
    ----------
    Burrell, A. G. et al.: AMPERE Polar Cap Boundaries, Ann. Geophys., 38,
    481-490, doi:10.5194/angeo-38-481-2020, 2020.

    """

    if instrument.lower() != 'ampere':
        raise ValueError("no elliptical correction for {:}".format(instrument))

    method = method.lower()
    coeff = {"median": {"a": 4.01, "e": 0.55, "t": -0.92},
             "gaussian": {"a": 4.41, "e": 0.51, "t": -0.95}}

    if method not in coeff.keys():
        raise ValueError("unknown coefficient computation method")


# Path: ocbpy/ocb_time.py
# def hr2rad(lt):
#     """ Convert from hours to radians
# 
#     Parameters
#     ----------
#     lt : (float or array-like)
#         Local time-like value in hours
# 
#     Returns
#     -------
#     lon : (float or array-like)
#         Longitude-like value in radians
# 
#     """
# 
#     lt = np.asarray(lt)
#     lon = lt * np.pi / 12.0
# 
#     return lon


# Path: ocbpy/ocb_correction.py
import numpy as np
from ocbpy.ocb_time import hr2rad

    mlt : (float or array-like)
        Magnetic local time in hours
    instrument : (str)
        Data set's instrument name (default='ampere')
    method : (str)
        Method used to calculate the elliptical correction, accepts
        'median' or 'gaussian'. (default='median')

    Returns
    -------
    r_corr : (float or array-like)
        Radius correction in degrees at this MLT

    References
    ----------
    Burrell, A. G. et al.: AMPERE Polar Cap Boundaries, Ann. Geophys., 38,
    481-490, doi:10.5194/angeo-38-481-2020, 2020.

    """

    if instrument.lower() != 'ampere':
        raise ValueError("no elliptical correction for {:}".format(instrument))

    method = method.lower()
    coeff = {"median": {"a": 4.01, "e": 0.55, "t": -0.92},
             "gaussian": {"a": 4.41, "e": 0.51, "t": -0.95}}

    if method not in coeff.keys():
        raise ValueError("unknown coefficient computation method")


    mlt_rad = hr2rad(mlt)