welleng.errors package

Submodules

welleng.errors.extract_iscwsa_codes module

welleng.errors.extract_iscwsa_codes.extract_codes(workbook)[source]
welleng.errors.extract_iscwsa_codes.extract_data(filename)[source]
welleng.errors.extract_iscwsa_codes.extract_header(workbook)[source]
welleng.errors.extract_iscwsa_codes.make_error_dict(data)[source]
welleng.errors.extract_iscwsa_codes.make_header_dict(data)[source]
welleng.errors.extract_iscwsa_codes.make_index(tool_code, data)[source]
welleng.errors.extract_iscwsa_codes.remove_characters(data, chars=[':', '[', ']'])[source]

welleng.errors.extract_owsg_codes_generic module

welleng.errors.extract_owsg_codes_generic.extract_codes(worksheet)[source]
welleng.errors.extract_owsg_codes_generic.extract_data(file, sheet_name='Model')[source]
welleng.errors.extract_owsg_codes_generic.extract_header(worksheet)[source]
welleng.errors.extract_owsg_codes_generic.get_index(short_name, index_file)[source]
welleng.errors.extract_owsg_codes_generic.get_short_names(index_file)[source]
welleng.errors.extract_owsg_codes_generic.make_error_dict(data)[source]
welleng.errors.extract_owsg_codes_generic.make_header_dict(data)[source]
welleng.errors.extract_owsg_codes_generic.make_index(wb)[source]
welleng.errors.extract_owsg_codes_generic.open_workbook(filename)[source]
welleng.errors.extract_owsg_codes_generic.remove_characters(data, chars=[':', '[', ']'])[source]

welleng.errors.tool_errors module

welleng.errors.tool_errors.ABIXY_TI1(code, error, mag=0.004, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ABIXY_TI2(code, error, mag=0.004, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ABIZ(code, error, mag=0.004, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ABXY_TI1(code, error, mag=0.004, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ABXY_TI2(code, error, mag=0.004, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ABZ(code, error, mag=0.004, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.AMID(code, error, mag=0.04363323129985824, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.AMIL(code, error, mag=220.0, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ASIXY_TI1(code, error, mag=0.0005, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ASIXY_TI2(code, error, mag=0.0005, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ASIXY_TI3(code, error, mag=0.0005, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ASIZ(code, error, mag=0.0005, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ASXY_TI1(code, error, mag=0.0005, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ASXY_TI2(code, error, mag=0.0005, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ASXY_TI3(code, error, mag=0.0005, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.ASZ(code, error, mag=0.0005, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.AZ(code, error, mag=0.00628, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.CNA(code, error, mag=0.35, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.CNI(code, error, mag=0.35, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.DBH(code, error, mag=np.float64(0.0015707963267948964), propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.DBHR(code, error, mag=np.float64(52.35987755982988), propagation='random', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.DREF(code, error, mag=0.35, propagation='random', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.DSF(code, error, mag=0.00056, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.DST(code, error, mag=2.5e-07, propagation='systematic', NEV=True, **kwargs)[source]
class welleng.errors.tool_errors.DroppedTerm(code: str, missing: str | None, reason: str)[source]

Bases: object

A tool-model term that could not be evaluated, and so contributed zero.

⚠️ Zero is the anti-conservative direction for an uncertainty. A term that contributes nothing is indistinguishable, in the resulting covariance, from a tool that is perfect in that respect – so the survey’s EOU comes out SMALLER than the model specifies, in a quantity that feeds anti-collision.

This is recorded on the object rather than only warned about because a warning is fired once, at computation time, into whatever filter happened to be installed – and is gone by the time anyone is handed the result. A consumer that did not see the warning can still ask:

em = ErrorModel(survey, error_model=...)
if em.errors.dropped_terms:
    ...                     # the EOU is understated; by these terms

The cause is a documented gap in the ISCWSA JSON schema (cross-station references, per-tool calibration constants), catalogued by welleng/errors/conformance.py – not a defect in the survey.

__init__(code: str, missing: str | None, reason: str) → None
code: str

The term’s ISCWSA code, e.g. 'XYM3E'.

missing: str | None

The variable the formula referenced and the interpreter could not bind, where that is recoverable from the error. None means the evaluation failed for some other reason – see reason, and do not read None as “nothing was missing”.

reason: str

The underlying exception, as text.

welleng.errors.tool_errors.MBIXY_TI1(code, error, mag=70.0, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MBIXY_TI2(code, error, mag=70.0, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MBXY_TI1(code, error, mag=70.0, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MBXY_TI2(code, error, mag=70.0, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MBZ(code, error, mag=70.0, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MDI(code, error, mag=np.float64(87.26646259971648), propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MFI(code, error, mag=70, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MSIXY_TI1(code, error, mag=0.0016, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MSIXY_TI2(code, error, mag=0.0016, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MSIXY_TI3(code, error, mag=0.0016, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MSXY_TI1(code, error, mag=0.0016, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MSXY_TI2(code, error, mag=0.0016, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MSXY_TI3(code, error, mag=0.0016, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.MSZ(code, error, mag=0.0016, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.SAG(code, error, mag=0.00349, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.SAGE(code, error, mag=0.00175, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.STRICT_LOCATION = False

Refuse, rather than warn, when a latitude-dependent error model is asked to compute at the package fallback location.

Default False ONLY as a migration courtesy: turning it on today raises in 115 places in this repo’s own suite and in every downstream consumer that builds a gyro survey without a location. That count IS the finding – it measures how invisible the substitution has been – and the refusal is the correct end state. Set it True in any pipeline whose numbers are acted on.

welleng.errors.tool_errors.STRICT_TERMS = False

Refuse, rather than warn, when a tool-model term cannot be evaluated and would otherwise contribute ZERO covariance.

Default False for the same migration reason as STRICT_LOCATION: the dropped terms are documented ISCWSA-JSON schema gaps, and refusing would make those models unusable rather than partly-usable. But the fallback is ANTI-CONSERVATIVE – see DroppedTerm.

class welleng.errors.tool_errors.ToolError(error, model)[source]

Bases: object

__init__(error, model)[source]

Class using the ISCWSA listed tool errors to determine well bore uncertainty.

Parameters:
  • error (an intitiated welleng.error.ErrorModel object)

  • model (string)

Returns:

errors – A populated ErrorModel object for the selected error model.

Return type:

welleng.error.ErrorModel object

call_func(code, func, error, mag, propagation, **kwargs)[source]

Function for calling functions by mapping function labels to their functions.

cov_NEV_tie

The first station’s own attitude error over half its first leg, added uncorrelated with the survey’s errors beyond the first station (SurveyHeader.first_station_allowance="uncorrelated"), else zero.

dropped_terms: List[DroppedTerm]

Terms that could not be evaluated and contributed ZERO covariance, understating this survey’s EOU. Empty is the normal case. See DroppedTerm – recorded here because a warning is gone by the time anyone is handed the result.

welleng.errors.tool_errors.XCL(code, error, mag=0.0167, propagation='random', NEV=True, **kwargs)[source]

Dummy function to manage the ISCWSA workbook not correctly defining the weighting functions.

welleng.errors.tool_errors.XCLA(code, error, mag=0.167, propagation='random', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.XCLH(code, error, mag=0.167, propagation='random', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.XYM1(code, error, mag=0.00175, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.XYM2(code, error, mag=0.00175, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.XYM3(code, error, mag=0.00175, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.XYM3E(code, error, mag=0.00524, propagation='random', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.XYM3L(code, error, mag=0.0167, propagation='random', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.XYM4(code, error, mag=0.00175, propagation='systematic', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.XYM4E(code, error, mag=0.00524, propagation='random', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.XYM4L(code, error, mag=0.0167, propagation='random', NEV=True, **kwargs)[source]
welleng.errors.tool_errors.clear_error_model_cache() → None[source]

Clear the cached tool-model parses + name resolution (call after editing a model file on disk within a running process).

Module contents