'Input value validation, typically overridden by derived classes'

def _check_val_type(self, val1, val2):

    if (not ((val1.dtype == np.double) and np.all(np.isfinite(val1)) and ((val2 is None) or ((val2.dtype == np.double) and np.all(np.isfinite(val2)))))):
        raise TypeError(u'Input    values    for    {0}    class    must    be    finite    doubles'.format(self.name))
    if (getattr(val1, u'unit', None) is not None):
        _unit = u.CompositeUnit(getattr(self, u'unit', 1.0), [u.day], [1])
        val1 = u.Quantity(val1, copy=False).to_value(_unit)
        if (val2 is not None):
            val2 = u.Quantity(val2, copy=False).to_value(_unit)
    elif (getattr(val2, u'unit', None) is not None):
        raise TypeError(u'Cannot    mix    float    and    Quantity    inputs')
    if (val2 is None):
        val2 = np.zeros_like(val1)
    def asarray_or_scalar(val):
        u'\n                                                Remove    ndarray    subclasses    since    for    jd1/jd2    we    want    a    pure    ndarray\n                                                or    a    Python    or    numpy    scalar.\n                                                '
        return (np.asarray(val) if isinstance(val, np.ndarray) else val)
    return (asarray_or_scalar(val1), asarray_or_scalar(val2))
