Example #1
0
func main() {
	if len(os.Args) != 2 {
		panic("You must give exactly one argument.")
	}
	outDir := os.Args[1]

	alphaTable := table.NewOutTable(alphaNames...)
	betaTable := table.NewOutTable(betaNames...)
	fthTable := table.NewOutTable(fthNames...)
	biasTable := table.NewOutTable(biasNames...)

	cFunc0 := halo.ConcentrationFunc(halo.Bhattacharya2013, 0)
	cFunc5 := halo.ConcentrationFunc(halo.Bhattacharya2013, 0.5)

	h014 := halo.New(fTh, simPpt, cFunc0, halo.Corrected, 1e14, 0)
	h015 := halo.New(fTh, simPpt, cFunc0, halo.Corrected, 5e14, 0)
	h214 := halo.New(fTh, simPpt, cFunc5, halo.Corrected, 1e14, 0.2)
	h215 := halo.New(fTh, simPpt, cFunc5, halo.Corrected, 5e14, 0.2)

	minFracLog, maxFracLog := math.Log10(0.01), math.Log10(10)
	logWidth := (maxFracLog - minFracLog) / steps
	for fracLog := minFracLog; fracLog <= maxFracLog; fracLog += logWidth {
		frac := math.Pow(10, fracLog)
		r014 := h014.C500.R * frac
		r015 := h015.C500.R * frac
		r214 := h214.C500.R * frac
		r215 := h215.C500.R * frac

		alphaTable.AddRow(frac,
			h014.AlphaBias(r014),
			h015.AlphaBias(r015),
			h214.AlphaBias(r214),
			h215.AlphaBias(r215))

		betaTable.AddRow(frac,
			h014.BetaBias(r014),
			h015.BetaBias(r015),
			h214.BetaBias(r214),
			h215.BetaBias(r215))

		fthTable.AddRow(frac,
			h014.FThermal(r014),
			h015.FThermal(r015),
			h214.FThermal(r214),
			h215.FThermal(r215))

		biasTable.AddRow(frac,
			h014.BFrac(r014),
			h015.BFrac(r015),
			h214.BFrac(r214),
			h215.BFrac(r215))
	}

	alphaTable.Write(table.KeepHeader, path.Join(outDir, "radial-alpha.table"))
	betaTable.Write(table.KeepHeader, path.Join(outDir, "radial-beta.table"))
	fthTable.Write(table.KeepHeader, path.Join(outDir, "radial-fth.table"))
	biasTable.Write(table.KeepHeader, path.Join(outDir, "radial-bias.table"))
}
Example #2
0
func main() {
	if len(os.Args) != 2 {
		panic("You must give exactly one argument.")
	}
	outDir := os.Args[1]

	println("WARNING: You still need to implement this quickly :3")

	fgasTable := table.NewOutTable(fgasNames...)
	normTable := table.NewOutTable(normNames...)

	cFunc0 := halo.ConcentrationFunc(halo.Bhattacharya2013, 0.0)
	cFunc5 := halo.ConcentrationFunc(halo.Bhattacharya2013, 0.5)

	h014 := halo.New(fTh, simPpt, cFunc0, halo.Corrected, 1e14, 0.0)
	h015 := halo.New(fTh, simPpt, cFunc0, halo.Corrected, 5e14, 0.0)
	h514 := halo.New(fTh, simPpt, cFunc5, halo.Corrected, 1e14, 0.5)
	h515 := halo.New(fTh, simPpt, cFunc5, halo.Corrected, 5e14, 0.5)

	minFracLog, maxFracLog := math.Log10(0.01), math.Log10(10)
	logWidth := (maxFracLog - minFracLog) / steps

	for fracLog := minFracLog; fracLog <= maxFracLog; fracLog += logWidth {
		frac := math.Pow(10, fracLog)
		r14 := h014.C500.R * frac
		r15 := h015.C500.R * frac

		frac014 := h014.GasEnclosed(bt, valPpt, r14) /
			h014.MassEnclosed(bt, r14)
		frac015 := h015.GasEnclosed(bt, valPpt, r15) /
			h015.MassEnclosed(bt, r15)
		frac514 := h514.GasEnclosed(bt, valPpt, r14) /
			h514.MassEnclosed(bt, r14)
		frac515 := h515.GasEnclosed(bt, valPpt, r15) /
			h515.MassEnclosed(bt, r15)

		fgasTable.AddRow(frac, frac014, frac015, frac514, frac515)

		normTable.AddRow(frac,
			frac014/(cosmo.OmegaB/cosmo.OmegaM),
			frac015/(cosmo.OmegaB/cosmo.OmegaM),
			frac514/(cosmo.OmegaB/cosmo.OmegaM),
			frac515/(cosmo.OmegaB/cosmo.OmegaM))
	}

	fgasTable.Write(table.KeepHeader,
		path.Join(outDir, "radial-density-frac.table"))
	normTable.Write(table.KeepHeader,
		path.Join(outDir, "radial-density-frac-norm.table"))
}
Example #3
0
func main() {
	if len(os.Args) != 2 {
		panic("You must give exactly one argument.")
	}
	outDir := os.Args[1]
	outTable := table.NewOutTable(colNames...)

	fGas := func(h *halo.Halo, bt halo.BiasType, pbt halo.PressureBiasType) float64 {
		if bt != halo.Biased {
			return h.GasEnclosed(bt, pbt, valPpt, h.C500.R) /
				h.MassEnclosed(bt, h.C500.R)
		} else {
			return h.GasEnclosed(bt, pbt, valPpt, h.R500cBias) /
				h.MassEnclosed(bt, h.R500cBias)
		}
	}

	minMassLog, maxMassLog := math.Log10(1e13), math.Log10(1e15)
	logWidth := (maxMassLog - minMassLog) / steps

	for massLog := minMassLog; massLog <= maxMassLog; massLog += logWidth {
		mass := math.Pow(10, massLog)

		h := halo.New(fTh, simPpt, cFunc0, halo.Corrected, mass, 0.0)

		fGasCorrected := fGas(h, halo.Corrected, halo.EffectivePressure)
		fGasNaive := fGas(h, halo.Corrected, halo.NaiveThermalPressure)
		outTable.AddRow(mass, h.M500cBias, fGasCorrected, fGasNaive,
			fGasCorrected*mass, fGasNaive*h.M500cBias)
	}

	outTable.Write(table.KeepHeader, path.Join(outDir, "mass-fgas.table"))
}
Example #4
0
func main() {
	if len(os.Args) != 2 {
		panic("Must provite a target directory.")
	}

	outDir := os.Args[1]
	outTable := table.NewOutTable(colNames...)

	minMassLog, maxMassLog := math.Log10(1e13), math.Log10(1e15)
	logWidth := (maxMassLog - minMassLog) / steps

	for massLog := minMassLog; massLog <= maxMassLog; massLog += logWidth {
		mass := math.Pow(10, massLog)
		h := halo.New(fTh, simPpt, cFunc, halo.Biased, mass, 0.0)

		outTable.AddRow(mass,
			h.C500.M/h.M500cBias,
			1.0/h.FThermal(h.C500.R),
			1.0/h.FThermal(h.R500cBias),
			h.BFrac(h.C500.R),
			h.BFrac(h.R500cBias))
	}

	outTable.Write(table.KeepHeader, path.Join(outDir, "mass-false-bias.table"))
}
Example #5
0
func main() {
	if len(os.Args) != 2 {
		panic("You must give exactly one argument.")
	}
	outDir := os.Args[1]
	tempTable := table.NewOutTable(tempColNames...)
	yTable := table.NewOutTable(yColNames...)
	fGasTable := table.NewOutTable(fGasColNames...)

	minMassLog, maxMassLog := math.Log10(1e13), math.Log10(1e15)
	logWidth := (maxMassLog - minMassLog) / steps

	for massLog := minMassLog; massLog <= maxMassLog; massLog += logWidth {
		bMass := math.Pow(10, massLog)

		h := halo.New(fTh, ppt, cFunc, halo.Biased, bMass, z)

		bTemp := h.EWTemperature(halo.Biased, bpbt, ppt, h.R500cBias)
		cTemp := h.EWTemperature(halo.Corrected, cpbt, ppt, h.C500.R)
		tempTable.AddRow(bMass, h.C500.M, bTemp, cTemp, cTemp/bTemp)

		bY := h.ThompsonY(bpbt, ppt, h.R500cBias)
		cY := h.ThompsonY(cpbt, ppt, h.C500.R)
		yTable.AddRow(bMass, h.C500.M, bY, cY, cY/bY)

		bFGas := fGas(h, halo.Biased)
		cFGas := fGas(h, halo.Corrected)
		fGasTable.AddRow(bMass, h.C500.M, bFGas, cFGas, cFGas/bFGas)
	}

	tempTable.Write(table.KeepHeader, path.Join(outDir, "mass-temp.table"))
	yTable.Write(table.KeepHeader, path.Join(outDir, "mass-y.table"))
	fGasTable.Write(table.KeepHeader, path.Join(outDir, "mass-fgas.table"))
}
Example #6
0
func main() {
	if len(os.Args) != 2 {
		panic("You must give exactly one argument.")
	}
	outDir := os.Args[1]
	outTable := table.NewOutTable(colNames...)

	minMassLog, maxMassLog := math.Log10(1e13), math.Log10(1e15)
	logWidth := (maxMassLog - minMassLog) / steps

	for massLog := minMassLog; massLog <= maxMassLog; massLog += logWidth {
		mass := math.Pow(10, massLog)
		
		h := halo.New(fTh, simPpt, cFunc0, halo.Corrected, mass, 0.0)

		mGas500Corrected := h.GasEnclosed(halo.Biased,
			halo.EffectivePressure, valPpt, h.C500.R)
		mGas500ThCorrected := h.GasEnclosed(halo.Biased,
			halo.EffectivePressure, valPpt, h.R500cBias)
		mGas500ThNaive := h.GasEnclosed(halo.Biased,
			halo.ThermalPressure, valPpt, h.R500cBias)

		outTable.AddRow(mass, h.M500cBias, mGas500Corrected,
			mGas500ThCorrected, mGas500ThNaive)
	}

	outTable.Write(table.KeepHeader, path.Join(outDir, "plot-type-comp.table"))
}
Example #7
0
func main() {
	if len(os.Args) != 2 {
		panic("You must give exactly one argument.")
	}
	outDir := os.Args[1]
	outTable := table.NewOutTable(colNames...)

	minMassLog, maxMassLog := math.Log10(1e13), math.Log10(1e15)
	logWidth := (maxMassLog - minMassLog) / steps

	for massLog := minMassLog; massLog <= maxMassLog; massLog += logWidth {
		mass := math.Pow(10, massLog)

		h0 := halo.New(fTh, simPpt, cFunc0, halo.Biased, mass, 0.0)
		h0p := halo.New(fThP, simPpt, cFunc0, halo.Biased, mass, 0.0)
		h0m := halo.New(fThM, simPpt, cFunc0, halo.Biased, mass, 0.0)

		h5 := halo.New(fTh, simPpt, cFunc5, halo.Biased, mass, 0.5)
		h5p := halo.New(fThP, simPpt, cFunc5, halo.Biased, mass, 0.5)
		h5m := halo.New(fThM, simPpt, cFunc5, halo.Biased, mass, 0.5)

		outTable.AddRow(mass,
			h0.EWTemperature(tempBt, valPpt, h5p.C500.R),
			h0p.EWTemperature(tempBt, valPpt, h0p.C500.R),
			h0m.EWTemperature(tempBt, valPpt, h0m.C500.R),
			h5.EWTemperature(tempBt, valPpt, h5p.C500.R),
			h5p.EWTemperature(tempBt, valPpt, h5p.C500.R),
			h5m.EWTemperature(tempBt, valPpt, h5m.C500.R))
	}

	outTable.Write(table.KeepHeader, path.Join(outDir, "mass-temp.table"))
}
Example #8
0
func main() {
	if len(os.Args) != 2 {
		panic("Must provite a target directory.")
	}

	outDir := os.Args[1]
	outTable := table.NewOutTable(colNames...)

	minMassLog, maxMassLog := math.Log10(1e13), math.Log10(1e15)
	logWidth := (maxMassLog - minMassLog) / steps

	for massLog := minMassLog; massLog <= maxMassLog; massLog += logWidth {
		mass := math.Pow(10, massLog)

		h0 := halo.New(fTh, simPpt, cFunc0, halo.Biased, mass, 0.0)
		h0p := halo.New(fThP, simPpt, cFunc0, halo.Biased, mass, 0.0)
		h0m := halo.New(fThM, simPpt, cFunc0, halo.Biased, mass, 0.0)

		h2 := halo.New(fTh, simPpt, cFunc2, halo.Biased, mass, 0.2)
		h2p := halo.New(fThP, simPpt, cFunc2, halo.Biased, mass, 0.2)
		h2m := halo.New(fThM, simPpt, cFunc2, halo.Biased, mass, 0.2)

		outTable.AddRow(mass,
			h0.C500.M/h0.M500cBias,
			h0p.C500.M/h0p.M500cBias,
			h0m.C500.M/h0m.M500cBias,
			h2.C500.M/h2.M500cBias,
			h2p.C500.M/h2p.M500cBias,
			h2m.C500.M/h2m.M500cBias)
	}

	outTable.Write(table.KeepHeader, path.Join(outDir, "mass-bias.table"))
}
Example #9
0
func main() {
	if len(os.Args) != 2 {
		panic("You must give exactly one argument.")
	}
	outDir := os.Args[1]
	outFile := path.Join(outDir, "radial-pressure.table")
	t := table.NewOutTable(colNames...)

	h014 := halo.New(fTh, halo.BattagliaAGN2012,
		cFunc, halo.Corrected, 1e14, 0)
	h015 := halo.New(fTh, halo.BattagliaAGN2012,
		cFunc, halo.Corrected, 5e14, 0)
	h214 := halo.New(fTh, halo.BattagliaAGN2012,
		cFunc, halo.Corrected, 1e14, 0.2)
	h215 := halo.New(fTh, halo.BattagliaAGN2012,
		cFunc, halo.Corrected, 5e14, 0.2)

	minFracLog, maxFracLog := math.Log10(0.01), math.Log10(10)
	logWidth := (maxFracLog - minFracLog) / steps
	for fracLog := minFracLog; fracLog <= maxFracLog; fracLog += logWidth {
		frac := math.Pow(10, fracLog)

		r014 := h014.C500.R * frac
		r015 := h015.C500.R * frac
		r214 := h214.C500.R * frac
		r215 := h215.C500.R * frac

		t.AddRow(frac,
			h014.Pressure(halo.ThermalPressure, halo.BattagliaAGN2012,
				halo.ElectronPressure, r014),
			h015.Pressure(halo.ThermalPressure, halo.BattagliaAGN2012,
				halo.ElectronPressure, r015),
			h214.Pressure(halo.ThermalPressure, halo.BattagliaAGN2012,
				halo.ElectronPressure, r214),
			h215.Pressure(halo.ThermalPressure, halo.BattagliaAGN2012,
				halo.ElectronPressure, r215))
	}

	t.Write(table.KeepHeader, outFile)
}
Example #10
0
func main() {
	if len(os.Args) != 2 {
		panic("You must give exactly one argument.")
	}
	outDir := os.Args[1]

	outTable := table.NewOutTable(colNames...)

	cFunc0 := halo.ConcentrationFunc(halo.Bhattacharya2013, 0.0)
	cFunc5 := halo.ConcentrationFunc(halo.Bhattacharya2013, 0.5)

	h014 := halo.New(fTh, simPpt, cFunc0, halo.Corrected, 1e14, 0.0)
	h015 := halo.New(fTh, simPpt, cFunc0, halo.Corrected, 5e14, 0.0)
	h514 := halo.New(fTh, simPpt, cFunc5, halo.Corrected, 1e14, 0.5)
	h515 := halo.New(fTh, simPpt, cFunc5, halo.Corrected, 5e14, 0.5)

	minFracLog, maxFracLog := math.Log10(0.01), math.Log10(10)
	logWidth := (maxFracLog - minFracLog) / steps
	for fracLog := minFracLog; fracLog <= maxFracLog; fracLog += logWidth {
		frac := math.Pow(10, fracLog)

		println(
			h014.EWTemperature(halo.Corrected, valPpt, h015.C500.R*frac),
			h015.EWTemperature(halo.Corrected, valPpt, h015.C500.R*frac),
			h514.EWTemperature(halo.Corrected, valPpt, h514.C500.R*frac),
			h515.EWTemperature(halo.Corrected, valPpt, h515.C500.R*frac))

		outTable.AddRow(frac,
			h014.EWTemperature(halo.Corrected, valPpt, h015.C500.R*frac),
			h015.EWTemperature(halo.Corrected, valPpt, h015.C500.R*frac),
			h514.EWTemperature(halo.Corrected, valPpt, h514.C500.R*frac),
			h515.EWTemperature(halo.Corrected, valPpt, h515.C500.R*frac))
	}

	outTable.Write(table.KeepHeader, path.Join(outDir, "radial-temp.table"))
}