-
Notifications
You must be signed in to change notification settings - Fork 3
/
make_cosmological_sources
111 lines (103 loc) · 2.94 KB
/
make_cosmological_sources
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env python
import argparse
import numpy as np
from soxs.cosmology import make_cosmological_sources_file
parser = argparse.ArgumentParser(
description="Create a SIMPUT photon list catalog of a " "cosmological background."
)
parser.add_argument(
"filename",
type=str,
help="The filename of the SIMPUT catalog to be used as the root of the "
+ "catalog. If it does not exist, it will be created.",
)
parser.add_argument(
"name", type=str, help="The name of the source in the SIMPUT catalog."
)
parser.add_argument("exp_time", help="The exposure time to use, in seconds.")
parser.add_argument("fov", help="The field of view on a side in arcminutes.")
parser.add_argument(
"sky_center",
type=str,
help="The center RA, Dec coordinates of the "
+ "observation, in degrees, comma-separated",
)
parser.add_argument(
"--cat_center",
type=str,
help="The center of the field in the coordinates "
"of the halo catalog, which range from -5.0 "
"to 5.0 degrees in both directions. If not "
"set, a center will be randomly chosen.",
)
parser.add_argument(
"--absorb_model",
type=str,
default="wabs",
help="The absorption model to use for foreground galactic absorption. Default: 'wabs'",
)
parser.add_argument(
"--nh",
default=0.05,
help="The hydrogen column in units of 10**22 atoms/cm**2. Default: 0.05",
)
parser.add_argument(
"--area",
default=30000.0,
help="The collecting area to use, in cm^2. Default: 30000.0",
)
parser.add_argument(
"--src_filename",
type=str,
help="An optional filename to store the source instead of the SIMPUT "
"catalog file.",
)
parser.add_argument(
"--append",
action="store_true",
help="If set, append a new source an existing SIMPUT catalog.",
)
parser.add_argument(
"--overwrite",
action="store_true",
help="Overwrite an existing file with the same name.",
)
parser.add_argument(
"--output_sources",
type=str,
help="Output the source properties to the specified file.",
)
parser.add_argument(
"--write_regions",
type=str,
help="Write ds9 circle region files corresponding to the positions "
"and r500 of the halos.",
)
parser.add_argument(
"--random_seed",
type=int,
help="A constant integer random seed to produce a consistent set of random numbers.",
)
args = parser.parse_args()
sky_center = np.array(args.sky_center.split(",")).astype("float64")
if args.cat_center is None:
cat_center = None
else:
cat_center = np.array(args.cat_center.split(",")).astype("float64")
make_cosmological_sources_file(
args.filename,
args.name,
args.exp_time,
args.fov,
sky_center,
cat_center=cat_center,
absorb_model=args.absorb_model,
nH=args.nh,
area=args.area,
append=args.append,
overwrite=args.overwrite,
src_filename=args.src_filename,
output_sources=args.output_sources,
write_regions=args.write_regions,
prng=args.random_seed,
)