<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _format_data(self, data):
 """ Sort the data in blue wavelengths to red, and ignore any spectra that have entirely non-finite or negative fluxes. """

        return [spectrum for spectrum in \
            sorted(data if isinstance(data, (list, tuple)) else [data],
                key=lambda x: x.disp[0]) if np.any(np.isfinite(spectrum.flux))]