fieldslice.h
1.05 KB
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
#ifndef FIELDSLICE_H
#define FIELDSLICE_H
#include "dataTypes.h"
#include <string>
#include <sstream>
#include "rts/math/quad.h"
#include "scalarslice.h"
struct fieldslice
{
//images representing the slice for each world-space polarization direction
bsComplex* x_hat;
bsComplex* y_hat;
bsComplex* z_hat;
//slice resolution
unsigned int R[2];
//if the slice is a scalar
bool scalarField;
fieldslice(unsigned int x_res, unsigned int y_res);
fieldslice();
~fieldslice();
//void setPos(bsPoint pMin, bsPoint pMax, bsVector N);
scalarslice Mag();
scalarslice Real();
scalarslice Imag();
scalarslice Intensity();
void IntegrateAndResample(scalarslice* detector, unsigned int supersample);
void ScaleField(ptype v);
//convert the field slice to the angular spectrum
void toAngularSpectrum();
void fromAngularSpectrum();
//crop a region from the field
fieldslice crop(int u, int v, int su, int sv);
void init_gpu();
void kill_gpu();
void clear_gpu();
std::string toStr();
};
#endif