示例#1
0
    def calc_thickness(self, contact_decimate, null_scheme, thickness_buffer,
                       max_thickness_allowed, cl):
        # Estimate formation thickness and normalised formation thickness
        geology_file = os.path.join(self.tmp_path, 'basal_contacts.shp')
        # contact_decimate = 5
        # null_scheme = 'null'
        m2l_interpolation.save_contact_vectors(geology_file, self.tmp_path,
                                               self.dtm, self.dtb,
                                               self.dtb_null, False, self.bbox,
                                               self.c_l, null_scheme,
                                               contact_decimate)

        # buffer = 5000
        # max_thickness_allowed = 10000

        m2l_geometry.calc_thickness_with_grid(self.tmp_path, self.output_path,
                                              thickness_buffer,
                                              max_thickness_allowed, self.c_l,
                                              self.bbox, self.dip_grid,
                                              self.dip_dir_grid, self.x,
                                              self.y, self.spacing, self.dtm)

        m2l_geometry.calc_min_thickness_with_grid(
            self.tmp_path, self.output_path, thickness_buffer,
            max_thickness_allowed, self.c_l, self.bbox, self.dip_grid,
            self.dip_dir_grid, self.x, self.y, self.spacing, self.dtm)

        m2l_geometry.normalise_thickness(self.output_path)

        if self.quiet == "None":
            m2l_utils.plot_points(
                os.path.join(self.output_path,
                             'formation_thicknesses_norm.csv'), self.geol_clip,
                'norm_th', 'x', 'y', True, 'numeric')
示例#2
0
    def export_orientations(self, orientation_decimate):
        m2l_geometry.save_orientations(self.structure_clip, self.output_path,
                                       self.c_l, orientation_decimate,
                                       self.dtm, self.dtb, self.dtb_null,
                                       False)

        if self.quiet == 'None':
            m2l_utils.plot_points(
                os.path.join(self.output_path, 'orientations.csv'),
                self.geol_clip, 'formation', 'X', 'Y', False, 'alpha')

        # Create arbitrary points for series without orientation data
        m2l_geometry.create_orientations(self.tmp_path, self.output_path,
                                         self.dtm, self.dtb, self.dtb_null,
                                         False, self.geol_clip,
                                         self.structure_clip, self.c_l)
示例#3
0
    def export_contacts(self, contact_decimate, intrusion_mode):

        ls_dict, ls_dict_decimate = m2l_geometry.save_basal_contacts(
            self.tmp_path, self.dtm, self.dtb, self.dtb_null, False,
            self.geol_clip, contact_decimate, self.c_l, intrusion_mode)

        # Remove basal contacts defined by faults, no decimation
        m2l_geometry.save_basal_no_faults(
            os.path.join(self.tmp_path, 'basal_contacts.shp'),
            os.path.join(self.tmp_path, 'faults_clip.shp'), ls_dict, 10,
            self.c_l, self.proj_crs)

        # Remove faults from decimated basal contacts then save
        contacts = gpd.read_file(
            os.path.join(self.tmp_path, 'basal_contacts.shp'))
        m2l_geometry.save_basal_contacts_csv(contacts, self.output_path,
                                             self.dtm, self.dtb, self.dtb_null,
                                             False, contact_decimate, self.c_l)
        # False in this call was already false and isn't the cover flag
        if self.quiet == "None":
            m2l_utils.plot_points(
                os.path.join(self.output_path, 'contacts4.csv'),
                self.geol_clip, 'formation', 'X', 'Y', False, 'alpha')
示例#4
0
    def postprocess(self, inputs, workflow, use_interpolations, use_fat):
        # use_interpolations = True
        # use_fat = True

        m2l_geometry.tidy_data(self.output_path, self.tmp_path, self.clut_path,
                               self.use_gcode3, use_interpolations, use_fat,
                               self.pluton_form, inputs, workflow, self.c_l)
        model_top = round(np.amax(self.dtm.read(1)), -2)

        # self.dtm.close()
        # if(workflow['cover_map']):
        #     dtb.close()

        # Calculate polarity of original bedding orientation data
        if (workflow['polarity']):
            m2l_geometry.save_orientations_with_polarity(
                os.path.join(self.output_path, 'orientations.csv'),
                self.output_path,
                self.c_l,
                os.path.join(self.tmp_path, 'basal_contacts.shp'),
                os.path.join(self.tmp_path, 'all_sorts.csv'),
            )

            if self.quiet == "None":
                m2l_utils.plot_points(
                    os.path.join(self.output_path,
                                 'orientations_polarity.csv'), self.geol_clip,
                    'polarity', 'X', 'Y', True, 'alpha')

        # Calculate minimum fault offset from stratigraphy and stratigraphic fault offset
        if (workflow['strat_offset']):
            fault_test = pd.read_csv(
                os.path.join(self.output_path, 'fault_dimensions.csv'), ', ')
            if (len(fault_test) > 0):

                m2l_geometry.fault_strat_offset(
                    self.output_path, self.c_l, self.proj_crs,
                    os.path.join(self.output_path,
                                 'formation_summary_thicknesses.csv'),
                    os.path.join(self.tmp_path, 'all_sorts.csv'),
                    os.path.join(self.tmp_path, 'faults_clip.shp'),
                    os.path.join(self.tmp_path, 'geol_clip.shp'),
                    os.path.join(self.output_path, 'fault_dimensions.csv'))

                if self.quiet == "None":
                    m2l_utils.plot_points(
                        os.path.join(self.output_path,
                                     'fault_strat_offset3.csv'),
                        self.geol_clip, 'min_offset', 'X', 'Y', True,
                        'numeric')
                    m2l_utils.plot_points(
                        os.path.join(self.output_path,
                                     'fault_strat_offset3.csv'),
                        self.geol_clip, 'strat_offset', 'X', 'Y', True,
                        'numeric')

        # Analyse fault topologies
        fault_parse_figs = True
        if self.quiet == "None":
            fault_parse = False
        Topology.parse_fault_relationships(self.graph_path, self.tmp_path,
                                           self.output_path, fault_parse_figs)