You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since we are planing to allow arbitrary dimensions in PyKrige, we need to prepare GSTools for that as well.
There are just a few modifications needed. The foundation for rotation and anisotropy in N-D, as discussed in issue GeoStat-Framework/PyKrige#138, could be implemented in GSTools.
The covariance model needs some updates:
it could simply provide the respective transformation matrices rot_mat, derot_mat, iso_mat and aniso_mat depending on the given angles and anisotropy-ratios (as described in the PyKrige issue)
we have to update the workflow for checking dimensionality. The fix_dim could be a check_dim routine, that takes the wanted dimension and state if it is valid.
anis and angles need to be treated based on the dimension. for anis this already works and for angles we need to consider, that there are (dim * (dim - 1)) // 2 rotation angles in N-D (15e2d80)
The associated rotation planes are [(i, j) for i in range(angles_no) for j in range(i + 1, angles_no)] (15e2d80)
everything else should be already working (SFT and so on).
The SRF would need some special treatment:
We need samples of the unit-sphere in N-D. Following this, we could modify RNG.sample_sphere for dim>3 with: (a856ea2)
coord=self.random.normal(size=coord.shape)
whileTrue: # loop until all norms are non-zeronorm=np.linalg.norm(coord, axis=0)
# check for zero normszero_norms=np.isclose(norm, 0)
# exit the loop if all norms are non-zeroifnotnp.any(zero_norms):
break# transpose, since the next transpose reverses axis orderzero_samples=zero_norms.T.nonzero()
# need to transpose to have dim-axis lastnew_shape=coord.T[zero_samples].shape# resample the zero norm samplescoord.T[zero_samples] =self.random.normal(size=new_shape)
# project onto spherecoord=coord/norm
The generators for unstructured meshes are already prepared for arbitrary dimensions.
For structured meshes, we could simply drop handling structured meshes separately and convert them always to unstructured (which is done already, if anisotropy is present) or we could keep this procedures for 1,2 and 3 dimensions.
we need to get rid of this cumbersome pos=(x,y,z) handling. We could simply handle it as an array and the spatial dimension is first array dimension.
The text was updated successfully, but these errors were encountered:
Since we are planing to allow arbitrary dimensions in PyKrige, we need to prepare GSTools for that as well.
There are just a few modifications needed. The foundation for rotation and anisotropy in N-D, as discussed in issue GeoStat-Framework/PyKrige#138, could be implemented in GSTools.
The covariance model needs some updates:
rot_mat
,derot_mat
,iso_mat
andaniso_mat
depending on the given angles and anisotropy-ratios (as described in the PyKrige issue)fix_dim
could be acheck_dim
routine, that takes the wanted dimension and state if it is valid.anis
andangles
need to be treated based on the dimension. foranis
this already works and forangles
we need to consider, that there are(dim * (dim - 1)) // 2
rotation angles in N-D (15e2d80)[(i, j) for i in range(angles_no) for j in range(i + 1, angles_no)]
(15e2d80)The SRF would need some special treatment:
RNG.sample_sphere
for dim>3 with: (a856ea2)pos=(x,y,z)
handling. We could simply handle it as an array and the spatial dimension is first array dimension.The text was updated successfully, but these errors were encountered: