def setref(graphtable=None, comptable=None, thermtable=None,
           area=None, waveset=None):
    """Set default graph and component tables, primary area, and
    wavelength set.

    This is similar to setting ``refdata`` in IRAF STSDAS SYNPHOT.
    If all parameters set to `None`, they are reverted to software default.
    If any of the parameters are not `None`, they are set to desired
    values while the rest (if any) remain at current setting.

    Parameters
    ----------
    graphtable, comptable, thermtable : str or `None`
        Graph, component, and thermal table names, respectively,
        for `~pysynphot.observationmode` throughput look-up.
        Do not use "*" wildcard.

    area : float or `None`
        Telescope collecting area, i.e., the primary
        mirror, in :math:`\\textnormal{cm}^{2}`.

    waveset : tuple or `None`
        Parameters for :func:`set_default_waveset` as follow:
            * ``(minwave, maxwave, num)`` - This assumes log scale.
            * ``(minwave, maxwave, num, 'log')``
            * ``(minwave, maxwave, num, 'linear')``

    Raises
    ------
    ValueError
        Invalid ``waveset`` parameters.

    """
    global GRAPHTABLE, COMPTABLE, THERMTABLE, PRIMARY_AREA, GRAPHDICT, COMPDICT, THERMDICT

    GRAPHDICT = {}
    COMPDICT = {}
    THERMDICT = {}

    #Check for all None, which means reset
    kwds=set([graphtable,comptable,thermtable,area,waveset])
    if kwds == set([None]):
        #then we should reset everything.
        _set_default_refdata()
        return

    #Otherwise, check them all separately
    if graphtable is not None:
        GRAPHTABLE = irafconvert(graphtable)

    if comptable is not None:
        COMPTABLE = irafconvert(comptable)

    if thermtable is not None:
        THERMTABLE = irafconvert(thermtable)

    #Area is a bit different:
    if area is not None:
        PRIMARY_AREA = area

    if waveset is not None:
        if len(waveset) not in (3, 4):
            raise ValueError('waveset tuple must contain 3 or 4 values')

        minwave = waveset[0]
        maxwave = waveset[1]
        num = waveset[2]

        if len(waveset) == 3:
            log = True
        elif len(waveset) == 4:
            if waveset[3].lower() == 'log':
                log = True
            elif waveset[3].lower() == 'linear':
                log = False
            else:
                raise ValueError('fourth waveset option must be "log" or "linear"')

        set_default_waveset(minwave,maxwave,num,log=log)

    #That's it.
    return
Set default graph and component tables, primary area, and
    wavelength set.

    This is similar to setting ``refdata`` in IRAF STSDAS SYNPHOT.
    If all parameters set to `None`, they are reverted to software default.
    If any of the parameters are not `None`, they are set to desired
    values while the rest (if any) remain at current setting.

    Parameters
    ----------
    graphtable, comptable, thermtable : str or `None`
        Graph, component, and thermal table names, respectively,
        for `~pysynphot.observationmode` throughput look-up.
        Do not use "*" wildcard.

    area : float or `None`
        Telescope collecting area, i.e., the primary
        mirror, in :math:`\\textnormal{cm}^{2}`.

    waveset : tuple or `None`
        Parameters for :func:`set_default_waveset` as follow:
            * ``(minwave, maxwave, num)`` - This assumes log scale.
            * ``(minwave, maxwave, num, 'log')``
            * ``(minwave, maxwave, num, 'linear')``

    Raises
    ------
    ValueError
        Invalid ``waveset`` parameters.