Commit 74eb20a6 authored by felix kleinert's avatar felix kleinert

include interpolation_method

parent 6bc2d2db
Pipeline #42003 passed with stages
in 5 minutes and 57 seconds
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment