PyPO User Manual
InterfaceReflector.cpp File Reference

Implementation of reflector objects. More...

#include <iostream>
#include <vector>
#include <array>
#include <cmath>
#include "Utils.h"
#include "InterfaceReflector.h"

Macros

#define M_PI   3.14159265358979323846
 

Functions

template<typename T , typename U >
void transformGrids (T *reflc, int idx, std::array< U, 3 > &inp, std::array< U, 3 > &out, Utils< U > *ut, U mat[16])
 
template<typename T , typename U >
void Parabola_xy (T *parabola, U xu_lo, U xu_up, U yv_lo, U yv_up, U xcenter, U ycenter, U a, U b, int ncx, int ncy, int nfac, U mat[16], bool transform)
 
template<typename T , typename U >
void Parabola_uv (T *parabola, U xu_lo, U xu_up, U yv_lo, U yv_up, U xcenter, U ycenter, U ecc_uv, U rot_uv, U a, U b, int ncx, int ncy, int nfac, U mat[16], bool transform)
 
template<typename T , typename U >
void Hyperbola_xy (T *hyperbola, U xu_lo, U xu_up, U yv_lo, U yv_up, U xcenter, U ycenter, U a, U b, U c, int ncx, int ncy, int nfac, U mat[16], bool transform)
 
template<typename T , typename U >
void Hyperbola_uv (T *hyperbola, U xu_lo, U xu_up, U yv_lo, U yv_up, U xcenter, U ycenter, U ecc_uv, U rot_uv, U a, U b, U c, int ncx, int ncy, int nfac, U mat[16], bool transform)
 
template<typename T , typename U >
void Ellipse_xy (T *ellipse, U xu_lo, U xu_up, U yv_lo, U yv_up, U xcenter, U ycenter, U a, U b, U c, int ncx, int ncy, int nfac, U mat[16], bool transform)
 
template<typename T , typename U >
void Ellipse_uv (T *ellipse, U xu_lo, U xu_up, U yv_lo, U yv_up, U xcenter, U ycenter, U ecc_uv, U rot_uv, U a, U b, U c, int ncx, int ncy, int nfac, U mat[16], bool transform)
 
template<typename T , typename U >
void Plane_xy (T *plane, U xu_lo, U xu_up, U yv_lo, U yv_up, int ncx, int ncy, int nfac, U mat[16], bool transform)
 
template<typename T , typename U >
void Plane_uv (T *plane, U xu_lo, U xu_up, U yv_lo, U yv_up, U xcenter, U ycenter, U ecc_uv, U rot_uv, int ncx, int ncy, int nfac, U mat[16], bool transform)
 
template<typename T , typename U >
void Plane_AoE (T *plane, U xu_lo, U xu_up, U yv_lo, U yv_up, U xcenter, U ycenter, int ncx, int ncy, U mat[16], bool transform, bool spheric)
 
template<typename T , typename U , typename W >
void add_surferr_uncorr (T refl, W *container)
 
void generateGrid (reflparams refl, reflcontainer *container, bool transform, bool spheric)
 
void generateGridf (reflparamsf refl, reflcontainerf *container, bool transform, bool spheric)
 

Detailed Description

Implementation of reflector objects.

General definitions of reflector objects. Generates reflectors using xy, uv or Azimuth over Elevation parametrization. Associated normal vectors and area element sizes are also returned.

Function Documentation

◆ Ellipse_uv()

template<typename T , typename U >
void Ellipse_uv ( T *  ellipse,
xu_lo,
xu_up,
yv_lo,
yv_up,
xcenter,
ycenter,
ecc_uv,
rot_uv,
a,
b,
c,
int  ncx,
int  ncy,
int  nfac,
mat[16],
bool  transform 
)

Generate ellipsoid from uv parametrization.

Generate a ellipsoid using a uv parametrization. Also generates the normal vectors and area elements. Applies specified transformations as well, if enabled.

Parameters
ellipsePointer to reflcontainer or reflcontainerf object.
xu_loLower limit on u co-ordinate, double/float.
xu_upUpper limit on u co-ordinate, double/float.
yv_loLower limit on v co-ordinate, double/float.
yv_upUpper limit on v co-ordinate, double/float.
xcenterCenter x co-ordinate of xy region.
ycenterCenter y co-ordinate of xy region.
ecc_uvEccentricity of uv-generated ellipse in xy-grid, double/float.
rot_uvPosition angle of uv-generated ellipse in xy-grid, double/float.
aScaling factor along x-axis.
bScaling factor along y-axis.
cScaling factor along z-axis
ncxNumber of cells along x-axis.
ncyNumber of cells along y-axis.
nfacFlip normal vectors.
matArray of 16 double/float, transformation matrix.
transformWhether or not to apply transformation to reflector.
See also
reflcontainer
reflcontainerf

◆ Ellipse_xy()

template<typename T , typename U >
void Ellipse_xy ( T *  ellipse,
xu_lo,
xu_up,
yv_lo,
yv_up,
xcenter,
ycenter,
a,
b,
c,
int  ncx,
int  ncy,
int  nfac,
mat[16],
bool  transform 
)

Generate ellipsoid from xy parametrization.

Generate a ellipsoid using an xy parametrization. Also generates the normal vectors and area elements. Applies specified transformations as well, if enabled.

Parameters
ellipsePointer to reflcontainer or reflcontainerf object.
xu_loLower limit on x co-ordinate, double/float.
xu_upUpper limit on x co-ordinate, double/float.
yv_loLower limit on y co-ordinate, double/float.
yv_upUpper limit on y co-ordinate, double/float.
xcenterCenter x co-ordinate of xy region.
ycenterCenter y co-ordinate of xy region.
aScaling factor along x-axis.
bScaling factor along y-axis.
cScaling factor along z-axis
ncxNumber of cells along x-axis.
ncyNumber of cells along y-axis.
nfacFlip normal vectors.
matArray of 16 double/float, transformation matrix.
transformWhether or not to apply transformation to reflector.
See also
reflcontainer
reflcontainerf

◆ generateGrid()

void generateGrid ( reflparams  refl,
reflcontainer container,
bool  transform,
bool  spheric 
)

Generate reflector/far-field grids.

Generate x, y, z grids and corresponding normal vectors nx, ny, nz. Also generates area elements. For far-field grids, generates Az and El grid, leaves z-container at 0 values.

Parameters
reflA reflparams object containing reflector parameters.
containerPointer to reflcontainer object.
transformWhether or not to apply transformation to reflector.
sphericWhether or not to convert a far-field grid to spherical co-ordinates, for plotting purposes.
See also
reflparams
reflcontainer

◆ generateGridf()

void generateGridf ( reflparamsf  refl,
reflcontainerf container,
bool  transform,
bool  spheric 
)

Generate reflector/far-field grids.

Generate x, y, z grids and corresponding normal vectors nx, ny, nz. Also generates area elements. For far-field grids, generates Az and El grid, leaves z-container at 0 values.

Parameters
reflA reflparamsf object containing reflector parameters.
containerPointer to reflcontainerf object.
transformWhether or not to apply transformation to reflector.
sphericWhether or not to convert a far-field grid to spherical co-ordinates, for plotting purposes.
See also
reflparamsf
reflcontainerf

◆ Hyperbola_uv()

template<typename T , typename U >
void Hyperbola_uv ( T *  hyperbola,
xu_lo,
xu_up,
yv_lo,
yv_up,
xcenter,
ycenter,
ecc_uv,
rot_uv,
a,
b,
c,
int  ncx,
int  ncy,
int  nfac,
mat[16],
bool  transform 
)

Generate hyperboloid from uv parametrization.

Generate a hyperboloid using a uv parametrization. Also generates the normal vectors and area elements. Applies specified transformations as well, if enabled.

Parameters
hyperbolaPointer to reflcontainer or reflcontainerf object.
xu_loLower limit on u co-ordinate, double/float.
xu_upUpper limit on u co-ordinate, double/float.
yv_loLower limit on v co-ordinate, double/float.
yv_upUpper limit on v co-ordinate, double/float.
xcenterCenter x co-ordinate of xy region.
ycenterCenter y co-ordinate of xy region.
ecc_uvEccentricity of uv-generated ellipse in xy-grid, double/float.
rot_uvPosition angle of uv-generated ellipse in xy-grid, double/float.
aScaling factor along x-axis.
bScaling factor along y-axis.
cScaling factor along z-axis
ncxNumber of cells along x-axis.
ncyNumber of cells along y-axis.
nfacFlip normal vectors.
matArray of 16 double/float, transformation matrix.
transformWhether or not to apply transformation to reflector.
See also
reflcontainer
reflcontainerf

◆ Hyperbola_xy()

template<typename T , typename U >
void Hyperbola_xy ( T *  hyperbola,
xu_lo,
xu_up,
yv_lo,
yv_up,
xcenter,
ycenter,
a,
b,
c,
int  ncx,
int  ncy,
int  nfac,
mat[16],
bool  transform 
)

Generate hyperboloid from xy parametrization.

Generate a hyperboloid using an xy parametrization. Also generates the normal vectors and area elements. Applies specified transformations as well, if enabled.

Parameters
hyperbolaPointer to reflcontainer or reflcontainerf object.
xu_loLower limit on x co-ordinate, double/float.
xu_upUpper limit on x co-ordinate, double/float.
yv_loLower limit on y co-ordinate, double/float.
yv_upUpper limit on y co-ordinate, double/float.
xcenterCenter x co-ordinate of xy region.
ycenterCenter y co-ordinate of xy region.
aScaling factor along x-axis.
bScaling factor along y-axis.
cScaling factor along z-axis
ncxNumber of cells along x-axis.
ncyNumber of cells along y-axis.
nfacFlip normal vectors.
matArray of 16 double/float, transformation matrix.
transformWhether or not to apply transformation to reflector.
See also
reflcontainer
reflcontainerf

◆ Parabola_uv()

template<typename T , typename U >
void Parabola_uv ( T *  parabola,
xu_lo,
xu_up,
yv_lo,
yv_up,
xcenter,
ycenter,
ecc_uv,
rot_uv,
a,
b,
int  ncx,
int  ncy,
int  nfac,
mat[16],
bool  transform 
)

Generate paraboloid from uv parametrization.

Generate a paraboloid using a uv parametrization. Also generates the normal vectors and area elements. Applies specified transformations as well, if enabled.

Parameters
parabolaPointer to reflcontainer or reflcontainerf object.
xu_loLower limit on u co-ordinate, double/float.
xu_upUpper limit on u co-ordinate, double/float.
yv_loLower limit on v co-ordinate, double/float.
yv_upUpper limit on v co-ordinate, double/float.
xcenterCenter x co-ordinate of uv region.
ycenterCenter y co-ordinate of uv region.
ecc_uvEccentricity of uv-generated ellipse in xy-grid, double/float.
rot_uvPosition angle of uv-generated ellipse in xy-grid, double/float.
aScaling factor along x-axis.
bScaling factor along y-axis.
ncxNumber of cells along u-axis.
ncyNumber of cells along v-axis.
nfacFlip normal vectors.
matArray of 16 double/float, transformation matrix.
transformWhether or not to apply transformation to reflector.
See also
reflcontainer
reflcontainerf

◆ Parabola_xy()

template<typename T , typename U >
void Parabola_xy ( T *  parabola,
xu_lo,
xu_up,
yv_lo,
yv_up,
xcenter,
ycenter,
a,
b,
int  ncx,
int  ncy,
int  nfac,
mat[16],
bool  transform 
)

Generate paraboloid from xy parametrization.

Generate a paraboloid using an xy parametrization. Also generates the normal vectors and area elements. Applies specified transformations as well, if enabled.

Parameters
parabolaPointer to reflcontainer or reflcontainerf object.
xu_loLower limit on x co-ordinate, double/float.
xu_upUpper limit on x co-ordinate, double/float.
yv_loLower limit on y co-ordinate, double/float.
yv_upUpper limit on y co-ordinate, double/float.
xcenterCenter x co-ordinate of xy region.
ycenterCenter y co-ordinate of xy region.
aScaling factor along x-axis.
bScaling factor along y-axis.
ncxNumber of cells along x-axis.
ncyNumber of cells along y-axis.
nfacFlip normal vectors.
matArray of 16 double/float, transformation matrix.
transformWhether or not to apply transformation to reflector.
See also
reflcontainer
reflcontainerf

◆ Plane_AoE()

template<typename T , typename U >
void Plane_AoE ( T *  plane,
xu_lo,
xu_up,
yv_lo,
yv_up,
xcenter,
ycenter,
int  ncx,
int  ncy,
mat[16],
bool  transform,
bool  spheric 
)

Generate plane from AoE (on-sky angles) parametrization.

Generate a plane using an AoE parametrization. Used for calculating far-fields only.

Parameters
planePointer to reflcontainer or reflcontainerf object.
xu_loLower limit on Az co-ordinate, double/float.
xu_upUpper limit on Az co-ordinate, double/float.
yv_loLower limit on El co-ordinate, double/float.
yv_upUpper limit on El co-ordinate, double/float.
xcenterCenter Az co-ordinate of Az-El region.
ycenterCenter El co-ordinate of Az-El region.
ncxNumber of cells along Az-axis.
ncyNumber of cells along El-axis.
matArray of 16 double/float, transformation matrix.
transformWhether or not to apply transformation to plane.
sphericWhether or not to apply spherical transformation to plane, for plotting purposes..
See also
reflcontainer
reflcontainerf

◆ Plane_uv()

template<typename T , typename U >
void Plane_uv ( T *  plane,
xu_lo,
xu_up,
yv_lo,
yv_up,
xcenter,
ycenter,
ecc_uv,
rot_uv,
int  ncx,
int  ncy,
int  nfac,
mat[16],
bool  transform 
)

Generate plane from uv parametrization.

Generate a plane using an uv parametrization. Also generates the normal vectors and area elements. Applies specified transformations as well, if enabled.

Parameters
planePointer to reflcontainer or reflcontainerf object.
xu_loLower limit on x co-ordinate, double/float.
xu_upUpper limit on x co-ordinate, double/float.
yv_loLower limit on y co-ordinate, double/float.
yv_upUpper limit on y co-ordinate, double/float.
xcenterCenter x co-ordinate of xy region.
ycenterCenter y co-ordinate of xy region.
ecc_uvEccentricity of uv-generated ellipse in xy-grid, double/float.
rot_uvPosition angle of uv-generated ellipse in xy-grid, double/float.
ncxNumber of cells along x-axis.
ncyNumber of cells along y-axis.
nfacFlip normal vectors.
matArray of 16 double/float, transformation matrix.
transformWhether or not to apply transformation to reflector.
See also
reflcontainer
reflcontainerf

◆ Plane_xy()

template<typename T , typename U >
void Plane_xy ( T *  plane,
xu_lo,
xu_up,
yv_lo,
yv_up,
int  ncx,
int  ncy,
int  nfac,
mat[16],
bool  transform 
)

Generate plane from xy parametrization.

Generate a plane using an xy parametrization. Also generates the normal vectors and area elements. Applies specified transformations as well, if enabled.

Parameters
planePointer to reflcontainer or reflcontainerf object.
xu_loLower limit on x co-ordinate, double/float.
xu_upUpper limit on x co-ordinate, double/float.
yv_loLower limit on y co-ordinate, double/float.
yv_upUpper limit on y co-ordinate, double/float.
ncxNumber of cells along x-axis.
ncyNumber of cells along y-axis.
nfacFlip normal vectors.
matArray of 16 double/float, transformation matrix.
transformWhether or not to apply transformation to reflector.
See also
reflcontainer
reflcontainerf

◆ transformGrids()

template<typename T , typename U >
void transformGrids ( T *  reflc,
int  idx,
std::array< U, 3 > &  inp,
std::array< U, 3 > &  out,
Utils< U > *  ut,
mat[16] 
)

Transform reflector grids.

Applies rotations and translations to reflector, co-ordinate wise.

Parameters
reflcPointer to reflcontainer or reflcontainerf object.
idxIndex of co-ordinate.
inpArray of 3 double/float.
outArray of 3 double/float.
utPointer to Utils object.
matArray of 16 double/float.
See also
Utils
Structs
reflcontainer
reflcontainerfa