breidablik.analysis.format_read =============================== .. py:module:: breidablik.analysis.format_read Functions --------- .. autoapisummary:: breidablik.analysis.format_read.pixel_format breidablik.analysis.format_read.rew_format Module Contents --------------- .. py:function:: pixel_format(data, wavelength, center=670.9659, lower=0.4, upper=0.4, ftype='flux') Changes the data from read into a machine learning format. This function is for machine learning over pixels. :param data: Flux data from the read functions. The outermost keys are the stellar parameters for the models. The next keys are the lithium abundances. The innermost keys are 'flux' which retreives the NLTE flux or 'fluxl' which retreives the LTE flux. All data must be located at the same wavelength points. :type data: dict :param wavelength: The wavelengths that correspond to the data. From read.get_wavelengths(). :type wavelength: List[Real] or 1darray :param center: The center of the wavelengths where the cut should be taken, in the same units as the wavelength. The 3 lithium lines are centered at 610.5298, 670.9659, and 812.8606 nm in the Balder results. :type center: Real, optional :param upper: The amount to go above the center when taking the cut, in the same units as the wavelength. :type upper: Real, optional :param lower: The amount to go below the center when taking the cut, in the same units as the wavelength. :type lower: Real, optional :param ftype: Which type of flux to convert from the data. Accepted options are: 'flux' for NLTE or 'fluxl' for LTE. :type ftype: str, optional :returns: **Xy** -- The X and y data sets in the form (X, y). X contains [num of objects x num of parameters], and y contains [num of objects x num of pixels]. :rtype: tuple of 2darrays .. py:function:: rew_format(data, wavelength, predict='rew', center=670.9659, upper=10, lower=10, ftype='flux', num=10000) Changes the data from read into a machine learning format. This function is for machine learning over REWs. :param data: Flux data from the read functions. The outermost keys are the stellar parameters for the models. The next keys are the lithium abundances. The innermost keys are 'flux' which retreives the NLTE flux or 'fluxl' which retreives the LTE flux. All data must be located at the same wavelength points. :type data: dict :param wavelength: The wavelengths that correspond to the data. From read.get_wavelengths(). :type wavelength: List[Real] or 1darray :param predict: Determines what varlue is placed in the y data. Accepted options are 'rew' and 'li'. :type predict: str, optional :param center: The center of the wavelengths where the cut should be taken, in the same units as the wavelength. The 3 lithium lines are centered at 610.5298, 670.9659, and 812.8606 nm in the Balder results. :type center: Real, optional :param upper: The amount to go above the center when taking the cut, in the same units as the wavelength. :type upper: Real, optional :param lower: The amount to go below the center when taking the cut, in the same units as the wavelength. :type lower: Real, optional :param ftype: Which type of flux to convert from the data. Possible options are: 'flux' for NLTE or 'fluxl' for LTE. :type ftype: str, optional :param num: The number of points in the interpolation. Before calculating the REW, the line profile is interpolated to finer wavelength points. :type num: Int, optional :returns: **Xy** -- The X and y data sets in the form (X, y). X contains [num of objects x num of parameters], and y contains [num of objects]. :rtype: tuple of 2darrays