Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Toro1997 attenuation model #62

Merged
merged 1 commit into from
Feb 2, 2022
Merged

Conversation

navarroc
Copy link
Member

I've added the Toro 1997 attenuation model from Ergo. To test this out, do the following steps:

To create an example earthquake using Toro1997 on your local machine, use the following JSON:

{
   "name":"Memphis toro EQ Model",
   "description":"Memphis model based hazard",
   "eqType":"model",
   "attenuations":{
      "Toro1997":"1.0"
   },
   "eqParameters":{
      "srcLatitude":"35.927",
      "srcLongitude":"-89.919",
      "magnitude":"7.9",
      "depth":"10.0"
   },
   "visualizationParameters":{
      "demandType":"PGA",
      "demandUnits":"g",
      "minX":"-90.3099",
      "minY":"34.9942",
      "maxX":"-89.6231",
      "maxY":"35.4129",
      "numPoints":"1025",
      "amplifyHazard":"true"
   }
}

To test your newly created earthquake, use the following, replacing {id} with the ID of the EQ you created:

POST http://localhost:8080/hazard/api/earthquakes/{id}/values
JSON body is:

[{"demands": ["PGA"],"units": ["g"],"loc": "35.1373, -89.99892"}, {"demands": ["0.2 Sa"],"units": ["g"],"loc": "35.13916, -89.9914"}]

For the provided attenuation and locations, the values returned from the local service should be:

[
   {
      "hazardValues":[
         0.28649803773513977
      ],
      "demands":[
         "PGA"
      ],
      "units":[
         "g"
      ],
      "loc":"35.1373, -89.99892"
   },
   {
      "hazardValues":[
         0.6157173468407837
      ],
      "demands":[
         "0.2 Sa"
      ],
      "units":[
         "g"
      ],
      "loc":"35.13916, -89.9914"
   }
]

@navarroc navarroc added this to the 1.8.0 milestone Jan 25, 2022
@navarroc navarroc changed the title WIP - added Toro1997 attenuation model Added Toro1997 attenuation model Jan 25, 2022
@navarroc navarroc linked an issue Jan 25, 2022 that may be closed by this pull request
@navarroc navarroc requested review from diegoac2, a user and ywkim312 February 1, 2022 17:02
Copy link
Member

@ywkim312 ywkim312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I posted the earthquake and tried to get values. Both methods worked as they were written in test description.

}

public double getValue(String period, Site site) throws Exception {
double mag = ruptureParameters.getMagnitude();// double m =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you can remove this double m =

@navarroc navarroc merged commit 35a6c6a into develop Feb 2, 2022
@navarroc navarroc deleted the 35-add-toro-1997-attenuation branch February 2, 2022 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Toro1997 attenuation model
2 participants