Example data sets#

Datasets#

skgstat.data.pancake(N=500, band=0, seed=42, as_dataframe=False)[source]#

Sample of the pancake_field. By default, the Red band is sampled at 500 random location without replacement.

Parameters:
  • N (int) – Number of sample points to use.

  • band (int) – can be 0 (Red), 1 (Green), 2 (Blue) or 'mean', which will average all three RGB bands

  • seed (int) – By default a seed is set to always return the same sample for same N and band input

  • as_dataframe (bool) – If True, the data is returned as pandas.Dataframe. Default is False.

Returns:

result – Dictionary of the sample and a citation information. The sample is a tuple of two numpy arrays.

Return type:

dict

See also

get_sample pancake_field

Notes

The image originates from a photograph of an actual pancake. The image was cropped to an 500x500 pixel extent keeping the center of the original photograph. If you use this example somewhere else, please cite SciKit-GStat [502]_, as it is distributed with the library.

References

skgstat.data.pancake_field(band=0)[source]#

Image of a pancake with apparent spatial structure. The pankcake has three RGB bands.

Parameters:

band (int) – can be 0 (Red), 1 (Green), 2 (Blue) or 'mean', which will average all three RGB bands

Returns:

result – Dictionary of the sample and a citation information. The sample is 2D numpy array of the field.

Return type:

dict

See also

skgstat.data._loader.field, skgstat.data.pancake

Notes

The image originates from a photograph of an actual pancake. The image was cropped to an 500x500 pixel extent keeping the center of the original photograph. If you use this example somewhere else, please cite SciKit-GStat [501]_, as it is distributed with the library.

References

skgstat.data.aniso(N=500, seed=42, as_dataframe=False)[source]#

Sample of the ansio_field. By default the greyscale image is sampled at 500 random locations.

Parameters:
  • N (int) – Number of sample points to use.

  • seed (int) – By default a seed is set to always return the same sample for same N and band input

  • as_dataframe (bool) – If True, the data is returned as pandas.Dataframe. Default is False.

Returns:

result – Dictionary of the sample and a citation information. The sample is a tuple of two numpy arrays.

Return type:

dict

See also

skgstat.data._loader.field

field loader

aniso_field

Return the full field

Notes

This image was created using gstools.SRF. The spatial random field was created using a Gaussian model and has a size of 500x500 pixel. The created field was normalized and rescaled to the value range of a uint8. The spatial model includes a small nugget (~ 1/25 of the value range). If you use this example somewhere else, please cite SciKit-GStat [501]_, as it is distributed with the library.

References

skgstat.data.aniso_field()[source]#

Image of a greyscale image with geometric anisotropy. The anisotropy has a North-Easth orientation and has a approx. 3 times larger correlation length than in the perpendicular orientation.

Returns:

result – Dictionary of the sample and a citation information. The sample a numpy array representing the image.

Return type:

dict

See also

skgstat.data._loader.field

field loader

aniso

Return a sample

Notes

This image was created using gstools.SRF. The spatial random field was created using a Gaussian model and has a size of 500x500 pixel. The created field was normalized and rescaled to the value range of a uint8. The spatial model includes a small nugget (~ 1/25 of the value range). If you use this example somewhere else, please cite SciKit-GStat [501]_, as it is distributed with the library.

References

skgstat.data.meuse(variable='lead', as_dataframe=False)[source]#

Returns one of the samples of the well-known Meuse dataset. You can specify which heave metal data you want to load.

Parameters:
  • variable (str) – Name of the variable to be extracted from the dataset. Can be one of [‘cadmium’, ‘copper’, ‘lead’, ‘zinc’]. Default is ‘lead’.

  • as_dataframe (bool) – If True, the data is returned as pandas.Dataframe. Default is False.

Returns:

result – Dictionary of the sample and a citation information.

Return type:

dict

Notes

The example data was taken from the R package ‘sp’ as published on CRAN: https://cran.r-project.org/package=sp The package is licensed under GPL-3, which applies to the sample if used somewhere else. If you use this sample, please cite the original sources [502]_, [503] and not SciKit-GStat.

References

skgstat.data.corr_variable(size: int = 150, means: List[float] = [1.0, 1.0], vars: List[float] = None, cov: float | List[float] | List[List[float]] = None, coordinates: ndarray = None, seed: int = None)[source]#

Returns random cross-correlated variables assigned to random coordinate locations. These can be used for testing cross-variograms, or as a random benchmark for cross-variograms in method development, aka. does actual correlated data exhibit different cross-variograms of random variables of the same correlation coefficient matrix.

Parameters:
  • size (int) – Length of the spatial sample. If coordinates are supplied, the length has to match size.

  • means (List[float]) – Mean values of the variables, defaults to two variables with mean of 1. The number of means determines the number of variables, which will be returned.

  • vars (List[float]) – Univariate variances for each of the random variables. If None, and cov is given, the diagonal of the correlation coefficient matrix will be used. If cov is None, the correlation will be random, but the variance will match. If vars is None, random variances will be used.

  • cov (list, float) – Co-variance matrix. The co-variances and variances for all created random variables can be given directly, as matrix of shape (len(means), len(means)). If cov is a float, the same matrix will be created using the same co-variance for all combinations.

  • coordinates (np.ndarray) – Coordinates to be used for the sample. If None, random locations are created.

  • seed (int) – Optional. If the seed is given, the random number generator is seeded and the function will return the same sample.

Returns:

result – Dictionary of the sample and a citation information.

Return type:

dict

Utility Functions#

..automodule:: skgstat.data._loader
members:

field, get_sample