Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
529fd24a
Commit
529fd24a
authored
Jan 15, 2018
by
Uwe Schulzweida
Browse files
gridsearch: Added tolerance to bounding box (bug fix).
parent
cb9c1c63
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/grid_search.cc
View file @
529fd24a
...
...
@@ -206,8 +206,8 @@ void *gs_create_kdtree(size_t n, const double *restrict lons, const double *rest
for
(
unsigned
j
=
0
;
j
<
3
;
++
j
)
{
//
min[j] = min[j] < 0 ? min[j]*1.01 : min[j]*0.99;
//
max[j] = max[j] < 0 ? max[j]*0.99 : max[j]*1.01;
min
[
j
]
=
min
[
j
]
<
0
?
min
[
j
]
*
1.01
:
min
[
j
]
*
0.99
;
max
[
j
]
=
max
[
j
]
<
0
?
max
[
j
]
*
0.99
:
max
[
j
]
*
1.01
;
gs
->
min
[
j
]
=
min
[
j
];
gs
->
max
[
j
]
=
max
[
j
];
}
...
...
@@ -395,7 +395,15 @@ size_t gs_nearest_kdtree(void *search_container, double lon, double lat, double
kdata_t
query_pt
[
3
];
LLtoXYZ
(
lon
,
lat
,
query_pt
);
/*
if ( lon*RAD2DEG > -27 && lon*RAD2DEG < 60 && lat*RAD2DEG > 30 && lat*RAD2DEG < 35 )
{
printf("lon %g lat %g\n", lon*RAD2DEG, lat*RAD2DEG);
for ( unsigned j = 0; j < 3; ++j )
if ( query_pt[j] < gs->min[j] || query_pt[j] > gs->max[j] )
printf(" %g %g\n", query_pt[j] - gs->min[j], query_pt[j] - gs->max[j]);
}
*/
if
(
!
gs
->
extrapolate
)
for
(
unsigned
j
=
0
;
j
<
3
;
++
j
)
if
(
query_pt
[
j
]
<
gs
->
min
[
j
]
||
query_pt
[
j
]
>
gs
->
max
[
j
]
)
return
index
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment