Skip to content

Commit

Permalink
auto
Browse files Browse the repository at this point in the history
  • Loading branch information
arahlin committed Nov 12, 2024
1 parent c124b4d commit e74c101
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion maps/src/FlatSkyProjection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ FlatSkyProjection::QueryDisc(const Quat &q, double radius) const
double phi = i * step;
double c = COS(phi);
double s = SIN(phi);
Quat qv = Quat(c, pva * s, pvb * s, pvc * s);
Quat qv(c, pva * s, pvb * s, pvc * s);
auto xy = QuatToXY(qv * p * ~qv);
ssize_t fx = std::floor(xy[0]);
ssize_t cx = std::ceil(xy[0]);
Expand Down
20 changes: 10 additions & 10 deletions maps/src/G3SkyMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ G3SkyMap::PixelsToAngles(const std::vector<size_t> & pixels,
size_t
G3SkyMap::AngleToPixel(double alpha, double delta) const
{
Quat q = ang_to_quat(alpha, delta);
auto q = ang_to_quat(alpha, delta);

return QuatToPixel(q);
}

std::vector<double>
G3SkyMap::PixelToAngle(size_t pixel) const
{
Quat q = PixelToQuat(pixel);
auto q = PixelToQuat(pixel);
double alpha, delta;
quat_to_ang(q, alpha, delta);

Expand Down Expand Up @@ -349,7 +349,7 @@ void
G3SkyMap::GetInterpPixelsWeights(double alpha, double delta,
std::vector<size_t> & pixels, std::vector<double> & weights) const
{
Quat q = ang_to_quat(alpha, delta);
auto q = ang_to_quat(alpha, delta);
GetInterpPixelsWeights(q, pixels, weights);
}

Expand Down Expand Up @@ -383,7 +383,7 @@ G3SkyMap::GetInterpPrecalc(const std::vector<size_t> & pix,
double
G3SkyMap::GetInterpValue(double alpha, double delta) const
{
Quat q = ang_to_quat(alpha, delta);
auto q = ang_to_quat(alpha, delta);
return GetInterpValue(q);
}

Expand Down Expand Up @@ -423,14 +423,14 @@ G3SkyMap::GetInterpValues(const G3VectorQuat & quats) const
std::vector<size_t>
G3SkyMap::QueryDisc(double alpha, double delta, double radius) const
{
Quat q = ang_to_quat(alpha, delta);
auto q = ang_to_quat(alpha, delta);
return QueryDisc(q, radius);
}

std::vector<size_t>
G3SkyMap::QueryAlphaEllipse(double alpha ,double delta, double a, double b) const
{
Quat q = ang_to_quat(alpha, delta);
auto q = ang_to_quat(alpha, delta);
return QueryAlphaEllipse(q, a, b);
}

Expand All @@ -446,17 +446,17 @@ G3SkyMap::QueryAlphaEllipse(const Quat &q, double a, double b) const
double da = ACOS(COS(rmaj) / COS(rmin)) / cd;

// focus locations
Quat qda = get_origin_rotator(da, 0);
Quat ql = qda * q * ~qda;
Quat qr = ~qda * q * qda;
auto qda = get_origin_rotator(da, 0);
auto ql = qda * q * ~qda;
auto qr = ~qda * q * qda;

// narrow search to pixels within the major disc
auto disc = QueryDisc(q, rmaj);

// narrow further to locus of points within ellipse
std::vector<size_t> pixels;
for (auto i: disc) {
Quat qp = PixelToQuat(i);
auto qp = PixelToQuat(i);
double d = quat_ang_sep(qp, ql) + quat_ang_sep(qp, qr);
if (d < 2 * rmaj)
pixels.push_back(i);
Expand Down

0 comments on commit e74c101

Please sign in to comment.