Beispiel #1
0
def tauofsnu(nu, snu, beamomega, temperature=20):
    """
    nu in GHz
    snu in Jy
    """
    bnu = blackbody.blackbody(nu, temperature, normalize=False, frequency_units='GHz')
    tau = -log(1-snu*1e-23 / bnu)
    return tau
Beispiel #2
0
def snuofmass(nu, mass, beamomega, distance=1, temperature=20):
    """
    nu in Hz
    snu in Jy
    """
    column = mass * constants.msun / (beamomega * (distance*constants.kpc)**2)# g cm^-2 
    tau = kappa(nu) * column * beamomega
    bnu = blackbody.blackbody(nu, temperature, normalize=False, frequency_units='GHz')
    snu = bnu * (1.0-exp(-tau)) * 1e23
    return snu
Beispiel #3
0
def fit3(parameters, E, H_E, teff):
    """
        In the third fit we minimize

        sum^N_n=1 (F_En - w3*B_En(fc3*Teff))^2*En.
    """

    b = blackbody(parameters, E, teff)

    return (H_E - b) * E
def fit3(parameters, E, H_E, teff):
    """
        In the third fit we minimize

        sum^N_n=1 (F_En - w3*B_En(fc3*Teff))^2*En.
    """
   
    b = blackbody(parameters, E, teff) 
   

    return  (H_E - b)*E
def fit2(parameters, E, H_E, teff):
    """
        We fit the photon count flux, not the energy flux, so the
        second fit minimize

        sum^N_n=1 (F_En - w2*B_En(fc2*Teff))^2/E^2_n.
    """
   
    b = blackbody(parameters, E, teff) 

    return (H_E - b)/E 
Beispiel #6
0
def tauofsnu(nu, snu, beamomega, temperature=20):
    """
    nu in GHz
    snu in Jy
    """
    bnu = blackbody.blackbody(nu,
                              temperature,
                              normalize=False,
                              frequency_units='GHz')
    tau = -log(1 - snu * 1e-23 / bnu)
    return tau
Beispiel #7
0
def fit2(parameters, E, H_E, teff):
    """
        We fit the photon count flux, not the energy flux, so the
        second fit minimize

        sum^N_n=1 (F_En - w2*B_En(fc2*Teff))^2/E^2_n.
    """

    b = blackbody(parameters, E, teff)

    return (H_E - b) / E
def fit1(parameters, E, H_E, teff):    
    """
        In the first fit, we minimize the sum
        
        sum^N_n=1 (F_En - w1*B_En(fc1*Teff))^2

        where N is the number of photon energy points in the
        considered band.
    """ 
    
    b = blackbody(parameters, E, teff) 
    
    return H_E - b
Beispiel #9
0
def fit1(parameters, E, H_E, teff):
    """
        In the first fit, we minimize the sum
        
        sum^N_n=1 (F_En - w1*B_En(fc1*Teff))^2

        where N is the number of photon energy points in the
        considered band.
    """

    b = blackbody(parameters, E, teff)

    return H_E - b
Beispiel #10
0
def snuofmass(nu, mass, beamomega, distance=1, temperature=20):
    """
    nu in Hz
    snu in Jy
    """
    column = mass * constants.msun / (beamomega *
                                      (distance * constants.kpc)**2)  # g cm^-2
    tau = kappa(nu) * column * beamomega
    bnu = blackbody.blackbody(nu,
                              temperature,
                              normalize=False,
                              frequency_units='GHz')
    snu = bnu * (1.0 - exp(-tau)) * 1e23
    return snu
Beispiel #11
0
def fit3(parameters, energy, H_E, index, nset):
    """
        In the third fit we minimize

        sum^N_n=1 (F_En - w3*B_En(fc3*Teff))^2*En.
    """

    E = []

    b = blackbody(parameters, energy, index, nset)

    for i in range(len(energy)):
        if energy[i] > 3.0 and energy[i] < 20.0:
            E.append(energy[i])

    return (H_E - b) * E
def fit3(parameters, energy, H_E, index, nset):
    """
        In the third fit we minimize

        sum^N_n=1 (F_En - w3*B_En(fc3*Teff))^2*En.
    """
   
    E = []
   
    b = blackbody(parameters, energy, index, nset) 
   
    for i in range (len(energy)):
        if energy[i] > 3.0 and energy[i] < 20.0:
            E.append(energy[i]) 
   
    return  (H_E - b)*E
Beispiel #13
0
def fit2(parameters, energy, H_E, index, nset):
    """
        We fit the photon count flux, not the energy flux, so the
        second fit minimize

        sum^N_n=1 (F_En - w2*B_En(fc2*Teff))^2/E^2_n.
    """

    E = []

    b = blackbody(parameters, energy, index, nset)

    for i in range(len(energy)):
        if energy[i] > 3.0 and energy[i] < 20.0:
            E.append(energy[i])

    return (H_E - b) / E
def fit2(parameters, energy, H_E, index, nset):
    """
        We fit the photon count flux, not the energy flux, so the
        second fit minimize

        sum^N_n=1 (F_En - w2*B_En(fc2*Teff))^2/E^2_n.
    """
   
    E = []
    
    b = blackbody(parameters, energy, index, nset) 
    
    for i in range (len(energy)):
        if energy[i] > 3.0 and energy[i] < 20.0:
            E.append(energy[i]) 
   
    return (H_E - b)/E 
Beispiel #15
0
def snu(nu, column, kappa, temperature):
    tau = kappa / constants.mh
    snu = blackbody.blackbody(nu,temperature, normalize=False)
    return snu
Beispiel #16
0
def snu(nu, column, kappa, temperature):
    tau = kappa / constants.mh
    snu = blackbody.blackbody(nu, temperature, normalize=False)
    return snu