
import numpy as np
import matplotlib.pyplot as plt
from math import log10

def method_2_metal_profile_addition_routines_main(inp_dict):
    # Include function that creates the metal line flux
    dat       = np.loadtxt("test_weavify_spectrum.dat")
    user_wave = dat[:, 0]
    user_flux = dat[:, 1]
    #--------------------------------------------
    flux_key_name        = "Flux_resamp_arr"
    lambda_key_name      = "lambda_arr_obs"
    inp_dict_Flux        = inp_dict["inp_dict_Flux"]
    lambda_arr           = inp_dict_Flux[lambda_key_name]
    Flux_arr_inp         = inp_dict_Flux[flux_key_name]
    wave_diff            = np.abs(user_wave-lambda_arr)
    assert np.amax(wave_diff) < 1e-8
    Flux_arr             = Flux_arr_inp * user_flux

    inp_dict_Flux.update({flux_key_name:Flux_arr})
    inp_dict.update({"inp_dict_Flux":inp_dict_Flux})
    return inp_dict


