Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#45 closed defect (fixed)

Fix getAveStrike in FaultTrace

Reported by: Kevin Milner Owned by: Peter Powers
Priority: major Milestone: OpenSHA 1.1
Component: sha Version: 1.0.x
Keywords: strike Cc: Ned Field, Peter Powers

Description

Currently the method getAveStrike() in FaultTrace has been hardcoded to throw this exception:

new RuntimeException("This needs to be fixed for case where aximuths that cross the north direction (e.g., values of 10 & 350 average to 180");

Until this is addressed, we cannot determine the average strike for a fault trace.

Change History (9)

comment:1 Changed 13 years ago by Kevin Milner

Milestone: OpenSHA 1.1

Peter, is this an easy fix?

comment:2 Changed 13 years ago by Peter Powers

Communication from off-Trac email thread:

We also need to consider computation time in what Morgan did.

On Dec 3, 2010, at 6:45 AM, Peter Powers wrote:

Ooops.

Morgan provided a fix for this that has been committed to trunk but I failed to close the ticket.

I haven't run any tests on it to see what kind of results the method yields; I am sure it is fine as it does a lot value checking after iterating over the list. However, at the end of the day, are the results any different than calculating the average strike from the first and last endpoints in the fault trace (LocList?)? They shouldn't be. Moreover, the latter approach is consistent with the NSHM.

Any thoughts?

-peter

On Dec 3, 2010, at 6:07 AM, Ned (Edward) Field wrote:

Morgan,

Didn't you run into this problem and somehow fix it:

Currently the method getAveStrike() in FaultTrace?​ has been hardcoded to throw this exception:

new RuntimeException?("This needs to be fixed for case where aximuths that cross the north direction (e.g., values of 10 & 350 average to 180");

Until this is addressed, we cannot determine the average strike for a fault trace.

comment:3 Changed 13 years ago by Peter Powers

ToDo?:

  • Implement an alternate version that determines strike from first and last point in a trace.
  • Generate tests for several fault trace geometries and compare results and computation time.

Because fault traces can be quite long, any implementation should consider possible errors from flat-earth approximations.

comment:4 Changed 13 years ago by Kevin Milner

the first/last point approach is done in getStrikeDirection(), correct?

comment:5 Changed 13 years ago by Peter Powers

Yes. I'm not sure what gave rise to the other method (getAveStrike) as I'm not sure there should be any difference in the results.

comment:6 Changed 13 years ago by Kevin Milner

I did a little testing, and getStrikeDirection() and getAveStrike() are pretty close. I tested each fault in the database, doing each calculation 100,000 times. On average, getStrikeDirection() is 17.613467403 times faster (for an average of 6.4644 trace points/fault), and differs by 0.0758 degrees. See StrikeDirectionMethods for the details.

Ned, what do you think? Do we need both, or is strike direction sufficient

comment:7 Changed 13 years ago by Ned Field

I see no reason not to leave both methods in there, but lets definitely use getStrikeDirection() as our standard since it's close and much faster.

Can you please check to make sure the documentation is clear on each of these?

comment:8 Changed 13 years ago by Kevin Milner

Resolution: fixed
Status: newclosed

OK I updated JavaDocs? with a note about the differences and a link the StrikeDirectionMethods wiki page. Marking this "closed".

comment:9 Changed 13 years ago by anonymous

*SPAM*

Last edited 13 years ago by Kevin Milner (previous) (diff)
Note: See TracTickets for help on using tickets.