soilstats

Documentation about soilstats.

Subpackages

Submodules

Package Contents

Classes

SoilCollect

Class for collecting soil data for multiple locations within a grid.

SoilData

Class for collecting and analyzing soil data.

Attributes

__author__

__email__

__version__

class soilstats.SoilCollect(properties, depths, values, lat_bounds, lon_bounds, n=50)[source]

Bases: soilstats.analysis.analysis.Analyse

Class for collecting soil data for multiple locations within a grid.

property locations

Return locations.

property soildatapoints

Return SoilData objects.

get_data()[source]

Return data from the SoilGrids API as a data frame.

add_points(n)[source]

Add more datapoints to the existing SoilCollect object.

_init_soildata(points=None)[source]

Initialize SoilData objects for each location.

classmethod _random_points(lat_bounds, lon_bounds, n)[source]

Generate random locations within the specified boundaries.

classmethod _verify_bounds(bounds, datatype)[source]
class soilstats.SoilData(lat: float, lon: float, properties: list, depths: list, values: list)[source]

Bases: soilstats.analysis.analysis.Analyse

Class for collecting and analyzing soil data.

_property_key = 'properties'
_layer_key = 'layers'
_record_path = ['depths']
_meta = ['name', ['unit_measure', 'mapped_units']]
_boundaries
_clean_columns
_first_columns = ['lat', 'lon', 'property']
get_data()[source]

Return data from the SoilGrids API as a data frame.

_get_data()[source]

Get data from the SoilGrids API.

Use the properties to call the SoilGrids API. Generate a data frame fom the API response.

_clean_data()[source]

Clean up the data frame.

  • rename obscurely named columns

  • add latitude and longitude

  • reorder columns to increase readability

_setup_soilgrid()[source]

Initialize SoilGrids object.

classmethod _verify(value, datatype)[source]

Verify that latitude/longitude are within boundaries.

classmethod _enlist(value)[source]

Enlist value if it is not a list.

soilstats.__author__ = 'Barbara Vreede'[source]
soilstats.__email__ = 'b.vreede@gmail.com'[source]
soilstats.__version__ = '0.1.0'[source]