<jupyter_start><jupyter_text>testing the Pysme package https://pysme-astro.readthedocs.io/en/latest/index.html<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import astropy.io.fits as fits
import os
import glob
import scipy.interpolate as interpolate 
from astropy.table import Table
from astropy.io import ascii
import astropy.units as u
from scipy.optimize import leastsq
import astropy.constants as const

#matplotlib set up
%matplotlib inline
from matplotlib import rcParams
rcParams["figure.figsize"] = (14, 5)
rcParams["font.size"] = 20
#from pysme.gui import plot_plotly
from pysme import sme as SME
from pysme import util
from pysme.solve import solve
from pysme.synthesize import synthesize_spectrum

from pysme.abund import Abund
from pysme.linelist.vald import ValdFile
# from pysme.persistence import save_as_idl
datah = Table.read('spectra/eg_uma_H_20190319_smoothed.ecsv')
datak = Table.read('spectra/eg_uma_K_20190319_smoothed.ecsv')
hcut = [6000, 31000]
kcut = [8000, 31000]

waves = []
fluxes = []
errors = []
for data, cut in zip([datah,datak], [hcut, kcut]):
    w, f, e = data['WAVELENGTH'], data['FLUX'], data['ERROR']
    w, f, e = w[cut[0]:cut[1]], f[cut[0]:cut[1]], e[cut[0]:cut[1]]
    waves.append(w)
    fluxes.append(f)
    errors.append(e)
    plt.plot(w,f)
    plt.plot(w,e)

sme = SME.SME_Structure()
# sme.abund = Abund(0, "asplund2009")
sme.teff, sme.logg, sme.monh = 3500, 5.0, -0.1
sme.abund = Abund.solar()
vald = ValdFile("linelist.lin")
sme.linelist = vald<jupyter_output>INFO - Loading VALD file linelist.lin<jupyter_text>Need a linelist, have send request to VALD.<jupyter_code>w[-1]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12455089820359282, 'fraction_numerical': 0.035329341317365266, 'mean_word_length': 5.258426966292135, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '302562', 'license': 'MIT', 'n_tokens_mistral': 710, 'n_tokens_neox': 655, 'n_words': 157, 'path': 'igrins/pysme_test.ipynb', 'repo_name': 'davidjwilson/pceb', 'size': '1670'}