Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-lib
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
Service Desk
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
ghsc
National Seismic Hazard Model Project
nshmp-lib
Commits
0db9c4d7
Commit
0db9c4d7
authored
4 years ago
by
Powers, Peter M.
Browse files
Options
Downloads
Patches
Plain Diff
revert location precision
parent
16b83b72
No related branches found
No related tags found
1 merge request
!139
Lib work
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/gov/usgs/earthquake/nshmp/geo/Locations.java
+15
-6
15 additions, 6 deletions
src/main/java/gov/usgs/earthquake/nshmp/geo/Locations.java
with
15 additions
and
6 deletions
src/main/java/gov/usgs/earthquake/nshmp/geo/Locations.java
+
15
−
6
View file @
0db9c4d7
...
...
@@ -468,8 +468,20 @@ public final class Locations {
}
/*
* Helper assumes supplied values in radians and kilometers. Returned location
* is rounded to 6 decimal places, sub-meter scale precision.
* Helper assumes supplied values in radians and kilometers.
*
* TODO revisit. Introduced rounding of result in refactoring for JSON. This
* changes hazard, most significantly when creating pseudo-sources for grid
* source optimization tables. I think it would be nice to have locations be
* lower precision when resampling traces or splitting location lists.
* Consider introducing a rounding flag.
*
* Interestingly the Locations tests did not fail when the formatting was
* removed
*
* Location.create( Maths.round(lon2 * Maths.TO_DEGREES, 5), Maths.round(lat2
* * Maths.TO_DEGREES, 5), Maths.round(depth + Δv, 5));
*
*/
private
static
Location
location
(
double
lon
,
...
...
@@ -486,10 +498,7 @@ public final class Locations {
double
cosD
=
cos
(
ad
);
double
lat2
=
asin
(
sinLat1
*
cosD
+
cosLat1
*
sinD
*
cos
(
az
));
double
lon2
=
lon
+
atan2
(
sin
(
az
)
*
sinD
*
cosLat1
,
cosD
-
sinLat1
*
sin
(
lat2
));
return
Location
.
create
(
Maths
.
round
(
lon2
*
Maths
.
TO_DEGREES
,
5
),
Maths
.
round
(
lat2
*
Maths
.
TO_DEGREES
,
5
),
Maths
.
round
(
depth
+
Δv
,
5
));
return
Location
.
create
(
lon2
*
Maths
.
TO_DEGREES
,
lat2
*
Maths
.
TO_DEGREES
,
depth
+
Δv
);
}
/**
...
...
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