Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdo
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
cdo
Commits
3e02c4cd
Commit
3e02c4cd
authored
2 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
Renamed Indexing::Nested to Indexing::Nest
parent
80c42612
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#22569
passed
2 years ago
Stage: build
Stage: check
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/grid_from_name.cc
+13
-11
13 additions, 11 deletions
src/grid_from_name.cc
with
13 additions
and
11 deletions
src/grid_from_name.cc
+
13
−
11
View file @
3e02c4cd
...
...
@@ -342,18 +342,18 @@ enum class Indexing
{
XY
,
Ring
,
Nest
ed
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
::
Nest
ed
);
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
,
"nest
ed
"
)
==
0
)
indexing
=
Indexing
::
Nest
ed
;
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
]);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment