Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix calibration solution reading #43

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/vcsbeam.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ typedef struct vcsbeam_context_t

int num_coarse_chans_to_process; // The number of coarse channels to be processed
int *coarse_chan_idxs_to_process; // A list of the coarse chan idxs to be processed
int *cal_coarse_chan_idxs_to_process; // A list of the calibration coarse chan idxs to be processed

int num_gps_seconds_to_process; // The number of gps seconds to be processed
uint32_t *gps_seconds_to_process; // A list of the gps seconds to be processed
Expand Down
2 changes: 1 addition & 1 deletion src/calibration.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void read_bandpass_file(
void vmLoadOffringaSolution( vcsbeam_context *vm )
{
// Shorthand variables
int coarse_chan_idx = vm->coarse_chan_idxs_to_process[0];
int coarse_chan_idx = vm->cal_coarse_chan_idxs_to_process[0];

// Open the calibration file for reading
FILE *fp = NULL;
Expand Down
3 changes: 3 additions & 0 deletions src/metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ void vmBindObsData(
// Construct the gps second and coarse chan idx arrays
vm->gps_seconds_to_process = (uint32_t *)malloc( vm->num_gps_seconds_to_process * sizeof(uint32_t) );
vm->coarse_chan_idxs_to_process = (int *)malloc( vm->num_coarse_chans_to_process * sizeof(int) );
vm->cal_coarse_chan_idxs_to_process = (int *)malloc( vm->num_coarse_chans_to_process * sizeof(int) );

int g;
for (g = 0; g < vm->num_gps_seconds_to_process; g++)
Expand All @@ -189,6 +190,7 @@ void vmBindObsData(
for (c = 0; c < num_coarse_chans_to_process; c++)
{
vm->coarse_chan_idxs_to_process[c] = c + first_coarse_chan_idx;
vm->cal_coarse_chan_idxs_to_process[c] = c;
}

// Copy across the data directory
Expand Down Expand Up @@ -321,6 +323,7 @@ void destroy_vcsbeam_context( vcsbeam_context *vm )
// Free manually created arrays
free( vm->gps_seconds_to_process );
free( vm->coarse_chan_idxs_to_process );
free( vm->cal_coarse_chan_idxs_to_process );

// Free mwalib structs
mwalib_metafits_metadata_free( vm->obs_metadata );
Expand Down