@classmethod
def from_xspec_model(cls, model_string, params, emin, emax, nbins):
    """
        Create a model spectrum using a model string and parameters
        as input to XSPEC.

        Parameters
        ----------
        model_string : string
            The model to create the spectrum from. Use standard XSPEC
            model syntax. Example: "wabs*mekal"
        params : list
            The list of parameters for the model. Must be in the order
            that XSPEC expects.
        emin : float, (value, unit) tuple, or :class:`~astropy.units.Quantity`
            The minimum energy of the spectrum in keV
        emax : float, (value, unit) tuple, or :class:`~astropy.units.Quantity`
            The maximum energy of the spectrum in keV
        nbins : integer
            The number of bins in the spectrum.
        """
    xspec_in = []
    model_str = '%s &' % model_string
    for param in params:
        model_str += ' %g &' % param
    model_str += ' /*'
    xspec_in.append('model %s\n' % model_str)
    return cls._from_xspec(xspec_in, emin, emax, nbins)
