-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'temporal', 'spatial_dim' and 'geo_scale' attributes to Covmodel #308
Conversation
@LSchueler would it make sense to you to move the For non latlon fields, I would keep |
@LSchueler Maybe |
@LSchueler I like the |
@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 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 |
I added 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I think you are nearly there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-D Wow, my review wasn't very thorough, was it?
LGTM!
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: