Skip to content

OQ Disaggregation

See the base class for inherited parameters and a description of allowed parameter combinations.

OQDisaggArgs

Bases: OQArgs

Input for calculating disaggregations.

Validators
  • Cannot combine bin width or number of bins with bin edges.
  • Must provide bin width, number, or edges for every dimension in disagg_types.

Parameters:

Name Type Description Default
site OQDisaggArgs.Site | None

Used by runzi to create a unique task for each location, vs30 pair, not to be set by user.

None
hazard_model_id str

The hazard curve 'target,' i.e. the hazard curve at which to get the PoE that we will use for the disaggregation.

required
agg AggregationEnum

The aggregate of the hazard curve 'target,' i.e. the hazard curve at which to get the PoE that we will use for the disaggregation.

required
imt str

The IMT of the hazard curve 'target,' i.e. the hazard curve at which to get the PoE that we will use for the disaggregation.

required
investigation_time int

The investigation time (years) of the hazard curve 'target,' i.e. the hazard curve at which to get the PoE that we will use for the disaggregation.

required
poe float

The probability of exceedance for the investigation_time for the hazard curve 'target,' i.e. the hazard curve at which to get the PoE that we will use for the disaggregation.

required
disagg_types list[str]

Dimensions along which to calculate disaggregation. e.g. 'Mag', 'Dist', 'TRT_Mag_Dist_Eps'

required
mag_bin_width float | None
None
distance_bin_width float | None
None
coordinate_bin_width float | None
None
num_epsilon_bins int | None
None
disagg_bin_edges dict[str, list[float]]

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

<class 'dict'>

Attributes

site: Optional[Site] = None class-attribute instance-attribute

Used by runzi to create a unique task for each location, vs30 pair, not to be set by user.

hazard_model_id: str instance-attribute

The hazard curve 'target,' i.e. the hazard curve at which to get the PoE that we will use for the disaggregation.

agg: AggregationEnum instance-attribute

The aggregate of the hazard curve 'target,' i.e. the hazard curve at which to get the PoE that we will use for the disaggregation.

imt: str instance-attribute

The IMT of the hazard curve 'target,' i.e. the hazard curve at which to get the PoE that we will use for the disaggregation.

investigation_time: int instance-attribute

The investigation time (years) of the hazard curve 'target,' i.e. the hazard curve at which to get the PoE that we will use for the disaggregation.

poe: float instance-attribute

The probability of exceedance for the investigation_time for the hazard curve 'target,' i.e. the hazard curve at which to get the PoE that we will use for the disaggregation.

disagg_types: list[str] instance-attribute

Dimensions along which to calculate disaggregation. e.g. 'Mag', 'Dist', 'TRT_Mag_Dist_Eps'

mag_bin_width: Optional[float] = None class-attribute instance-attribute

distance_bin_width: Optional[float] = None class-attribute instance-attribute

coordinate_bin_width: Optional[float] = None class-attribute instance-attribute

num_epsilon_bins: Optional[int] = None class-attribute instance-attribute

disagg_bin_edges: dict[str, list[float]] = Field(default_factory=dict) class-attribute instance-attribute

Dict of disaggregation bin edges. Keys are dimentions (e.g. 'dist'), values are the edges (e.g. [0, 5.0, 10.0, ]).

model_config = ConfigDict(arbitrary_types_allowed=True) class-attribute instance-attribute

compatible_calc_id: Annotated[str, AfterValidator(_is_compat_calc_id)] instance-attribute

Identifies hazard run with similar software and settigs such that results can be compared.

nshm_model_version: Annotated[Optional[str], AfterValidator(_is_model_version)] = None class-attribute instance-attribute

An official released NSHM model. Includes logic trees and calculation configuration (i.e. OQ settings).

srm_logic_tree: Optional[SourceLogicTree | Path] = None class-attribute instance-attribute

Seismicity rate model logic tree.

gmcm_logic_tree: Optional[GMCMLogicTree | Path] = None class-attribute instance-attribute

Ground motion model logic tree.

hazard_config: Optional[OpenquakeConfig | Path] = None class-attribute instance-attribute

OpenQuake settings.

vs30: Optional[PositiveInt] = None class-attribute instance-attribute

Uniform site vs30.

locations: Optional[list[str]] = None class-attribute instance-attribute

Location strings as used by nzshm-common.

locations_file: Optional[Path] = None class-attribute instance-attribute

A file with lon, lat locations, and optinoally vs30.

locations_file_id: Optional[str] = None class-attribute instance-attribute

A toshi ID of a file with lon, lat locations, and optinoally vs30.

Classes

Site

Bases: BaseModel

A location, vs30 pair. Not a user object.

Parameters:

Name Type Description Default
location CodedLocation
required
vs30 int
required
Attributes
location: CodedLocation instance-attribute
vs30: PositiveInt instance-attribute

Functions

validate_bins() -> Self

valdiate_types() -> Self

check_logic_trees() -> Self

abs_path(value: Any, info: ValidationInfo) -> Any classmethod

If any of the fields are paths, resolve the absolute path and check that it exists.

ser_hazard_config(value: Any) -> Any

validate_hazard_config(value: Any) -> Any classmethod

check_locations() -> Self

default_system_args = SystemArgs(task_language=(TaskLanguage.PYTHON), use_api=USE_API, ecs_max_job_time_min=30, ecs_memory=30000, ecs_vcpu=8, ecs_job_definition='BigLever_32GB_8VCPU_v2_JD', ecs_job_queue='BigLever_32GB_8VCPU_v2_JQ') module-attribute