Skip to content

Commit

Permalink
unsigned
Browse files Browse the repository at this point in the history
  • Loading branch information
arahlin committed Sep 20, 2023
1 parent 6d16181 commit a4fb78c
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions maps/include/maps/FlatSkyMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ class FlatSkyMap : public G3FrameObject, public G3SkyMap {
double yres() const;
double res() const;

ssize_t AngleToPixel(double alpha, double delta) const override;
size_t AngleToPixel(double alpha, double delta) const override;
std::vector<double> PixelToAngle(size_t pixel) const override;
std::vector<double> PixelToAngle(size_t x_pix, size_t y_pix) const;
std::vector<double> PixelToAngleWrapRa(size_t pixel) const;
std::vector<double> AngleToXY(double alpha, double delta) const;
std::vector<double> XYToAngle(double x, double y) const;
ssize_t XYToPixel(double x, double y) const;
size_t XYToPixel(double x, double y) const;
std::vector<double> PixelToXY(size_t pixel) const;
std::vector<double> QuatToXY(quat q) const;
quat XYToQuat(double x, double y) const;
Expand Down
4 changes: 2 additions & 2 deletions maps/include/maps/FlatSkyProjection.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ class FlatSkyProjection : public G3FrameObject {
double yres() const { return y_res_; };
double res() const { return y_res_; };

ssize_t XYToPixel(double x, double y) const;
size_t XYToPixel(double x, double y) const;
std::vector<double> PixelToXY(size_t pixel) const;
std::vector<double> XYToAngle(double x, double y, bool wrap_alpha=false) const;
std::vector<double> AngleToXY(double alpha, double delta) const;
std::vector<double> PixelToAngle(size_t pixel, bool wrap_alpha=false) const;
ssize_t AngleToPixel(double alpha, double delta) const;
size_t AngleToPixel(double alpha, double delta) const;
std::vector<double> QuatToXY(quat q, bool local) const;
quat XYToQuat(double x, double y, bool local) const;

Expand Down
8 changes: 4 additions & 4 deletions maps/include/maps/G3SkyMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,17 @@ class G3SkyMap {
virtual void ApplyMask(const G3SkyMapMask &mask, bool inverse=false);

// Pointing information
std::vector<ssize_t> AnglesToPixels(const std::vector<double> & alphas,
std::vector<size_t> AnglesToPixels(const std::vector<double> & alphas,
const std::vector<double> & deltas) const;
void PixelsToAngles(const std::vector<size_t> & pixels,
std::vector<double> & alphas, std::vector<double> & deltas) const;
std::vector<ssize_t> QuatsToPixels(const G3VectorQuat &quats) const;
std::vector<size_t> QuatsToPixels(const G3VectorQuat &quats) const;
G3VectorQuat PixelsToQuats(const std::vector<size_t> &pixels) const;

virtual std::vector<double> PixelToAngle(size_t pixel) const = 0;
virtual ssize_t AngleToPixel(double alpha, double delta) const = 0;
virtual size_t AngleToPixel(double alpha, double delta) const = 0;
quat PixelToQuat(size_t pixel) const;
ssize_t QuatToPixel(quat q) const;
size_t QuatToPixel(quat q) const;

// Rebinning and interpolation
virtual void GetRebinAngles(size_t pixel, size_t scale,
Expand Down
2 changes: 1 addition & 1 deletion maps/include/maps/HealpixSkyMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class HealpixSkyMap : public G3FrameObject, public G3SkyMap {
bool nested() const {return info_.nested();}
double res() const;

ssize_t AngleToPixel(double alpha, double delta) const override;
size_t AngleToPixel(double alpha, double delta) const override;
std::vector<double> PixelToAngle(size_t pixel) const override;

void GetRebinAngles(size_t pixel, size_t scale,
Expand Down
4 changes: 2 additions & 2 deletions maps/include/maps/HealpixSkyMapInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class HealpixSkyMapInfo : public G3FrameObject {
size_t RingToPixel(size_t iring, size_t ringpix) const;

std::vector<double> PixelToAngle(size_t pixel) const;
ssize_t AngleToPixel(double alpha, double delta) const;
size_t AngleToPixel(double alpha, double delta) const;

void GetRebinAngles(size_t pixel, size_t scale,
std::vector<double> & alphas, std::vector<double> & deltas) const;
Expand Down Expand Up @@ -68,7 +68,7 @@ class HealpixSkyMapInfo : public G3FrameObject {

std::vector<HealpixRingInfo> rings_;

ssize_t RingAbove(double z) const;
size_t RingAbove(double z) const;

SET_LOGGER("HealpixSkyMapInfo");
};
Expand Down
8 changes: 4 additions & 4 deletions maps/src/FlatSkyMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ std::vector<double> FlatSkyMap::XYToAngle(double x, double y) const {
return proj_info.XYToAngle(x, y, false);
}

ssize_t
size_t
FlatSkyMap::XYToPixel(double x, double y) const {
return proj_info.XYToPixel(x, y);
}
Expand All @@ -718,7 +718,7 @@ FlatSkyMap::XYToQuat(double x, double y) const
return proj_info.XYToQuat(x, y, coord_ref == Local);
}

ssize_t FlatSkyMap::AngleToPixel(double alpha, double delta) const {
size_t FlatSkyMap::AngleToPixel(double alpha, double delta) const {
return proj_info.AngleToPixel(alpha, delta);
}

Expand Down Expand Up @@ -1161,13 +1161,13 @@ flatskymap_pixels_to_xy(const FlatSkyMap & skymap, const std::vector<size_t> &pi
return boost::python::make_tuple(x, y);
}

static std::vector<ssize_t>
static std::vector<size_t>
flatskymap_xy_to_pixels(const FlatSkyMap & skymap, const std::vector<double> &x,
const std::vector<double> &y)
{
g3_assert(x.size() == y.size());

std::vector<ssize_t> pixel(x.size());
std::vector<size_t> pixel(x.size());
for (size_t i = 0; i < x.size(); i++) {
pixel[i] = skymap.XYToPixel(x[i], y[i]);
}
Expand Down
4 changes: 2 additions & 2 deletions maps/src/FlatSkyProjection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void FlatSkyProjection::SetRes(double res, double x_res)
SetXRes(x_res);
}

ssize_t
size_t
FlatSkyProjection::XYToPixel(double x, double y) const
{
// Truncate X/Y coordinates to integer pixels and wrap to 1D.
Expand Down Expand Up @@ -552,7 +552,7 @@ FlatSkyProjection::PixelToAngle(size_t pixel, bool wrap_alpha) const
return XYToAngle(xy[0], xy[1], wrap_alpha);
}

ssize_t
size_t
FlatSkyProjection::AngleToPixel(double alpha, double delta) const
{
std::vector<double> xy = AngleToXY(alpha, delta);
Expand Down
10 changes: 5 additions & 5 deletions maps/src/G3SkyMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ G3SkyMapWeights::G3SkyMapWeights(const G3SkyMapWeights &r, bool copy_data) :
{
}

std::vector<ssize_t>
std::vector<size_t>
G3SkyMap::AnglesToPixels(const std::vector<double> & alphas,
const std::vector<double> & deltas) const
{
std::vector<ssize_t> pixels(alphas.size());
std::vector<size_t> pixels(alphas.size());

for (size_t i = 0; i < alphas.size(); i++) {
pixels[i] = AngleToPixel(alphas[i], deltas[i]);
Expand Down Expand Up @@ -169,7 +169,7 @@ G3SkyMap::PixelsToAngles(const std::vector<size_t> & pixels,
}
}

ssize_t
size_t
G3SkyMap::QuatToPixel(quat q) const
{
double alpha, delta;
Expand All @@ -190,10 +190,10 @@ G3SkyMap::PixelToQuat(size_t pixel) const
return ang_to_quat(alphadelta[0], alphadelta[1]);
}

std::vector<ssize_t>
std::vector<size_t>
G3SkyMap::QuatsToPixels(const G3VectorQuat &quats) const
{
std::vector<ssize_t> pixels(quats.size());
std::vector<size_t> pixels(quats.size());
for (size_t i = 0; i < quats.size(); i++)
pixels[i] = QuatToPixel(quats[i]);

Expand Down
2 changes: 1 addition & 1 deletion maps/src/HealpixSkyMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ size_t HealpixSkyMap::NpixNonZero() const
return sz;
}

ssize_t
size_t
HealpixSkyMap::AngleToPixel(double alpha, double delta) const
{
return info_.AngleToPixel(alpha, delta);
Expand Down
16 changes: 8 additions & 8 deletions maps/src/HealpixSkyMapInfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ HealpixSkyMapInfo::PixelToRing(size_t pixel) const

const HealpixRingInfo & ring = rings_[iring];

ssize_t ringpix = pixel - ring.pix0;
size_t ringpix = pixel - ring.pix0;
if (ringpix >= ring.npix)
return bad;

Expand Down Expand Up @@ -208,7 +208,7 @@ HealpixSkyMapInfo::RingToPixel(size_t iring, size_t ringpix) const
return pixel;
}

ssize_t
size_t
HealpixSkyMapInfo::AngleToPixel(double alpha, double delta) const
{
if (std::isnan(alpha) || std::isnan(delta))
Expand Down Expand Up @@ -290,13 +290,13 @@ HealpixSkyMapInfo::GetRebinAngles(size_t pixel, size_t scale,
}
}

ssize_t
size_t
HealpixSkyMapInfo::RingAbove(double z) const
{
double za = fabs(z);
if (za <= twothird)
return nside_ * (2 - 1.5 * z);
ssize_t iring = nside_ * sqrt(3 * (1 - za));
size_t iring = nside_ * sqrt(3 * (1 - za));
return (z > 0) ? iring : (nring_ - iring - 1);
}

Expand All @@ -316,8 +316,8 @@ HealpixSkyMapInfo::GetInterpPixelsWeights(double alpha, double delta,

double phi = (alpha < 0) ? (alpha + twopi) : alpha;

ssize_t ir1 = RingAbove(z);
ssize_t ir2 = ir1 + 1;
size_t ir1 = RingAbove(z);
size_t ir2 = ir1 + 1;

double z1, z2;

Expand Down Expand Up @@ -417,7 +417,7 @@ HealpixSkyMapInfo::QueryDisc(double alpha, double delta, double radius) const

double rlat1 = theta - radius;
double zmax = cos(rlat1);
ssize_t irmin = RingAbove(zmax) + 1;
size_t irmin = RingAbove(zmax) + 1;

if ((rlat1 <= 0) && (irmin > 1)) {
// north pole in the disk
Expand All @@ -428,7 +428,7 @@ HealpixSkyMapInfo::QueryDisc(double alpha, double delta, double radius) const

double rlat2 = theta + radius;
double zmin = cos(rlat2);
ssize_t irmax = RingAbove(zmin);
size_t irmax = RingAbove(zmin);

for (size_t iring = irmin; iring <= irmax; iring++) {
const HealpixRingInfo & ring = rings_[iring];
Expand Down

0 comments on commit a4fb78c

Please sign in to comment.