Skip to content
Snippets Groups Projects
Commit b185f33c authored by lukas leufen's avatar lukas leufen
Browse files

Merge branch 'felix_issue152_reimplement-interpolation' into...

Merge branch 'felix_issue152_reimplement-interpolation' into 'lukas_issue144_feat_workflow-with-advanced-data-handling'

include interpolation_method

See merge request toar/mlair!133
parents 9308de5d 74eb20a6
No related branches found
No related tags found
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 #42004 passed
...@@ -40,7 +40,7 @@ class StationPrep(AbstractStationPrep): ...@@ -40,7 +40,7 @@ class StationPrep(AbstractStationPrep):
def __init__(self, station, data_path, statistics_per_var, station_type, network, sampling, 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, 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, overwrite_local_data: bool = False, transformation=None, store_data_locally: bool = True,
min_length: int = 0, start=None, end=None, **kwargs): min_length: int = 0, start=None, end=None, **kwargs):
super().__init__() # path, station, statistics_per_var, transformation, **kwargs) super().__init__() # path, station, statistics_per_var, transformation, **kwargs)
...@@ -57,7 +57,10 @@ class StationPrep(AbstractStationPrep): ...@@ -57,7 +57,10 @@ class StationPrep(AbstractStationPrep):
self.time_dim = time_dim self.time_dim = time_dim
self.window_history_size = window_history_size self.window_history_size = window_history_size
self.window_lead_time = window_lead_time self.window_lead_time = window_lead_time
self.interpolation_limit = interpolation_limit self.interpolation_limit = interpolation_limit
self.interpolation_method = interpolation_method
self.overwrite_local_data = overwrite_local_data self.overwrite_local_data = overwrite_local_data
self.store_data_locally = store_data_locally self.store_data_locally = store_data_locally
self.min_length = min_length self.min_length = min_length
...@@ -103,7 +106,7 @@ class StationPrep(AbstractStationPrep): ...@@ -103,7 +106,7 @@ class StationPrep(AbstractStationPrep):
f"sampling='{self.sampling}', target_dim='{self.target_dim}', target_var='{self.target_var}', " \ 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"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"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})" f"transformation={self._print_transformation_as_string}, **{self.kwargs})"
@property @property
...@@ -165,7 +168,7 @@ class StationPrep(AbstractStationPrep): ...@@ -165,7 +168,7 @@ class StationPrep(AbstractStationPrep):
Setup samples. This method prepares and creates samples X, and labels Y. Setup samples. This method prepares and creates samples X, and labels Y.
""" """
self.load_data() 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: if self.transformation is not None:
self.call_transform() self.call_transform()
self.make_samples() self.make_samples()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment