identify_spectrum_format

specutils.io.registers.identify_spectrum_format(filename, dtype=<class 'specutils.spectra.spectrum1d.Spectrum1D'>)[source]

Attempt to identify a spectrum file format

Given a filename, attempts to identify a valid file format from the list of registered specutils loaders. Essentially a wrapper for identify_format setting origin to read and data_class_required to Spectrum1D.

Parameters:
filenamestr

A path to a file to be identified

dtype: object

class type of Spectrum1D, SpectrumList, or SpectrumCollection. Default is Spectrum1D.

Returns:
valid_formatlist, str

A list of valid file formats. If only one valid format found, returns just that element.