Skip to content

Commit

Permalink
Merge pull request #18 from Loop3D/intrusion_issue
Browse files Browse the repository at this point in the history
fix: Intrusions issues fix
  • Loading branch information
RoyThomsonMonash authored Jan 25, 2024
2 parents 598d82e + 527de6c commit 71f9f01
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion map2loop/mapdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ def parse_geology_map(self) -> tuple:
geology["INTRUSIVE"] = self.raw_data[Datatype.GEOLOGY][config["rocktype_column"]].astype(str).str.contains(config["intrusive_text"])
geology["ROCKTYPE1"] = self.raw_data[Datatype.GEOLOGY][config["rocktype_column"]].astype(str)
else:
geology["INSTRUSIVE"] = False
geology["INTRUSIVE"] = False
geology["ROCKTYPE1"] = ""

if config["alt_rocktype_column"] in self.raw_data[Datatype.GEOLOGY]:
Expand Down Expand Up @@ -1213,6 +1213,9 @@ def extract_all_contacts(self, save_contacts=True):
"""
geology = self.get_map_data(Datatype.GEOLOGY).copy()
geology = geology.dissolve(by="UNITNAME", as_index=False)
# Remove intrusions
geology = geology[geology["INTRUSIVE"]==False]
geology = geology[geology["SILL"]==False]
# Remove faults from contact geomety
if self.get_map_data(Datatype.FAULT) is not None:
faults = self.get_map_data(Datatype.FAULT).copy()
Expand Down
2 changes: 1 addition & 1 deletion map2loop/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def calculate_stratigraphic_order(self, take_best=False):
Use unit relationships, unit ages and the sorter to create a stratigraphic column
"""
if take_best:
sorters = [SorterUseHint(), SorterAgeBased(), SorterAlpha(), SorterUseNetworkX(), SorterMaximiseContacts(), SorterObservationProjections()]
sorters = [SorterUseHint(), SorterAgeBased(), SorterAlpha(), SorterUseNetworkX()]
columns = [sorter.sort(self.stratigraphic_column.stratigraphicUnits,
self.map2model.get_unit_unit_relationships(),
self.map2model.get_sorted_units(),
Expand Down
4 changes: 3 additions & 1 deletion map2loop/sorter.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def sort(self, units: pandas.DataFrame, unit_relationships: pandas.DataFrame, st
while graph.number_of_nodes() > 0:
if cnode is None:
df = pandas.DataFrame(columns=["unit", "num_neighbours"])
df["unit"] = units
df["unit"] = list(graph.nodes)
df["num_neighbours"] = df.apply(lambda row: len(list(graph.neighbors(row["unit"]))), axis=1)
df.sort_values(by=["num_neighbours"], inplace=True)
df.reset_index(inplace=True, drop=True)
Expand Down Expand Up @@ -320,6 +320,8 @@ def sort(self, units: pandas.DataFrame, unit_relationships: pandas.DataFrame, st
return stratigraphic_order_hint

geol = map_data.get_map_data(Datatype.GEOLOGY).copy()
geol = geol[geol["INTRUSIVE"]==False]
geol = geol[geol["SILL"]==False]
orientations = map_data.get_map_data(Datatype.STRUCTURE).copy()

verbose = False
Expand Down

0 comments on commit 71f9f01

Please sign in to comment.