PyLandslide.data_preparation.DataPreparation
- class PyLandslide.data_preparation.DataPreparation(json_file=None, folder_name=None, *args, **kwargs)[source]
This is a data preparation class that includes methods for co-registering raster layers and extracting point data for Machine Learning.
- __init__(json_file=None, folder_name=None, *args, **kwargs)[source]
Initialise a new DataPreparation object.
- Args:
json_file: JSON-based document specifying the configuration information for performing data preparation.
folder_name: Folder containing the raster data.
Methods
__init__
([json_file, folder_name])Initialise a new DataPreparation object.
adjust
()Looks into the self.folder_name variable and pre-process the raster files located in it by converting them to uint8 to reduce data size.
align
()Co-registers the rasters adjusted with the adjust() method by looking into "folder_name/uint8".
create_results_dict
(index_array)Creates a dictionary for saving the results of the extract() method.
extract
()Extracts the factor values at the landslide and non-landslide locations.
factor_data_preperation
(factors)Takes a list of dictionaries that include factor names and their associated raster files and returns lists of factor names, datasets, and datasets as arrays.
load_data_from_json
()Loads the configuration JSON-based document assigned to self.json_file.
setup
()Calls the load_data_from_json method to extract the information provided in the JSON-based document.