Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TransformAddDummyStratigraphy(base.BaseTransform):
- """
- Adds and extra horizon above the first horizon
- from the ground level. MD of the top of the new
- horizon begins a the point where a record of all
- logs appears.
- Parameters
- ----------
- logs: list of str
- list of logs that need to be present at the top
- of the new horizon
- gap_threshold: int
- gap .......
- horizon_name: str
- name of new horizon
- """
- def __init__(self, logs, gap_threshold, horizon_name):
- """
- """
- self._logs = logs
- self._horizon_name = horizon_name
- self._gap_threshold = gap_threshold
- def __call__(self, data):
- log_top_md = data.dropna(subset=self._logs)['MD'].min()
- horizon_top_md = data[data['Layer'] != 'nan']['MD'].min()
- gap = horizon_top_md - log_top_md
- if gap > self._gap_threshold:
- new_horizon_top_md = horizon_top_md - self._gap_threshold
- elif gap <= self._gap_threshold and gap > 0:
- new_horizon_top_md = log_top_md
- else:
- return data
- where_new_layer = ((data['MD'] >= new_horizon_top_md)
- & (data['MD'] <= horizon_top_md))
- data.loc[where_new_layer, 'Layer'] = self._horizon_name
- return data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement