# Buggy code
def _parse_hdus(cls, hdulist):
    header = MetaDict(OrderedDict(hdulist[0].header))
    if len(hdulist) == 4:
        if is_time_in_given_format(hdulist[0].header["DATE-OBS"], "%d/%m/%Y"):
            start_time = Time.strptime(hdulist[0].header["DATE-OBS"], "%d/%m/%Y")
        elif is_time_in_given_format(hdulist[0].header["DATE-OBS"], "%d/%m/%y"):
            start_time = Time.strptime(hdulist[0].header["DATE-OBS"], "%d/%m/%y")
        else:
            raise ValueError("Date not recognized")
        xrsb = hdulist[2].data["FLUX"][0][:, 0]
        xrsa = hdulist[2].data["FLUX"][0][:, 1]
        seconds_from_start = hdulist[2].data["TIME"][0]
    elif 1 <= len(hdulist) <= 3:
        start_time = parse_time(header["TIMEZERO"])
        seconds_from_start = hdulist[0].data[0]
        xrsb = hdulist[0].data[1]
        xrsa = hdulist[0].data[2]
    else:
        raise ValueError("Don't know how to parse this file")

    times = start_time + TimeDelta(seconds_from_start * u.second)
    times.precision = 9

    # remove bad values as defined in header comments
    xrsb[xrsb == -99999] = np.nan
    xrsa[xrsa == -99999] = np.nan

    # fix byte ordering
    newxrsa = xrsa.byteswap().newbyteorder()
    newxrsb = xrsb.byteswap().newbyteorder()

    data = DataFrame(
        {"xrsa": newxrsa, "xrsb": newxrsb}, index=times.isot.astype("datetime64")
    )
    data.sort_index(inplace=True)

    # Add the units
    units = OrderedDict([("xrsa", u.W / u.m**2), ("xrsb", u.W / u.m**2)])
    return data, header, units


# Traceback (ValueError)
In [3]: g = TimeSeries('../flarenet/data/goes/go06860129.fits')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-3-686c02e70652> in <module>()
----> 1 g = TimeSeries('../flarenet/data/goes/go06860129.fits')

~/Projects/sunpydev/sunpy/timeseries/timeseries_factory.py in __call__(self, *args, **kwargs)
442             cls = types[0]
443
--> 444             data_header_unit_tuples.append(cls._parse_hdus(pairs))
445
446         # Loop over each registered type and check to see if WidgetType

~/Projects/sunpydev/sunpy/timeseries/sources/goes.py in _parse_hdus(cls, hdulist)
169             seconds_from_start = hdulist[2].data['TIME'][0]
170         elif 1 <= len(hdulist) <= 3:
--> 171             start_time = parse_time(header['TIMEZERO'])
172             seconds_from_start = hdulist[0].data[0]
173             xrsb = hdulist[0].data[1]

~/Projects/sunpydev/sunpy/time/time.py in parse_time(time_string, format, **kwargs)
291         rt = Time.now()
292     else:
--> 293         rt = convert_time(time_string, format=format, **kwargs)
294
295     return rt

~/.pyenv/versions/3.6.3/lib/python3.6/functools.py in wrapper(*args, **kw)
801
802     def wrapper(*args, **kw):
--> 803         return dispatch(args[0].__class__)(*args, **kw)
804
805     registry[object] = func

~/Projects/sunpydev/sunpy/time/time.py in convert_time(time_string, format, **kwargs)
138 def convert_time(time_string, format=None, **kwargs):
139     # default case when no type matches
--> 140     return Time(time_string, format=format, **kwargs)
141
142

~/.virtualenvs/sunpy-dev/lib/python3.6/site-packages/astropy/time/core.py in __init__(self, val, val2, format, scale, precision, in_subfmt, out_subfmt, location, copy)
397         else:
398             self._init_from_vals(val, val2, format, scale, copy,
--> 399                                  precision, in_subfmt, out_subfmt)
400             self.SCALES = TIME_TYPES[self.scale]
401

~/.virtualenvs/sunpy-dev/lib/python3.6/site-packages/astropy/time/core.py in _init_from_vals(self, val, val2, format, scale, copy, precision, in_subfmt, out_subfmt)
452         # Parse / convert input values into internal jd1, jd2 based on format
453         self._time = self._get_time_fmt(val, val2, format, scale,
--> 454                                         precision, in_subfmt, out_subfmt)
455         self._format = self._time.name
456

~/.virtualenvs/sunpy-dev/lib/python3.6/site-packages/astropy/time/core.py in _get_time_fmt(self, val, val2, format, scale, precision, in_subfmt, out_subfmt)
485                   format.lower() in self.FORMATS):
486             if format is None:
--> 487                 raise ValueError("No time format was given, and the input is "
488                                  "not unique")
489             else:

ValueError: No time format was given, and the input is not unique

# Fixed code
def _parse_hdus(cls, hdulist):
    header = MetaDict(OrderedDict(hdulist[0].header))
    if len(hdulist) == 4:
        if is_time_in_given_format(hdulist[0].header["DATE-OBS"], "%d/%m/%Y"):
            start_time = Time.strptime(hdulist[0].header["DATE-OBS"], "%d/%m/%Y")
        elif is_time_in_given_format(hdulist[0].header["DATE-OBS"], "%d/%m/%y"):
            start_time = Time.strptime(hdulist[0].header["DATE-OBS"], "%d/%m/%y")
        else:
            raise ValueError("Date not recognized")
        xrsb = hdulist[2].data["FLUX"][0][:, 0]
        xrsa = hdulist[2].data["FLUX"][0][:, 1]
        seconds_from_start = hdulist[2].data["TIME"][0]
    elif 1 <= len(hdulist) <= 3:
        start_time = parse_time(header["TIMEZERO"], format="utime")
        seconds_from_start = hdulist[0].data[0]
        xrsb = hdulist[0].data[1]
        xrsa = hdulist[0].data[2]
    else:
        raise ValueError("Don't know how to parse this file")

    times = start_time + TimeDelta(seconds_from_start * u.second)
    times.precision = 9

    # remove bad values as defined in header comments
    xrsb[xrsb == -99999] = np.nan
    xrsa[xrsa == -99999] = np.nan

    # fix byte ordering
    newxrsa = xrsa.byteswap().newbyteorder()
    newxrsb = xrsb.byteswap().newbyteorder()

    data = DataFrame(
        {"xrsa": newxrsa, "xrsb": newxrsb}, index=times.isot.astype("datetime64")
    )
    data.sort_index(inplace=True)

    # Add the units
    units = OrderedDict([("xrsa", u.W / u.m**2), ("xrsb", u.W / u.m**2)])
    return data, header, units