Skip to content

Improve DisaggExport - JSON structure and redundancy

Also see #214

Additional improvements (likely breaking changes for any code or scripts that parse the current JSON output):

  • Rename the generic data arrays that recur at almost every level of the disagg JSON response (this is a holdover from hazdev?). use self-documenting names like disagg_response for the top level (contains list of IMT disaggs)
  • Remove redundancy - see items listed below with bold comments
    • consolidate global metadata (discretization and epsilon keys)
    • consolidate IMT metadata (disagg targets and recovered targets)
  • For each IMT, the current organization dumps the total, GMM, and SOURCE_TYPE disagg components into a single list (named data). GMM and SOURCE_TYPE data only included if requested. Separate these out into separate lists with appropriate names (within an IMT disagg block), e.g.:
    • data_total - a single item with data, summary, and sources lists as noted below
    • data_GMM - list of GMM disaggs, could be empty/null if GMM data type is not specified in config
    • data_SOURCE_TYPE - list of SOURCE_TYPE disaggs, could be empty or null if SOURCE data type is not specified in config
  • Each component above (total, GMM, SOURCE_TYPE) contains three data lists:
    • data - null without DISAGG_DATA output, M-R-E binned data for 3D stacked bar plots
      • rename data_mre?
    • summary - list of summary statistics and metadata
      • disaggregation targets -- currently repeated for each component? varies by IMT
      • recovered targets -- currently repeated for each component? varies by IMT
      • totals (binned, residual, trace)
      • Mean over all sources - m, r, e
      • Mode (largest m-r bin) - m, r, e, % contrib
      • Mode (largest m-r-e bin) - m, r, e, % contrib
      • Discretization -- currently repeated for each component of each IMT
      • Epsilon keys -- currently repeated for each component of each IMT and not needed without DISAGG_DATA output?
    • sources - list of contributing sources, these are both SET and SINGLE sources as noted in #214
      • possibly collapse or omit "SINGLE" sources and only include "SET" sources... this may be good for gridded sources but may not for fault systems, where the "SINGLE" sources identify individual fault sections...