def METHOD_NAME(time_value_pair, out_ts_format):
    """
    converts a numpy array containing basic_types.time_value_pair to a
    numpy array containing basic_types.datetime_value_2d in user specified
    basic_types.ts_format
    :param time_value_pair: numpy array of type basic_types.time_value_pair
    :param out_ts_format: desired format of the array defined by one of the
                          options given in basic_types.ts_format
    """
    if time_value_pair.dtype != basic_types.time_value_pair:
        raise ValueError('Method expects a numpy array containing '
                         'basic_types.time_value_pair')
    datetime_value_2d = np.zeros((len(time_value_pair), ),
                                 dtype=basic_types.datetime_value_2d)
    out_ts_format = tsformat(out_ts_format)
    # convert time_value_pair to datetime_value_2d in desired output format
    if out_ts_format == basic_types.ts_format.magnitude_direction:
        datetime_value_2d['time'] = \
            time_utils.sec_to_date(time_value_pair['time'])
        uv = np.zeros((len(time_value_pair), 2), dtype=np.double)
        uv[:, 0] = time_value_pair['value']['u']
        uv[:, 1] = time_value_pair['value']['v']
        datetime_value_2d['value'] = transforms.uv_to_r_theta_wind(uv)
    elif out_ts_format == basic_types.ts_format.uv:
        datetime_value_2d['time'] = \
            time_utils.sec_to_date(time_value_pair['time'])
        datetime_value_2d['value'][:, 0] = time_value_pair['value']['u']
        datetime_value_2d['value'][:, 1] = time_value_pair['value']['v']
    else:
        raise ValueError('out_ts_format is not one of the two supported '
                         'types: '
                         'basic_types.ts_format.magnitude_direction, '
                         'basic_types.ts_format.uv')
    return datetime_value_2d