<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_from_sedfile(cls, fitsfile, norm_type='eflux'):
 """Create a CastroData object from an SED fits file Parameters fitsfile : str Name of the fits file norm_type : str Type of normalization to use, options are: * norm : Normalization w.r.t. to test source * flux : Flux of the test source ( ph cm^-2 s^-1 ) * eflux: Energy Flux of the test source ( MeV cm^-2 s^-1 ) * npred: Number of predicted photons (Not implemented) * dnde : Differential flux of the test source ( ph cm^-2 s^-1 MeV^-1 ) Returns ------- castro : `~fermipy.castro.CastroData` """

        tab_s = Table.read(fitsfile, hdu=1)
        tab_s = convert_sed_cols(tab_s)

        if norm_type in ['flux', 'eflux', 'dnde']:
            ref_colname = 'ref_%s' % norm_type
            norm_vals = np.array(tab_s['norm_scan'] *
                                 tab_s[ref_colname][:, np.newaxis])
        elif norm_type == "norm":
            norm_vals = np.array(tab_s['norm_scan'])
        else:
            raise ValueError('Unrecognized normalization type: %s' % norm_type)

        nll_vals = -np.array(tab_s['dloglike_scan'])
        ref_spec = ReferenceSpec.create_from_table(tab_s)
        spec_data = SpecData(ref_spec, tab_s['norm'], tab_s['norm_err'])
        return cls(norm_vals, nll_vals, spec_data, norm_type)