Skip to content
Snippets Groups Projects
Commit 3e02c4cd authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed Indexing::Nested to Indexing::Nest

parent 80c42612
No related branches found
No related tags found
No related merge requests found
Pipeline #22569 passed
......@@ -342,18 +342,18 @@ enum class Indexing
{
XY,
Ring,
Nested
Nest
};
static size_t
convert_index(size_t ipix, size_t nside, Indexing indexing)
{
size_t index = ipix;
// clang-format off
if (indexing == Indexing::Ring) return healpixl_ring_to_xy(ipix, nside);
else if (indexing == Indexing::Nest) return healpixl_nested_to_xy(ipix, nside);
// clang-format on
if (indexing == Indexing::Ring) index = healpixl_ring_to_xy(ipix, nside);
else if (indexing == Indexing::Nested) index = healpixl_nested_to_xy(ipix, nside);
return index;
return ipix;
}
static void
......@@ -365,7 +365,7 @@ gen_grid_healpix(GridDesciption &grid, const char *pline)
const size_t nside = strtol(pline, &endptr, 10);
if (*endptr == 0 || endptr != pline)
{
Indexing indexing(Indexing::Nested);
Indexing indexing(Indexing::Nest);
pline = endptr;
bool withBounds = false;
......@@ -377,10 +377,12 @@ gen_grid_healpix(GridDesciption &grid, const char *pline)
if (*pline == '_')
{
pline++;
if (strcmp(pline, "xy") == 0) indexing = Indexing::XY;
// clang-format off
if (strcmp(pline, "xy") == 0) indexing = Indexing::XY;
else if (strcmp(pline, "ring") == 0) indexing = Indexing::Ring;
else if (strcmp(pline, "nested") == 0) indexing = Indexing::Nested;
else if (strcmp(pline, "nest") == 0) indexing = Indexing::Nest;
else return;
// clang-format on
}
const size_t ncells = 12 * nside * nside;
......@@ -400,7 +402,7 @@ gen_grid_healpix(GridDesciption &grid, const char *pline)
for (size_t ipix = 0; ipix < ncells; ipix++)
{
size_t index = convert_index(ipix, nside, indexing);
const auto index = convert_index(ipix, nside, indexing);
double lon, lat, dx, dy;
dx = 0.5;
dy = 0.5;
......@@ -722,7 +724,7 @@ grid_from_name(const char *gridnameptr)
{
gen_grid_gme(grid, &gridname[2]);
}
else if (gridname[0] == 'h' && gridname[1] == 'p') // healpix hp<nside><c|b><_ring|nested>
else if (gridname[0] == 'h' && gridname[1] == 'p') // healpix hp<nside>[b][_nest|ring|xy]
{
gen_grid_healpix(grid, &gridname[2]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment