Resolution-aware earthquake–well association (stage vs present) that can refresh in full or update incrementally while remaining CRS-safe.
Install the package in editable mode:
pip install -e .The project exposes a console script eq-assoc. Run eq-assoc --help to see
all available options and their defaults. Common invocations include:
Rebuild all associations from scratch, truncating existing result tables.
eq-assoc --mode full --assoc_mode detailedProcess only earthquakes that have not been associated yet and append the results.
eq-assoc --mode incremental --assoc_mode detailedOutput debug logs and force re-association for a single quake and well.
eq-assoc --mode incremental --assoc_mode detailed --verbose \
--reassociate_quake 12345 --reassociate_wa 67890Earthquakes are streamed from the database in batches (default 10k) so full re-runs do not exhaust memory. Adjust the size and keep results in memory before writing:
eq-assoc --mode incremental --batch_size 5000 --in_memoryBy default the association considers hydraulic fracturing (HF), water disposal
(WD) and production (PROD) activities. Use --types to specify a subset of
these, e.g. to omit production wells:
eq-assoc --mode incremental --types HF WDTime-window parameters for each activity type can also be overridden from the CLI. For example, to shorten the HF association tail:
eq-assoc --hf_tmax_days 365The falloff after an activity's lag is governed by an exponential decay. The
--time_decay_factor option controls this rate so that the probability at
Tmax is exp(-factor):
eq-assoc --time_decay_factor 3.0The association workflow converts raw distance and time relationships into standardized probabilities for each injection type.
- For every earthquake, candidate links to hydraulic fracturing (HF), water disposal (WD) and production (PROD) activities are scored using distance and time kernels weighted by activity-specific factors.
- Scores for all linked stages are normalized so their sum equals one,
producing a per-stage probability
P_stagethat can be compared across injection types. - Stage probabilities are summed by well to derive
P_welland by pad to deriveP_pad; each set is re-normalized per earthquake to maintain a standard scale. - The highest probability stage, well and pad for each earthquake are identified along with distance, time offset and well counts.
- Per-link probabilities are stored in the
eq_well_associationtable and the aggregated classification ineq_well_association_classified.
The CLI reads the database connection string from the EQ_DB_URI environment variable; the default is mysql+pymysql://root@localhost/earthquakes.
Data files are expected under /home/pgcseiscomp/Documents/bcer_data unless configured otherwise.
Earthquake timestamps are stored in UTC, whereas well activity data uses Fort St. John local time (America/Fort_Nelson). All earthquake times are converted to Fort St. John time during loading so that both datasets share the same time reference.