import numpy as np


def find_cols_for_params(parameter_list,input_names,parameter_names,my_names):
    cols=[]
    param_names=[]
    for param in my_names:
        cols.append(parameter_list.index(input_names[param]))
        param_names.append(parameter_names[param])
    return cols,param_names

input_names={ 'omch2' :'cosmological_parameters--omch2', 
              'ombh2':'cosmological_parameters--ombh2', 
              'h'    :'cosmological_parameters--h0', 
              'n_s'   :'cosmological_parameters--n_s', 
              's8_in':'cosmological_parameters--s_8_input', 
              'a_bar'      :'halo_model_parameters--a', 
              'a_ia':'intrinsic_alignment_parameters--a', 
              'deltaz_uncorr_1' :'nofz_shifts--uncorr_bias_1', 
              'deltaz_uncorr_2' :'nofz_shifts--uncorr_bias_2', 
              'deltaz_uncorr_3' :'nofz_shifts--uncorr_bias_3', 
              'deltaz_uncorr_4' :'nofz_shifts--uncorr_bias_4', 
              'deltaz_uncorr_5' :'nofz_shifts--uncorr_bias_5', 
              'uncorr_m1' :'shear_calibration_parameters--uncorr_m1', 
              'uncorr_m2' :'shear_calibration_parameters--uncorr_m2', 
              'uncorr_m3' :'shear_calibration_parameters--uncorr_m3', 
              'uncorr_m4' :'shear_calibration_parameters--uncorr_m4', 
              'uncorr_m5' :'shear_calibration_parameters--uncorr_m5', 
              's8':    'COSMOLOGICAL_PARAMETERS--S_8', 
              'sigma_8':  'COSMOLOGICAL_PARAMETERS--SIGMA_8', 
              'a_s': 'COSMOLOGICAL_PARAMETERS--A_S', 
              'omega_m':    'COSMOLOGICAL_PARAMETERS--OMEGA_M', 
              'omega_nu':    'COSMOLOGICAL_PARAMETERS--OMEGA_NU', 
              'omega_lambda':       'COSMOLOGICAL_PARAMETERS--OMEGA_LAMBDA', 
              'theta_mc':      'COSMOLOGICAL_PARAMETERS--COSMOMC_THETA', 
              'deltaz_1':'NOFZ_SHIFTS--BIAS_1', 
              'deltaz_2':'NOFZ_SHIFTS--BIAS_2', 
              'deltaz_3':'NOFZ_SHIFTS--BIAS_3', 
              'deltaz_4':'NOFZ_SHIFTS--BIAS_4', 
              'deltaz_5':'NOFZ_SHIFTS--BIAS_5', 
              'deltaz_out_1':'DELTA_Z_OUT--BIN_1', 
              'deltaz_out_2':'DELTA_Z_OUT--BIN_2', 
              'deltaz_out_3':'DELTA_Z_OUT--BIN_3', 
              'deltaz_out_4':'DELTA_Z_OUT--BIN_4', 
              'deltaz_out_5':'DELTA_Z_OUT--BIN_5',
              'm1':'SHEAR_CALIBRATION_PARAMETERS--M1',
              'm2':'SHEAR_CALIBRATION_PARAMETERS--M2',
              'm3':'SHEAR_CALIBRATION_PARAMETERS--M3',
              'm4':'SHEAR_CALIBRATION_PARAMETERS--M4',
              'm5':'SHEAR_CALIBRATION_PARAMETERS--M5',
              'prior':'prior', 
              'like':'like', 
              'post':'post', 
              'weight':'weight'}

parameter_names={ 'omch2' : r'$\Omega_{\rm c}h^2$', 
                  'ombh2':r'$\Omega_{\rm b}h^2$', 
                  'h'    :r'$h$', 
                  'n_s'   :r'$n_{\rm s}$', 
                  's8_in':r'$S_8^{\rm in}$', 
                  'a_bar'      :r'$A_{\rm bar}$', 
                  'a_ia':r'$A_{\rm IA}$', 
                  'deltaz_uncorr_1' :r'$\Delta z_1^{\rm uncorr}$', 
                  'deltaz_uncorr_2' :r'$\Delta z_2^{\rm uncorr}$', 
                  'deltaz_uncorr_3' :r'$\Delta z_3^{\rm uncorr}$', 
                  'deltaz_uncorr_4' :r'$\Delta z_4^{\rm uncorr}$', 
                  'deltaz_uncorr_5' :r'$\Delta z_5^{\rm uncorr}$', 
                  'uncorr_m1' :r'$m_1^{\rm uncorr}$', 
                  'uncorr_m2' :r'$m_2^{\rm uncorr}$', 
                  'uncorr_m3' :r'$m_3^{\rm uncorr}$', 
                  'uncorr_m4' :r'$m_4^{\rm uncorr}$', 
                  'uncorr_m5' :r'$m_5^{\rm uncorr}$', 
                  's8':    r'$S_8$', 
                  'sigma_8':  r'$\sigma_8$', 
                  'a_s': r'$A_{\rm s}$', 
                  'omega_m':  r'$\Omega_{\rm m}$'  , 
                  'omega_nu':    r'$\Omega_{\nu}$' , 
                  'omega_lambda': r'$\Omega_{\Lambda}$' , 
                  'theta_mc':     r'$\theta_{\rm MC}$' , 
                  'deltaz_1':r'$\Delta z_1^{\rm in}$', 
                  'deltaz_2':r'$\Delta z_2^{\rm in}$', 
                  'deltaz_3':r'$\Delta z_3^{\rm in}$', 
                  'deltaz_4':r'$\Delta z_4^{\rm in}$', 
                  'deltaz_5':r'$\Delta z_5^{\rm in}$', 
                  'deltaz_out_1':r'$\Delta z_1^{\rm out}$', 
                  'deltaz_out_2':r'$\Delta z_2^{\rm out}$', 
                  'deltaz_out_3':r'$\Delta z_3^{\rm out}$', 
                  'deltaz_out_4':r'$\Delta z_4^{\rm out}$', 
                  'deltaz_out_5':r'$\Delta z_5^{\rm out}$', 
                  'm1':r'$m_1$',
                  'm2':r'$m_2$',
                  'm3':r'$m_3$',
                  'm4':r'$m_4$',
                  'm5':r'$m_5$',
                  'prior':'prior', 
                  'like':'like', 
                  'post':'post', 
                  'weight':'weight'}
                  