estimate_gridding_opts#
- emg3d.meshes.estimate_gridding_opts(gridding_opts, model, survey, input_sc2=None)[source]#
Estimate parameters for automatic gridding.
Automatically determines the required gridding options from the provided model, and survey, if they are not provided in
gridding_opts
.The dict
gridding_opts
can contain any input parameter taken byemg3d.meshes.construct_mesh
, see the corresponding documentation for more details with regards to the possibilities.Different keys of
gridding_opts
are treated differently:The following parameters are estimated from the
model
if not provided:properties
: lowest conductivity / highest resistivity in the outermost layer in a given direction. This is usually air in x/y and positive z. Note: This is very conservative. If you go into deeper water you could provide less conservative values.mapping
: taken from model.
The following parameters are estimated from the
survey
if not provided:frequency
: average (on log10-scale) of all frequencies.center
: center of all sources.domain
: fromdistance
orvector
, if provided, orin x/y-directions: extent of sources and receivers plus 10% on each side, ensuring ratio of 3.
in z-direction: extent of sources and receivers, ensuring ratio of 2 to horizontal dimension; 1/10 tenth up, 9/10 down.
The ratio means that it is enforced that the survey dimension in x or y-direction is not smaller than a third of the survey dimension in the other direction. If not, the smaller dimension is expanded symmetrically. Similarly in the vertical direction, which must be at least half the dimension of the maximum horizontal dimension or 5 km, whatever is smaller. Otherwise it is expanded in a ratio of 9 parts downwards, one part upwards.
The following parameter is taken from the
grid
if provided as a string:vector
: This is the only real “difference” to the inputs ofemg3d.meshes.construct_mesh
. The normal input is accepted, but it can also be a string containing any combination of'x'
,'y'
, and'z'
. All directions contained in this string are then taken from the provided grid. E.g., ifgridding_opts['vector']='xz'
it will take the x- and z-directed vectors from the grid.
The following parameters are simply passed along if they are provided, nothing is done otherwise:
vector
distance
stretching
seasurface
cell_numbers
lambda_factor
lambda_from_center
max_buffer
min_width_limits
min_width_pps
verb
- Parameters:
- gridding_optsdict
Containing input parameters to provide to
emg3d.meshes.construct_mesh
. See the corresponding documentation and the explanations above.- modelModel
The model; a
emg3d.models.Model
instance.- surveySurvey
The survey; a
emg3d.surveys.Survey
instance.- input_sc2int, default: None
If
emg3d.models.expand_grid_model
was used,input_sc2
corresponds to the originalgrid.shape_cells[2]
. NOTE: Will be removed in v1.9.0.
- Returns:
- gridding_optsdict
Dict to provide to
emg3d.meshes.construct_mesh
.