Skip to content

Feature: differentiate Participation Rate (system) vs Conditional Participation Rate  #59

@chrisbc

Description

@chrisbc

Currently the API is providing just the Conditional Participation Rate, which is usually much lower and may be misleading

# some solvis code for comparison
# get ruptures passing through a named parent fault(s)
TARGET_FAULTS = ['Opotiki 3', 'Calypso 2']
ruptures = helper.ruptures_for_parent_fault_names(TARGET_FAULTS) 

# get rupture fault sections (rs) with rates for those ruptures
df0 = solution.rs_with_rupture_rates
rupture_sections_df = df0[df0["Rupture Index"].isin(ruptures)]

opo_section = 1426 # Opotiki 3, Subsection 2
cal_section = 217  # Calypso 2, Subsection 1
df0 = solution.rs_with_rupture_rates

print("rate.sum() filtered by section ID: `Participation Rate` (all ruptures in the system)")
print(f'Opotiki rate: {df0[df0.section==opo_section]["rate_weighted_mean"].sum()}')
print(f'Calypso rate: {df0[df0.section==cal_section]["rate_weighted_mean"].sum()}')

print("API rate.sum() filtering by rupture ID: `Conditional Participation Rate` (filtered by rupture id or attribute)")
df0 = df0[df0["Rupture Index"].isin(ruptures)]
print(f'Opotiki rate: {df0[df0.section==opo_section]["rate_weighted_mean"].sum()}')
print(f'Calypso rate: {df0[df0.section==cal_section]["rate_weighted_mean"].sum()}')

and in graphql api...

query q3 {
  filter_rupture_sections(filter:
    { model_id: "NSHM_v1.0.4" 
      #location_ids: ["MRO", "WLG"]  
      fault_system:"CRU" 
      radius_km:125
      corupture_fault_names: ["Opotiki 3"]
     filter_set_options:{multiple_locations: INTERSECTION
      }
     
  	}
  ) {
    model_id
    fault_traces
  }
}

Metadata

Metadata

Assignees

Labels

APIfor project filteringsolvis-graphql-apifor project filtering

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions