<jupyter_start><jupyter_text>Fiddling with Fluxing [v2]<jupyter_code>%matplotlib notebook
# imports
import numpy as np
from matplotlib import pyplot as plt

from configobj import ConfigObj

from pypeit.par import util as putil
from pypeit.par import pypeitpar
from pypeit.spectrographs.util import load_spectrograph
path = '/home/xavier/scratch/FRB181112/FORS2/vlt_fors2_E/Science'<jupyter_output><empty_output><jupyter_text>Load parameter file<jupyter_code>spectro = load_spectrograph('shane_kast_blue')
spectrograph_def_par = spectro.default_pypeit_par()
lines = putil._read_pypeit_file_lines(path+'/fluxing.config')
cobj = ConfigObj(list(lines))
cobj
par = pypeitpar.PypeItPar.from_cfg_lines(cfg_lines=spectrograph_def_par.to_config(), merge_with=list(lines))
par['fluxcalib']
cfg['fluxcalib']
cfg['rdx']['spectrograph'] = 'shane_kast_blue'
tmp_par = pypeitpar.PypeItPar.from_dict(cfg)<jupyter_output><empty_output><jupyter_text>----  Checking photometry<jupyter_code>g = 18.45 # SDSS
f_nu_g = 10.**(-0.4*(g+48.6)) * u.erg/u.s/u.Hz/u.cm**2
f_nu_g
f_lam_g = f_nu_g * const.c.cgs / (4000*u.AA)**2
f_lam_g.to('erg/s/cm**2/AA')
200 * 1e-17<jupyter_output><empty_output><jupyter_text>Tests and Misc<jupyter_code>15 * 40.<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13381410256410256, 'fraction_numerical': 0.029647435897435896, 'mean_word_length': 7.921428571428572, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '541979', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 552, 'n_tokens_neox': 525, 'n_words': 73, 'path': 'doc/nb/Fluxing.ipynb', 'repo_name': 'afloers/PypeIt', 'size': '1248'}