User Tools

Site Tools


Chris' Note on Configuration Coding

int getMaxNumChannels() Returns the maximum number of spectral channels of all frequency bands.

int getStartMJD() Return the MJD of the start of the correlation

int getStartSeconds() Return the seconds from start of UT day at the start of correlation

int getCoreResultLength(int configindex) Return the size in “complex floats” (cf32) of the data blob containing all complex cross correlations, real autocorrelations and associated weights.

int getCoreResultBaselineOffset(configindex, freqindex, baselineindex) Return cf32 offset to the start of freq/baseline cross correlation data

int getCoreResultBWeightOffset(configindex, freqindex, baselineindex) Return cf32 offset to start of f32 weight array for freq/baseline

int getCoreResultAutocorrOffset(configindex, datastreamindex) Return cf32 offset to start of autocorrelation data

int getCoreResultACWeightOffset(configindex, datastreamindex) Return cf32 offset to start of autocorrelation weights

Looping Over All Products

The following loops iterates over all products

int binloop = 1;    
if(config->pulsarBinOn(configindex) && !config->scrunchOutputOn(configindex))
  binloop = config->getNumPulsarBins(configindex);

for (int i=0;i<config->getNumBaselines();i++) {
  // i loops over all baselines
  int ds1index = config->getBDataStream1Index(configindex, i);
  int ds2index = config->getBDataStream2Index(configindex, i);

  for(int j=0;j<config->getBNumFreqs(configindex,i);j++) {
    // j loops over all frequencies for this baseline
    int /freqindex = config->getBFreqIndex(configindex, i, j);
    int resultindex = config->getCoreResultBaselineOffset(configindex, freqindex, i);
    int freqchannels = config->getFNumChannels(freqindex)/config->getFChannelsToAverage(freqindex);

    for(int s=0;s<model->getNumPhaseCentres(currentscan);s++) {
      for(int b=0;b<binloop;b++) {
        for(int k=0;k<config->getBNumPolProducts(configindex, i, j);k++) {
          //results[resultindex] is start of vector of freqchennels spectral points
          resultindex += freqchannels;
difx/configcode.txt · Last modified: 2015/10/21 10:08 (external edit)