Skip to content

Commit

Permalink
fix: Use geology sampler for contact sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyThomsonMonash committed Dec 6, 2023
1 parent 6776e25 commit 615d19a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion map2loop/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def set_default_samplers(self):
self.samplers[Datatype.GEOLOGY] = SamplerSpacing(50.0)
self.samplers[Datatype.FAULT] = SamplerSpacing(50.0)
self.samplers[Datatype.FOLD] = SamplerSpacing(50.0)
self.samplers[Datatype.DTM] = SamplerSpacing(50.0)

@beartype.beartype
def set_sampler(self, datatype: Datatype, sampler: Sampler):
Expand Down Expand Up @@ -316,7 +317,7 @@ def extract_geology_contacts(self):
"""
# Use stratigraphic column to determine basal contacts
self.map_data.extract_basal_contacts(self.stratigraphic_column.column)
self.sampled_contacts = SamplerSpacing(500.0).sample(self.map_data.basal_contacts)
self.sampled_contacts = self.samplers[Datatype.GEOLOGY].sample(self.map_data.basal_contacts)
self.map_data.get_value_from_raster_df(Datatype.DTM, self.sampled_contacts)

def calculate_stratigraphic_order(self, take_best=False):
Expand Down Expand Up @@ -500,6 +501,8 @@ def save_into_projectfile(self):
faults_obs_data["dipPolarity"] = 0 # self.fault_samples["DIPPOLARITY"]
# faults_obs_data["val"] = self.fault_samples["???"]
faults_obs_data["displacement"] = 100 # self.fault_samples["DISPLACEMENT"]

# TODO: Find a better way to assign posOnly for fault observations
from itertools import cycle, islice
faults_obs_data["posOnly"] = list(islice(cycle([0, 1]), len(faults_obs_data)))
LPF.Set(self.loop_filename, "faultObservations", data=faults_obs_data, verbose=True)
Expand Down

0 comments on commit 615d19a

Please sign in to comment.