File: atcabeam.h

package info (click to toggle)
wsclean 2.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,196 kB
  • sloc: cpp: 34,504; ansic: 234; python: 174; makefile: 10
file content (61 lines) | stat: -rw-r--r-- 1,577 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef ATCA_BEAM_H
#define ATCA_BEAM_H

#include "../uvector.h"

#include <string>

struct VoltagePattern
{
	// Array of size nsamples x frequencies, where the sample index is least significant (fastest changing)
	ao::uvector<double> values;
	ao::uvector<double> frequencies;
	double inverseIncrementRadius;
	double maximumRadiusArcMin;
	
	size_t NSamples() const { return values.size() / frequencies.size(); }
	
	const double* FreqIndexValues(size_t freqIndex) const { return &values[freqIndex * NSamples()]; }
	
	ao::uvector<double> InterpolateValues(double freq) const;
};

class ATCABeam
{
public:
	enum Band {
		ATCA_X,
		ATCA_C,
		ATCA_16,
		ATCA_K,
		ATCA_Q,
		ATCA_W,
		ATCA_L1,
		ATCA_L2,
		ATCA_L3,
		ATCA_S,
		ATCA_C_RI,
		ATCA_Unknown
	};
	
	static enum Band GetBand(double freqGHz);
	static enum Band GetBand(const std::string& str);
	
	static VoltagePattern CalculateVoltagePattern(enum Band band);
	
	static void Calculate(class PrimaryBeamImageSet& beamImages,
		size_t width, size_t height,
		double pixelScaleX, double pixelScaleY, 
		double phaseCentreRA, double phaseCentreDec,
		double phaseCentreDL, double phaseCentreDM,
		double frequencyHz,
		const VoltagePattern& voltagePattern
	);
	
private:
	static void calculateInversePolyNarrowband(VoltagePattern& vPattern, const ao::uvector<double>& coefficients);
	static void calculateInversePolyWideband(VoltagePattern& vPattern, const ao::uvector<double>& coefficients);
	static void calculatePoly(VoltagePattern& vPattern, const ao::uvector<double>& coefficients, double maximumRadiusArcMin);
};

#endif