VCSBeam
|
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <mwalib.h>
#include "vcsbeam.h"
#include "gpu_macros.h"
Functions | |
vcsbeam_context * | vmInit (bool use_mpi) |
Initialises a VCSBeam context struct. More... | |
void | vmBindObsData (vcsbeam_context *vm, char *first_coarse_chan_str, int num_coarse_chans_to_process, int coarse_chan_idx_offset, char *first_gps_second_str, int num_gps_seconds_to_process, int gps_second_offset, char *datadir) |
Binds a set of observation files to the VCSBeam context. More... | |
void | vmBindCalibrationData (vcsbeam_context *vm, char *caldir, int cal_type, bool use_bandpass, char *flags_file) |
Binds a calibration solution to the VCSBeam context. More... | |
void | vmReadCalibration (vcsbeam_context *vm) |
Reads in a calibration solution. More... | |
Antenna * | find_antenna_by_name (MetafitsMetadata *obs_metadata, char *tile_name) |
Finds an antenna in an observation with a given name. More... | |
void | destroy_vcsbeam_context (vcsbeam_context *vm) |
Frees the memory associated with the VCSBeam context. More... | |
void | vmSetOutputChannelisation (vcsbeam_context *vm, bool out_fine, bool out_coarse) |
Sets flags governing whether the PFB and inverse PFB routines are run depending on the input and output channelisations. More... | |
void | vmMallocVHost (vcsbeam_context *vm) |
Allocates memory for the input voltages on the CPU. More... | |
void | vmMallocJVHost (vcsbeam_context *vm) |
Allocates memory for the quantity \({\bf J}{\bf v}\) on the CPU. More... | |
void | vmMallocEHost (vcsbeam_context *vm) |
Allocates memory for the quantity \({\bf e}\) on the CPU. More... | |
void | vmMallocSHost (vcsbeam_context *vm) |
Allocates memory for the quantity \({\bf S}\) on the CPU. More... | |
void | vmMallocJHost (vcsbeam_context *vm) |
Allocates memory for the quantity \({\bf J}\) on the CPU. More... | |
void | vmMallocDHost (vcsbeam_context *vm) |
Allocates memory for the quantity \({\bf D}\) on the CPU. More... | |
void | vmMallocPQIdxsHost (vcsbeam_context *vm) |
Allocates memory for the polarisation indexes on the CPU. More... | |
void | vmFreeVHost (vcsbeam_context *vm) |
Frees memory allocated for the input voltages on the CPU. More... | |
void | vmFreeJVHost (vcsbeam_context *vm) |
Frees memory allocated with vmMallocJVHost(). More... | |
void | vmFreeEHost (vcsbeam_context *vm) |
Frees memory allocated with vmMallocEHost(). More... | |
void | vmFreeSHost (vcsbeam_context *vm) |
Frees memory allocated with vmMallocSHost(). More... | |
void | vmFreeJHost (vcsbeam_context *vm) |
Frees memory allocated with vmMallocJHost(). More... | |
void | vmFreeDHost (vcsbeam_context *vm) |
Frees memory allocated with vmMallocDHost(). More... | |
void | vmFreePQIdxsHost (vcsbeam_context *vm) |
Frees memory allocated with vmMallocPQIdxsHost(). More... | |
void | vmMallocVDevice (vcsbeam_context *vm) |
Allocates memory for the input voltages on the GPU. More... | |
void | vmMallocJVDevice (vcsbeam_context *vm) |
Allocates memory for the quantities \({\bf J}{\bf v}\) on the GPU. More... | |
void | vmMallocEDevice (vcsbeam_context *vm) |
Allocates memory for the quantity \({\bf e}\) on the GPU. More... | |
void | vmMallocSDevice (vcsbeam_context *vm) |
Allocates memory for the quantity \({\bf S}\) on the GPU. More... | |
void | vmMallocJDevice (vcsbeam_context *vm) |
Allocates memory for the quantity \({\bf J}\) on the GPU. More... | |
void | vmMallocDDevice (vcsbeam_context *vm) |
Allocates memory for the quantity \({\bf D}\) on the GPU. More... | |
void | vmMallocPQIdxsDevice (vcsbeam_context *vm) |
Allocates memory for the polarisation indexes on the GPU. More... | |
void | vmFreeVDevice (vcsbeam_context *vm) |
Frees the GPU memory allocated with vmMallocVDevice(). More... | |
void | vmFreeJVDevice (vcsbeam_context *vm) |
Frees memory allocated with vmMallocJVDevice(). More... | |
void | vmFreeEDevice (vcsbeam_context *vm) |
Frees memory allocated with vmMallocEDevice(). More... | |
void | vmFreeSDevice (vcsbeam_context *vm) |
Frees memory allocated with vmMallocSDevice(). More... | |
void | vmFreeJDevice (vcsbeam_context *vm) |
Frees memory allocated with vmMallocJDevice(). More... | |
void | vmFreeDDevice (vcsbeam_context *vm) |
Frees memory allocated with vmMallocDDevice(). More... | |
void | vmFreePQIdxsDevice (vcsbeam_context *vm) |
Frees memory allocated with vmMallocPQIdxsDevice(). More... | |
void | vmSetMaxGPUMem (vcsbeam_context *vm, int nchunks) |
Tries to cleverly figure out how many chunks are needed to fit everything on the GPU. More... | |
void | vmPushChunk (vcsbeam_context *vm) |
Loads a "chunk" of input data onto the GPU. More... | |
vm_error | vmReadNextSecond (vcsbeam_context *vm) |
Reads a second's worth of input data from the observation files. More... | |
void | vmPushJ (vcsbeam_context *vm) |
Loads the Jones matrices onto the GPU. More... | |
void | vmCreateCudaStreams (vcsbeam_context *vm) |
Sets up CUDA streams for multi-pixel beamforming. More... | |
void | vmDestroyCudaStreams (vcsbeam_context *vm) |
Destroys the CUDA streams that were set up for multi-pixel beamforming. More... | |
void | vmCreateStatistics (vcsbeam_context *vm, mpi_psrfits *mpfs) |
Allocates both CPU and GPU memory for the scales, offsets, and data for PSRFITS output. More... | |
void | vmDestroyStatistics (vcsbeam_context *vm) |
Frees both the CPU and GPU memory for the scales, offsets, and data for PSRFITS output. More... | |
void | vmSetNumPointings (vcsbeam_context *vm, unsigned int npointings) |
Sets the number of pointings. More... | |
void | vmCreateFilenames (vcsbeam_context *vm) |
Creates a list of file names for the input data. More... | |
void | vmGetVoltFilename (vcsbeam_context *vm, unsigned int coarse_chan_idx, uint64_t gps_second, char *filename) |
Gets the input file name for the given channel index and GPS second. More... | |
void | vmGetLegacyVoltFilename (vcsbeam_context *vm, unsigned int coarse_chan_idx, uint64_t gps_second, char *filename) |
Gets the file name for the given channel index and GPS, as if the observation were a Legacy VCS observation. More... | |
void | vmDestroyFilenames (vcsbeam_context *vm) |
Destroys the list of input file names. More... | |
void | vmLoadObsMetafits (vcsbeam_context *vm, char *filename) |
Loads an observation's metadata from its metafits file. More... | |
void | vmLoadCalMetafits (vcsbeam_context *vm, char *filename) |
Loads a calibration observation's metadata from its metafits file. More... | |
void | vmGetVoltageMetadata (vcsbeam_context *vm) |
Creates the voltage metadata structs using mwalib's API. More... | |
long unsigned int | get_relative_gps (MetafitsMetadata *obs_metadata, long int relative_begin) |
Gets the GPS second for an observation from a relative offset value. More... | |
long unsigned int | parse_begin_string (MetafitsMetadata *obs_metadata, char *begin_str) |
Gets the GPS second from a string representation of either a relative or absolute value. More... | |
uintptr_t | parse_coarse_chan_string (MetafitsMetadata *obs_metadata, char *begin_coarse_chan_str) |
Gets the coarse channel index from a string representation of either a relative or absolute value. More... | |
void | vmSetNumNotFlaggedRFInputs (vcsbeam_context *vm) |
Counts the number of tiles that are not flagged. More... | |
Rfinput * | find_matching_rf_input (MetafitsMetadata *metadata, Rfinput *rfinput) |
Finds a matching RF input in the given metadata. More... | |
Antenna * | find_matching_antenna (MetafitsMetadata *metadata, Rfinput *rfinput) |
Finds a matching Antenna in the given metadata. More... | |
void | get_mwalib_version (char *version_str) |
Gets the mwalib version. More... | |
void | vmParsePointingFile (vcsbeam_context *vm, const char *filename) |
Parses RA/Dec pointings from a file. More... | |
void | vmReportPerformanceStats (vcsbeam_context *vm) |
Reports all performance statistics. More... | |
void | vmPrintTitle (vcsbeam_context *vm, const char *title) |
Prints a title to the specified log output stream. More... | |
void | vmCheckError (vm_error err) |
void destroy_vcsbeam_context | ( | vcsbeam_context * | vm | ) |
Frees the memory associated with the VCSBeam context.
vm | The VCSBeam context struct |
After freeing the memory associated with the VCSBeam context's member variables, this function frees the VCSBeam context itself.
vm...
name Antenna* find_antenna_by_name | ( | MetafitsMetadata * | obs_metadata, |
char * | tile_name | ||
) |
Finds an antenna in an observation with a given name.
obs_metadata | The observation metadata to be searched |
tile_name | The name of the tile being sought |
If no tile with the given name is found in the observation, NULL
is returned.
Antenna* find_matching_antenna | ( | MetafitsMetadata * | metadata, |
Rfinput * | rfinput | ||
) |
Finds a matching Antenna in the given metadata.
metadata | The metadata to be searched |
rfinput | The RF input being sought |
metadata
This function goes through the antennas in metadata
, searching for one that matches rfinput
. A "match" is an RF input that has the same tile_id
. If no match is found, NULL
is returned.
Rfinput* find_matching_rf_input | ( | MetafitsMetadata * | metadata, |
Rfinput * | rfinput | ||
) |
Finds a matching RF input in the given metadata.
metadata | The metadata to be searched |
rfinput | The RF input being sought |
metadata
This function goes through the RF inputs in metadata
, searching for one that matches rfinput
. A "match" is an RF input that has the same tile_id
and pol
. If no match is found, NULL
is returned.
void get_mwalib_version | ( | char * | version_str | ) |
Gets the mwalib version.
[out] | version_str | A buffer to hold the version string |
This function assumes that version_str
is already allocated, and is big enough
long unsigned int get_relative_gps | ( | MetafitsMetadata * | obs_metadata, |
long int | relative_begin | ||
) |
Gets the GPS second for an observation from a relative offset value.
obs_metadata | The observation's metadata |
relative_begin | An offset number of seconds |
If relative_begin
>= 0, then return the GPS second relative to the "good
time" (i.e. from the beginning of the observation). If relative_begin
< 0, then return the GPS second relative to the end of the observation.
relative_begin | GPS second |
---|---|
0 | 1st "good" second |
1 | 2nd "good" second |
2 | 3rd "good" second |
... | ... |
-2 | 2nd last second |
-1 | Last second |
long unsigned int parse_begin_string | ( | MetafitsMetadata * | obs_metadata, |
char * | begin_str | ||
) |
Gets the GPS second from a string representation of either a relative or absolute value.
obs_metadata | The observation's metadata |
begin_str | A string representation of either a relative or absolute GPS second |
If the first character of begin_str
is '+
' or '-
', then return a relative GPS second according to get_relative_gps(). Otherwise, parse it as a GPS second in its own right.
uintptr_t parse_coarse_chan_string | ( | MetafitsMetadata * | obs_metadata, |
char * | begin_coarse_chan_str | ||
) |
Gets the coarse channel index from a string representation of either a relative or absolute value.
obs_metadata | The observation's metadata |
begin_coarse_chan_str | A string representation of either a relative or absolute coarse channel index |
If the first character of begin_coarse_chan_str
is '+
' or '-
', then return the coarse channel index relative to the lowest or highest coarse channel, respectively (with "-1" representing the highest channel, "-2" the second highest, etc.). Otherwise, parse it as a coarse channel index in its own right.
void vmBindCalibrationData | ( | vcsbeam_context * | vm, |
char * | caldir, | ||
int | cal_type, | ||
bool | use_bandpass, | ||
char * | flags_file | ||
) |
Binds a calibration solution to the VCSBeam context.
vm | The VCSBeam context struct |
caldir | The directory containing RTS solution files, OR the path of an Offringa-style calibration solution file |
cal_type | Either CAL_RTS or CAL_OFFRINGA |
use_bandpass | Whether to include the Bandpass information (relevant for RTS solutions only) |
flags_file | A file containing names of (extra) tiles to be flagged, or NULL |
void vmBindObsData | ( | vcsbeam_context * | vm, |
char * | first_coarse_chan_str, | ||
int | num_coarse_chans_to_process, | ||
int | coarse_chan_idx_offset, | ||
char * | first_gps_second_str, | ||
int | num_gps_seconds_to_process, | ||
int | gps_second_offset, | ||
char * | datadir | ||
) |
Binds a set of observation files to the VCSBeam context.
vm | The VCSBeam context struct |
first_coarse_chan_str | A string representation of the lowest coarse channel to be processed |
num_coarse_chans_to_process | The number of coarse channels to be processed |
coarse_chan_idx_offset | The first coarse channel (relative to first_coarse_chan_str ) to be processed by this MPI process |
first_gps_second_str | A string representation of the first GPS second to be processed |
num_gps_seconds_to_process | The number of GPS seconds to be processed |
gps_second_offset | The first GPS second (relative to first_gps_second_str ) to be processed by this MPI process |
datadir | The directory containing the observation data files |
void vmCheckError | ( | vm_error | err | ) |
void vmCreateCudaStreams | ( | vcsbeam_context * | vm | ) |
Sets up CUDA streams for multi-pixel beamforming.
vm | The VCSBeam context struct |
void vmCreateFilenames | ( | vcsbeam_context * | vm | ) |
Creates a list of file names for the input data.
vm | The VCSBeam context struct |
This function creates an array of file names that are passed to mwalib to manage the reading in of the data.
void vmCreateStatistics | ( | vcsbeam_context * | vm, |
mpi_psrfits * | mpfs | ||
) |
Allocates both CPU and GPU memory for the scales, offsets, and data for PSRFITS output.
vm | The VCSBeam context struct |
mpfs | A pointer to a MPI PSRFITS struct |
void vmDestroyCudaStreams | ( | vcsbeam_context * | vm | ) |
Destroys the CUDA streams that were set up for multi-pixel beamforming.
vm | The VCSBeam context struct |
void vmDestroyFilenames | ( | vcsbeam_context * | vm | ) |
Destroys the list of input file names.
vm | The VCSBeam context struct |
void vmDestroyStatistics | ( | vcsbeam_context * | vm | ) |
Frees both the CPU and GPU memory for the scales, offsets, and data for PSRFITS output.
vm | The VCSBeam context struct |
void vmFreeDDevice | ( | vcsbeam_context * | vm | ) |
Frees memory allocated with vmMallocDDevice().
vm | The VCSBeam context struct |
void vmFreeDHost | ( | vcsbeam_context * | vm | ) |
Frees memory allocated with vmMallocDHost().
vm | The VCSBeam context struct |
void vmFreeEDevice | ( | vcsbeam_context * | vm | ) |
Frees memory allocated with vmMallocEDevice().
vm | The VCSBeam context struct |
void vmFreeEHost | ( | vcsbeam_context * | vm | ) |
Frees memory allocated with vmMallocEHost().
vm | The VCSBeam context struct |
void vmFreeJDevice | ( | vcsbeam_context * | vm | ) |
Frees memory allocated with vmMallocJDevice().
vm | The VCSBeam context struct |
void vmFreeJHost | ( | vcsbeam_context * | vm | ) |
Frees memory allocated with vmMallocJHost().
vm | The VCSBeam context struct |
void vmFreeJVDevice | ( | vcsbeam_context * | vm | ) |
Frees memory allocated with vmMallocJVDevice().
vm | The VCSBeam context struct |
void vmFreeJVHost | ( | vcsbeam_context * | vm | ) |
Frees memory allocated with vmMallocJVHost().
vm | The VCSBeam context struct |
void vmFreePQIdxsDevice | ( | vcsbeam_context * | vm | ) |
Frees memory allocated with vmMallocPQIdxsDevice().
vm | The VCSBeam context struct |
void vmFreePQIdxsHost | ( | vcsbeam_context * | vm | ) |
Frees memory allocated with vmMallocPQIdxsHost().
vm | The VCSBeam context struct |
void vmFreeSDevice | ( | vcsbeam_context * | vm | ) |
Frees memory allocated with vmMallocSDevice().
vm | The VCSBeam context struct |
void vmFreeSHost | ( | vcsbeam_context * | vm | ) |
Frees memory allocated with vmMallocSHost().
vm | The VCSBeam context struct |
void vmFreeVDevice | ( | vcsbeam_context * | vm | ) |
Frees the GPU memory allocated with vmMallocVDevice().
vm | The VCSBeam context struct |
If the observation is Legacy, then free the memory.
If the observation is MWAX, then do nothing; the memory should be freed via a call to vmFreeForwardPFB().
void vmFreeVHost | ( | vcsbeam_context * | vm | ) |
Frees memory allocated for the input voltages on the CPU.
vm | The VCSBeam context struct |
void vmGetLegacyVoltFilename | ( | vcsbeam_context * | vm, |
unsigned int | coarse_chan_idx, | ||
uint64_t | gps_second, | ||
char * | filename | ||
) |
Gets the file name for the given channel index and GPS, as if the observation were a Legacy VCS observation.
vm | The VCSBeam context struct | |
[in] | coarse_chan_idx | The index of a coarse channel |
[in] | gps_second | A GPS second |
[out] | filename | A buffer for the filename |
This function returns the filename for the observation referred to in vm→obs_context_legacy
.
filename
must point to already-allocated memory.
void vmGetVoltageMetadata | ( | vcsbeam_context * | vm | ) |
Creates the voltage metadata structs using mwalib's API.
vm | The VCSBeam context struct |
This function should only be called after vmLoadObsMetafits().
void vmGetVoltFilename | ( | vcsbeam_context * | vm, |
unsigned int | coarse_chan_idx, | ||
uint64_t | gps_second, | ||
char * | filename | ||
) |
Gets the input file name for the given channel index and GPS second.
vm | The VCSBeam context struct | |
[in] | coarse_chan_idx | The index of a coarse channel |
[in] | gps_second | A GPS second |
[out] | filename | A buffer for the filename |
This function returns the filename for the observation referred to in vm→obs_context
.
The variable vm→seconds_per_file
must be set to the relevant value depending on whether the observation is Legacy (1) or MWAX (8), which is done via vmLoadObsMetafits().
filename
must point to already-allocated memory.
vcsbeam_context* vmInit | ( | bool | use_mpi | ) |
Initialises a VCSBeam context struct.
use_mpi | Set up the struct for using MPI |
vcsbeam_context
structOnce the VCSBeam context is finished with, it should be freed with a call to destroy_vcsbeam_context().
void vmLoadCalMetafits | ( | vcsbeam_context * | vm, |
char * | filename | ||
) |
Loads a calibration observation's metadata from its metafits file.
vm | The VCSBeam context struct |
filename | The name of the metafits file to be loaded. |
This function loads the metadata into vm→cal_context
and vm→cal_metadata
, using mwalib's API. The observation to be loaded should be the calibration observation, i.e. the observation for which a calibration solution has been obtained.
void vmLoadObsMetafits | ( | vcsbeam_context * | vm, |
char * | filename | ||
) |
Loads an observation's metadata from its metafits file.
vm | The VCSBeam context struct |
filename | The name of the metafits file to be loaded. |
This function loads the metadata into vm→obs_context
and vm→obs_metadata
, using mwalib's API. It also loads a "Legacy" version of the context and metafits into vm→obs_context_legacy
and vm→obs_metafits_legacy
. The observation to be loaded should be the "target" observation, i.e. the observation whose VCS data is to be processed.
void vmMallocDDevice | ( | vcsbeam_context * | vm | ) |
Allocates memory for the quantity \({\bf D}\) on the GPU.
vm | The VCSBeam context struct |
A pointer to the newly allocated memory is given in vm→d_D
.
void vmMallocDHost | ( | vcsbeam_context * | vm | ) |
Allocates memory for the quantity \({\bf D}\) on the CPU.
vm | The VCSBeam context struct |
A pointer to the newly allocated memory is given in vm→D
.
void vmMallocEDevice | ( | vcsbeam_context * | vm | ) |
Allocates memory for the quantity \({\bf e}\) on the GPU.
vm | The VCSBeam context struct |
A pointer to the newly allocated memory is given in vm→d_e
.
void vmMallocEHost | ( | vcsbeam_context * | vm | ) |
Allocates memory for the quantity \({\bf e}\) on the CPU.
vm | The VCSBeam context struct |
A pointer to the newly allocated memory is given in vm→e
.
void vmMallocJDevice | ( | vcsbeam_context * | vm | ) |
Allocates memory for the quantity \({\bf J}\) on the GPU.
vm | The VCSBeam context struct |
A pointer to the newly allocated memory is given in vm→d_J
.
void vmMallocJHost | ( | vcsbeam_context * | vm | ) |
Allocates memory for the quantity \({\bf J}\) on the CPU.
vm | The VCSBeam context struct |
A pointer to the newly allocated memory is given in vm→J
.
void vmMallocJVDevice | ( | vcsbeam_context * | vm | ) |
Allocates memory for the quantities \({\bf J}{\bf v}\) on the GPU.
vm | The VCSBeam context struct |
Pointers to the newly allocated memory are given in vm→d_Jv_P
and vm→d_Jv_Q
.
Only one "chunk" of memory is allocated (where each second of input data is divided up into one or more chunks, depending on the amount of memory available on the GPU).
void vmMallocJVHost | ( | vcsbeam_context * | vm | ) |
Allocates memory for the quantity \({\bf J}{\bf v}\) on the CPU.
vm | The VCSBeam context struct |
Pointers to the newly allocated memory are given in vm→Jv_P
and vm→Jv_Q
.
void vmMallocPQIdxsDevice | ( | vcsbeam_context * | vm | ) |
Allocates memory for the polarisation indexes on the GPU.
vm | The VCSBeam context struct |
Pointers to the newly allocated memory are given in vm→d_polP_idxs
and vm→d_polQ_idxs
.
void vmMallocPQIdxsHost | ( | vcsbeam_context * | vm | ) |
Allocates memory for the polarisation indexes on the CPU.
vm | The VCSBeam context struct |
Pointers to the newly allocated memory are given in vm→polP_idxs
and vm→polQ_idxs
.
void vmMallocSDevice | ( | vcsbeam_context * | vm | ) |
Allocates memory for the quantity \({\bf S}\) on the GPU.
vm | The VCSBeam context struct |
A pointer to the newly allocated memory is given in vm→d_S
.
void vmMallocSHost | ( | vcsbeam_context * | vm | ) |
Allocates memory for the quantity \({\bf S}\) on the CPU.
vm | The VCSBeam context struct |
A pointer to the newly allocated memory is given in vm→S
.
void vmMallocVDevice | ( | vcsbeam_context * | vm | ) |
Allocates memory for the input voltages on the GPU.
vm | The VCSBeam context struct |
If the observation is Legacy, then this function allocates new memory and sets vm→d_v_size_bytes
to the address of the new memory block.
If the observation is MWAX, then this function only copies the value of vm→fpfb→d_vcs_data
to vm→d_v_size_bytes
, (without checking whether it points to valid GPU memory).
Only one "chunk" of memory is allocated (where each second of input data is divided up into one or more chunks, depending on the amount of memory available on the GPU).
void vmMallocVHost | ( | vcsbeam_context * | vm | ) |
Allocates memory for the input voltages on the CPU.
vm | The VCSBeam context struct |
The memory is allocated as a host_buffer
struct (see vmInitReadBuffer() for a full description). The amount of memory allocated depends on whether the observation is Legacy or MWAX.
If the input is legacy, the read buffer can be just enough for one second's worth of data.
However, for MWAX, the read buffer must be slightly bigger to accommodate the PFB's extra taps. (For now, this is fixed to one voltage block. Changing this will break the gpu kernels that do the fine PFB, for which the offset into the data is currently hard-coded.)
void vmParsePointingFile | ( | vcsbeam_context * | vm, |
const char * | filename | ||
) |
Parses RA/Dec pointings from a file.
vm | The VCSBeam context struct |
filename | The name of the file to be parsed. |
The file must contain whitespace-separated RAs and Decs in the format HH:MM:SS.S DD:MM:SS.S
.
This function allocates memory for ras_hours and decs_degs arrays, which will be destroyed during destroy_vcsbeam_context().
void vmPrintTitle | ( | vcsbeam_context * | vm, |
const char * | title | ||
) |
Prints a title to the specified log output stream.
vm | The VCSBeam context struct |
title | The text to be printed |
The text is printed in the format
with VERSION
and TITLE
being replaced with the VCSBeam version string and the specified title respectively.
void vmPushChunk | ( | vcsbeam_context * | vm | ) |
Loads a "chunk" of input data onto the GPU.
vm | The VCSBeam context struct |
void vmPushJ | ( | vcsbeam_context * | vm | ) |
Loads the Jones matrices onto the GPU.
vm | The VCSBeam context struct |
void vmReadCalibration | ( | vcsbeam_context * | vm | ) |
Reads in a calibration solution.
vm | The VCSBeam context struct |
Calls either vmLoadRTSSolution() or vmLoadOffringaSolution() depending on whether vm→cal.cal_type
is set to CAL_RTS
or CAL_OFFRINGA
. Afterwards, vmSetCustomTileFlags() is called.
vm_error vmReadNextSecond | ( | vcsbeam_context * | vm | ) |
Reads a second's worth of input data from the observation files.
vm | The VCSBeam context struct |
void vmReportPerformanceStats | ( | vcsbeam_context * | vm | ) |
Reports all performance statistics.
vm | The VCSBeam context struct |
void vmSetMaxGPUMem | ( | vcsbeam_context * | vm, |
int | nchunks | ||
) |
Tries to cleverly figure out how many chunks are needed to fit everything on the GPU.
vm | The VCSBeam context struct |
max_gpu_mem_bytes | The maximum amount of GPU memory (in bytes) to use |
LOGIC IS CURRENTLY FAULTY AND INCOMPLETE. DO NOT USE!
void vmSetNumNotFlaggedRFInputs | ( | vcsbeam_context * | vm | ) |
Counts the number of tiles that are not flagged.
vm | The VCSBeam context struct |
The result is stored in vm→num_not_flagged
.
void vmSetNumPointings | ( | vcsbeam_context * | vm, |
unsigned int | npointings | ||
) |
Sets the number of pointings.
vm | The VCSBeam context struct | |
[in] | npointings | The number of pointings |
void vmSetOutputChannelisation | ( | vcsbeam_context * | vm, |
bool | out_fine, | ||
bool | out_coarse | ||
) |
Sets flags governing whether the PFB and inverse PFB routines are run depending on the input and output channelisations.
vm | The VCSBeam context struct |
out_fine | Sets the flag for fine channelised output |
out_coarse | Sets the flag for coarse_channelised output |
Whether the (forward) PFB or the inverse PFB needs to be run depends on the input channelisation (fine = Legacy, or coarse = MWAX), and what channelisations are desired in output (fine or coarse). The vm→do_forward_pfb
and vm→do_inverse_pfb
are set accordingly.
The following table describes all possible scenarios:
Input mode | Output fine? | Output coarse? | Do forward PFB? | Do inverse PFB? |
---|---|---|---|---|
Legacy | no | no | no | no |
Legacy | no | yes | no | yes |
Legacy | yes | no | no | no |
Legacy | yes | yes | no | yes |
MWAX | no | no | no | no |
MWAX | no | yes | yes | yes |
MWAX | yes | no | yes | no |
MWAX | yes | yes | yes | yes |
Note that both forward and inverse PFBs are required for MWAX data even when fine-channelised output is not requested. This is because the beamforming operation requires sufficiently fine channels in order to avoid decoherence across the channels.