Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Tom Rink
python
Commits
db4b45f3
Commit
db4b45f3
authored
3 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
da211b3e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/util/lon_lat_grid.py
+2
-2
2 additions, 2 deletions
modules/util/lon_lat_grid.py
with
2 additions
and
2 deletions
modules/util/lon_lat_grid.py
+
2
−
2
View file @
db4b45f3
...
@@ -21,7 +21,7 @@ class LonLatGrid:
...
@@ -21,7 +21,7 @@ class LonLatGrid:
# Incoming longitude must be in range: 0 - 360 degrees
# Incoming longitude must be in range: 0 - 360 degrees
# Can have NaN for off Earth grid points (these are handled internally).
# Can have NaN for off Earth grid points (these are handled internally).
# closeness_threshold: if < distance of located_point to target, return off grid
# closeness_threshold: if < distance of located_point to target, return off grid
def
__init__
(
self
,
grd_lons
,
grd_lats
,
closeness_threshold
=
5
000
,
reduce
=
1
,
leaf_size
=
40
):
def
__init__
(
self
,
grd_lons
,
grd_lats
,
closeness_threshold
=
2
000
,
reduce
=
1
,
leaf_size
=
40
):
if
grd_lons
.
shape
!=
grd_lats
.
shape
:
if
grd_lons
.
shape
!=
grd_lats
.
shape
:
raise
MyGenericException
(
'
incoming lons,lats must have same shape
'
)
raise
MyGenericException
(
'
incoming lons,lats must have same shape
'
)
...
@@ -52,7 +52,7 @@ class LonLatGrid:
...
@@ -52,7 +52,7 @@ class LonLatGrid:
points
=
np
.
stack
([
flons
,
flats
],
axis
=
1
)
points
=
np
.
stack
([
flons
,
flats
],
axis
=
1
)
self
.
kd
=
BallTree
(
np
.
deg2rad
(
points
),
leaf_size
=
leaf_size
,
metric
=
'
haversine
'
)
self
.
kd
=
BallTree
(
np
.
deg2rad
(
points
),
leaf_size
=
leaf_size
,
metric
=
'
haversine
'
)
self
.
closeness_threshold
=
closeness_threshold
self
.
closeness_threshold
=
closeness_threshold
*
reduce
self
.
reduce
=
reduce
self
.
reduce
=
reduce
# locate nearest neighbor for incoming target in earth coordinates (Should not have NaNs)
# locate nearest neighbor for incoming target in earth coordinates (Should not have NaNs)
...
...
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