|
13 | 13 |
|
14 | 14 | # if LoopStructural.experimental: |
15 | 15 | from LoopStructural.interpolators import P2Interpolator |
| 16 | + |
16 | 17 | try: |
17 | 18 | from LoopStructural.interpolators import SurfeRBFInterpolator as Surfe |
18 | 19 |
|
|
53 | 54 | get_vectors, |
54 | 55 | ) |
55 | 56 |
|
| 57 | +intrusions = True |
| 58 | +try: |
| 59 | + # from LoopStructural.modelling.intrusions import IntrusionNetwork |
| 60 | + from LoopStructural.modelling.intrusions import IntrusionBuilder |
| 61 | + |
| 62 | + # from LoopStructural.modelling.intrusions import IntrusionBody |
| 63 | + from LoopStructural.modelling.intrusions import IntrusionFrameBuilder |
| 64 | +except ImportError as e: |
| 65 | + print(e) |
| 66 | + intrusions = False |
56 | 67 | from LoopStructural.utils import getLogger, log_to_file |
57 | 68 |
|
58 | 69 | logger = getLogger(__name__) |
@@ -1071,7 +1082,143 @@ def create_and_add_folded_fold_frame( |
1071 | 1082 |
|
1072 | 1083 | self._add_feature(folded_fold_frame) |
1073 | 1084 |
|
1074 | | - return folded_fold_frame |
| 1085 | + return fold_frame |
| 1086 | + |
| 1087 | + def create_and_add_intrusion( |
| 1088 | + self, |
| 1089 | + intrusion_name, |
| 1090 | + intrusion_frame_name, |
| 1091 | + intrusion_lateral_extent_model=None, |
| 1092 | + intrusion_vertical_extent_model=None, |
| 1093 | + intrusion_network_parameters={}, |
| 1094 | + lateral_extent_sgs_parameters={}, |
| 1095 | + vertical_extent_sgs_parameters={}, |
| 1096 | + **kwargs, |
| 1097 | + ): |
| 1098 | + """ |
| 1099 | + An intrusion in built in two main steps: |
| 1100 | + (1) Intrusion builder: intrusion builder creates the intrusion structural frame. |
| 1101 | + This object is curvilinear coordinate system of the intrusion constrained with intrusion network points, |
| 1102 | + and flow and inflation measurements (provided by the user). |
| 1103 | + The intrusion network is a representation of the approximated location of roof or floor contact of the intrusion. |
| 1104 | + This object might be constrained using the anisotropies of the host rock if the roof (or floor) contact is not well constrained. |
| 1105 | +
|
| 1106 | + (2) Intrusion feature: simulation of lateral and vertical extent of intrusion within the model volume. |
| 1107 | + The simulations outcome consist in thresholds distances along the structural frame coordinates |
| 1108 | + that are used to constrained the extent of the intrusion. |
| 1109 | +
|
| 1110 | + Parameters |
| 1111 | + ---------- |
| 1112 | + intrusion_name : string, |
| 1113 | + name of intrusion feature in model data |
| 1114 | + intrusion_frame_name : string, |
| 1115 | + name of intrusion frame in model data |
| 1116 | + intrusion_lateral_extent_model = function, |
| 1117 | + geometrical conceptual model for simulation of lateral extent |
| 1118 | + intrusion_vertical_extent_model = function, |
| 1119 | + geometrical conceptual model for simulation of vertical extent |
| 1120 | + intrusion_network_parameters : dictionary, optional |
| 1121 | + contact : string, contact of the intrusion to be used to create the network (roof or floor) |
| 1122 | + type : string, type of algorithm to create the intrusion network (interpolated or shortest path). |
| 1123 | + Shortest path is recommended when intrusion contact is not well constrained |
| 1124 | + contacts_anisotropies : list of series-type features involved in intrusion emplacement |
| 1125 | + structures_anisotropies : list of fault-type features involved in intrusion emplacement |
| 1126 | + sequence_anisotropies : list of anisotropies to look for the shortest path. It could be only starting and end point. |
| 1127 | + lateral_extent_sgs_parameters = dictionary, optional |
| 1128 | + parameters for sequential gaussian simulation of lateral extent |
| 1129 | + vertical_extent_sgs_parameters = dictionary, optional |
| 1130 | + parameters for sequential gaussian simulation of vertical extent |
| 1131 | +
|
| 1132 | + kwargs |
| 1133 | +
|
| 1134 | + Returns |
| 1135 | + ------- |
| 1136 | + intrusion feature |
| 1137 | +
|
| 1138 | + """ |
| 1139 | + if intrusions == False: |
| 1140 | + logger.error("Libraries not installed") |
| 1141 | + raise Exception("Libraries not installed") |
| 1142 | + |
| 1143 | + intrusion_data = self.data[self.data["feature_name"] == intrusion_name].copy() |
| 1144 | + intrusion_frame_data = self.data[ |
| 1145 | + self.data["feature_name"] == intrusion_frame_name |
| 1146 | + ].copy() |
| 1147 | + |
| 1148 | + # -- get variables for intrusion frame interpolation |
| 1149 | + gxxgz = kwargs.get("gxxgz", 0) |
| 1150 | + gxxgy = kwargs.get("gxxgy", 0) |
| 1151 | + gyxgz = kwargs.get("gyxgz", 0) |
| 1152 | + |
| 1153 | + interpolatortype = kwargs.get("interpolatortype", "FDI") |
| 1154 | + nelements = kwargs.get("nelements", 1e2) |
| 1155 | + |
| 1156 | + weights = [gxxgz, gxxgy, gyxgz] |
| 1157 | + interpolator = self.get_interpolator(interpolatortype=interpolatortype) |
| 1158 | + |
| 1159 | + intrusion_frame_builder = IntrusionFrameBuilder( |
| 1160 | + interpolator, name=intrusion_frame_name, model=self, **kwargs |
| 1161 | + ) |
| 1162 | + |
| 1163 | + # -- create intrusion network |
| 1164 | + intrusion_frame_builder.set_intrusion_network_parameters( |
| 1165 | + intrusion_data, intrusion_network_parameters |
| 1166 | + ) |
| 1167 | + intrusion_network_geometry = intrusion_frame_builder.create_intrusion_network() |
| 1168 | + |
| 1169 | + # -- create intrusion frame using intrusion network points and flow/inflation measurements |
| 1170 | + intrusion_frame_builder.set_intrusion_frame_data( |
| 1171 | + intrusion_frame_data, intrusion_network_geometry |
| 1172 | + ) |
| 1173 | + |
| 1174 | + ## -- create intrusion frame |
| 1175 | + intrusion_frame_builder.setup( |
| 1176 | + nelements=nelements, |
| 1177 | + w2=weights[0], |
| 1178 | + w1=weights[1], |
| 1179 | + gxygz=weights[2], |
| 1180 | + ) |
| 1181 | + |
| 1182 | + intrusion_frame = intrusion_frame_builder.frame |
| 1183 | + intrusion_builder = IntrusionBuilder( |
| 1184 | + intrusion_frame, model=self, name=f"{intrusion_frame_name}_feature" |
| 1185 | + ) |
| 1186 | + intrusion_builder.lateral_extent_model = intrusion_lateral_extent_model |
| 1187 | + intrusion_builder.vertical_extent_model = intrusion_vertical_extent_model |
| 1188 | + |
| 1189 | + # # -- Create intrusion feature |
| 1190 | + # intrusion_feature = IntrusionFeature( |
| 1191 | + # intrusion_name, model=self |
| 1192 | + # ) |
| 1193 | + |
| 1194 | + # if intrusion_lateral_extent_model == None: |
| 1195 | + # logger.error( |
| 1196 | + # "Specify conceptual model function for intrusion lateral extent" |
| 1197 | + # ) |
| 1198 | + # else: |
| 1199 | + # intrusion_feature.lateral_extent_model = intrusion_lateral_extent_model |
| 1200 | + |
| 1201 | + # if intrusion_vertical_extent_model == None: |
| 1202 | + # logger.error( |
| 1203 | + # "Specify conceptual model function for intrusion vertical extent" |
| 1204 | + # ) |
| 1205 | + # else: |
| 1206 | + # intrusion_feature.vertical_extent_model = intrusion_vertical_extent_model |
| 1207 | + |
| 1208 | + # logger.info("setting data for thresholds simulation") |
| 1209 | + intrusion_builder.set_data_for_extent_simulation(intrusion_data) |
| 1210 | + intrusion_builder.build_arguments = { |
| 1211 | + "lateral_extent_sgs_parameters": lateral_extent_sgs_parameters, |
| 1212 | + "vertical_extent_sgs_parameters": vertical_extent_sgs_parameters, |
| 1213 | + } |
| 1214 | + # intrusion_builder.vertical_extent_sgs_parameters = vertical_extent_sgs_parameters |
| 1215 | + # intrusion_builder.lateral_extent_sgs_parameters = lateral_extent_sgs_parameters |
| 1216 | + # intrusion_builder.set_l_sgs_GSLIBparameters(lateral_extent_sgs_parameters) |
| 1217 | + # intrusion_builder.set_g_sgs_GSLIBparameters(vertical_extent_sgs_parameters) |
| 1218 | + intrusion_feature = intrusion_builder.feature |
| 1219 | + self._add_feature(intrusion_feature) |
| 1220 | + |
| 1221 | + return intrusion_feature |
1075 | 1222 |
|
1076 | 1223 | def _add_faults(self, feature_builder, features=None): |
1077 | 1224 | """Adds all existing faults to a geological feature builder |
@@ -1360,12 +1507,12 @@ def create_and_add_fault( |
1360 | 1507 | fault : FaultSegment |
1361 | 1508 | created fault |
1362 | 1509 | """ |
1363 | | - if 'fault_extent' in kwargs and major_axis == None: |
1364 | | - major_axis = kwargs['fault_extent'] |
1365 | | - if 'fault_influence' in kwargs and minor_axis == None: |
1366 | | - minor_axis = kwargs['fault_influence'] |
1367 | | - if 'fault_vectical_radius' in kwargs and intermediate_axis == None: |
1368 | | - intermediate_axis = kwargs['fault_vectical_radius'] |
| 1510 | + if "fault_extent" in kwargs and major_axis == None: |
| 1511 | + major_axis = kwargs["fault_extent"] |
| 1512 | + if "fault_influence" in kwargs and minor_axis == None: |
| 1513 | + minor_axis = kwargs["fault_influence"] |
| 1514 | + if "fault_vectical_radius" in kwargs and intermediate_axis == None: |
| 1515 | + intermediate_axis = kwargs["fault_vectical_radius"] |
1369 | 1516 |
|
1370 | 1517 | logger.info(f'Creating fault "{fault_surface_data}"') |
1371 | 1518 | logger.info(f"Displacement: {displacement}") |
|
0 commit comments