import numpy as np

import GAL_PLOT


def getchains(nFreqBins):

    
    if nFreqBins==9:
        path = '/home/ADF/middlehr/Documents/PTA/EPTAInterp/results/gal_model/f{0}/ptmcmc_f{0}_1/output/'.format(nFreqBins)
        saveResultsHere = '/home/ADF/middlehr/Documents/PTA/EPTAInterp/results/gal_model/f{0}/f{0}_plotting_things_prior'.format(nFreqBins)
    elif nFreqBins==5: 
        path = '/home/ADF/middlehr/Documents/PTA/EPTAInterp/results/gal_model/f5/ptmcmc_2/output/'.format(nFreqBins)
    elif nFreqBins==3:
        path = '/home/ADF/middlehr/Documents/PTA/EPTAInterp/results/gal_model/f3/ptmcmc_f{}_1/output/'.format(nFreqBins)

    readChains = np.genfromtxt('{}/chain_1.txt'.format(path))

    burnin = int(0.25*len(readChains))

    chains = readChains[burnin:,:]

    priorChains = np.genfromtxt('/home/ADF/middlehr/repositories/PTAInference/runs/galaxyModel_ext/prior.dat')

    
    
    return chains, priorChains, saveResultsHere


chain, prior, directory = getchains(9)
print(chain)
print(prior)



GAL_PLOT.conf_hmz(chain,directory,priorChains=prior)
