<commit_before>from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from astropy.io import fits
from astropy.time import Time
from PyAstronomy import pyasl
from scipy import ndimage
import pandas as pd
import gaussfitter as gf
'''
Functions used in BF_python.py
Read the damn comments
(I'm sorry there aren't more objects)
'''

##Diana's function to make the plots look nice##
def user_rc(lw=1.5):
    """Set plotting RC parameters"""
    # These are the "Tableau 20" colors as RGB.
    tableau20 = [(31, 119, 180), (174, 199, 232), (255, 127, 14), (255, 187, 120),
                 (44, 160, 44), (152, 223, 138), (214, 39, 40), (255, 152, 150),
                 (148, 103, 189), (197, 176, 213), (140, 86, 75), (196, 156, 148),
                 (227, 119, 194), (247, 182, 210), (127, 127, 127), (199, 199, 199),
                 (188, 189, 34), (219, 219, 141), (23, 190, 207), (158, 218, 229)]
    # Scale the RGB values to the [0, 1] range, which is the format matplotlib accepts.
    for i in range(len(tableau20)):
        r, g, b = tableau20[i]
        tableau20[i] = (r / 255., g / 255., b / 255.)
    # Change some of the default line-widths, font sizes for xticks, labels, titles,
    # and the color cycle to tableau20
    plt.rc('lines', linewidth=lw)
    plt.rc('font', size=14, weight='normal')
    plt.rc('xtick', labelsize=14)
    plt.rc('xtick.major', size=6, width=1)
    plt.rc('axes', color_cycle=tableau20, lw=1, labelsize=18, titlesize=22)
    return tableau20

def logify_spec(isAPOGEE=False, w00=5400, n=38750, stepV=1.7, m=171):
    # The new log-wavelength array will be w1. it will have equal spacing in velocity.
    # Specify reasonable values when you call this function or else bad things will happen.
### GUIDELINES FOR CHOOSING GOOD INPUT VALUES ###
#    good APOGEE values
#        w00 = 15145         # starting wavelength of the log-wave array in Angstroms
#        n = 20000           # desired length of the log-wave vector in pixels (must be EVEN)<commit_msg>Adapt Diana's changes to user_rc (tableau colorable) into BF_functions<commit_after>from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from astropy.io import fits
from astropy.time import Time
from PyAstronomy import pyasl
from scipy import ndimage
import pandas as pd
import gaussfitter as gf
from cycler import cycler
'''
Functions used in BF_python.py
Read the damn comments
(I'm sorry there aren't more objects)
'''

##Diana's function to make the plots look nice##
def user_rc(lw=1.5):
    """Set plotting RC parameters"""
    # These are the "Tableau 20" colors as RGB.
    tableau20 = [(31, 119, 180), (174, 199, 232), (255, 127, 14), (255, 187, 120),
                 (44, 160, 44), (152, 223, 138), (214, 39, 40), (255, 152, 150),
                 (148, 103, 189), (197, 176, 213), (140, 86, 75), (196, 156, 148),
                 (227, 119, 194), (247, 182, 210), (127, 127, 127), (199, 199, 199),
                 (188, 189, 34), (219, 219, 141), (23, 190, 207), (158, 218, 229)]
    # Scale the RGB values to the [0, 1] range, which is the format matplotlib accepts.
    for i in range(len(tableau20)):
        r, g, b = tableau20[i]
        tableau20[i] = (r / 255., g / 255., b / 255.)
    # Change some of the default line-widths, font sizes for xticks, labels, titles,
    # and the color cycle to tableau20
    plt.rc('lines', linewidth=lw)
    plt.rc('font', size=14, weight='normal')
    plt.rc('xtick', labelsize=14)
    plt.rc('xtick.major', size=6, width=1)
    plt.rc('axes', prop_cycle=cycler(c=tableau20), lw=1, labelsize=18, titlesize=22)
    #plt.rc('axes', color_cycle=tableau20, lw=1, labelsize=18, titlesize=22)
    return tableau20

def logify_spec(isAPOGEE=False, w00=5400, n=38750, stepV=1.7, m=171):
    # The new log-wavelength array will be w1. it will have equal spacing in velocity.
    # Specify reasonable values when you call this function or else bad things will happen.
### GUIDELINES FOR CHOOSING GOOD INPUT VALUES ###
#    good APOGEE values
#        w00 = 15145         # starting wavelength of the log-wave array in Angstroms
#        n = 20000           # desired length of the log-wave vector in pixels (must be EVEN)
{'fraction_non_alphanumeric': 0.12468252135765412, 'fraction_numerical': 0.11198337566381898, 'mean_word_length': 3.2428991185112634, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 2, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2598911', 'n_tokens_mistral': 1858, 'n_tokens_neox': 1431, 'n_words': 552}