Closed MuellerSeb closed 1 year ago
@LSchueler would it make sense to you to move the time
axis position in the pos
tuple to the front in case of latlon coordinates? This would then follow CF-Conventions: T-Lat-Lon (and not Lat-Lon-T) which is basically T-Y-X (fully inversed axis order in contrast to normal (x,y,z,...,t)).
For non latlon fields, I would keep (x,y,z,...,t)
.
@LSchueler Maybe radius
is a bit misleading, since it is a rather technical term with respect to the internal representation of the yadrenko-variogram. May we could call this attribute geo_scale
witch is a bit more self-descriptive. What do you think?
@LSchueler I like the geo_scale
attribute. Next question, following #282 is, if we want to add geo_scale
also to the vario_estimate
routine so the bin_centers have a meaningful unit?
vario_estimate was update with geo_scale
and **std_bins
arguments. Now everything feels really straight forward.
@LSchueler we may disable rotation between spatial dimensions and time if time=True
. Otherwise I think the metric spatio-temporal model is violated.
Sorry for responding so late. I was sick.
This looks interesting! Just a few very brief comments:
geo_scale
time
is a bit too generic. Although it's a bit longer, I think spatio-temporal
makes it much clearer what the keyword is for.Thanks for your thoughts @LSchueler. Maybe time_dim
could be a compromise? Since we are basically adding a "time-dimension"?
Or only temporal
?
You find spatio-temporal
too long? I guess I could live with temporal
;-)
@LSchueler all fixes implemented. I would also vote against the CF conventions and maybe have that with #140
@LSchueler Only question I still have is, if dim
should really be automatically increased by 1 if temporal=True
.
For example if you want a model with 3 spatial dimensions and a time dimension, which option looks better to you:
model = gs.Gaussian(dim=3, temporal=True)
or
model = gs.Gaussian(dim=4, temporal=True)
In both cases model.dim
would be 4 and model.spatial_dim
would be 3.
I added spatial_dim
to solve this. dim
now always really refers to the model dimension. spatial_dim
could be used instead, when defining a spatio-temporal model:
model = gs.Gaussian(temporal=True, spatial_dim=3)
model.dim == 4
model.spatial_dim == 3
This is equal to:
model = gs.Gaussian(temporal=True, dim=4)
Closes #223, #282
This PR adds a boolean
temporal
andspatial_dim
attribute to the CovModel class as well asgeo_scale
to CovModel and vario_estimate.Setting
temporal=True
indicates that the model should be seen as a metric spatio-temporal model. This was possible before by increasing the model dimension by one but this feature basically enables using spatio-temporal model with latlon coordinates.spatial_dim
was added so the spatial dimension could be set explicitly and not implicitly by increasing onlydim
by 1.Also a
geo_scale
attribute was added to be able to get meaningful length-scales and bins for latlon models. Before we always used therescale
attribute to do that, but that was rather a hack. Now both can be used to set the sphere radius and to rescale the length-scale. In addition to that I addedKM_SCALE
,DEGREE_SCALE
andRADIAN_SCALE
constant that can be used as radius to get a length-scale in km, degree or radian as some people expect the length-scale to be in degree when working latlon coordinates.Another dimension indicator attribute was added to the CovModel class:
spatial_dim
: The truly spatial dimension of the model (2 for latlon, otherwisedim
ordim-1
(iftemporal=True
))dim
: the internal model dimension (4 forlatlon=True
andtemporal=True
for example)field_dim
: this is the parametric dimension of the generated field (3 forlatlon=True
andtemporal=True
, 2 forlatlon=True
andtemporal=False
for example)Works like this: