Documentation for detector.pixel
Pixelization scheme module for jax-gw.
This module contains functions for calculating the sky geometry.
flat_to_matrix_sky_indices(N_theta, N_phi)
Calculate the (N_theta*N_phi, 2) matrix of flat indices for a given sky resolution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N_theta |
int
|
Number of ecliptic thetas. |
required |
N_phi |
int
|
Number of ecliptic phis. |
required |
Returns:
Type | Description |
---|---|
ArrayLike
|
Matrix of flat indices. |
Source code in src/jax_gw/detector/pixel.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
flatten_sky(i_theta, j_phi, N_phi)
Flatten the sky coordinates into a single index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i_theta |
int
|
Index of the ecliptic theta. |
required |
j_phi |
int
|
Index of the ecliptic phi. |
required |
N_phi |
int
|
Number of ecliptic phis. |
required |
Returns:
Type | Description |
---|---|
int
|
Flattened index. |
Source code in src/jax_gw/detector/pixel.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
get_directional_basis(ecl_theta, ecl_phi)
Calculate the directional basis for a given source direction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ecl_theta |
ArrayLike
|
Ecliptic latitude of the source. |
required |
ecl_phi |
ArrayLike
|
Ecliptic phi of the source. |
required |
Returns:
Type | Description |
---|---|
array
|
Directional basis k_hat, u_hat, v_hat, where k_hat is the direction of the incoming signal, u_hat is same as theta_hat, and v_hat is same as phi_hat. Note that k, u, v are not a right-handed coordinate system, but -k, u, v is. |
Source code in src/jax_gw/detector/pixel.py
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 |
|
get_solid_angle_theta_phi(theta, phi, N_theta, N_phi)
Get the sky area associated with a given theta and phi in a pixelated sphere. Assumes linear spacing in theta and phi.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta |
float
|
Ecliptic theta. |
required |
phi |
float
|
Ecliptic phi. |
required |
N_theta |
int
|
Number of theta bins. |
required |
N_phi |
int
|
Number of phi bins. |
required |
Returns:
Type | Description |
---|---|
float
|
Sky area associated with theta and phi. |
Source code in src/jax_gw/detector/pixel.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 |
|
pixel_to_lm(data_omega, axis, N_theta, N_phi, ecl_thetas, ecl_phis, sph_harm_values)
Convert a pixelated map to a spherical harmonic map.
Source code in src/jax_gw/detector/pixel.py
182 183 184 185 186 187 188 189 190 191 |
|
unflatten_sky(index, N_phi)
Unflatten the sky coordinates from a single index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index |
int
|
Flattened index. |
required |
N_phi |
int
|
Number of ecliptic phis. |
required |
Returns:
Type | Description |
---|---|
NamedTuple
|
Unflattened sky coordinates. |
Source code in src/jax_gw/detector/pixel.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
unflatten_sky_axis(matrix, axis, N_theta, N_phi)
Unflatten the axis of a matrix that corresponds to the sky coordinates.
Shape is converted from (...N, N_theta*N_phi, M...) to (...N, N_theta, N_phi, M...).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
matrix |
ArrayLike
|
Matrix to unflatten. |
required |
axis |
int
|
Axis to unflatten. |
required |
N_theta |
int
|
Number of ecliptic thetas. |
required |
N_phi |
int
|
Number of ecliptic phis. |
required |
Returns:
Type | Description |
---|---|
array
|
Unflattened matrix. |
Source code in src/jax_gw/detector/pixel.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|