Skip to content
Snippets Groups Projects
Commit 74eb20a6 authored by Felix Kleinert's avatar Felix Kleinert
Browse files

include interpolation_method

parent 6bc2d2db
Branches
Tags
5 merge requests!136update release branch,!135Release v0.11.0,!134MLAir is decoupled from join,!133include interpolation_method,!119Resolve "Include advanced data handling in workflow"
Pipeline #42003 passed
......@@ -40,7 +40,7 @@ class StationPrep(AbstractStationPrep):
def __init__(self, station, data_path, statistics_per_var, station_type, network, sampling,
target_dim, target_var, time_dim, window_history_size, window_lead_time,
interpolation_limit: int = 0,
interpolation_limit: int = 0, interpolation_method: str = 'linear',
overwrite_local_data: bool = False, transformation=None, store_data_locally: bool = True,
min_length: int = 0, start=None, end=None, **kwargs):
super().__init__() # path, station, statistics_per_var, transformation, **kwargs)
......@@ -57,7 +57,10 @@ class StationPrep(AbstractStationPrep):
self.time_dim = time_dim
self.window_history_size = window_history_size
self.window_lead_time = window_lead_time
self.interpolation_limit = interpolation_limit
self.interpolation_method = interpolation_method
self.overwrite_local_data = overwrite_local_data
self.store_data_locally = store_data_locally
self.min_length = min_length
......@@ -103,7 +106,7 @@ class StationPrep(AbstractStationPrep):
f"sampling='{self.sampling}', target_dim='{self.target_dim}', target_var='{self.target_var}', " \
f"time_dim='{self.time_dim}', window_history_size={self.window_history_size}, " \
f"window_lead_time={self.window_lead_time}, interpolation_limit={self.interpolation_limit}, " \
f"overwrite_local_data={self.overwrite_local_data}, " \
f"interpolation_method='{self.interpolation_method}', overwrite_local_data={self.overwrite_local_data}, " \
f"transformation={self._print_transformation_as_string}, **{self.kwargs})"
@property
......@@ -165,7 +168,7 @@ class StationPrep(AbstractStationPrep):
Setup samples. This method prepares and creates samples X, and labels Y.
"""
self.load_data()
self.interpolate(dim=self.time_dim, limit=self.interpolation_limit)
self.interpolate(dim=self.time_dim, method=self.interpolation_method, limit=self.interpolation_limit)
if self.transformation is not None:
self.call_transform()
self.make_samples()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment