LSSTApplications  11.0-24-g0a022a1,15.0+8,15.0+9,15.0-1-g19261fa+1,15.0-1-g1eca518+10,15.0-1-g60afb23+8,15.0-1-g615e0bb,15.0-1-g6668b0b+5,15.0-1-g788a293+8,15.0-1-ga91101e+8,15.0-1-gae1598d+7,15.0-1-gc45031d+10,15.0-1-gd076f1f+8,15.0-1-gdf18595+1,15.0-1-gf4f1c34+7,15.0-18-g5f205baaa,15.0-2-g100d730+1,15.0-2-g18f3f21,15.0-2-g35685a8+1,15.0-2-g947dc0d+10,15.0-2-ge3d7f4b+1,15.0-2-gf38729e,15.0-3-g150fc43+9,15.0-3-g6f085af+1,15.0-3-g9103c06+7,15.0-3-ga03b4ca+10,15.0-3-gaec6799+5,15.0-3-gb7a597c+8,15.0-3-ge6a6747,15.0-4-g45f767a+7,15.0-4-g654b129+6,15.0-4-gff20472+11,15.0-5-g389937dc+6,15.0-5-ga70c291+1,15.0-6-gbad5ef12+1,15.0-6-ge2d9597+10
LSSTDataManagementBasePackage
AstroUtils.cc
Go to the documentation of this file.
1 #include <math.h>
2 #include <iostream>
3 #include <fstream>
4 #include <stdio.h>
5 #include <string.h>
6 
9 #include "lsst/jointcal/Frame.h"
10 #include "lsst/jointcal/Gtransfo.h"
11 
12 namespace lsst {
13 namespace jointcal {
14 
15 Frame applyTransfo(const Frame& inputframe, const Gtransfo& gtransfo, const WhichTransformed which) {
16  // 2 opposite corners
17  double xtmin1, xtmax1, ytmin1, ytmax1;
18  gtransfo.apply(inputframe.xMin, inputframe.yMin, xtmin1, ytmin1);
19  gtransfo.apply(inputframe.xMax, inputframe.yMax, xtmax1, ytmax1);
20  Frame fr1(std::min(xtmin1, xtmax1), std::min(ytmin1, ytmax1), std::max(xtmin1, xtmax1),
21  std::max(ytmin1, ytmax1));
22  // 2 other corners
23  double xtmin2, xtmax2, ytmin2, ytmax2;
24  gtransfo.apply(inputframe.xMin, inputframe.yMax, xtmin2, ytmax2);
25  gtransfo.apply(inputframe.xMax, inputframe.yMin, xtmax2, ytmin2);
26  Frame fr2(std::min(xtmin2, xtmax2), std::min(ytmin2, ytmax2), std::max(xtmin2, xtmax2),
27  std::max(ytmin2, ytmax2));
28 
29  if (which == SmallFrame) return fr1 * fr2;
30  return fr1 + fr2;
31 }
32 } // namespace jointcal
33 } // namespace lsst
double xMin
coordinate of boundary.
Definition: Frame.h:22
T min(T... args)
rectangle with sides parallel to axes.
Definition: Frame.h:19
A base class for image defects.
Definition: cameraGeom.dox:3
T max(T... args)
WhichTransformed
Definition: Frame.h:13
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:41
Frame applyTransfo(const Frame &inputframe, const Gtransfo &gtransfo, const WhichTransformed which)
Transform a Frame through a Transfo.
Definition: AstroUtils.cc:15
virtual void apply(const double xIn, const double yIn, double &xOut, double &yOut) const =0