import numpy as np
import h5py
import matplotlib.pyplot as plt

def EDGES_T21_Steven():
  d = np.genfromtxt('/Users/cangtao/IHEPBox/Projects/GitHub/Radio_Excess_EDGES/data/Data_EDGES.txt')
  f = d[:,0]
  T0 = d[:,5]*1000
  z = 1420/f-1
  return z,T0

def EDGES_T21_v2():
  d = np.genfromtxt('/Users/cangtao/IHEPBox/Projects/GitHub/21cmEZ/plots/src/EDGES_Temp.txt')
  z = d[:,0]
  T0 = d[:,1]
  # z, T0 = EDGES_T21_Steven()
  return z,T0


def T_Arcade(z):
    '''Arcade2 radio excess temp as a function of z, see 1802.07432'''
    v = 1.42/(1+z) # frequency today after redshifting
    v0 = 1.0
    TR = 1.19
    beta = -2.62
    Trad = TR*(v/v0)**beta
    return Trad
