Skip to content

Commit

Permalink
Enable curved power laws in GPU modelling.
Browse files Browse the repository at this point in the history
These were left as todo!() in my mad rush to get most things working.

In the process of altering model.cu, I found a bug for shapelets with
"list" flux densities (potentially using the wrong beam responses). A
new series of tests verify that beam responses work as intended. Also
add many new tests to ensure the FEE beam is being applied to model
visibilities as expected.
  • Loading branch information
cjordan committed Mar 19, 2022
1 parent 0abc675 commit 6a51036
Show file tree
Hide file tree
Showing 9 changed files with 3,780 additions and 547 deletions.
357 changes: 270 additions & 87 deletions cuda/src/model_double.rs

Large diffs are not rendered by default.

357 changes: 270 additions & 87 deletions cuda/src/model_single.rs

Large diffs are not rendered by default.

240 changes: 231 additions & 9 deletions cuda/src_cuda/model.cu

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions cuda/src_cuda/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ extern "C" {
* sky-model point-source components.
*
* `points` contains coordinates and flux densities for their respective
* component types. The components are further split into "power law" and "list"
* types; this is done for efficiency. For the list types, the flux densities
* ("fds") are two-dimensional arrays, of which the first axis corresponds to
* frequency and the second component.
* component types. The components are further split into "power law", "curved
* power law" and "list" types; this is done for efficiency. For the list types,
* the flux densities ("fds") are two-dimensional arrays, of which the first
* axis corresponds to frequency and the second component.
*
* `a` is the populated `Addresses` struct needed to do any sky modelling.
*
Expand Down
34 changes: 34 additions & 0 deletions cuda/src_cuda/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#define JONES JonesF64
#endif

#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
Expand Down Expand Up @@ -135,6 +137,15 @@ typedef struct Points {
// Spectral indices.
FLOAT *power_law_sis;

size_t num_curved_power_law_points;
LMN *curved_power_law_lmns;
// Instrumental flux densities calculated at 150 MHz.
JONES *curved_power_law_fds;
// Spectral indices.
FLOAT *curved_power_law_sis;
// Spectral curvatures.
FLOAT *curved_power_law_qs;

size_t num_list_points;
LMN *list_lmns;
// Instrumental (i.e. XX, XY, YX, XX).
Expand All @@ -153,6 +164,16 @@ typedef struct Gaussians {
FLOAT *power_law_sis;
GaussianParams *power_law_gps;

size_t num_curved_power_law_gaussians;
LMN *curved_power_law_lmns;
// Instrumental flux densities calculated at 150 MHz.
JONES *curved_power_law_fds;
// Spectral indices.
FLOAT *curved_power_law_sis;
// Spectral curvatures.
FLOAT *curved_power_law_qs;
GaussianParams *curved_power_law_gps;

size_t num_list_gaussians;
LMN *list_lmns;
// Instrumental (i.e. XX, XY, YX, XX).
Expand All @@ -175,6 +196,19 @@ typedef struct Shapelets {
ShapeletCoeff *power_law_shapelet_coeffs;
size_t *power_law_num_shapelet_coeffs;

size_t num_curved_power_law_shapelets;
LMN *curved_power_law_lmns;
// Instrumental flux densities calculated at 150 MHz.
JONES *curved_power_law_fds;
// Spectral indices.
FLOAT *curved_power_law_sis;
// Spectral curvatures.
FLOAT *curved_power_law_qs;
GaussianParams *curved_power_law_gps;
ShapeletUV *curved_power_law_shapelet_uvs;
ShapeletCoeff *curved_power_law_shapelet_coeffs;
size_t *curved_power_law_num_shapelet_coeffs;

size_t num_list_shapelets;
LMN *list_lmns;
// Instrumental (i.e. XX, XY, YX, XX).
Expand Down
234 changes: 203 additions & 31 deletions src/model/cuda.rs

Large diffs are not rendered by default.

Loading

0 comments on commit 6a51036

Please sign in to comment.