diff --git a/mlair/data_handler/data_handler_wrf_chem.py b/mlair/data_handler/data_handler_wrf_chem.py index f191d6d0d40eea7cd7165f969474da17f910688e..4bf0ca1e0d517d97fb9ddb1aa7d36d762fa69541 100644 --- a/mlair/data_handler/data_handler_wrf_chem.py +++ b/mlair/data_handler/data_handler_wrf_chem.py @@ -924,9 +924,11 @@ class DataHandlerSingleGridColumn(DataHandlerSingleStation): self.__loader = loader def load_data(self, path, station, statistics_per_var, sampling, station_type=None, network=None, - store_data_locally=False, data_origin: Dict = None, start=None, end=None): + store_data_locally=False, data_origin: Dict = None, start=None, end=None, meta_col_names=None): self.loader = (station, path) + if meta_col_names is None: + meta_col_names = ['station_name', 'station_lon', 'station_lat', 'station_alt'] with self.loader as loader: if self._logical_z_coord_name is None: @@ -950,8 +952,13 @@ class DataHandlerSingleGridColumn(DataHandlerSingleStation): # ToDo add metadata _meta = {self.loader.physical_x_coord_name: self.loader.get_coordinates()['lon'].tolist(), - self.loader.physical_y_coord_name: self.loader.get_coordinates()['lat'].tolist()} - meta = pd.DataFrame(_meta, index=station) + self.loader.physical_y_coord_name: self.loader.get_coordinates()['lat'].tolist() + } + _meta.update({k: v for k, v in zip(meta_col_names, (station[0], + _meta[self.loader.physical_x_coord_name], + _meta[self.loader.physical_y_coord_name], np.nan)) + }) + meta = pd.DataFrame(_meta, index=station).T # if isinstance(self.input_output_sampling4toarstats, tuple) and len(self.input_output_sampling4toarstats) == 2: # if self.var_logical_z_coord_selector != 0: