krischer / instaseis

Instant high-frequency seismograms from an AxiSEM database
http://instaseis.net
Other
52 stars 23 forks source link

Multiple phases for the /ttimes route #46

Closed krischer closed 8 years ago

krischer commented 8 years ago

This PR enables the /ttimes route to serve multiple phases in a single request. The required callback function did not change but the /ttimes route changed slightly. This should be ok as I'm not aware of any implementation publicly using it. Instead of phase the argument name is now phases, e.g.

ROOT/ttimes?sourcelatitude=0&sourcelongitude=0&
  sourcedepthinmeters=300000&receiverlatitude=0&receiverlongitude=50&
  receiverdepthinmeters=0&phases=sPKiKP,P,PP,Sdiff

Will return the following JSON:

{
    "travel_times": {
        "P": 504.357,
        "PP": 622.559,
        "sPKiKP": 1090.081
    }
}

It is only capable of returning a single time per phase. The callback function must thus deal with multiple arrivals of the same phase and choose which one to return.

@martinvandriel Can you check with your folks if that is acceptable?

sceylan commented 8 years ago

The first arrival of each given phase should be enough for Mars needs for now.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.0003%) to 99.839% when pulling 749be2c6bcbe2f56b15fe6bb366a2a1ddd579b31 on multiple_phases into bfea2ae4aed83e89eca519439439c20cd18d985b on master.