saclaymocks¶
Vendored geometry helpers and constants from SaclayMocks. Prefer installing SaclayMocks directly; this copy is a fallback.
box¶
box
¶
Box sky<->cartesian geometry helpers (vendored from SaclayMocks).
Bundled copy of the SaclayMocks box module, used as a fallback when
SaclayMocks is not installed. Provides the coordinate transforms between sky
(ra, dec, R) and box-frame cartesian (X, Y, Z), plus box-geometry
helpers. Prefer installing SaclayMocks directly.
ComputeXYZdeg
¶
ComputeXYZdeg(ra, dec, R, ra0, dec0)
Box cartesian coordinates from sky coordinates in degrees.
Degree-input wrapper around :func:ComputeXYZ.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ra, dec
|
array - like
|
Sky angles (degrees). |
required |
R
|
array - like
|
Comoving distance. |
required |
ra0, dec0
|
float
|
Box-centre sky angles (degrees). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
|
Source code in lelantos/saclaymocks/box.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
ComputeXYZ
¶
ComputeXYZ(ra, dec, R, ra0, dec0)
XYZ of a point P (ra,dec,R) in a frame with observer at O, Z along OP, X along ra0, Y along dec0
angles in radians tested that ra,dec, R = box.ComputeRaDecR(R0,ra0,dec0,X,Y,Z) x,y,z = box.ComputeXYZ(ra[0],dec[0],R,ra0,dec0) print(x-X,y-Y,z-R0-Z)# prints ~1E-13 for random inputs
Source code in lelantos/saclaymocks/box.py
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 | |
ComputeRaDecR
¶
ComputeRaDecR(R0, ra0, dec0, X, Y, Z)
ra, dec, R of P(X,Y,Z) in a box with center located in C(R0,ra0,dec0)
angles in radian -pi < ra < pi -pi/2 < dec < pi/2 R0, ra0, dec0 define the position of the box in a (U,V,W) frame centered at the oberver position O box oriented such that Z along OC, X along ra, Y along dec R0,ra0,dec0 are scalar X, Y, Z can be scalars, 1D or 2D arrays
Source code in lelantos/saclaymocks/box.py
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 | |
Compute_cos_min
¶
Compute_cos_min(LX, LY, Rmax)
Maximum tangents and minimum cosine of the box opening cone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
LX, LY
|
float
|
Transverse box sizes. |
required |
Rmax
|
float
|
Maximum comoving distance. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
|
Source code in lelantos/saclaymocks/box.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
box_center
¶
box_center(LX, LY, Rmax, Rmin, margin)
Radial box centre and depth enclosing a cone within a transverse box.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
LX, LY
|
float
|
Transverse box sizes. |
required |
Rmax, Rmin
|
float
|
Comoving distance bounds of the cone. |
required |
margin
|
float
|
Margin kept inside the box edges. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
|
|
|
opening tangents. |
Source code in lelantos/saclaymocks/box.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
box_limitOld
¶
box_limitOld(LX, LY, LZ, R0, margin)
Legacy: radial/angular limits of a box at distance R0 (see box_limit).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
LX, LY, LZ
|
float
|
Box sizes. |
required |
R0
|
float
|
Box-centre comoving distance. |
required |
margin
|
float
|
Margin kept inside the box edges. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
|
Source code in lelantos/saclaymocks/box.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
box_limit
¶
box_limit(LX, LY, LZ, R0, margin)
Radial and angular limits of a box at distance R0 (with a margin).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
LX, LY, LZ
|
float
|
Box sizes (requires |
required |
R0
|
float
|
Box-centre comoving distance. |
required |
margin
|
float
|
Margin kept inside the box edges. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
|
Source code in lelantos/saclaymocks/box.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
sample_box
¶
sample_box(xbox, ybox, zbox, rho, threshold=2.5)
Obsolete: sample QSO positions at density peaks of a box.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xbox, ybox, zbox
|
array - like
|
Box cell-centre coordinates per axis. |
required |
rho
|
ndarray
|
Density field. |
required |
threshold
|
float
|
Peak threshold in units of the rms. |
2.5
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
The sampled QSO objects. |
Source code in lelantos/saclaymocks/box.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | |
ComputeRaDecR2
¶
ComputeRaDecR2(x, y, z, ra0, dec0)
Sky coordinates from box cartesian coordinates (rotation form).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x, y, z
|
array - like
|
Box-frame cartesian coordinates. |
required |
ra0, dec0
|
float
|
Box-centre sky angles (radians). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
|
Source code in lelantos/saclaymocks/box.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | |
ComputeXYZ2
¶
ComputeXYZ2(ra, dec, R, ra0, dec0)
Box cartesian coordinates from sky coordinates (rotation form).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ra, dec
|
array - like
|
Sky angles (radians). |
required |
R
|
array - like
|
Comoving distance. |
required |
ra0, dec0
|
float
|
Box-centre sky angles (radians). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
|
Source code in lelantos/saclaymocks/box.py
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
constant¶
constant
¶
Physical constants and fiducial parameters (vendored from SaclayMocks).
Bundled copy of the SaclayMocks constant module, used as a fallback when
SaclayMocks is not installed. Prefer installing SaclayMocks directly.