Tutorial: GSTools, a toolbox for geostatistical modeling in Python

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right then uh welcome everybody to transform 2022 to this um this tutorial we are going to be joined today by sebastian muller who's going to tell us about uh some geostatistical tools that he and his team work on so i'm super excited about that i'll hand over to sebastian in a sec um if so what's transform transform is a three days of tutorials uh monday tuesday wednesday this is just the second one so if you're tuning in now you are in time for lots of cool content this week um you can go to software underground slack to find out more about that and each one of these tutorials has a channel in the slack where you can like follow along live ask questions and so on um right now and sort of for the next few weeks right you'll be able to continue the conversation so go to software underground.org slack for that content and in the meantime why don't you subscribe to the youtube channel because that way you'll get notifications about the other videos that are coming up and uh you know hit like as well uh apparently that helps i don't really know how but um with that we'll hand over to things we do uh know uh something about um or and if you don't you're going to find out right now uh we'll learn about geostatistics from sebastian muller hand over to you sebastian welcome yeah thank you matt and thank you for having me i really appreciate the invitation i got and i'm happy to present something today so yeah my name is sebastian miller i'm working at the helmholtz center for environmental research in leipzig in germany and there i am a model keeper in the department of of computational hydrosystems and working in the newly formed subgroup called hydroscientific software development and i will just start sharing my screen to show some introductory stuff so yeah i hope you're seeing it now so that's the website of the hydroscientific software development subgroup of chs and there i am part in as a model keeper and yeah i did my phd here at the u of sets and during my phd i founded the geostat framework that has a website tuesday framework.org and there i put some python packages that came up during my phd that i needed for research and i really wanted to make people able to work with stuff like that and so we decided to do it in a good fashion for people to be able to work with it and as matt already said today's video will be about gs tools that is uh something like the core package of this whole framework but to give you an idea of what this framework is about i will just go through the packages that are there for a brief introduction and yeah everything's python based this we decided on to be easily accessible and because python came became something like the standard for uh scientific computing in a way because it is easy it's easy to use and as a wholesale community and we wanted to be part of that and so yeah just to jump in the geostar framework um mainly consists of these four packages that are shown here you can install them with pip and conda we will come to that later and yeah as i said main package is tools we will be talking about today a python package for geostatistical simulations and applications analysis really a toolbox for anything you would like to do with geostatistics and yeah what these plots are showing here we will talk in a bit and it's mainly a library for random field generation cricking variogram estimation variogram analysis and a lot of further stuff to integrate in the scientific software stack of python and of course we have a pipi package and we have a really extensive documentation you can find on redox and you can find our source code on github and to just show what the environment in the geostat framework looks like i will shortly show you what packages are there because when i started doing my phd i was working on pumping tests and what i wanted to do was i wanted to analyze pumping test data to infer geostatistical parameters from standard pumping test data and for that i needed a whole setup where i can simulate pumping tests and that is what the next package is about and i needed a package to simulate um heterogeneous aquifers that follow some just statistical parameters that is what js tools that i just showed this about and [Music] there are also packages for pumping test type curves and automated pumping test analysis i will show in a bit so for first ogs five pi so ogs is a scientific modeling package that is also developed here to set and you can simulate ground water flow and a lot of processes in the subsurface with that it is already um superseded by ogs 6 that is now in active development but i used ogs 5 because it is a working horse for me and i just wrote a python api for it to generate workflows in python to simulate mainly pumping tests and such a pump test is shown here so random field generated with gs tools and a pumping test simulated with ogs yeah and for analyzing these pumping tests there's also weltespi that i created where you can analyze pumping test data for subsurface parameters like mean transmissivity storage storativity and also as i said geostatistical parameters like variance of transmissivity or length scale of the underlying variogram that the transmissivity is falling or more precise the log transmissivity and yeah that's also a package here i won't go into more detail just that the back end for this package is anna flow which provides analytical solutions for specific flow scenarios or specific solutions for the groundwater flow equation yeah and that's basically it so also some words about myself what i already said and you can follow me on github and i'm not for hire yeah so first a short look at the choose that framework at github itself so there is an organization which contains all the packages i talked about and it's as you see it's not only the four packages i presented it's growing so pie creek a really um well-established package for cricking and python just joined the framework and we are really trying to clue things together here and um creating packages that are working well together and yeah so you can find the source code here and as and second repository or second organization with repositories we have the geostat examples where we just collect complex workflows that are built with to choose that framework and here are mainly workflows that we used for publications we wrote on all the packages introduced that framework and here you will also find the repository for today's tutorial the gstools transform 22 tutorial that is also in the uh video descriptions of this youtube video and i will come to that in a bit and yeah maybe i will just jump in this repository because here uh as previously shown with all the repositories who are working here you can just download the zip file extract all the files and then you can start working there and the environment i choose to work in this tutorial is the jupiter lab and i will just jump in there and show you the repository but don't fear uh i will explain how to get here because we can have a look at the readme that i wrote so js holds our transform22 hands-on and yeah at first we have a lot of channels to get in touch so um as matt already mentioned there is this awesome slack channel by the software underground where we also have a channel 4gs tools that you can find under the link here we created a badge for that but if you want to get in touch with us we really appreciate this new github discussions feature where a lot of discussions came up and it's really sustainable because all the answers we give there are just staying there and people can look it up and you can also write us an email we're always happy about hearing of you and you can follow us on twitter so maybe at this point i will turn off my video because as we just noticed this will increase the uh video quality of the shared desktop here ah it wasn't active all the way okay so i won't deactivate it maybe i will activate it later okay then your resolution should be fine okay so jumping into gs tools what's the purpose of the package so as i already said gstools was created by us to mainly generate random fields for this test setups that i have been talk that i've been talking about and we extended it during the time to also provide cricking in different scenarios then condition field generation we provide biogram estimation and fitting data normalization and data transformation we have a lot of readily provided covariance models we provide spatial temporal modeling and a lot of plotting and exporting routines you will get an idea what it means during these tutorials so but first the installation we assume that you are using conda to follow this tutorial and to get conda the previous video in the transform 22 introductions was an introduction about python and that tutorial also included an installation guide for conda how to set it up on windows or mac or linux these are the free target systems we are talking about during this tutorial but if you want to install it for example on unix systems you can just copy these lines and get conda up and running and on windows you can just install anaconda from the link we provided here and then you can download and install it and then you can proceed in an anaconda command prompt that is then there as a new program on your computer and afterwards we prepared an environment for this tutorial in this environment yaml file that you can just use um as a template for creating a new environment that will be called t22gstools and you create it with this command and afterwards you activate your environment with this command if you have that setup then running and your conda environment is active you can just [Music] start jupiter lab with typing this command and something like this will show up here so you will see the repository if you're starting jupiter lab from the folder that contains the tutorial files and then yeah you will be ready to start um something i'd like to mention at this point is we just published a paper about gstools in the geosci scientific modeling development model development journal that just was published about two weeks ago and there a lot of the scientific background of js tools is explained and a lot of features almost all features are explained there and a lot of workflows how to work with js souls also presented there you can have a look at that if you are interested in the more scientific part of this package okay and with that i'd really like to jump in so there's the documentation for gstools i just mentioned on read the docs you can follow that link and now i'd like to jump into the introduction with you okay i created an introduction um notebook we will start with and we can just put the readme to the site so we can copy stuff from there because that's what i'd like to do for the start to get an impression of what we can do so i use this these lines of code here as an header i'd say for the python notebook so that the matplotlib functions are all working correctly and i just uh turned off warnings to not get distracted by warnings outputs from downstream packages or upstream packages upstream yeah so i will execute that cell first and then we have an introduction chapter here and as an introduction i'd like to first show you a spatial random field because that's what we will be mainly talking about during this tutorial since we are talking here about geoscience and geostatistics uh we are looking at spatial fields and spatial data and this statistical toolbox is here to analyze this data for some certain information and we will copy these lines here um create another cell with typing b put it there and i will just execute it with ctrl and and as you see we will get instantly a plot okay so what is happening here line by line we are first importing gstools and we are using the abbreviation gs during the whole tutorial here and then we'd like to create this field that we are seeing and i just defined the dimensions of the fields that is x y axis with a range from 0 to 100 and yeah for simplicity and then there are two lines that are really interesting here we are creating a model i will explain in a short bit what that means and we are using a gaussian model and define the dimension there we define a variance here and a length scale and then we use this model to set up a spatial random field we uh use the appropriation srf for that and we just put that model in here and then afterwards we can evaluate this spatial random field at our given locations and we use these locations as axis definition so access definition in the x and y axis and that's why we use a mesh type of structured here and all this happens here in place and we can also in place just plot this spatial random field okay that's for what was happening here but what do we see here so first thing is you see it's not a constant field of course so we get a certain range for values ranging from -2 to 2 here that range is mainly defined by the variance we put into our model and then you see that there are some blobs in here so blobs of high values blocks of low values and it's smoothly transitioning from one value to another and as you see these plops have a certain diameter a certain size they are they are following so and that is what we are interested in because we want to describe a certain spatial correlation of data so if you how can you describe the spatial correlation in such a field because what i always use as an imagination for what that shows is since i'm coming from pumping tests i always think about that like a field of log transmissivity uh lock transmissivity values oh i just read the redmi readme is not being rendered in jupyter lab in the uh okay so if you want to render to read me you just click right on the readme and open with markdown preview then it should be rendered okay okay so i always think about these fields as being a field of log transmissivity in in the subsurface and yeah we want to describe the spatial correlation within such a field so we can for example tinker around here with length scale to see what that does if we increase the length scale by two you see these blobs are getting bigger and if you make them smaller these blobs are getting smaller so you can grow control the the range of where points are still correlated that's what is what is going on here and all this is as you see controlled by this covariance model and we could also take a look at the model itself i will just plot it here beneath it and the model itself is represented by this variogram function and there you can see all the parameters i just talked about so for example the variance is the value that this variogram is converging and the length scale is controlling how fast uh the variogram is converging from its initial value to this uh far field value so the variance so for example if we cut down uh or increase the length scale you will see it's now up to 30 and it has been 15 before so this is just stretching this this one and we also have a lot of other models that you can use for example the exponential model that creates a rather rough field so you see the field before has been rather smooth and now it's a bit rougher and that's mainly controlled by the slope at the origin okay i will go into detail about covariance models later but just to get an impression here and we can also do fancy stuff with gs tools for example here the is another example for using card to pie [Music] oh but maybe it's a good idea just to have a look at what is possible okay i need a plt that show there was a question about the plotting library it's mud blood clip of course thank you leonard um yeah so leonard will be in the chat at slack to help you during the tutorial oh it was working so i guess that is because we need another figure yeah okay so as you see we can also use geographical coordinates and we can generate fields on different scenarios um yeah just to get an impression what is possible here and what i already talked about was this this variogram and for now we just use the variogram to generate fields but the other way around is also possible so um there's another example here for estimating the variogram from given data so for example you have data from field exploration and you want to estimate variogram here and what we did in this example is we generate artificial data again with um the methods i just showed we generate a model we generate special random field and afterwards we will use that to estimate the variogram from that data and let's have a look how that works okay so the field itself is not shown here but what is shown is the estimated variogram this is uh shown here by the scatter plot and we use another model from gs tools to fit it to these to this data and with that way we can estimate parameters of the statistics for this field so for example we use this stable model and we estimated the variance to be about two the length scale is about eight and there's no nugget because we disallowed it and there's a shape parameter for this model that is estimated to be one and we can have a look of at what we put in there and the parameters we put in there have been a variance of two and a length scale of eight so the same that we put in came also out and to get an impression about the field itself we could again just plot that special random field yeah it looks a bit cumbersome because it is um [Music] scarce data but could also use could also deactivate the control plot and then we get a better field view here yeah but as i said um if you don't understand all the bits and bytes here it's not a problem because we come to get we will come to that later and yeah there are some further um examples here you can try out yourself so you can always just pause the video and tinker around with all the things i've already shown you so as as you have seen i also just changed some parameters to see what happens and that you can do also with the following introduction examples um yeah and just have a look at the another three examples that are here if you're interested and but it's no problem to just continue watching what we are doing now here okay then i will close this introduction that was just a glimpse of what we can do and i will directly jump into our first tutorial sections about the covariance models or variogram models so there's also a readme here to show you an introduction and yeah the covariance model i've already shown you that this covariance models are there to describe spatial correlation in in a certain way and yeah just as written here one fundamental feature of gstools is the powerful covariance model class which allows you to easily define arbitrary covariance models by yourself the resulting models provide a bunch of nice features to explore the corian's models a covariance model is used to characterize the semivariogram denoted by gamma of a special random fields in jazz schools we use the following formulation for an isotropic stationary fields and yeah this is a formulation for the picture i've just shown you there's the variance that defines the far field behavior and there's a length scale parameter denoted by l here that is scaling the variogram on the x-axis so and the parameters in there r is just a lack distance so it's the distance between the two points you are analyzing l is the main correlation length then we use a rescaling factor that's not that interesting but you will find different formulations for almost the same variables in literature then sigma square is the variance n is a nugget we will come to that later what it means but you can have something like a subscale variance or measurement error so there's no clear definition what a nugget really represents but it introduces some noise to the data that's what you can think about and then there is this function we call core or normalized correlation function that is depending on this non-dimensional this distance that is the distance between the points normalized by the length scale we are using in the model and derived from that there are two other functions so there's the correlation function that is just this normalized correlation and d non-dimensional distance put in there and the covariance that is the correlation function multiplied by the variance okay i said that we are using this formulation for isotropic random fields but we are also supporting an isotropy and rotation because fields don't have to be isotropic in nature and can be rotated and stretched in certain directions but we will come to that later just to get an overview of what kind of models we are providing here's a short list that is taken from our publication i just talked about and we really wanted to provide a lot of models that are used in literature or by practioneers so we have the gaussian variogram that we have already seen the exponential one that's also quite common and a bit rougher then there are models that provide shape parameters for example the material model is quite famous here as an uh transition model between actual exponential and gaussian model and also the stable model is uh in between these two models and provide a shape parameter and then there are a lot of other models that are popping up here and there in literature a famous one is for example the spherical model because there the length scale itself describes the area of where you can expect covariance at variance or covariance at all between two points i will show you that in a bit and the nice thing is if you are not finding the model you would like to use you can just define your own one and work with it just the way i have shown and that's what we will be doing in the first example here i will put the readme to the side again so we can read up what is happening here okay our preamble here as before and then yeah let's start with a simple example of a self-defined covariance model and we will just re-implement the gaussian model we just used just to show you how easy it is so and yeah to do so you just define this normalized correlation function i just i just talked about and to do so in python you just again import gstools and here we use numpy for numerical calculations and to get some special functions and then you create a clause that's a sub class of the covariance model and you override the core function and there you just return the exponential minus h squared and that is what is just written here for the gaussian model and with that definition you have a fully functional covariance model and a re-implementation of the gaussian covariance model and yeah now we can again just instantiate this model with a dimension of 2 a variance of 2 a length scale of 10 and then we want to have a look at how it looks like and i now want to show you all these associated functions that i talked about so at first we will plot the variogram you could also write variogram here it's just a default value for what is plotted and this plotting method will return an matplotlib axis object that you can put in other plotting routines and we will reuse it to plot all three functions in one plot and if we do so we get a plot like this okay so you see it's the again the same shape for the gaussian covariance model and the blue line is the variogram that describes the variance in your data depending on the distance between two points so uh it is assumed that there is no variance at all if you have uh two points at the exact same or almost close very close together and then you see the covariance is just the variogram flipped or the variance minus the covari uh minus the variogram so this is having the exact opposite behavior because it describes the covariance and the covariance is highest if the points are close together because then they behave almost the same and the further away two points are from each other the more covariance goes down until there's no covariance at all and the correlation is just a normalized form of the covariance so and these three pictures are all you need to to think about spatial correlation in the sense like gstools uses the covariance model okay here i just used um the already implemented gaussian model um to plot it on the same axis above here and if you execute that it will show up there and as you see the only difference is that we are using a slightly rescaled version um and i will explain in a bit why we did that it's just that the length scale that goes into the model has a direct connection to a interpretation of length scale we are using ngs tools so what parameters can go into these models we have already seen some that we used so there is the dimension that is really the spatial dimension we are using to describe data then we have the variance which should be the variance of the data you are describing or looking at then we have the length scale we already talked about the log that's describing the the area of correlation and we have a nugget that i uh already mentioned and the naked is something like the offset at the origin so it's it can be interpreted as measurement arrow or subscale variance so marion's below the um distance you have measurements so it's for the area where you don't have any measurements or data that's another view and you can just update uh model parameters by setting the attributes like here so if you execute that we have the old model had a dimension of two variants to length scale and nugget and then the new model gets updated parameters just by setting the properties another term that is often used with these models is the term sill and the sill is just the [Music] value the variogram is converging to so maybe i will just to give you an impression i will just add a nugget here or 0.5 and if you if you execute that again you will see there is now an offset at the origin of this nugget and the sill or the value that the variogram is converging to is two plus five so we are at 2.5 and that is the variance or correlated variability you can also call it like that plus the nugget so that's something to keep in mind because a lot of people if they say the variance of this variogram model um they sometimes mean distill so the value this model is converging to and some just say it's the partial sill so everything above the the nugget and as you see covariance and correlation function don't care about the nugget because it's just a jump for the variogram at the origin so you don't see them here okay so that's the first introduction for a self-defined model and the uh main parameters we are using with these models and then we will come to basic methods so we'll just close that um yeah i've already talked about the variogram the covariance and the correlation and these functions you can just access with each covariance model and there's also the model defining normalized correlation that you can access with dot core and yeah these are methods provided by every covariance model so here's just the the same plot again for the exponential model just to get another impression of what i already talked about so there's an offset of the nugget and we have these three functions that are always connected to each other and one could ask why do we call it covariance model if the standard function that is plotted is the variogram and the simple answer is we always use variograms that are derived from covariance models because we need our variograms to be finite so there has to be a finite value this covariance model is converging to so that the field has a finite variance at each point and that's why we call it co cuff model or covariance model because it always comes from a covariance there are also unbounded variogram models but we are not using them now at least there was an idea to implement unbounded models as well in the future but we didn't do so now okay that was just a brief overview of the methods the standard methods that come with this covariance model and then we can go to an isotropy and rotation i already said that for now we just used isotropic models that um are describing the variogram in in all directions the same way but as i said you can introduce an isotropy i will just execute the header here again and that can be quite simple with let's start with dimension two here we use a two dimensional model again i mostly use the gaussian model because it is simple and easy to describe we use a variance of two a length scale of ten and now comes a new parameter that's called anise or ns for an isotropy and there we set a value of 0.5 and let's look what this does so if we are printing the model itself we get to see that um now there is a uh an array of an isotropy values because there can be multiple in higher dimension but in two dimensions we only have one value and that's the one we gave here and you can access this parameter by the model property and another property that now comes is the length scale vector where you get the length scales in all the principal directions and this is now 10 and 5 because in the second direction so in the y direction now the length scale is the anisotropy factor times the main length scale and that's 0.5 and that's why we result in 5. and we can also have a look at a spatial representation of the covariance model so that's the next thing we are doing here and you don't need to use the n isotropy parameter here to define that you can also provide an array of length scales to define the anisotropy ratios in each direction by just providing different length scales for all the principal actual axes so here in three dimensions we need three length scales and then we can have a look at the covariance spatial routine here that's something we can plot and let's have a look at how this looks like okay i need some space here okay so this is now a multi-dimensional representation of the covariance model we just saw and now i don't know if you uh can convert the the original variogram plot to this one but it's starting at the origin and in a certain direction it just it would just look like the variogram function we just saw and now we can look at it in the three-day way to see how the variogram changes in certain directions so we put in here in the first two directions 10 and 5 as length scale so you see the correlation has a much longer range in x direction than in y direction and if we put that to the x and set plane we see it gets even narrower because that is ten to four and in the y set plane you see it's almost um isotropic because it's five to four so you don't see much of a difference here and this plot here is something like a built-in feature of gs tools to to be able to have a view at multi-dimensional data so it's just a hack that you can scroll through this data by sections and there's something like a bug here because of a new matplotlib version where our implementation somehow messes up that slider but yeah we will use that in the future also to have a look at spatial random fields yeah there was a question x y and z axis are representing the leg this is like distance right and lag distance also with a direction so like distance in this direction this direction you can just have a look here okay and we also plotted something so we plotted the anisotropy ratios and the main length scale and the length scale vector so these are the three things we get here so the ns of b ratios are now two values because we have three dimensions the first dimension always follows the main length scale and the following dimensions will be defined with these anisotropy ratios and here for example we have 0.5 and 0.4 and from the main length scale we can derive this set of length scales okay and now the data here doesn't have to follow the the main axis because it can be rotated uh in space because the data hasn't uh doesn't need to follow your reference system and that's why we also provide rotation angles and that's just another parameter that's going in here so if for example here we use an angle of 2.5 and let's see how that now looks like and as you see it is just rotating the whole thing here so rotation is now not following the principal x or the the reference frame axis but is now following a rotated system of angles and these rotation angles are quite complicated in multiple dimensions so in two dimensions for example there's just one angle that's defining your rotated model because you can just rotate around the z axis or you can rotate in the x y plane and in three dimensions you get at least you get three angles to describe the rotation and we went for the tate prime angles that's coming from aerospace science to describe [Music] the position of planes in the sky but don't think too much about it it really gives you a headache and we also implemented routines for arbitrary dimensions so you can not just use gs tools for data in one two and three dimensions but in any dimension you want but i will skip that in this tutorial because we are here talking about geoscience and so we will stick to three or at most four dimensions okay so that's for anisotropy and i think yeah the next thing we will talk about are these different scales i just mentioned with the gaussian model because this scale parameter is something for for the interpretation of the person that is working with a covariance model and there are different definitions for length scales or what they mean and the main definition we are using is the integral length scale that is just the integral over the correlation function itself and that will give you an model independent definition for in value you can associate with such a model as a length scale parameter and these these values can really differ from the length scale you put into your model because it doesn't have to follow each other but it's always just a rescale factor that is uh controlling the ratio between these two so for example if we are executing that we are again using a standard model that comes with gstools this stable model and we put a length scale of 10 in there and then we will just look how does this then result into an integral scale so executing that will give you an integral scale of nine so you see they are quite close close together and if you have a look at the integrals grail vector because it's an isotropic model the length scale in all directions is just the same and if we just multiply it by 10 here you will see the integral scale is also just multiplied by 10. um yeah maybe just we could have a look at the variogram model and if you see we used now 100 as length scale and that is something that is that is here so and it could be a bit arbitrary for some people uh to say why is that where's that length scale so isn't the length scale something like uh here so at 250 where i can say okay at least at that point after that point i won't have any correlation at all and yeah that's totally fine and that's why we also i will go over that because it's just a discussion about uh the anesthesia ratios and length scale and so on but it's not that interesting and to have that scale that i just said to see where is the correlation almost almost zero you can use the percentile scale and we provide a method with each model to calculate this percentile scale and for example this will give you the the point where the correlation reaches or reaches 90 percent so or think thinks below um 90 uh so 90 of the correlation is within this distance and that's what you get here so for example if we put in length scale of 10 we will get a 90 percentile scale of 17 and that's more than double of the integral scale so and you really have to keep that in mind when you're talking about scales or length scales that there's no no common definition for for a length scale you can speak about the parameter you put into the model you can speak about the integral scale or you can speak about a percentile scale but these can all three be different and here we just provide a little plot to show these all these different length scales so there is the um yeah the length scale here is the dotted line it's a length scale of 10 then the integral scale was a bit lower so it's about nine and that's here but the 90 percentile scale that is just here with 17 so and that is just um the 90 percentile so you see these um length scale really differ and you have to be really cautious what to use okay and i think i will skip the fitting parameter ranges because we will come to um variogram models later so in all these subfolders there are extra sections for people who are interested and you can just uh dive into there and tinker around with it like i just do here live and yeah so i think that's that's enough for covariance models just have a look at uh all the extra stuff if you're interested but the next thing we will look at now are random fields and we already have seen random fields in the introduction and i will just open the readme here and this special random field generator was something like the first feature we wanted to have in gstools and was the the main thing why we created js tools and everything else built around that and we wanted to have a spatial random field generator that can generate a field that is following such a given covariance model that's that's the idea here and so i will just jump in with the first example and that's basically the same as the introductory example uh we are again just using a covariance model we just talked about we will use a certain range for the axis in the uh in the field and then we will generate a spatial random field okay so just execute this stuff here again we will import gs and set the range and then yeah we will define the model and create this special random field and afterwards we can again have a look at the field so that's that's the basic workflow and i think you know more understands what is happening here in between so the model is defining the way this this field looks and uh our spatial random fields can be then evaluated at all the positions we want and there's for example a structured method to evaluate the field at a in a structured way where you just provide the axis in each direction and it will generate all uh all the uh grits values you need yeah and again you can always have a look at the at the model that was used to define this model okay the only thing that's new here is uh since we are talking about randomness um we want to reproduce results with these calculations and that's why you can provide a seat to the spatial random field class so i used today's state but you can for example change it and then you get another field that looks slightly different but still has the same behavior so the these blobs are the same and you have the same size and it is smooth as before yeah so that's just something the seed controls here and yeah that's something we just already saw and so we can jump in the next into the next notebook that's about ensembles of these fields because if you can give a seat to such a field you can just uh use different seeds to generate different fields to for example as i have talked about earlier run pumping tests simulations on these fields to make an ensemble of such simulations and that's what we will be talking about in this notebook so the setup is almost identical to what we have just seen we again are using gs tools numpy we are generating uh access to where we want to evaluate our field on we set up our model and the spatial random field class with no initial seed at that point and then we use methods to already set the position tuple that we are using for generating the fields so that's a setpost method that we're using here and again we are scan generating structured fields so i will just execute that and now we just want to use uh we just want to generate an ensemble of four random fields and so we are just setting an ensemble number to four here and we are looping over these uh just looping over a range of four and generating the spatial random fields with a certain seat that's what i just said and as i see it we just use the ensembl number itself and we can control the name of the field that is stored in the srf class by a name and that's what we are using here so it will just be filled with a number that is appended here we can execute that and afterwards we can have a look at it by creating a two by two plot with matplotlib and we are just using in show to show the special random fields here so let's see what happens with that okay and that's that was pretty easy because now we see all these fields look really similar but they are different that's what i just talked about and now you can use this to uh simulate anything you want on that to generate an ensemble of scenarios yeah and as you have seen the seed here was really simple it was just the number 40 for the ensemble member but you shouldn't use um seeds that are just numbers that that are coming after each other you can get artifacts by that and so we are also providing uh something to better seed your models and that is a master random number generator that is basically wrapping around the numpy random number generator and the only thing that is different here we are generating such a seed object and that seed object will be called for each fields in the special random field here and nothing much should change here you would also get fields here but they are better seeded now and as you saw we can access the fields by subscription of the srf class so here's the srf class with um in brackets you just provide the name of the field you want to access and all the fields that are stored in these special random fields you can see for example with the field names and that are the four fields we generated in the first example and now these better fields in the second example yeah so that's really a simple application we often use when working with gstools in a simulation environment okay and now to something fancier so we already talked a lot about anisotropy and different models for to see some roughness in the data and rotation and so on and we can can combine all that to get an impression of on how fields look like that are following such an uh an isotropic model and to demonstrate that we use uh correlation lengths here in this example of 12 and three in the main directions and we use a rotation angle of p over over eight p over eight yeah and it's about 22.5 degree i think yeah we are using uh radians almost everywhere in gs tools and decrease only for latitude and longitude yeah just to be consistent okay so it's again really the same setup we are having a setup for the axis we are using we are creating a model and we are now passing some more parameters but we have already seen it so the length scales are 12 and three and we are using a rotation angle that is rotate rotating [Music] the model by 22.5 degrees you can use the numpy build in routine stack to write to convert between degrees and radians and then we just set up again a special random field with that model we seed it and generate a structured field with these axes and you have a look at it oh i just forgot to execute that and as you see our spatial random field is now really doing what we what we told it to do it is rotated so it's now going in that direction you can just tell by looking at it and the length scales in the main direction is much much larger than the uh length scale in the orthogonal direction and that's what we set here with 12 and three for the length scales and yeah and you can also imagine or think about that like a cross-section to to through soil where through layering you get something like these different correlation lengths in the different directions and yeah we plotted the model again to to have a look at it and yeah you can also set instead of using length scale you can also set the anisotropy ratio as i just told you will get the same model so these are the two options to set an isotropy either use two length scales or multiple length scales or use multiple or one unless attribute ratio okay then let's go to the next one what we did up to now was taking a look at structured fields that means fields that are defined by the axes around these fields and we are getting regular grids that are holding the data but if you are working in the field and for example you are you are having uh measurements at certain points you will just have point data that you [Music] yeah that you can use or that you can look at and so we also provide unstructured fields i will just do a little bit down and yeah it just works almost the same way but now to generate random points we will use we will use randomly generated spatial points with a numpy numpy's random library and we will use points between 0 and 100 and in 2d with randomly selected values that's what's happening in these first four lines and then we will proceed as always we generate a model we generate the random fields and we can then evaluate the fields on uh the given points with x and y and now we are not passing anything like structured or mesh type structured because unstructured is for us the uh default way of generating random fields so it could also be written mesh type equals structured here but that would be just the same and another option that you have to more explicitly use structure generation is to use the structured method of the srf but that is also just a shortcut for just executing srf itself and let's do that i will explain afterwards what the last line does um yeah and now we will just take a short look at what was generated i hope that it works here somehow it's not executing i don't know no it looks good at least in my okay for some reason my jupiter notebook won't show the plot here and i don't know why but one thing that is really nice uh working with all these meshes and structured data is that there are a lot of libraries uh okay for you it is working that's nice that there are a lot of libraries to deal with data and spatial data and a really common format for dealing with spatial data is the vtk format and as you see here we provide exporting routines that you can export data to a vtk file and in this case it's it generated a vtr file ah and now i know what i did wrong i test typed structured here and that's that's what happening because i just generated the field with a million points for generating its structured and that's what just happened i think that's why okay okay i just set up the kernel again because i just killed it i guess with that yeah that was the problem sorry um okay now also the field works here so yeah we are jenna generated now a field that is unstructured with a thousand points and you see it's quite rough here we can also increase the size of the points to get some more and then you see it will get much higher resoluted here and as i said vdk is a really nice example of a library for dealing with data and that is why we also provide not only date file export but you can also export just to pi vista to get to use the uh really great privisa package that was presented also here by bain sullivan last year and as you see we just have a set of points in an in an unstructured way with no uh mesh cells defined so these are just vertices yeah and you can just use that on the fly and yeah so i would say all the following examples here are additional information because by vista support we already showed with this simple example here that you can export to pyvista and you can also generate fields on pi vista meshes to see that you can look at the pi vista example here and yeah there are some um extra information in the following samples here you can have a look at it if you're interested and with that i'd like to do a short break of five minutes and afterwards we will jump into variogram and cricking and i think everything after conditioning so geocoordinates normalizes and transformation will be just further information for people who just want to jump in there or maybe we can then afterwards do another tutorial on that in another channel but yeah for now i will just have a break of three to five minutes and then we will try to finish the next three sections in the next hour okay then see you in a bit all right this is matt here um before sebastian gets back i'll just take a quick opportunity to remind you that there is live chat for this video as turned off in youtube but you can go to softwareunderground.org and sign up um in the software underground slack where there's a dedicated channel called t22 mun for monday gs tools all the transform 2022 channels start with t22 so you should be able to find them easily enough but that chat will persist this video will be here um well i don't know how long youtube videos will be here forever um or until the next uh you know giant uh solar storm wipes out all the electronics on earth and so you know please share that watch it at your leisure re-watch it do go over the materials this is fantastic stuff that sebastian's put together here and i want to take a second as well to recognize um one of our sponsors for this conference curve note uh if you've not come across curve note yet do go check it out curvenote.com uh these guys are doing really awesome things with scientific communication digital communication essentially a sort of new way to communicate with maths code everything interactive everything's citable um plugs right into uh jupiter notebooks and it's just really cool piece of technology so uh have a look at curve note when you get a chance and thank you to them for supporting um the conference by um basically turning these tutorials uh this content into interactive documents um so yeah do check that out when you get a chance all right i'll go quiet again i think i can hear sebastian yeah around there so yeah if you're ready to take it away sorry i was just doing a bit of you know yeah no pretending to be a late night radio host i'll hand back over to you sebastian okay thank you uh yeah so again after one hour i could at least show my face again for a second okay so yeah we have seen a lot so far uh don't be afraid that these are just two sections uh from from eight we are here after one hour but these two sections really are the core functionality of uh gs tools itself the covariance model with all its features and we just have shown a glimpse here of what is inside that model and the random field generator that as i just said was our main motivation to write this library and to yeah dive into geostatistics and how to work with it because we come from a simulation site um and yeah but as shown in the introduction there's also another side that's coming from from the field and from measured data and from this side you really want to analyze data that that you have and that since we are working in sub surface here mostly is spares and you need to get information from that and it's really an established thing that has evolved over the last 70 years um that's variogram analysis and tricking to analyze data and to interpolate data and these are the two next sections we will go into and yeah i will open that readme and as said before i will now turn off my camera again to increase screen resolution so yeah as matt just wrote i will say bye again but you will still hear me okay variogram estimation i already have shown a simple example an introduction how to estimate variogram from artificial data and we provide a sub package called variogram for all this estimation stuff and to get more information about the similar.com you can also have a look at wikipedia or our documentation so we already talked a lot about of that a lot about this so okay let's jump in with the first example again our header and again we will just import numpy and gs tools and also again we will generate a random field with a thousand points as our synthetic input data and we will use that to generate a synthetic field that we can analyze afterwards and pretend it is our real data we want to have a look at so um same procedure set up a model set up the special random fields generate the field on our given points and let's have a look at a scatter plot of our data so that is our input data just some measurements for example you could here think about weather stage stations that are measuring temperature for example that could be something that produces patterns like these if you have a dense network and now we will use this data to estimate our variogram and the estimated or empirical variogram is something that has to be defined in certain certain ranges so i will just execute that and try to explain what happens afterwards so here you see we have a routine that is called vario estimate that will estimate the bariogram and all you put in is the tuple for the positions so our our x x y data and your field values and what you get back is an area of gamma that's the value for the variogram and another array that is called bin centers or bin center here and these bin centers are there because uh we need to group together certain certain points or a lag distances to be used to estimate the variogram value for a certain range of distances because you can't have the exact variogram value for a for an exact distance with just a finite number of given data and that's why all the data will be grouped and you will get one value for one bin that is created for example here you see um points that have a distance of yeah i guess about two to three and within these bins you will get a single value and these are the scatter plot dots here that are estimated and then you can use just another model of gs tools we call we call it fit model here and the only thing you have to give there beforehand is the dimension and we will use a stable model because it's a bit more flexible than the exponential model we use to create the data and then we will use it to fit our model to and that is what we are using for the fit variogram method of the model and there just these two areas go in bin center and gamma and we can then control the fitting by for example disabling certain parameters that we don't want to use during during the fitting routine and in this case for example we turned the nacket off or you can also set fixed values to certain to certain parameters and yeah that's all then the model is fitted and you can have a look at it afterwards again with the plotting routine and we just set a appropriate maximum value for the x-axis and to see the data that we put and we add another scatter plot and we can have a look at the model itself so the model itself is now here and you see all the estimated values that are stored in place we have a length scale of about eight a variance of about two and a shape parameter of one and a shape parameter for the stable model of one is really the exact exponential model and as you see what we put in here is also a length scale of eight and a variance of two so that was a really good workflow because we got out what we put in and to see what happens here for example if we turn off the turn on the nugget value you will see there happens something because we get a little offset here and the first value here is now fitted better but there isn't a light slope here and it is estimating a nugget that is not zero and then we get uh values that are slightly off so our variance is a bit lower because you now have to add it to the nugget to get the soul value and the shape parameter also changes a bit away from that and yeah you can also fiddle around with other values for example you could uh just remove this nugget value because then all parameters will be fitted and you can for example also set values for diesel for example you could say the sill is just the the variance of of the fields so let's see what happens then yeah so now you see maybe we need to print for comparison we need to to print also that field variance so and we see the field variance itself is 1.9 and that doesn't need to match the variance we put in here because um there's a slight different meaning in what is the variance of the whole field you get and the variance that could uh be observed at each point and these two values are often um uh assumed to be equal which is called called ergodicity uh that the variance of the of the input model is really the variance of the uh generated field or the spatial variance it's the same variance as the point variance but i won't go into much much deeper into that but this workflow can really be very stable to set a finite value for for the sill of the variogram that is uh equal to your to the variance of your input data and uh we will use that later during trigging also okay and you can for example also fix other values for example we could use an alpha value of one and then you see the here having happened something different now and the nugget is still not zero but but almost and yeah so you can can use this to really tinker around with all the parameters you put in there you can also set different ranges for all the parameters so there's default ranges which we assume to be stable for the most scenarios you run into but yeah you can have look at the documentation there's really a lot of uh different examples and i guess this um next example is a bit extensive uh yeah but i will just show you uh how you could use js tools to find a best fitting variogram model because that's an uh question that often arises with data that you are analyzing what is the best model you could use for your data and yeah we are just using the same workflow we are generating the same fields here a thousand points with an exponential model and we again just use js tools to estimate the variogram and then we want to apply a set of models to to this data and we just set up a dictionary of models that we want to use so it's a subset of the provided routines provided models that jesus has and then yeah we just loop over all these models we instantiated a fitting model and then we use again the fit variogram routine to fit this model to the data and here we use a feature that is called return r2 and we implemented a um little feature here to estimate and or to to to calculate a pseudo r2 score there's also a discussion on uh the gstools repo about how much sense this r2 score uh makes or how much information it carries because r2 scores are mainly there for linear regressions but i still think you get some information about the goodness of fit for the variogram by calculating this r2 score and we will just use it here in this example to see which model fits best so we are generating this this and we are plotting everything and that is that is what you get so you see almost all models uh look quite good for the data so there are differences in the in the origin how how does the model behave at origin how is the nugget estimated that's really the main difference here and how do these models differently behave uh in their in their slope or in the transition from from near field to far field so there's really the main difference here and yeah but you see all these models really are able to be fitted to the data we put in and then we could just use it to rank all the models here and the stable model we already used fits best here so and yeah you can just think around with that um to see what model could be best for for your scenario and what are the estimated parameters to compare your results yeah okay that's for finding the best model and then the next thing we want to talk about are directional variogram estimations and fitting at least in 2d so executing our header again and yeah we are still in the same process of generating artificial data that has the information we want to see if we can find this information again by analyzing the data we generated so that's really a workflow we often use to assure that everything is working fine internally so we already talked about rotation and an isotropy so we putting two different length scales in here to generate our data and i will just put an srf.plot afterwards to see what what was generated and i will turn that off to make it a bit nicer so that's the data we put in um that's now interpolated to be on a regular grid but that's that's our reality we are assuming and now we want to estimate and directional variogram on it and now we again use the value estimate routine but we can put a lot of more a lot more information in there of what we want to do and yeah so the first two informations are again the position tuple and the fields itself and then we don't want the bins to be calculated automatically but we provide bins that should be used during calculations so we use bins of with a width of 2 and they should range from 0 to 40. we put that in here and one thing you have to specify are the directions you are looking uh looking at so and here we just use the the uh directions we already put into our model but in reality you would need to generate multiple directions look at them and try to find the direction with the highest correlation length to find the main direction that that would be the process here but for simplicity we just look at the two directions we already know that are the domain directions and you can provide a tolerance value for for the for the angular opening uh in the direction you are searching so all these these angles within the tolerance are also used for this bin you can also select the bandwidth for this search direction to not go wider than than this yeah and then we again use a mesh mesh type of structured data uh because we generated struct the structured data and we want to return the counts uh of point pairs that fell into each bin so let's execute that it could take a while yeah and now let's see what we get so um again we generated the bin center and the directional variogram values this is now um an array that is holding multiple variograms for for each direction so we have two directions here so here will be two arrays in this directional variable maybe we can just put it here as well print the vario.shape so we get 19 values for each direction and these models look okay that's that's now a shame because we re evaluated the model that's where they look the same okay so now this is the model we put in and that is now the model we fitted and the only thing that was not fiddles are the angles since as i said the angles have to be defined beforehand but an isotropy and nugget length scale and variance so these these four values are fitted and as you see it went quite well our anisotropy uh looks good the nugget looks good length scale looks also good and the variance also looks good so we are fine here and here is just a set of plots to have a look at what happened and yeah so we have as i said two mario grams in each each direction so the first is here in the in the main direction that's the blue one so the slope is there a bit lower because there's a longer range of correlation in this direction and the orange one in the orthogonal direction is a lot steeper because there we have a shorter range of correlation and that means it's faster converges to the field variance and the lines here are the fitted variogram value okay and as you see it just worked fine yeah we need to think about how to automatize finding the directions the main directions of the model in an automated way in js tools but that's really a hard task to do so you always have to tinker around with that and yeah okay another short example about automatically fitting variable crumbs we already did that silently and i just wanted to to mention that again that in the previous example we defined these bins we wanted to have where point pairs fell into and what gstools does if you don't give any pins it will just estimate the bin centers ddt bin edges and then generate the bin sensors from there and so this this example is really just what we already saw we generate a random field and and then we estimate uh the variogram and it will just now show you um that the estimated number of bins was estimated to be 21 and the maximal bin distance is about 46 and there are two rules in gs tools for estimating these two numbers and the first one is the number of bins is estimated by sturge's rule that's an old rule of thumb for histograms and the maximal bin distance is one third of the field diameter to be able to have enough points in each bin so these are the two rules we are using but you can also do it by always do it by hand to get better results um okay and then hit this just again a fitted model and we will have a look at at the fit so nothing nothing special here so you don't have to think a lot about it you just need to think about it when the variogram estimation goes wrong in some some way and you have to do it by hand okay and with that we can at least have a look at cricking so we have 20 minutes left and creaking and conditioning will be the last things i will capture here in this example and yeah so jump into that okay we'll close all our tabs and so cricking cricking is provided by the sub-package ts souls.crick and it provides routines for gaussian process regression that is also known as cricking named after crick who invented that in the 50s i think uh a geostation from south africa and it was later um then theoretically founded by maferon i think it's called he's called here and cricking is a method of data interpolation based on predefined covariance models so exactly what we have been talking all the time about and the aim of cricking is to derive a value for of a field at some point when there are fixed observed values that you have so for example again the example with the temperature measurements you have measurements of temperature and you want to interpolate the fields based on your covariance analysis to a to a whole map for example and what is done internally is that all the values you have have observed the while you set which i are denoted here um will be used in a weighted sum to generate another value so your target volume and these weights are really interesting thing because these are what is generated by cricking and we provide a lot of clicking routines um like maybe you know there's ordinary cricking there's simple cricking and then you can put some auxiliary value variables in there for universal cricking and external drift tricking and detrended clicking yeah there's really a lot going on there and you can have a look at all the features we provide here but instead of just talking about i would really like to just jump in and have a look at the first example for simple clicking and maybe put that to the side again okay so execute our header again so in simple tricking um as i said we are interested in generating the weights for our interpolation so and the weights are now generated from a system that includes the covariance matrix derived from our covariance model for all the input points and an area of the covariance values between all input points and the target points so that's just a derived equation and gstools really simply provides an um api to use to use all this in almost the same way we have seen for the spatial random fields and so we are again starting with uh our header here and we are using num.js tools official conditioning data so these are our input points and input measurements so for simplicity we just use one dimension here so we have x values for the condition and conditioning point positions and we have some measurements for the conditioning values and then we want to have a resulting crit on which we want to evaluate our clicking routine on and we are using a certain model to describe the spatial correlation structure of the data so we can just use that we don't fit any any model here we are just defining it and then we are executing it and i will show you what comes out of that okay so as you see we use an model called qrik.simple here and again in there goes the model we have to put in a mean value for for the data that could be the mean of the of the data you have or a mean you have measured otherwise or mean you want to set and then you put in your conditioning points and conditioning values and then you can just execute or calculate the cricking fields like the spatial random field but it won't give you just a field but also an arrow variance that is the second really important information kriegen gives you and yeah let's have a look at what was generated okay so these scatter scatter dots here the black ones are our artificial measured data conditioning points and the blue line is what the cricking estimator gave us as the best linear unbiased predictor for the area of interest that we have so it's our it's our range from 0 to 15. and you see a lot of interesting things first um the transitions here are really smooth as you see and that is because of the gaussian model we were using and the gaussian model will always result in very smooth fields many people say it's quite unrealistic but for this demonstration purpose i think it's really fitting and the data is interpolated exactly so all data is matched and if we are going away from the data we will converge to the mean we just provided and we have to provide that mean with simple clicking um yeah and with that we can really just jump into the next example that is ordinary tricking because uh it could be a question why should i provide a mean i just want it to be estimated and that is exactly the purpose of ordinary creaking where we again use this covariance matrix we have just seen and another row is added to the cricking system to estimate the mean this are lagrange multipliers to minimize the cricking error and estimate the mean for a constant drift basically that is put into this matrix and that constant shift should be minimized and that is then in the end exactly the mean okay so executing our header the setup here is exactly the same we are using the same data the same grid and the same model the only thing is we are not using these simple model but ordinary cricking and there are multiple ways to do it because we could again use qrik dot ordinary here and then put in uh all the uh things we put in before so we put in the model and our conditioning positions and conditioning values and we don't have to put any mean here because that will be estimated during calculations yeah and i will just execute that we generate our field and the error variants that will i talk about later and then we can have a look at it again and now we see the behavior here is almost the same as for simple cricking but the estimated mean is now the far field behavior here that is as you see not the mean of the data but the mean that would make sense if the data you put in is following the covariance model you are using and you can also get this mean by executing this method that is provided with each tricking class yeah that's basically ordinary cricketing where uh in contrast to simple tricking you can estimate mean okay and now we can get more and more complex with what you want to put into your system and what you want to get out of it so the first thing we added was the estimation of the mean with the data and something that is really used often in in practice is external drift tricking if you have an other measured variable that correlates to your target data so for example temperature again as measured data and a variable that is also often is also available is the digital elevation model so the height at where the weather station is located and the height itself is also a really good predictor for the temperature and so you could use that as an external drift and that is something that is done in this example where we are generating a synthetic drift that's also just a special random field and i will just execute that here to show what is happening so we again have artificial data here and the orange line is now a drift so we want our data to follow this drift outside of the locations where we have measured data but we have information from this correlated data and that is something we can put into our cricketing routine that is called external drift here and there you can put an external drift in there and you have also to provide the external the external drift for the grids you are evaluating the cricketing routine on so you can have just have a look at that example in detail because we are just generating everything uh in the first cell and then putting it into the external drift routines yeah so just to give an idea what is also possible here and external drift is called that way because you have to provide it externally it can it can be calculated internally if you calculate uh if you have a model that can be calculated internally you will result in so called universal cricking and universal cracking maybe the next thing i can capture here is also similar to that and there you provide a drift that is provided by a function or by yeah by mostly by a function by a polynomial function or something like that and something you could imagine is uh a drift in latitude for for for temperature so the temperature should be increase if you are going to the equator that's that's something you could you could think about and functional drift and we will also do almost the same here we generate this drift again with a special random field and then we are using universal tricking and there we can specify a set of drift functions that are built in so for example a linear drift is just built in and you can then estimate that and yeah just to show show you this here we put a lot of things together so let's start simply we have again this measured data and the original field is the green one that's that's the one we sampled from and there was a drift in there that is going um in the uh that was the the orange one that's the that's the original uh linear drift and we know there is some drift and we want to estimate it during tricking also and that's why we just put linear drift in here and then we don't have to provide anything if we evaluate the clicking routine because this linear drift will be fitted internally by your universal clicking and that's really a neat feature for scenarios where you know there is a there's a certain functional drift or a drift that you can describe by some routine yeah okay so maybe that's just a short overview of our cricking cricking examples as you see there are still some extra um notebooks here that are filled with information you could use and if you're interested just just look at that and you will get more information about cricking is working in in gstools and maybe for the last five minutes we have i would show a combination of what we have seen up to now and that is conditioned field generation because one problem as you see here with with clicking is that tricking the the estimated cricking field will always converge to the estimated mean in the far field so the the red line here is the estimated drift or the the mean value or mean yeah behavior of the field and in the far field this cricking routine will always converge to this value but as you see the input field we sampled from really deviates from that estimated field and that is something you could be interested in for simulations on fields that should be conditioned with data that you have measured and that's exactly what conditioning is for so i will go to this example here and conditioning is combining trigging and spatial random field generation that we have discussed in the last two sections we'll again start with our header and in this example we will stick to one dimension to get a better impression of what is happening and it is the same as we did before we use some conditioning values uh that are artificial here and we use a certain grid we want to evaluate our condition field on so that looks like just like that again our sample data and now we want to generate fields that are following first a certain covariance model and that secondly coincides with the given data but has some sort of randomness outside of the measured data and that's what we are doing here in the next step and here are now three lines that we have already seen we are again setting up a model with this model we are setting up a clicking routine in this case ordinary clicking with our conditioning positions and conditioning values and then we will set up a new class that's called cond srf for condition spatial random field and that class just takes and clicking instance to be set up and that's everything and afterwards we can again just use all the routines all these fields classes have so creaking special random fields and conditioned srf are all working the same way basically you set them up and then you evaluate a field on them and we will set a position tuple that we just defined beforehand and then we can again generate an ensemble of conditioned fields on that it's just the way we have already seen with the conditioned ensemble and yeah so we will evaluate the cond srf instance on the preset positions we will give a certain seat and we will store the field with a certain name so it's just f and prepended with the number of the ensemble member and then we will just plot this field okay the plot is not showing up yet because we didn't have the plot.show now but yeah what we are now doing is we are also adding the um the cricking field the estimated mean and the triggering field and our conditioning values and positions and then let's see what what happens here okay something went wrong i guess i need another figure here so this okay there's something is missing here and i don't know really why i guess this was too much yeah that's that's exactly what i wanted okay so for the last minute a lot is going on here but as you see we have again our condition conditioning data these five points here and the green line is again the estimated cricking fields for ordinary tricking that we had here and all the black lines here are realizations of a random field that are conditioned to this data and that is why they coincide with the data on that side and afterwards they get their random behavior again that is oscillating around the demean behavior and in blue you see the um confidence interval for uh the 99 confidence interval and that is basically the second information that qriket gives you and that is the arrow variance uh around the estimated field so this is um what you can generate with this spatial conditioned spatial random fields and yeah in orange is also the ensemble mean and um that's maybe the last thing to mention here the ensemble mean of this generated uh random fields coincides with the ordinary cricking results and that's basically how you can think about cricking in general that is the mean behavior of random fields that coincide with your given data and yeah with that i think we are almost one minute over and i'd like to close it here you can have a look at all the following examples so we also have examples for uh geo coordinates for normalizers to normalize data that you're analyzing and field transformations that is also quite interesting and some extra you can just stick around i also i just wanted to give you an impression of what is possible with gs tools and to have a playground to start looking at what you can do and what you'd like to and if you have any questions just just contact us and yeah with that thank you wonderful just putting my camera on thank you very much sebastian that's great um really terrific stuff i think the community's so lucky to have people like you putting things like this out there so uh this and hopefully this tutorial will go on to you know serve as a great introduction for people who just want to start getting into gs tools and find out what it is so yeah thanks very much thank
Info
Channel: Software Underground
Views: 6,119
Rating: undefined out of 5
Keywords: conference, python, geostatistics, geoscience, kriging, tutorial
Id: qZBJ-AZXq6Q
Channel Id: undefined
Length: 121min 33sec (7293 seconds)
Published: Mon Apr 25 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.