This extracts the LSM data from a folder of netcdf files

def _load_lsm_data(self, data_var,
                       conversion_factor=1,
                       calc_4d_method=None,
                       calc_4d_dim=None,
                       time_step=None):
        """
        This extracts the LSM data from a folder of netcdf files
        """
        data = self.xd.lsm.getvar(data_var,
                                  yslice=self.yslice,
                                  xslice=self.xslice,
                                  calc_4d_method=calc_4d_method,
                                  calc_4d_dim=calc_4d_dim)
        if isinstance(time_step, datetime):
            data = data.loc[{self.lsm_time_dim: [pd.to_datetime(time_step)]}]
        elif time_step is not None:
            data = data[{self.lsm_time_dim: [time_step]}]
        data = data.fillna(0)
        data.values *= conversion_factor
        return data