spyfit.io.sfit4.read_single_spectrum

spyfit.io.sfit4.read_single_spectrum(filename, var_name=None, wdim='spec_wn')

Read a single spectrum in a SFIT4 output ascii files.

Read one spectrum that is stored in a single file, i.e., for a given gas, band, scan and at a given iteration.

Use this function to load ‘out.gas_spectra’ files.

Parameters:

filename : str

Name or path to the file.

var_name : str or None

Name chosen for the spectrum variable. If empty, the name is set from filename. If None (default), the name is defined from the spectrum metadata (gas, band, scan and iteration).

wdim : str

Name of the dimension of the wavenumber (default: ‘spec_wn’). This is actually the prefix to which the band id will be added.

Returns:

dataarray : dict

A CDM-structured dictionary.