11 #define VS2E 5.22703725e-6 15 operator<<(std::ostream& os,
const Ray& ray) {
16 return os <<
"(" << ray.x() <<
", " << ray.y() <<
"\t" << ray.z() <<
")";
20 openPMD_io::Rays::Rays(): _size(0), _read(0) {}
24 openPMD_io::Rays::push(
const Ray& this_ray) {
25 _x.push_back(this_ray.x());
26 _y.push_back(this_ray.y());
27 _z.push_back(this_ray.z());
29 _dx.push_back(this_ray.dx());
30 _dy.push_back(this_ray.dy());
31 _dz.push_back(this_ray.dz());
33 _sx.push_back(this_ray.sx());
34 _sy.push_back(this_ray.sy());
35 _sz.push_back(this_ray.sz());
37 _sPolAx.push_back(this_ray.sPolAx());
38 _sPolAy.push_back(this_ray.sPolAy());
39 _sPolAz.push_back(this_ray.sPolAz());
40 _sPolPh.push_back(this_ray.sPolPh());
42 _pPolAx.push_back(this_ray.pPolAx());
43 _pPolAy.push_back(this_ray.pPolAy());
44 _pPolAz.push_back(this_ray.pPolAz());
45 _pPolPh.push_back(this_ray.pPolPh());
47 _wavelength.push_back(this_ray.get_wavelength());
48 _time.push_back(this_ray.get_time());
49 _weight.push_back(this_ray.get_weight());
51 _id.push_back(this_ray.get_id());
58 openPMD_io::Rays::pop(
bool next) {
66 r.
set_sPolarization(_sPolAx[_read], _sPolAy[_read], _sPolAz[_read], _sPolPh[_read]);
67 r.
set_pPolarization(_pPolAx[_read], _pPolAy[_read], _pPolAz[_read], _pPolPh[_read]);
74 r.set_status(_status[_read]);
I/O API for the ray trace extension of the openPMD format.
void set_wavelength(double w)
set wavelength
void set_polarization(double x, double y, double z, double scale=1)
scale and set polarization for non-photons
void set_weight(double w)
set weight
Generic ray, containing all the ray information being stored by the API into the openPMD file...
void set_direction(double x, double y, double z, double scale=1)
scale and set the direction
defines the maximum number of rays that can be stored in memory before dumping to file ...
void set_sPolarization(double x, double y, double z, double phase, double scale=1)
scale and set s-polarization for photons
void set_pPolarization(double x, double y, double z, double phase, double scale=1)
scale and set p-polarization for photons
void set_time(double t)
set time
void set_position(double x, double y, double z, double scale=1)
scale and set the position
particleStatus_t get_status(void) const
return the particle status