@@ -36,13 +36,6 @@ class PlateOptions(BaseModel):
3636 :param geometry: Parameters describing the plate geometry.
3737 :param number: Number of offset plates to be created.
3838 :param spacing: Spacing between plates.
39- :param relative_locations: If True locations are relative to survey in xy and
40- mean topography in z.
41- :param reference_surface: Switches between using topography and overburden as
42- elevation reference of the plate.
43- :param reference_type: Type of reference for plate elevation. Can be 'mean'
44- 'min', or 'max'. Resulting elevation will be relative to the mean,
45- minimum, or maximum of the reference surface.
4639 """
4740
4841 model_config = ConfigDict (arbitrary_types_allowed = True )
@@ -54,31 +47,17 @@ class PlateOptions(BaseModel):
5447 geometry : PlateModel
5548 number : int = 1
5649 spacing : float = 0.0
57- relative_locations : bool = False
58- reference_surface : str = "topography"
59- reference_type : str = "mean"
60-
61- @field_validator ("reference_surface" , "reference_type" , mode = "before" )
62- @classmethod
63- def none_to_default (cls , value : T | None , info : ValidationInfo ) -> T :
64- return value or cls .model_fields [info .field_name ].default # pylint: disable=unsubscriptable-object
6550
6651 @model_validator (mode = "after" )
6752 def single_plate (self ):
6853 if self .number == 1 :
6954 self .spacing = 0.0
7055 return self
7156
72- @property
73- def halfplate (self ):
74- """Compute half the z-projection length of the plate."""
75- return 0.5 * self .geometry .dip_length * np .sin (np .deg2rad (self .geometry .dip ))
76-
7757 def center (
7858 self ,
7959 survey : Points ,
8060 surface : Points ,
81- depth_offset : float = 0.0 ,
8261 ) -> tuple [float , float , float ]:
8362 """
8463 Find the plate center relative to a survey and topography.
@@ -87,36 +66,14 @@ def center(
8766 :param surface: Points-like object to reference plate depth from.
8867 :param depth_offset: Additional offset to be added to the depth of the plate.
8968 """
90- return * self ._get_xy (survey ), self ._get_z (surface , depth_offset )
91-
92- def _get_xy (self , survey : Points ) -> tuple [float , float ]:
93- """Return true or relative locations in x and y."""
9469
95- if self . relative_locations :
96- return (
97- survey .vertices [:, 0 ].mean () + self .geometry .origin [0 ],
98- survey . vertices [:, 1 ]. mean () + self . geometry . origin [ 1 ],
99- )
70+ xy = (
71+ survey . vertices [:, 0 ]. mean () + self . geometry . origin [ 0 ],
72+ survey .vertices [:, 1 ].mean () + self .geometry .origin [1 ],
73+ )
74+ z_topo = topography_above_point ( topography = surface , point = xy ) # TODO
10075
101- return self .geometry .origin [0 ], self .geometry .origin [1 ]
102-
103- def _get_z (self , surface : Points , offset : float = 0.0 ) -> float :
104- """
105- Return true or relative locations in z.
106-
107- :param surface: Points-like object to reference plate depth from.
108- :offset: Additional offset to be added to the depth.
109-
110- """
111- if surface .vertices is None :
112- raise ValueError ("Topography object has no vertices." )
113- if self .relative_locations :
114- z = getattr (surface .vertices [:, 2 ], self .reference_type )()
115- z += offset + self .geometry .elevation - self .halfplate
116- else :
117- z = self .geometry .elevation
118-
119- return z
76+ return xy + (z_topo - self .geometry .elevation ,)
12077
12178
12279class OverburdenOptions (BaseModel ):
0 commit comments